事情是这样的:前面我们发布了这样一款函数((原创函数)-Cellchat受配体多组比较气泡图函数)。但是限制是最多只能进行三组的比较。小伙伴也强烈要求更新多组分析。其实在第一版函数完成后,我们就考虑到了这个问题,也有这个意向,并在睡觉前冥想了一下思路,所以比较顺畅,连夜进行了函数更新!看看更新函数:此次更新不仅可以进行多组比较了,还能够自选受配体!
效果如下:
setwd('D:\\KS项目\\公众号文章\\Cellchat受配体多组比较气泡图函数\\更新-cellchat多组受配体可视化函数(不限组数)')
# group_name <- c("HD","MDA")
# analysis_cells <- "Tcell"
# pathway=c("CCL", "MIF","MHC-II")
#两组
object_list1 <- list(HD.cellchat, MDA.cellchat)
ks_ccGroup_bubble(object_list=object_list1,
analysis_cells = "Tcell",
pathway=c("CCL", "MIF","MHC-II"),
group_name = c("HD","MDA"),
tag_pos = c(0.5, 0.085))
#三组-假装有三组
object_list2 <- list(HD.cellchat, MDA.cellchat,HD.cellchat)
ks_ccGroup_bubble(object_list=object_list2,
analysis_cells = "Tcell",
pathway=c("CCL", "MIF","MHC-II"),
group_name = c("HD","MDA","EE"),
tag_pos = c(0.5, 0.085))
#4组-假装有4组
object_list3 <- list(HD.cellchat, MDA.cellchat,HD.cellchat,MDA.cellchat)
ks_ccGroup_bubble(object_list=object_list3,
analysis_cells = "Tcell",
pathway=c("CCL", "MIF","MHC-II"),
group_name = c("HD","MDA","EE","AA"),
tag_pos = c(0.5, 0.085))
#选定LR
object_list2 <- list(HD.cellchat, MDA.cellchat,HD.cellchat)
LR <- read.csv('hh.csv', header = F)
ks_ccGroup_bubble(object_list=object_list2,
analysis_cells = "Tcell",
select_LR=LR$V1,
group_name = c("HD","MDA","EE"),
tag_pos = c(0.55, 0.085))
image.png
觉得我们分享有些用的,点个赞再走呗!
网友评论