把metadata里面的seurat_clusters改成cel
2023-06-24 本文已影响0人
oceanandshore
单细胞转录调控网络分析工具(TF,motifs)-SCENIC - 简书 (jianshu.com)
current.cluster.ids <- c(0:20)
new.cluster.ids <- c("Naive CD8+ ",
"CD4 TCM",
"CD8 TCM",
"Naive CD4+",
"NK",
"CD8 TEM",
"CD4 TEM",
"Naive B cells",
"CD4 CTL ",
"Tregs",
"Other T ",
"γδ T ",
"Unknown",
"CD16 Mono",
"Memory B ",
"MAIT",
"CD14 Mono ",
"Platelet ",
"Dc",
"Eryth",
"Double-negative T ")
scRNAsub@meta.data$celltype = plyr::mapvalues(x = scRNAsub@meta.data[,"seurat_clusters"], from = current.cluster.ids, to = new.cluster.ids)
上面这里是把把metadata里面的seurat_clusters改成celltype,如果想要增加一行,那就复制一个,代码在下面,然后再改名字。麻烦一些,但是能用
scRNAsub@meta.data$seurat_clusters = scRNAsub@meta.data$celltype