clustree确定多少个cluster
clustree确定多少个cluster
DefaultAssay(lung)
DefaultAssay(lung)<-“RNA”
lung<-lung %>% Seurat::NormalizeData(verbose = FALSE) %>%
FindVariableFeatures(selection.method = “vst”, nfeatures = 2000) %>%
ScaleData(verbose = FALSE) %>%
RunPCA(npcs = 50, verbose = FALSE)
ElbowPlot(lung, ndims = 50)
lung=lung%>%
RunUMAP( dims = 1:40) %>%
RunTSNE( dims = 1:40) %>%
FindNeighbors( dims = 1:40)
for (res in seq(0.4,1,0.1)) {
lung=FindClusters(lung,graph.name = “RNA_snn”,resolution = res,algorithm = 1)
}
apply(lung@meta.data[,grep(“RNA_snn_res”,colnames(lung@meta.data))], 2, table)
library(clustree)
p5_tree=clustree::clustree(lung@meta.data,prefix=“RNA_snn_res.”)
p5_tree
clustree确定多少个cluster