satijalab / seurat

R toolkit for single cell genomics
http://www.satijalab.org/seurat
Other
2.2k stars 894 forks source link

some challenges with the integration analysis of scRNA-seq and scATAC-seq #8292

Closed wenhai-cell87 closed 6 months ago

wenhai-cell87 commented 6 months ago

Hello everyone,

I'm facing some challenges with the integration analysis of scRNA-seq and scATAC-seq. I obtained a good clustering result during my first transfer, but the second transfer resulted in a very messy clustering. Any insights into why this might be happening?

Thank you for your help! combined = readRDS(file="/ATAC5/liucheng/remerge_beforeQC.RDS")

QC

combined <- subset( x = combined, subset = nCount_ATAC > 200 & nCount_ATAC < 10000 & blacklist_fraction < 0.2 & nucleosome_signal < 0.4 & TSS.enrichment > 2 ) combined <- RunTFIDF(combined) combined <- FindTopFeatures(combined, min.cutoff = "q0") combined <- RunSVD(combined) DepthCor(combined) combined <- RunUMAP(combined, dims = 3:30, reduction = 'lsi') combined <- RunUMAP(combined, dims = 3:30, reduction = 'lsi') options(repr.plot.width=9, repr.plot.height=8) p0 = DimPlot(object = combined, label = TRUE, repel = TRUE, group.by = "seurat_clusters") p0 image

compute gene activities

gene.activities <- GeneActivity(combined)

add the gene activity matrix to the Seurat object as a new assay

combined[['RNA']] <- CreateAssayObject(counts = gene.activities) combined <- NormalizeData( object = combined, assay = 'RNA', normalization.method = 'LogNormalize', scale.factor = median(combined$nCount_RNA) ) combined <- ScaleData(combined, features = rownames(combined))

Load the pre-processed scRNA-seq data

nhlh2_rna <- readRDS("/ATAC5/liucheng/Nhlh2.integrated.v2.131787cells.rds") nhlh2_rna <- subset(x=nhlh2_rna, batch2 == "CKO_Female_2" ) nhlh2_rna <- UpdateSeuratObject(nhlh2_rna) nhlh2_rna <- FindVariableFeatures( object = nhlh2_rna, nfeatures = 5000 ) transfer.anchors <- FindTransferAnchors( reference = nhlh2_rna, query = combined, features = VariableFeatures(object = nhlh2_rna), reduction = 'cca', reference.assay = "RNA", query.assay = "RNA" )

predicted.labels <- TransferData( anchorset = transfer.anchors, refdata = nhlh2_rna$cellclass, weight.reduction = combined[['lsi']], dims = 2:30 ) combined <- AddMetaData(object = combined, metadata = predicted.labels) plot1 <- DimPlot(nhlh2_rna, group.by = 'cellclass', label = TRUE, repel = TRUE) + ggtitle('scRNA-seq')+ scale_color_ucscgb() plot2 <- DimPlot(combined, group.by = 'predicted.id', label = TRUE, repel = TRUE) + ggtitle('scATAC-seq')+ scale_color_ucscgb() plot1 + plot2 image

neuron subset

neuron <- subset(x=combined, predicted.id %in% c("DP neuron","GABA","GLU")) neuron <- RunTFIDF(neuron) neuron <- FindTopFeatures(neuron, min.cutoff = "q0") neuron <- RunSVD(neuron) neuron <- RunUMAP(neuron, dims = 2:30, reduction = 'lsi') neuron <- FindNeighbors(object = neuron, reduction = 'lsi', dims = 2:30) neuron <- FindClusters(object = neuron, algorithm = 3, resolution = 1, verbose = FALSE) transfer.neuron.anchors <- FindTransferAnchors( reference = neuron_rna, query = neuron, features = VariableFeatures(object = neuron_rna), reduction = 'cca', reference.assay = "RNA", query.assay = "RNA" ) predicted.labels <- TransferData( anchorset = transfer.neuron.anchors, refdata = neuron_rna$celltype, weight.reduction = neuron[['lsi']], dims = 2:30 )

neuron <- AddMetaData(object = neuron, metadata = predicted.labels) p1 <- DimPlot(neuron_rna, reduction = "umap", group.by = "celltype", label = TRUE, repel = TRUE) + NoLegend() + ggtitle("Reference") p2 <- DimPlot(neuron, reduction = "umap", group.by = "predicted.id", label = TRUE, repel = TRUE) + NoLegend() + ggtitle("Query") p1 | p2 image

Gesmira commented 6 months ago

Hi, Unfortunately without knowing how you got neuron_rna, it's very hard to know what is going wrong here. I would make sure that neuron_rna has the same preprocessing steps that the full object does. You should run FindVariableFeaturesand scale the data again as your neuron only sample would likely have a different set of variable features than the rest of the object.

Gesmira commented 6 months ago

Closing now due to lack of response. Feel free to reopen if you continue to run into issues.