报错如下
image.png1. 如果你是运行如下代码报的错。
sce
sce <- NormalizeData(sce, normalization.method = "LogNormalize",
scale.factor = 10000)
GetAssay(sce,assay = "RNA")
sce <- FindVariableFeatures(sce,
selection.method = "vst", nfeatures = 2000)
sce <- ScaleData(sce)
sce <- RunPCA(object = sce, pc.genes = VariableFeatures(sce))
res.used <- 0.7
sce <- FindClusters(object = sce, verbose = T, resolution = res.used)
则添加一行代码即可,如下
res.used <- 0.7
sce <- FindNeighbors(sce, dims = 1:10)
sce <- FindClusters(object = sce, verbose = T, resolution = res.used)
2. 如果不是,看下面
2.1问
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")
2.2 答
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
2.3 问
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)
2.4 答
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.
网友评论