umap发现自己的簇顺序有问题
设置一下因子就好
sample.integrated@meta.data$integrated_snn_res.0.9 <- factor(sample.integrated@meta.data$integrated_snn_res.0.9,levels = c(0:(max(as.integer(sample.integrated@meta.data$integrated_snn_res.0.9))-1)))
ggplot绘制umap图
#ggplot
sample.integrated<-AddMetaData(sample.integrated,sample.integrated@reductions$umap@cell.embeddings,col.name = colnames(sample.integrated@reductions$umap@cell.embeddings))
head(sample.integrated@meta.data)
umap <- ggplot(sample.integrated@meta.data ,aes(x=UMAP_1,y=UMAP_2,color=integrated_snn_res.0.9))+
geom_point()
umap