Hi,
I have a question about the joining data layers in scRNA-Seq data in R performed via seurat
. I merged 4 samples, performed integration of data (steps below), and while running either FindConservedMarkers
or FindMarkers
step, I always encounter with the below error, is it mandatory to use JoinLayers
in order to find markers for merged or integrated data always?
I did not find JoinLayers
function in seurat as part of standard scRNA-Seq integration workflow (maybe I would have missed it), however, while I reading found below resources which discusses about this function.
- https://github.com/satijalab/seurat/issues/7493
- https://github.com/satijalab/seurat/issues/7804
- https://github.com/satijalab/seurat/issues/8160
- https://rdrr.io/github/satijalab/seurat/f/vignettes/integration_introduction.Rmd
## Seurat analysis
CB30_list <- lapply(c(CB30_1, CB30_2, CB30_3, CB30_4), function(x) {
x <- NormalizeData(x)
x <- FindVariableFeatures(x, selection.method = "vst", nfeatures = 2000)
})
features <- SelectIntegrationFeatures(object.list = CB30_list, nfeatures=10000)
CB30_anchors <- FindIntegrationAnchors(object.list = CB30_list, anchor.features = features)
CB30_combined <- IntegrateData(anchorset = CB30_anchors)
DefaultAssay(CB30_combined) <- "integrated"
CB30_combined <- ScaleData(CB30_combined, verbose = FALSE)
CB30_combined <- RunPCA(CB30_combined, npcs = 30, verbose = FALSE)
CB30_combined <- RunUMAP(CB30_combined, reduction = "pca", dims = 1:30)
CB30_combined <- FindNeighbors(CB30_combined, dims = 1:30)
CB30_combined <- FindClusters(CB30_combined, resolution = 0.8)
Idents(CB30_combined) <- "celltype"
DefaultAssay(CB30_combined) <- "RNA"
## Error
markers_1 <- FindConservedMarkers(CB30_combined, ident.1 = "CD4", grouping.var = "Vector", verbose = FALSE)
Warning: Identity: CD4+ not present in group 41BBz. Skipping 41BBz
Error in FindMarkers.StdAssay(object = data.use, slot = slot, cells.1 = cells$cells.1, :
data layers are not joined. Please run JoinLayers OR,
markers_2 <- FindMarkers(CB30_combined, ident.1 = "CD4+", ident.2 = "CD4+ UT", verbose = FALSE)
## Error resolved after running:
CB30_combined <- JoinLayers(object = CB30_combined)
markers_2 <- FindMarkers(CB30_combined, ident.1 = "CD4+", ident.2 = "CD4+ UT", verbose = FALSE)
Best Regards,
Toufiq
fracarb8 thank you very much. I see this here in the integration vignettes