Seurat: Provided graph.name not present in Seurat object

Created on 12 May 2020  路  3Comments  路  Source: satijalab/seurat

Sorry for disturbance.
My question is about cluster specific cluster 6, and then warning message shows below:
Error in FindClusters.Seurat(seurat_combined_6, resolution = 0.5) :
Provided graph.name not present in Seurat object
I could not find any method could work this out. Anyone knows how to do with this issue?

Original coding:
library(dplyr)
library(Seurat)
library(patchwork)

read rds

seurat_combined <- readRDS(file = "~/Downloads/10x_data/seruat out/salinevsAlign_combined_immue cells.rds")
seurat_combined_6 <- subset(x=seurat_combined, idents=c("6"))

find neighbor

seurat_combined_6 <- FindNeighbors(seurat_combined_6, dims = 1:10)

find cluster

seurat_combined_6 <- FindClusters(seurat_combined_6, resolution = 0.5)

head(Idents(seurat_combined_6), 5)

umap

seurat_combined <- RunUMAP(seurat_combined_6, dims = 1:10)
DimPlot(seurat_combined_6, reduction = "umap")

Most helpful comment

The code you presented should work, (for example, the lines below work)

seurat_combined_6 <- subset(x=pbmc3k, idents=c("6"))
#find neighbor
seurat_combined_6 <- FindNeighbors(seurat_combined_6, dims = 1:10)
#find cluster
seurat_combined_6 <- FindClusters(seurat_combined_6, resolution = 0.5)

You should make sure your assay is set correctly. I.e. if you originally run PCA on integrated values, make sure you have the DefaultAssay set to 'integrated'. This is the most likely cause of the problem, but if that doesn't fix it, please reopen and we'll take a closer look

All 3 comments

The code you presented should work, (for example, the lines below work)

seurat_combined_6 <- subset(x=pbmc3k, idents=c("6"))
#find neighbor
seurat_combined_6 <- FindNeighbors(seurat_combined_6, dims = 1:10)
#find cluster
seurat_combined_6 <- FindClusters(seurat_combined_6, resolution = 0.5)

You should make sure your assay is set correctly. I.e. if you originally run PCA on integrated values, make sure you have the DefaultAssay set to 'integrated'. This is the most likely cause of the problem, but if that doesn't fix it, please reopen and we'll take a closer look

Thank you for kind answer, following default could fix it:
DefaultAssay(seurat_combined_6 ) <- "integrated"
seurat_combined_6 <- ScaleData(seurat_combined_6 , verbose = FALSE)
seurat_combined_6 <- RunPCA(seurat_combined_6 , npcs = 30, verbose = FALSE)
seurat_combined_6 <- RunUMAP(seurat_combined_6, reduction = "pca", dims = 1:20)

Hi, I had the same issue. Comes up when I subset the seurat3 object and try to subcluster. I tried a fix that worked for me.
You can try to find the name of the graph object stored in the seurat object and specifiy it in the FindClusters function:
`sce<-RunUMAP(sce, reduction = "pca", features = rownames(sce), umap.method = "umap-learn", n.neighbors = 50)
sce<- FindNeighbors(sce, reduction= "umap", dims = 1:2, verbose = T)
sce<- FindClusters(sce, reduction.type="umap", algorithm= 1, resolution = 0.15, verbose = T, graph.name = "RNA_snn")

#
you can access graph names through:

sce@graphs$graphname # where graphname is what you choose`

Hope that helps.

Was this page helpful?
0 / 5 - 0 ratings