前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >CellChat细胞通讯(二)可视化篇

CellChat细胞通讯(二)可视化篇

作者头像
生信菜鸟团
发布2022-10-31 17:41:17
5.5K2
发布2022-10-31 17:41:17
举报
文章被收录于专栏:生信菜鸟团生信菜鸟团

书接上文。我在 CellChat细胞通讯分析(一)一文中简单介绍了CellChat,以及其进行细胞间通讯的推断与分析的代码实现。简言之,上文主要是得到一个细胞间通讯网络,而在此基础上,作者提供了一系列的可视化函数,方便用户进行可视化和数据探索。

前文说到:

在运行CellChat的基本流程之后得到了细胞间通讯网络,从这里开始,围绕这三个问题,作者给出了一系列的代码和可视化函数。带着这种自上而下,从细胞,到通路,再到基因(受配体对)的思维,我们能够更好的理解作者的分析思路和代码思维。

因此,围绕可视化,作者的思路是

  • 细胞层面的可视化,如细胞间与细胞间互作可视化;
  • 通路层面的可视化,如A细胞与B细胞互作主要通过哪些通路;
  • 基因,也就是配受体对的可视化,如A细胞与B细胞互作主要通过哪些受配体对。

Part III:细胞-细胞通讯网络可视化

在推断细胞-细胞通讯网络的基础上,CellChat为进一步的数据探索、分析和可视化提供了各种功能。

  • 它提供了多种可视化cell-cell通讯网络的方法,包括hierarchical plot, circle plot, Chord diagram, 和bubble plot.
  • 为推测网络的高阶信息提取和可视化提供便捷。例如,它可以预测细胞亚群的主要信号输入和输出,以及这些细胞群和信号如何协同工作。
  • 它可以利用社会网络分析、模式识别和多种学习方法相结合的综合方法对推断的细胞-细胞通讯网络进行定量表征和比较。
Step8. 使用层次图(Hierarchical plot),圆圈图(Circle plot)或和弦图(Chord diagram)可视化每个信号通路

下面是几种可视化图形的解读和部分参数,英文更为原汁原味:

  • Hierarchy plot: USER should define vertex.receiver, which is a numeric vector giving the index of the cell groups as targets in the left part of hierarchy plot. This hierarchical plot consist of two components: the left portion shows autocrine and paracrine signaling to certain cell groups of interest (i.e, the defined vertex.receiver), and the right portion shows autocrine and paracrine signaling to the remaining cell groups in the dataset. Thus, hierarchy plot provides an informative and intuitive way to visualize autocrine and paracrine signaling communications between cell groups of interest. For example, when studying the cell-cell communication between fibroblasts and immune cells, USER can define vertex.receiver as all fibroblast cell groups.
代码语言:javascript
复制
pathways.show <- c("MIF") 
# Hierarchy plot
# Here we define `vertex.receive` so that the left portion of the hierarchy plot shows signaling to fibroblast and the right portion shows signaling to immune cells 
vertex.receiver = c(1,2,3,4) # a numeric vector. 
netVisual_aggregate(cellchat, signaling = pathways.show,  vertex.receiver = vertex.receiver, layout = "hierarchy")

image-20221004094003443

可视化解读:层次图包含左(A,C,B)和右(A,C,B)两块内容,左边的部分显示了指定的细胞亚群的自分泌和旁分泌信号(定义为vertex.receiver参数对应的细胞亚群),如c(1,2,3,4), 分别对应上图的"Naive CD4 T", "Memory CD4 T", "CD14+ Mono" 和"B" ;右边显示数据集中剩余的细胞亚群(除了1,2,3,4以外的)的自分泌和旁分泌信号。(翻译成大白话还看不懂的朋友,如果又很想看懂这个图,可以后台私聊小编,有偿一对一解读,包教包会=.=)

  • Circle plot:Visualization of cell-cell communication at different levels**: One can visualize the inferred communication network of signaling pathways using netVisual_aggregate, and visualize the inferred communication networks of individual L-R pairs associated with that signaling pathway using netVisual_individual. 这个图比较好理解,也是目前用的比较多的展现方式,例如:
代码语言:javascript
复制
# Circle plot show pathway
par(mfrow=c(1,2))
netVisual_aggregate(cellchat, signaling = pathways.show, layout = "circle")
netVisual_aggregate(cellchat, signaling = pathways.show, layout = "circle",label.edge= T)

小技巧:extractEnrichedLR函数提取指定pathways内的所有受配体信号值,然后用netVisual_individual可视化(设置参数pairLR.use):

代码语言:javascript
复制
# Circle plot show L-R pairs
pairLR.CXCL <- extractEnrichedLR(cellchat, signaling = pathways.show, geneLR.return = FALSE)
LR.show <- pairLR.CXCL[1,] # show one ligand-receptor pair
LR.show
#"MIF_CD74_CXCR4"
# Vis
netVisual_individual(cellchat, signaling = pathways.show,  pairLR.use = "MIF_CD74_CXCR4", layout = "circle")
  • Chord diagram: CellChat provides two functions netVisual_chord_cell and netVisual_chord_gene for visualizing cell-cell communication with different purposes and different levels. netVisual_chord_cell is used for visualizing the cell-cell communication between different cell groups (where each sector in the chord diagram is a cell group), and netVisual_chord_gene is used for visualizing the cell-cell communication mediated by mutiple ligand-receptors or signaling pathways (where each sector in the chord diagram is a ligand, receptor or signaling pathway.)

CellChat的和弦图有两种展示方式:

  • 一种是netVisual_chord_cell函数,用于可视化不同细胞亚群之间的细胞-细胞通讯(弦图中的每个扇区都是一个细胞亚群);
  • netVisual_chord_gene函数,用于显示由多个配体-受体或信号通路(弦图中的每个扇区是一个配体、受体或信号通路)介导的细胞-细胞通讯。
代码语言:javascript
复制
par(mfrow = c(1,2), xpd=TRUE)
# Chord diagram 下面这两幅图等价
netVisual_aggregate(cellchat, signaling = pathways.show, layout = "chord",title.name = "Chord diagram  1")
netVisual_chord_cell(cellchat, signaling = pathways.show,title.name = "Chord diagram  2: show cell type")

image-20220816212942604

代码语言:javascript
复制
# Chord diagram 2 show L-R pairs 显示配受体层面的和弦图,指定slot.name为net
netVisual_chord_gene(cellchat, sources.use = 1, targets.use = c(5:8), lab.cex = 0.5,title.name = "Chord diagram  2: show gene",slot.name = "net") 

image-20220816213111678

代码语言:javascript
复制
# Chord diagram 3 show pathway 显示通路层面的和弦图,指定slot.name为netP
netVisual_chord_gene(cellchat, sources.use = 1, targets.use = c(5:8), lab.cex = 0.5,slot.name = "netP",title.name = "Chord diagram  2: show pathway") 

如何合并细胞类型进行Chord diagram可视化?

对于和弦图,CellChat有一个独立的功能netVisual_chord_cell,通过调整圆包中的不同参数,可以灵活地可视化信号网络。例如,我们可以定义一个命名字符向量组来创建多组和弦图,例如,将cell集群分组为不同的cell类型。

代码语言:javascript
复制
levels(cellchat@idents)
#[1] "Naive CD4 T" "Memory CD4 T" "CD14+ Mono" "B" "CD8 T" "FCGR3A+ Mono" "NK" "DC"          
#[9] "Platelet"  
代码语言:javascript
复制
### 合并细胞类型
group.cellType <- c("T","T","Mono","B","T","Mono","NK","DC","Platelet")
group.cellType <- factor(group.cellType, levels = c("T", "B", "Mono", "NK","DC","Platelet"))
names(group.cellType) <- levels(cellchat@idents)

# Vis
netVisual_chord_cell(cellchat, signaling = pathways.show, group = group.cellType, title.name = paste0(pathways.show, " signaling network"))

image-20220817150741995

  • Explnations of edge color/weight, node color/size/shape**: In all visualization plots, edge colors are consistent with the sources as sender, and edge weights are proportional to the interaction strength. Thicker edge line indicates a stronger signal. In the Hierarchy plot and Circle plot, circle sizes are proportional to the number of cells in each cell group. In the hierarchy plot, solid and open circles represent source and target, respectively. In the Chord diagram, the inner thinner bar colors represent the targets that receive signal from the corresponding outer bar. The inner bar size is proportional to the signal strength received by the targets. Such inner bar is helpful for interpreting the complex chord diagram. Note that there exist some inner bars without any chord for some cell groups, please just igore it because this is an issue that has not been addressed by circlize package.**
  • Heatmap:热图说的东西其实和上面展示的是差不多的,只是换了另外一种展现形式。
代码语言:javascript
复制
# Heatmap
par(mfrow=c(1,1))
netVisual_heatmap(cellchat, signaling = pathways.show, color.heatmap = "Reds")
Step9. 计算每个配体-受体对L-R pairs对整个信号通路的贡献,并可视化单个配体-受体对介导的细胞-细胞通信
代码语言:javascript
复制
netAnalysis_contribution(cellchat, signaling = pathways.show)

我们还可以可视化到单个配体-受体对介导的细胞-细胞通信。我们还可以用Circle plot show L-R pairs(见Step8),即可视化单个配体-受体对介导的细胞-细胞通信。作者提供了一个函数 extractEnrichedLR ,用于提取指定信号通路的所有L-R pairs和相关信号基因。

除了Circle plot可视化受配体对,还可以用和弦图,逻辑和可视化pathwaty是一样的,无非是多指定一个pairLR.use

代码语言:javascript
复制
# Chord diagram
netVisual_individual(cellchat, signaling = pathways.show, pairLR.use = "MIF_CD74_CXCR4", layout = "chord")
Step10.自动保存所有推断网络,方便用户快速探索

在实际使用中,用户可以使用for循环来自动保存所有推测的网络,以便使用netVisual进行快速探索。netVisual支持svg、png和pdf格式的输出,这里包括了两种可视化方法,一个是hierarchy plot,另一个是柱状图,见gg.plot的输出结果:

作者给的netVisual函数会在当前目录下生成N个配受体对的hierarchy图,居然没有给一个output的目录,因此我这里修改了作者的源代码,加了一个out.dir参数用于将png图片输出至指定的目录下。 此外,cellchat还有大量的函数存在一定问题,我把这些函数一一做了debug,因为篇幅太长了,没办法展示给大家看。文末赞赏一下,我把完整的代码私发你:

代码语言:javascript
复制
# Access all the signaling pathways showing significant communications
pathways.show.all <- cellchat@netP$pathways
# check the order of cell identity to set suitable vertex.receiver
levels(cellchat@idents)
vertex.receiver = seq(1,4)
# Vis
gg.list = list()
for (i in 1:length(pathways.show.all)) {
  ## 可视化1:hierarchy plot 可视化配受体对 netVisual.V2是在作者的netVisual基础上补充了out.dir参数
  # Visualize communication network associated with both signaling pathway and individual L-R pairs
  netVisual.V2(cellchat, signaling = pathways.show.all[i],
            vertex.receiver = vertex.receiver, layout = "hierarchy",out.dir = "./NetVisual/")
    
  ## 可视化2: 柱状图可视化配受体对 
  # Compute and visualize the contribution of each ligand-receptor pair to the overall signaling pathway
  gg <- netAnalysis_contribution(cellchat, signaling = pathways.show.all[i])
  gg.list[[pathways.show.all[i]]] = gg
  #ggsave(filename=paste0(pathways.show.all[i], "_L-R_contribution.pdf"), plot=gg, width = 3, height = 2, units = 'in', dpi = 300)
}
gg.plot = wrap_plots(gg.list,ncol = 5)
gg.plot
ggsave(gg.plot,filename = "./_L-R_contribution.pdf")

image-20220817163721139

我们再看一下out.dir = "./NetVisual/",目录下的N个png图:

image-20220818120736802

随便点开一个长这样,非常高清:

Step11. 观察多种配体受体或信号通路介导的细胞-细胞通讯

主要有气泡图、和弦图和小提琴图三种可视化方式:

11.1 气泡图
  • 展示指定sources.use和targets.use的所有的配受体信息
代码语言:javascript
复制
### Bubble plot
# show all the significant interactions (L-R pairs) from some cell groups (defined by 'sources.use') to other cell groups (defined by 'targets.use')
netVisual_bubble(cellchat, sources.use = 1, targets.use = c(1:7), remove.isolate = FALSE)

image-20220817171659166

  • 展示指定sources.use和targets.use的指定的pathway下的配受体信息,signaling参数
代码语言:javascript
复制
# show all the significant interactions (L-R pairs) associated with certain signaling pathways
netVisual_bubble(cellchat, sources.use = 1, targets.use = c(1:5), 
                 signaling = c("MIF","MHC-I"), remove.isolate = FALSE)

image-20220818133812526

  • 展示指定sources.use和targets.use的指定的配受体信息,pairLR.use参数
代码语言:javascript
复制
# show all the significant interactions (L-R pairs) based on user's input (defined by `pairLR.use`)
pairLR.use <- extractEnrichedLR(cellchat, signaling = c("MIF","MHC-I"))
pairLR.use  = pairLR.use[c(1,3),,drop=F]
netVisual_bubble(cellchat, sources.use = c(1), targets.use = c(1:5), 
                 pairLR.use = pairLR.use, remove.isolate = TRUE)

image-20220818134715771

11.2 和弦图

同样的,基于netVisual_chord_gene函数,也可以用和弦图进行可视化:

  • 展示从一些细胞群到其他细胞群的所有相互作用(受配体对或pathway)。两种特殊情况:一种是展示从一个细胞亚群发送的所有相互作用,另一种是显示由一个一个细胞亚群接收的所有相互作用;
  • 展示用户自定义的某些信号通路。

如下:

  • 第一种情况,展示所有的指定的细胞亚群之间的相互作用通路: 例如native CD4T接受其他细胞的信号
代码语言:javascript
复制
# show all the significant interactions (L-R pairs) from some cell groups (defined by 'sources.use') to other cell groups (defined by 'targets.use')
# show all the interactions sending from native CD4T 
netVisual_chord_gene(cellchat,
                     sources.use = 1,
                     targets.use = c(2:5),
                     lab.cex = 0.5,legend.pos.y = 30)

image.png

或者native CD4T传到其他细胞的信号:

代码语言:javascript
复制
# show all the interactions received by native CD4T
netVisual_chord_gene(cellchat,
                     sources.use = c(2:5),
                     targets.use = 1,
                     legend.pos.x = 15)

image-20220818160200090

  • 用户也可以通过slot.name = "netP"显示所有的通路,或者在此基础上加signaling参数指定特定通路:
代码语言:javascript
复制
# show all the significant signaling pathways from some cell groups (defined by 'sources.use') to other cell groups (defined by 'targets.use')
netVisual_chord_gene(cellchat,
                     sources.use = c(1),
                     targets.use = c(2:7),
                     slot.name = "netP", legend.pos.x = 10)

## 体会与上代码的区别?
netVisual_chord_gene(cellchat,
                     sources.use = c(1),
                     targets.use = c(2:7),signaling = c("MIF","MHC-I"),
                     slot.name = "netP", legend.pos.x = 10)

image-20220818162250164

  • 用户也可以通过signaling指定需要展示的特定通路下的受配体对,以及用pairLR.use指定需要展示的受配体对:
代码语言:javascript
复制
# show all the significant interactions (L-R pairs) associated with certain signaling pathways
netVisual_chord_gene(cellchat, sources.use = c(1),
                     targets.use = c(2:7),
                     signaling = c("MIF","MHC-I"),
                     legend.pos.x = 8)

# show specific interactions (L-R pairs) associated with certain signaling pathways
pairLR.use <- extractEnrichedLR(cellchat, signaling = c("MIF","MHC-I"))
pairLR.use  = pairLR.use[c(1,3),,drop=F]
netVisual_chord_gene(cellchat, sources.use = c(1),
                     targets.use = c(2:7),
                     pairLR.use = pairLR.use,
                     # signaling = c("MIF","MHC-I"),
                     legend.pos.x = 8)

image-20220818161527151

Step12. 使用小提琴/气泡图绘制信号基因表达分布
代码语言:javascript
复制
plotGeneExpression(cellchat, signaling = "MID")

默认情况下,plotGeneExpression只显示与推测的显著的通讯相关的信号基因的表达。用户可以展示某通路下所有的受配体信号

代码语言:javascript
复制
plotGeneExpression(cellchat, signaling = "CXCL", enriched.only = FALSE)

用户也可以使用extractEnrichedLR提取推测的受配体对或信号通路相关的信号基因,然后使用Seurat包绘制基因表达图。

Part IV: 细胞-细胞通讯网络的系统分析

为了便于理解复杂的细胞间通讯网络,CellChat通过从图论、模式识别和空间信息流形学习中抽象出来的方法对网络进行定量测量:

  • CellChat可以确定主要的信号sources和targets,以及在给定的信号网络中使用来自网络分析的中心性度量的中介和影响者;
  • CellChat利用模式识别方法,可以预测特定细胞类型的关键输入和输出信号,以及不同细胞类型之间的协调反应,利用模式识别方法;
  • CellChat可以通过定义相似性度量和从功能和拓扑两方面执行多种学习来对信号通路进行分组;
  • CellChat可以通过多网络的联合流形学习来勾画出保守的和上下文相关的信号通路。

这段话可能需要数学背景的人才能看懂......

Step13. 识别细胞亚群的信号作用(例如主要的发送者,接收者)以及主要的贡献信号

CellChat通过计算每个细胞组的若干网络中心性度量,可以随时识别细胞间通信网络中的主要的发送者(senders)、接收者(receivers)、中介(mediators)和影响者(influencers)。具体而言,作者使用加权定向网络中的指标,包括向外程度、向内程度、流动间度和信息中心性,分别识别细胞间通信的主导发送者、接收者、中介和影响者。在以权值为计算通信概率的加权有向网络中,小区组出方向信号的出度和入方向信号的入方向信号的出度分别用来识别信号网络中占主导地位的小区发送方和接收方。关于流间性和信息中心性的定义,请查阅作者的论文和相关参考资料。

13.1 计算并可视化网络中心性得分

netAnalysis_computeCentrality函数基于netP插槽,计算网络中心性得分,然后进行可视化:

代码语言:javascript
复制
# Compute the network centrality scores
cellchat <- netAnalysis_computeCentrality(cellchat, slot.name = "netP") # the slot 'netP' means the inferred intercellular communication network of signaling pathways
# Visualize the computed centrality scores using heatmap, allowing ready identification of major signaling roles of cell groups
cellchat@netP$pathways
pathways.show = "MHC-I"
netAnalysis_signalingRole_network(cellchat,
                                  signaling = pathways.show,
                                  width = 8, height = 2.5,
                                  font.size = 10)

image-20220818214830962

13.2 在2D空间中可视化主要的发送者(source)和接收者(target)

作者还提供了另一种直观的方法,使用散点图在2D空间中可视化主要的发送方(source)和接收方(target):

代码语言:javascript
复制
# Signaling role analysis on the aggregated cell-cell communication network from all signaling pathways
gg1 <- netAnalysis_signalingRole_scatter(cellchat)+ggtitle("All pathway")

## 感兴趣的pathway
# Signaling role analysis on the cell-cell communication networks of interest
gg2 <- netAnalysis_signalingRole_scatter(cellchat, signaling = c("MIF","MHC-I"))+ggtitle("MIF and MHC-I")

gg1 + gg2

image-20220818222113999

13.3 识别对某些细胞亚群的输出或输入信号中贡献最大的信号
代码语言:javascript
复制
# Signaling role analysis on the aggregated cell-cell communication network from all signaling pathways
ht1 <- netAnalysis_signalingRole_heatmap(cellchat, pattern = "outgoing")
ht2 <- netAnalysis_signalingRole_heatmap(cellchat, pattern = "incoming")
ht1 + ht2

当然也支持可视化指定的pathway:

代码语言:javascript
复制
# Signaling role analysis on the cell-cell communication networks of interest
ht1 <- netAnalysis_signalingRole_heatmap(cellchat, pattern = "outgoing",signaling = c("MIF","MHC-I"))
ht2 <- netAnalysis_signalingRole_heatmap(cellchat, pattern = "incoming",signaling = c("MIF","MHC-I"))
ht1 + ht2
Step14. 确定全局的通讯模式,探索多种细胞类型和信号通路如何协调在一起

除了探索单个通路的详细通讯外,一个重要的问题是多个细胞亚群和信号通路之间是如何协调作用的。CellChat采用一种模式识别方法来识别全局性的通讯模式。随着模式数量的增加,可能会出现多余的模式,这使得解释通信模式变得困难。我们默认选择了五种模式。一般来说,模式的数量大于2是有生物学意义的。此外,我们还提供了一个函数selectK来推断模式的数量,它基于NMF R包中已经实现的两个指标,包括Cophenetic和Silhouette。这两个度量标准都是基于共识矩阵的层次聚类来衡量特定数量的模式的稳定性。对于一个模式数量范围,一个合适的模式数量是Cophenetic和Silhouette值开始突然下降的那个

14.1 识别并可视化分泌细胞的传出(outgoing)通讯模式

传出模式揭示了发送细胞(例如作为信号源的细胞)如何与其他细胞相互协调,以及它们如何与特定的信号通路协调以驱动通讯。

为了直观地显示潜在模式与细胞亚群、配体-受体对或信号通路的关联,我们使用河流/冲积(river/alluvial)图。我们首先将W的每一行和H的每一列归一化为[0,1],然后将W和H中小于0.5的元素设为0。这种阈值可以揭示与每个推断的模式相关的最丰富的细胞组和信号通路,也就是说,每个细胞组或信号通路只与一个推断的模式相关。这些阈值矩阵W和H被用作创建冲积图的输入。

为了将细胞亚群与其丰富的信号通路直接联系起来,我们将W和H中的元素设为零,如果它们小于1/R,其中R是潜在模式的数量。通过使用一个不那么严格的阈值,可以获得与每个细胞组相关的更丰富的信号通路。利用W乘以H计算出的每个细胞组对每个信号通路的贡献分数,我们构建了一个点图,其中点的大小与贡献分数成比例,以显示细胞组与其丰富的信号通路之间的关联。用户还可以降低参数截断,以显示与每个细胞组相关的更丰富的信号通路。

本质上是用NMF对细胞通讯网络进行无监督聚类为N个模块。

加载通信模式分析所需的包:

代码语言:javascript
复制
library(NMF)
library(ggalluvial)

这里,我们运行selectK来推断模式的数量:

代码语言:javascript
复制
selectK(cellchat, pattern = "outgoing")

当outgoing模式的数量为3时,Cophenetic和Silhouette值开始突然下降。因此最佳k值定为3:

代码语言:javascript
复制
nPatterns = 3
cellchat <- identifyCommunicationPatterns.V2(object = cellchat,
                                          pattern = "outgoing",
                                          k = nPatterns)

identifyCommunicationPatterns函数有一点Bug: Error in svd(A, k, k, LINPACK = LINPACK) : the LINPACK argument has been defunct since R 3.1.0 因此,我修改了作者的源代码。

image-20220818225655587

  • 以river plot进行可视化:
代码语言:javascript
复制
# river plot
netAnalysis_river(cellchat, pattern = "outgoing")

image-20220818225911853

  • 气泡图:
代码语言:javascript
复制
# dot plot
netAnalysis_dot(cellchat, pattern = "outgoing")

image-20220818225925220

14.2 识别并可视化目标单元的传入(incoming)通讯模式

传入(incoming)模式显示了目标细胞(即作为信号接收器的细胞)如何与其他细胞相互协调,以及它们如何与特定的信号通路协调以响应传入信号。

与outgoing模式一样的代码和可视化方法:

代码语言:javascript
复制
selectK(cellchat, pattern = "incoming")
代码语言:javascript
复制
nPatterns = 4
cellchat <- identifyCommunicationPatterns(cellchat, pattern = "incoming", k = nPatterns)
代码语言:javascript
复制
# river plot
netAnalysis_river(cellchat, pattern = "incoming")
#> Please make sure you have load `library(ggalluvial)` when running this function
代码语言:javascript
复制
# dot plot
netAnalysis_dot(cellchat, pattern = "incoming")
Step15. 信号网络的流形分类学习分析

此外,CellChat能够量化所有重要信号通路之间的相似性,然后根据它们的蜂窝通信网络相似性对它们进行分组。可以根据功能或结构相似性进行分组。功能相似:功能相似程度高表明主要的发送者和接收者相似,可以解释为两个信号通路或两个配体-受体对表现出相似和/或冗余的作用。功能相似性分析要求两个数据集之间具有相同的细胞种群组成。结构相似性:采用结构相似性比较两家信令网络结构,不考虑发送方和接收方的相似性。

根据功能相似性确定信号组:

以下作者的源代码都有Bug,我将源代码修改为_GitHub后缀的:

代码语言:javascript
复制
cellchat <- computeNetSimilarity_GitHub(cellchat, type = "functional")
cellchat <- netEmbedding_GitHub(cellchat, type = "functional")
#> Manifold learning of the signaling networks for a single dataset
cellchat <- netClustering_GitHub(cellchat, type = "functional")
#> Classification learning of the signaling networks for a single dataset
# Visualization in 2D-space
netVisual_embedding(cellchat, type = "functional", label.size = 3.5)

image-20220818230354894

代码语言:javascript
复制
netVisual_embeddingZoomIn(cellchat, type = "functional", nCol = 2)

根据结构相似性确定信号组,以下作者给的代码也有Bug,暂时解决不了。

代码语言:javascript
复制
cellchat <- computeNetSimilarity(cellchat, type = "structural")
cellchat <- netEmbedding(cellchat, type = "structural")
#> Manifold learning of the signaling networks for a single dataset
cellchat <- netClustering(cellchat, type = "structural")
#> Classification learning of the signaling networks for a single dataset
# Visualization in 2D-space
netVisual_embedding(cellchat, type = "structural", label.size = 3.5)

以上就是CellChat包的可视化展示及解读的全部内容。上文的分析和可视化完全是基于没有分组的情况下,例如乳腺癌的单细胞通讯图谱,并不涉及多组间的比较,例如免疫治疗前中后的通讯比较分析。因此,在此基础上,作者还开发了一套代码和函数,方便用户进行多组间比较分析,我们下期再聊。

CellChat还有大量的函数存在一定问题,我把这些函数一一做了debug,因为篇幅太长了,没办法展示给大家看。文末赞赏一下,我把完整的代码私发你。

如果上述可视化图表有哪里没有看懂的地方,欢迎各位留言评论。

- END -

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2022-10-08,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 生信菜鸟团 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Part III:细胞-细胞通讯网络可视化
    • Step8. 使用层次图(Hierarchical plot),圆圈图(Circle plot)或和弦图(Chord diagram)可视化每个信号通路
      • Step9. 计算每个配体-受体对L-R pairs对整个信号通路的贡献,并可视化单个配体-受体对介导的细胞-细胞通信
        • Step10.自动保存所有推断网络,方便用户快速探索
          • Step11. 观察多种配体受体或信号通路介导的细胞-细胞通讯
            • 11.1 气泡图
            • 11.2 和弦图
            • Step12. 使用小提琴/气泡图绘制信号基因表达分布
        • Part IV: 细胞-细胞通讯网络的系统分析
          • Step13. 识别细胞亚群的信号作用(例如主要的发送者,接收者)以及主要的贡献信号
            • 13.1 计算并可视化网络中心性得分
            • 13.2 在2D空间中可视化主要的发送者(source)和接收者(target)
            • 13.3 识别对某些细胞亚群的输出或输入信号中贡献最大的信号
          • Step14. 确定全局的通讯模式,探索多种细胞类型和信号通路如何协调在一起
            • 14.1 识别并可视化分泌细胞的传出(outgoing)通讯模式
            • 14.2 识别并可视化目标单元的传入(incoming)通讯模式
          • Step15. 信号网络的流形分类学习分析
          相关产品与服务
          灰盒安全测试
          腾讯知识图谱(Tencent Knowledge Graph,TKG)是一个集成图数据库、图计算引擎和图可视化分析的一站式平台。支持抽取和融合异构数据,支持千亿级节点关系的存储和计算,支持规则匹配、机器学习、图嵌入等图数据挖掘算法,拥有丰富的图数据渲染和展现的可视化方案。
          领券
          问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档