从基因表达解读细胞之间的相互作用和交流

目前单细胞转录组技术的快速发展,关于单细胞转录组数据的应用也越来越宽泛,其中细胞相互作用的探索尤为重要。

从基因表达解读细胞之间的相互作用和交流

细胞互作存在多种形式

  1. 自分泌信号转导是指细胞内通讯,细胞分泌配体,这些配体用于通过同源受体诱导同一细胞上表达的那些分子的细胞应答。
  2. 旁分泌细胞间的通讯不需要细胞间的接触,而是取决于信号分子在分泌后从一个细胞扩散到另一个细胞。
  3. 近分泌,即依赖于接触的细胞间通讯依赖于间隙连接或膜纳米管等其他结构,使信号分子直接在细胞之间传递,而不会分泌到细胞外。
  4. 内分泌细胞间的通讯代表细胞间的通讯,信号分子被分泌并通过诸如血浆的细胞外液传播很长一段距离。

细胞互作分析步骤

步骤1:通过转录组学分析样品或细胞,以测量基因的表达;
步骤2:然后对生成的数据进行预处理以构建基因表达矩阵,其中包含跨不同样品或细胞的每个基因的转录水平;
步骤3:从其他来源生成或获得参与细胞间通讯的相互作用蛋白列表,通常包括分泌蛋白和膜结合蛋白(分别为配体和受体)之间的相互作用;
步骤4:在基因表达矩阵中仅保留与相互作用蛋白相关的基因。
步骤5:它们的表达水平用作输入,使用评分函数[函数f (L,R)],其中L和R分别是配体和受体的表达值来计算每个配体-受体对的交流得分。可以使用聚合函数[函数g (Cell 1,Cell 2)],其中Cell 1和Cell 2都是这些细胞或相应样本的所有通讯得分,可以汇总这些通信得分以计算各个样本或细胞之间的总体交互状态;
步骤6:最后,可以通过Circos图和网络可视化来表示交流和汇总分数,以方便对结果进行分析解释。

Plant cell-cell communication

植物由于存在细胞壁,成为了一道阻隔细胞交流的物理屏障;但是目前研究发现植物还是存在两种机制进行细胞交流:

  1. 小分子(如肽和植物激素)通过细胞壁和质膜受体的扩散
  2. 在胞质分裂的过程中,通过plasmodesmata保持细胞的连接(可以将营养素,激素,调节蛋白和RNA等分子从一个细胞转运到另一个细胞),包括primary plasmodesmata、secondary plasmodesmata

能够在植物细胞之间移动的蛋白称为:non-cell-autonomous proteins (NCAPs)
CPC is transported from atrichoblasts, where it is expressed, to trichoblasts, and accumulates in their nuclei.

植物中也支持膜受体配体介导的细胞间信号转导;通过转录因子进行细胞间交流、small RNA介导的细胞信号传导、

细胞配受体通识

主要介绍动物相关细胞信号交流知识;细胞通常使用化学信号进行交流。这些化学信号是由发送细胞产生的蛋白质或其他分子,通常由细胞分泌并释放到细胞外空间。在那里,它们可以像漂流瓶一样漂浮到邻近的细胞。一个受体只能识别一个(或几个)特定的配体,一个配体只能与一个(或几个)目标受体结合。配体与受体结合会改变受体的形状或活性,使其能够传递信号或直接在细胞内部产生变化。
受体分为:胞内受体、细胞表面受体
细胞表面受体:配体门控离子通道,G蛋白偶联受体,受体酪氨酸激酶

CellChat

输入文件:1.细胞基因表达数据;2.细胞标签
输入是均一化的数据(Seurat@assay$RNA@data);如果用户提供counts数据,可以用normalizeData函数来均一化。对于细胞的信息,需要一个带有rownames的数据格式作为CellChat的输入。

  1. library(CellChat)
  2. library(ggplot2)
  3. library(ggalluvial)
  4. library(svglite)
  5. library(Seurat)
  6. library(SeuratData)
  7. options(stringsAsFactors = FALSE)
  8.  
  9. # 根据Seurat对象准备CellChat输入数据
  10. data.input <- pbmc3k.final@assays$RNA@data
  11. identity = data.frame(group =pbmc3k.final$seurat_annotations , row.names = names(pbmc3k.final$seurat_annotations)) # create a dataframe consisting of the cell labels
  12. unique(identity$group) # check the cell labels
  13.  
  14. # 构建cellchat对象
  15. cellchat <- createCellChat(data = data.input)
  16. cellchat
  17.  
  18. # 可视化数据结构
  19. library(mindr)
  20. (out <- capture.output(str(cellchat)))
  21. out2 <- paste(out, collapse="n")
  22. mm(gsub("\.\.@","# ",gsub("\.\. ","#",out2)),type ="text")
  23.  
  24. # 添加metadata到cellchat对象
  25. cellchat <- addMeta(cellchat, meta = identity, meta.name = "labels")
  26. cellchat <- setIdent(cellchat, ident.use = "labels") # set "labels" as default cell identity
  27. levels(cellchat@idents) # show factor levels of the cell labels
  28. groupSize <- as.numeric(table(cellchat@idents)) # number of cells in each cell group
  29.  
  30. # 导入配受体库
  31. # 查看数据库结构
  32. CellChatDB <- CellChatDB.human
  33. (out3 <- capture.output(str(CellChatDB)))
  34. out4 <- paste(out3, collapse="n")
  35. mm(gsub("\$","# ",gsub("\.\. ","#",out4)),type ="text")
  36.  
  37. # 配受体库提取
  38. CellChatDB.use <- subsetDB(CellChatDB, search = "Secreted Signaling") # use Secreted Signaling for cell-cell communication analysis
  39. cellchat@DB <- CellChatDB.use # set the used database in the object
  40.  
  41. # 表达数据预处理
  42. # 在一个细胞组中识别过表达的配体或受体
  43. cellchat <- subsetData(cellchat) # subset the expression data of signaling genes for saving computation cost
  44. future::plan("multiprocess", workers = 4)
  45. cellchat <- identifyOverExpressedGenes(cellchat)
  46. cellchat <- identifyOverExpressedInteractions(cellchat)
  47. cellchat <- projectData(cellchat, PPI.human)
  48.  
  49. # 为每个相互作用分配一个概率值并进行置换检验来推断生物意义上的细胞-细胞通信
  50. # cellchat <- computeCommunProb(cellchat) 注意这个函数如果你可以用就用
  51. mycomputeCommunProb <-edit(computeCommunProb)
  52. environment(mycomputeCommunProb) <- environment(computeCommunProb)
  53. cellchat <- mycomputeCommunProb(cellchat)
  54.  
  55. # 聚合通信网络
  56. cellchat <- computeCommunProbPathway(cellchat)
  57. cellchat <- aggregateNet(cellchat)
  58.  
  59. # 层次图或圈图可视化
  60. # 实体圆和空心圆分别表示源和目标。圆的大小与每个细胞组的细胞数成比例。边缘颜色与信源一致。线越粗,信号越强。
  61. cellchat@netP$pathways
  62. levels(cellchat@idents)
  63. vertex.receiver = seq(1,4)
  64. pathways.show <- "MIF"
  65. mynetVisual_aggregate(cellchat, signaling = pathways.show, vertex.receiver = vertex.receiver, vertex.size = groupSize)
  66. mynetVisual_aggregate(cellchat, signaling = c("MIF"), layout = "circle", vertex.size = groupSize,pt.title=20,vertex.label.cex = 1.7)
  67. netAnalysis_contribution(cellchat, signaling = pathways.show)
  68.  
  69. netVisual_signalingRole(cellchat, signaling = pathways.show, width = 12, height = 2.5, font.size = 10)
  70.  
  71. # 识别分泌细胞外向交流模式
  72. nPatterns = 5
  73. # 同样在这里遇到了bug,难道说是我没有安装好吗,de了它。
  74. # cellchat <- myidentifyCommunicationPatterns(cellchat, pattern = "outgoing", k = nPatterns)
  75. myidentifyCommunicationPatterns <- edit(identifyCommunicationPatterns)
  76. environment(myidentifyCommunicationPatterns) <- environment(identifyCommunicationPatterns)
  77. cellchat <- myidentifyCommunicationPatterns(cellchat, pattern = "outgoing", k = nPatterns)
  78. # Visualize the communication pattern using river plot
  79. netAnalysis_river(cellchat, pattern = "outgoing")
  80. # Visualize the communication pattern using dot plot
  81. netAnalysis_dot(cellchat, pattern = "outgoing")
  82.  
  83. # 识别目标细胞的传入(incoming)通信模式
  84. netAnalysis_river(cellchat, pattern = "incoming")
  85. netAnalysis_dot(cellchat, pattern = "incoming")

celltalker

cellphonedb

  1. library(Seurat)
  2. library(SeuratData)
  3. pbmc3k
  4. head(pbmc3k@meta.data)
  5.  
  6. # 根据Seurat对象准备cellphonedb文件
  7. write.table(as.matrix(pbmc3k@assays$RNA@data), 'cellphonedb_count.txt', sep='t', quote=F)
  8. meta_data <- cbind(rownames(pbmc3k@meta.data), pbmc3k@meta.data[,'seurat_annotations', drop=F])
  9. meta_data <- as.matrix(meta_data)
  10. meta_dat[is.na(meta_data)] = "Unkown" # 细胞类型中不能有NA
  11. write.table(meta_data, 'cellphonedb_meta.txt', sep='t', quote=F, row.names=F)
  12.  
  13. # linux运行
  14. cellphonedb method statistical_analysis cellphonedb_meta.txt cellphonedb_count.txt --counts-data=gene_name
  15. cellphonedb plot dot_plot
  16. cellphonedb plot heatmap_plot cellphonedb_meta.txt
  17.  
  18. # R中绘图
  19. pbmc='D:\SingleCell\out\' ## outs 文件放在这里了。
  20.  
  21. library(psych)
  22. library(qgraph)
  23. library(igraph)
  24.  
  25. netf<- "count_network.txt"
  26. mynet <- read.delim(paste0(pbmc,"count_network.txt"), check.names = FALSE)
  27. head(mynet)
  28. net<- graph_from_data_frame(mynet)
  29. plot(net)
  30.  
  31. allcolour=c("#DC143C","#0000FF","#20B2AA","#FFA500","#9370DB",
  32. "#98FB98","#F08080","#1E90FF","#7CFC00","#FFFF00",
  33. "#808000","#FF00FF","#FA8072","#7B68EE","#9400D3",
  34. "#800080","#A0522D","#D2B48C","#D2691E","#87CEEB",
  35. "#40E0D0","#5F9EA0","#FF1493",
  36. "#FFE4B5","#8A2BE2","#228B22","#E9967A","#4682B4",
  37. "#32CD32","#F0E68C","#FFFFE0","#EE82EE","#FF6347",
  38. "#6A5ACD","#9932CC","#8B008B","#8B4513","#DEB887")
  39.  
  40. karate_groups <- cluster_optimal(net)
  41. coords <- layout_in_circle(net, order =
  42. order(membership(karate_groups))) # 设置网络布局
  43.  
  44. E(net)$width <- E(net)$count/10 # 边点权重(粗细)
  45. plot(net, edge.arrow.size=.1,
  46. edge.curved=0,
  47. vertex.color=allcolour,
  48. vertex.frame.color="#555555",
  49. vertex.label.color="black",
  50. layout = coords,
  51. vertex.label.cex=.7)
  52.  
  53. net2 <- net # 复制一份备用
  54.  
  55. for (i in 1: length(unique(mynet$SOURCE)) ){
  56. E(net)[map(unique(mynet$SOURCE),function(x) {
  57. get.edge.ids(net,vp = c(unique(mynet$SOURCE)[i],x))
  58. })%>% unlist()]$color <- allcolour[i]
  59. } # 这波操作谁有更好的解决方案?
  60.  
  61. plot(net, edge.arrow.size=.1,
  62. edge.curved=0,
  63. vertex.color=allcolour,
  64. vertex.frame.color="#555555",
  65. vertex.label.color="black",
  66. layout = coords,
  67. vertex.label.cex=.7)
  68.  
  69. plot(net, edge.arrow.size=.1,
  70. edge.curved=0.2, # 只是调了这个参数
  71. vertex.color=allcolour,
  72. vertex.frame.color="#555555",
  73. vertex.label.color="black",
  74. layout = coords,
  75. vertex.label.cex=.7)
  76.  
  77. # 贝壳图
  78. dev.off()
  79. length(unique(mynet$SOURCE)) # 查看需要绘制多少张图,以方便布局
  80. par(mfrow=c(2,5), mar=c(.3,.3,.3,.3))
  81.  
  82. for (i in 1: length(unique(mynet$SOURCE)) ){
  83. net1<-net2
  84. E(net1)[map(unique(mynet$SOURCE),function(x) {
  85. get.edge.ids(net,vp = c(unique(mynet$SOURCE)[i],x))
  86. })%>% unlist()]$color <- allcolour[i]
  87.  
  88. plot(net1, edge.arrow.size=.1,
  89. edge.curved=0.4,
  90. vertex.color=allcolour,
  91. vertex.frame.color="#555555",
  92. vertex.label.color="black",
  93. layout = coords,
  94. vertex.label.cex=1)
  95. }
  96. dev.off()
  97. length(unique(mynet$SOURCE))
  98. par(mfrow=c(2,5), mar=c(.3,.3,.3,.3))
  99.  
  100. for (i in 1: length(unique(mynet$SOURCE)) ){
  101. net1<-net2
  102.  
  103. E(net1)$count <- ""
  104. E(net1)[map(unique(mynet$SOURCE),function(x) {
  105. get.edge.ids(net,vp = c(unique(mynet$SOURCE)[i],x))
  106. })%>% unlist()]$count <- E(net2)[map(unique(mynet$SOURCE),function(x) {
  107. get.edge.ids(net,vp = c(unique(mynet$SOURCE)[i],x))
  108. })%>% unlist()]$count # 故技重施
  109.  
  110. E(net1)[map(unique(mynet$SOURCE),function(x) {
  111. get.edge.ids(net,vp = c(unique(mynet$SOURCE)[i],x))
  112. })%>% unlist()]$color <- allcolour[i]
  113.  
  114. plot(net1, edge.arrow.size=.1,
  115. edge.curved=0.4,
  116. edge.label = E(net1)$count, # 绘制边的权重
  117. vertex.color=allcolour,
  118. vertex.frame.color="#555555",
  119. vertex.label.color="black",
  120. layout = coords,
  121. vertex.label.cex=1
  122. )
  123.  
  124. }
  1. # 点图
  2. mypvals <- read.delim(paste0(pbmc,"pvalues.txt"), check.names = FALSE)
  3. mymeans <- read.delim(paste0(pbmc,"means.txt"), check.names = FALSE)
  4.  
  5. # 这些基因list很有意思啊,建议保存
  6. chemokines <- grep("^CXC|CCL|CCR|CX3|XCL|XCR", mymeans$interacting_pair,value = T)
  7. chemokines <- grep("^CXC|CCL|CCR|CX3|XCL|XCR", mymeans$interacting_pair,value = T)
  8. th1 <- grep("IL2|IL12|IL18|IL27|IFNG|IL10|TNF$|TNF |LTA|LTB|STAT1|CCR5|CXCR3|IL12RB1|IFNGR1|TBX21|STAT4",
  9. mymeans$interacting_pair,value = T)
  10. th2 <- grep("IL4|IL5|IL25|IL10|IL13|AREG|STAT6|GATA3|IL4R",
  11. mymeans$interacting_pair,value = T)
  12. th17 <- grep("IL21|IL22|IL24|IL26|IL17A|IL17A|IL17F|IL17RA|IL10|RORC|RORA|STAT3|CCR4|CCR6|IL23RA|TGFB",
  13. mymeans$interacting_pair,value = T)
  14. treg <- grep("IL35|IL10|FOXP3|IL2RA|TGFB", mymeans$interacting_pair,value = T)
  15. costimulatory <- grep("CD86|CD80|CD48|LILRB2|LILRB4|TNF|CD2|ICAM|SLAM|LT[AB]|NECTIN2|CD40|CD70|CD27|CD28|CD58|TSLP|PVR|CD44|CD55|CD[1-9]",
  16. mymeans$interacting_pair,value = T)
  17. coinhibitory <- grep("SIRP|CD47|ICOS|TIGIT|CTLA4|PDCD1|CD274|LAG3|HAVCR|VSIR",
  18. mymeans$interacting_pair,value = T)
  19. niche <- grep("CSF", mymeans$interacting_pair,value = T)
  20.  
  21. mymeans %>% dplyr::filter(interacting_pair %in% costimulatory)%>%
  22. dplyr::select("interacting_pair",starts_with("NK"),ends_with("NK")) %>%
  23. reshape2::melt() -> meansdf
  24.  
  25. colnames(meansdf)<- c("interacting_pair","CC","means")
  26.  
  27. mypvals %>% dplyr::filter(interacting_pair %in% costimulatory)%>%
  28. dplyr::select("interacting_pair",starts_with("NK"),ends_with("NK"))%>%
  29. reshape2::melt()-> pvalsdf
  30.  
  31. colnames(pvalsdf)<- c("interacting_pair","CC","pvals")
  32. pvalsdf$joinlab<- paste0(pvalsdf$interacting_pair,"_",pvalsdf$CC)
  33. meansdf$joinlab<- paste0(meansdf$interacting_pair,"_",meansdf$CC)
  34. pldf <- merge(pvalsdf,meansdf,by = "joinlab")
  35.  
  36. summary((filter(pldf,means >1))$means)
  37.  
  38. pldf%>% filter(means >1) %>%
  39. ggplot(aes(CC.x,interacting_pair.x) )
  40. geom_point(aes(color=means,size=-log10(pvals 0.0001)) )
  41. scale_size_continuous(range = c(1,3))
  42. scale_color_gradient2(high="red",mid = "yellow",low ="darkblue",midpoint = 25 ) theme_bw()
  43. theme(axis.text.x = element_text(angle = -45,hjust = -0.1,vjust = 0.8))

 

发表评论

匿名网友

拖动滑块以完成验证
加载中...