我在跑Rstudio server时总出现这个问题
The previous R session was abnormally terminated due to an unexpected crash.
you may have lost workspace data as a result of this crash.
rstudio may not have restored the previously active project as a precaution. You may switch back to it using the projects menu

事实证明是因为跑了bbknn之后,已经自动找了neighbors,不需要再跑FindNeighbors了,这个crush的原因就是因为FindNeighbors不恰当运行,导致内存可能承受不住而crush
如下所示,跑完bbknn之后直接跑FindClusters,不需要FindNeighbors
seurat_obj<- RunBBKNN(seurat_obj, batch_key = c('orig.ident','technology'),n_pcs=30,run_UMAP=TRUE,run_TSNE=FALSE)
seurat_obj@graphs
#$RNA_bbknn
#A Graph object containing 231189 cells
names(seurat_obj@graphs)
#[1] "RNA_bbknn"
# 可选:查看批次效应校正效果
# 查看技术平台批次效应去除情况
DimPlot(seurat_obj, reduction = "umap", group.by = "technology")+
ggtitle("UMAP by technology")
# 查看样本批次效应去除情况
DimPlot(seurat_obj, reduction = "umap", group.by = "orig.ident")
seurat_obj <- FindClusters(seurat_obj, graph.name ="RNA_bbknn", resolution = c( 0.5, 0.7, 1))
