Closed hai178912522 closed 7 months ago
Hi @hai178912522, It makes perfect sense to use the Harmony dimensionality reduction for constructing the KNN graph, if this is the integration methods you have been using for other graph based analyses on your dataset (e.g. clustering, UMAP). This looks like a fairly standard case where no significant differences in abundance are detected, probably because of a small number of replicates per condition (3 replicates as far as I can tell).
One caveat with using Harmony is that it tends to overcorrect differences between samples, as opposed to other integration methods, so it might be that differences between conditions are lost after integration.
This is the situation with my design. It is a comparison of 8 vs 22 in total。 A data.frame: 30 × 2 sample group
Closing due to inactivity
sce <- as.SingleCellExperiment(data) class: SingleCellExperiment dim: 15341 79286 metadata(0): assays(2): counts logcounts rownames(15341): SAMD11 NOC2L ... PPAN-P2RY11 CEACAM19 rowData names(0): colnames(79286): P30.post.1_P30.tr.1.AAACCTGAGATCCGAG-1 P30.post.1_P30.tr.1.AAACCTGAGCCGATTT-1 ... P28.pre_P28.ut.TTTGTCAGTGACCAAG-1 P28.pre_P28.ut.TTTGTCATCGAATGCT-1 colData names(13): orig.ident nCount_RNA ... seurat_cluster ident reducedDimNames(4): UMAP TSNE HARMONY PCA mainExpName: RNA altExpNames(0): milo <- Milo(sce) milo <- buildGraph(milo, k = 30, d = 30, reduced.dim = "HARMONY") milo <- makeNhoods(milo, prop = 0.05, k = 30, d = 30, refined = TRUE, reduced_dims = "HARMONY") p.NhSize = plotNhoodSizeHist(milo) milo <- countCells(milo, meta.data = as.data.frame(colData(milo)), sample="sample") 6 x 30 sparse Matrix of class "dgCMatrix"
1 2 1 3 2 2 1 1 7 2 . . 2 2 1 1 11 3 8 . 6 5 8 5 . 2 1 1 . 1 1 2 2 3 . 1 1 . 2 1 1 1 . . . 1 . 8 . 4 . 3 6 4 11 . . . . . . . 3 3 1 3 2 . 1 1 2 1 1 . . 1 4 3 14 . 6 2 5 6 10 16 1 1 1 1 . 3 . 4 . 12 5 3 . 5 7 4 2 . . 4 6 1 2 20 4 11 2 6 5 6 10 . 4 2 8 . 1 1 5 4 3 3 1 1 1 2 7 . 3 . 2 3 1 3 14 1 8 3 9 14 7 6 . 4 . 2 . . . 6 1 7 1 1 1 2 5 6 1 1 . . 6 2 3 20 3 8 . 4 5 7 16 1 4 4 1 . 2 .
Design
design <- data.frame(colData(milo))[,c("sample", "group")] design <- distinct(design) rownames(design) <- design$sample
Compute neighbourhood connectivity
milo <- calcNhoodDistance(milo, d=30, reduced.dim = "HARMONY")
Differential abundance testing
da_results <- testNhoods(milo, design = ~ group, design.df = design) ggplot(da_results, aes(PValue)) + geom_histogram(bins=50)
ggplot(da_results, aes(logFC, -log10(SpatialFDR))) + geom_point() + geom_hline(yintercept = 1) ## Ma
Is there any issue with my analysis? Will it result in lack of significance?