美文网首页
复现SCI图表:适用于cellchat v2和cpdb v5的细

复现SCI图表:适用于cellchat v2和cpdb v5的细

作者: KS科研分享与服务 | 来源:发表于2024-12-20 23:14 被阅读0次

图是关于互作分析受配体的展示。横轴是source cell,纵轴是受配体对,展示了每个source与其他细胞的互作,也展示了每个组之间结果。其实看图就可以想到,用分面图就ok了,实际操作过程发现和我们之前的内容几乎一样(连夜更新---别说两组了,这个cellchat多组比较气泡图函数10组也能做了连夜苦战---Cellphonedb v5受配体多组比较气泡图(原创函数))。所以就不需要大家费劲的一步步操作,直接写成函数,当然了,还是依然考虑cellchat v2和cellphonedb v5两种方式。那么这两个方式可以整合到一个函数中嘛?可以呀,但我实在不行弄了,单个分开挺好的。此外,我们原图做了升级,可以设定分组和celltype颜色

image.png
(reference:Single-cell analysis of the cellular heterogeneity and interactions in the injured mouse spinal cord)
image.png image.png
object_list1 <- list(HD.cellchat, MDA.cellchat)
ks_CC_groupCells_bubble(object_list=object_list1,
                  group_name = c("HD","MDA"),
                  celltypes=c("Mon","Tcell" ,"Fibs", "ECs" ,"Mast" ),
                  LR_int = c("CCL14_ACKR1",
                             "CXCL2_ACKR1",
                             "CXCL12_CXCR4",
                             "ANXA1_FPR3",
                             "HLA-DRA_CD4",
                             "HLA-DQA1_CD4"),
                  cell_cols = c("#C1395E", "#AEC17B", "#E07B42", "#89A7C2", "#F0CA50"),
                  group_cols = c('#023858','#4d004b'))
image.png

object_list2 <- list(HD.cellchat)
ks_CC_groupCells_bubble(object_list=object_list2,
                        group_name = c("HD"),
                        celltypes=c("Mon","Tcell" ,"Fibs", "ECs" ,"Mast" ),
                        LR_int = c("CCL14_ACKR1",
                                   "CXCL2_ACKR1",
                                   "CXCL12_CXCR4",
                                   "ANXA1_FPR3",
                                   "HLA-DRA_CD4",
                                   "HLA-DQA1_CD4"),
                        cell_cols = c("#C1395E", "#AEC17B", "#E07B42", "#89A7C2", "#F0CA50"),
                        group_cols = c('white'))

image.png

library(ggplot2)
library(tidyr)

#load data
GO_pvals <- read.delim("D:/KS项目/公众号文章/cellphonedb受配体多组比较气泡图函数/GO_cpdb/statistical_analysis_pvalues_08_15_2024_132104.txt", check.names = FALSE)
GO_means <- read.delim("D:/KS项目/公众号文章/cellphonedb受配体多组比较气泡图函数/GO_cpdb/statistical_analysis_means_08_15_2024_132104.txt", check.names = FALSE)


WT_pvals <- read.delim("D:/KS项目/公众号文章/cellphonedb受配体多组比较气泡图函数/WT_cpdb/statistical_analysis_pvalues_08_15_2024_132617.txt", check.names = FALSE)
WT_means <- read.delim("D:/KS项目/公众号文章/cellphonedb受配体多组比较气泡图函数/WT_cpdb/statistical_analysis_means_08_15_2024_132617.txt", check.names = FALSE)


data = list(list(pval=GO_pvals, means=GO_means), 
            list(pval=WT_pvals, means=WT_means))




#测试1:cpdb_anno没有pathway,用cpdb默认的,用通路选择
cpdb_interLR <- read.csv(file="D:/KS项目/公众号文章/cellphonedb受配体多组比较气泡图函数/cpdb_interLR.csv",header = T)



ks_cpdb_groupCells_bubble(cpdb_data = data,
                     group_name = c("GO","WT"),
                     cpdb_anno = cpdb_interLR,
                     celltypes = c("SMC","Mesenchymal","MuSCs","Myoblasts","Endothelial"),
                     LR_int = c("CDH2-CDH2",
                                "TGFB1-TGFBR3",
                                "DIO3+TG-THRA",
                                "FASLG-TNFRSF6B",
                                "VEGFA-FLT1",
                                "VEGFB-NRP1"),
                     cell_cols = c("#C1395E", "#AEC17B", "#E07B42", "#89A7C2", "#F0CA50"),
                     group_cols = c('#023858','#4d004b'))

image.png

相关文章

网友评论

      本文标题:复现SCI图表:适用于cellchat v2和cpdb v5的细

      本文链接:https://www.haomeiwen.com/subject/csvlejtx.html