SCS【26】单细胞细胞间通信第二部分通信网络的系统分析(Cel
单细胞生信分析教程并配有视频在线教程,目前整理出来的相关教程目录如下:
SCS【4】单细胞转录组数据可视化分析 (Seurat 4.0)
SCS【6】单细胞转录组之细胞类型自动注释 (SingleR)
SCS【7】单细胞转录组之轨迹分析 (Monocle 3) 聚类、分类和计数细胞
SCS【8】单细胞转录组之筛选标记基因 (Monocle 3)
SCS【9】单细胞转录组之构建细胞轨迹 (Monocle 3)
SCS【10】单细胞转录组之差异表达分析 (Monocle 3)
SCS【11】单细胞ATAC-seq 可视化分析 (Cicero)
SCS【12】单细胞转录组之评估不同单细胞亚群的分化潜能 (Cytotrace)
SCS【13】单细胞转录组之识别细胞对“基因集”的响应 (AUCell)
SCS【15】细胞交互:受体-配体及其相互作用的细胞通讯数据库 (CellPhoneDB)
SCS【16】从肿瘤单细胞RNA-Seq数据中推断拷贝数变化 (inferCNV)
SCS【17】从单细胞转录组推断肿瘤的CNV和亚克隆 (copyKAT)
SCS【18】细胞交互:受体-配体及其相互作用的细胞通讯数据库 (iTALK)
SCS【21】单细胞空间转录组可视化 (Seurat V5)
SCS【22】单细胞转录组之 RNA 速度估计 (Velocyto.R)
SCS【24】单细胞数据量化代谢的计算方法 (scMetabolism)
SCS【25】单细胞细胞间通信第一部分细胞通讯可视化(CellChat)
上一期我们介绍了细胞通讯的可视化,这期我们继续介绍细胞通讯系统性分析,通过NMF的方式找到重要的通路,并对其进行分析,可视化最后结果。
为了便于解释复杂的细胞间通信网络,CellChat通过从图论、模式识别和流形学习中抽象出来的方法对网络进行定量测量。
-
使用网络分析的中心性度量来确定给定信号网络中的主要信号来源和目标以及介质和影响者;
-
利用模式识别方法预测特定细胞类型的关键输入和输出信号以及不同细胞类型之间的协调响应;
-
通过定义相似性度量和从功能和拓扑角度进行多种学习来分组信号通路;
-
通过多个网络的联合流形学习来描述保守的和上下文特定的信号通路。
数据构造
library(CellChat)
library(patchwork)
library(Seurat)
options(Seurat.object.assay.version = "v3")
library(SeuratData)
# Load data
load("data_humanSkin_CellChat.rda")
data.input = data_humanSkin$data # normalized data matrix
meta = data_humanSkin$meta # a dataframe with rownames containing cell mata data
cell.use = rownames(meta)[meta$condition == "LS"] # extract the cell names from disease data
# Prepare input data for CelChat analysis
data.input = data.input[, cell.use]
meta = meta[cell.use, ]
# meta = data.frame(labels = meta$labels[cell.use], row.names =
# colnames(data.input)) # manually create a dataframe consisting of the cell
# labels
unique(meta$labels) # check the cell labels
## [1] Inflam. FIB FBN1+ FIB APOE+ FIB COL11A1+ FIB cDC2
## [6] LC Inflam. DC cDC1 CD40LG+ TC Inflam. TC
## [11] TC NKT
## 12 Levels: APOE+ FIB FBN1+ FIB COL11A1+ FIB Inflam. FIB cDC1 cDC2 ... NKT
## Create a CellChat object
cellchat <- createCellChat(object = data.input, meta = meta, group.by = "labels")
## [1] "Create a CellChat object from a data matrix"
## Set cell identities for the new CellChat object
## The cell groups used for CellChat analysis are APOE+ FIB FBN1+ FIB COL11A1+ FIB Inflam. FIB cDC1 cDC2 LC Inflam. DC TC Inflam. TC CD40LG+ TC NKT
## Add cell information into meta slot of the object (Optional)
cellchat <- addMeta(cellchat, meta = meta)
cellchat <- setIdent(cellchat, ident.use = "labels") # set 'labels' as default cell identity
levels(cellchat@idents) # show factor levels of the cell labels
## [1] "APOE+ FIB" "FBN1+ FIB" "COL11A1+ FIB" "Inflam. FIB" "cDC1"
## [6] "cDC2" "LC" "Inflam. DC" "TC" "Inflam. TC"
## [11] "CD40LG+ TC" "NKT"
groupSize <- as.numeric(table(cellchat@idents)) # number of cells in each cell group
## Set the ligand-receptor interaction database
CellChatDB <- CellChatDB.human # use CellChatDB.mouse if running on mouse data
##
dplyr::glimpse(CellChatDB$interaction)
## Rows: 1,939
## Columns: 11
## $ interaction_name <chr> "TGFB1_TGFBR1_TGFBR2", "TGFB2_TGFBR1_TGFBR2", "TGFB…
## $ pathway_name <chr> "TGFb", "TGFb", "TGFb", "TGFb", "TGFb", "TGFb", "TG…
## $ ligand <chr> "TGFB1", "TGFB2", "TGFB3", "TGFB1", "TGFB1", "TGFB2…
## $ receptor <chr> "TGFbR1_R2", "TGFbR1_R2", "TGFbR1_R2", "ACVR1B_TGFb…
## $ agonist <chr> "TGFb agonist", "TGFb agonist", "TGFb agonist", "TG…
## $ antagonist <chr> "TGFb antagonist", "TGFb antagonist", "TGFb antagon…
## $ co_A_receptor <chr> "", "", "", "", "", "", "", "", "", "", "", "", "",…
## $ co_I_receptor <chr> "TGFb inhibition receptor", "TGFb inhibition recept…
## $ evidence <chr> "KEGG: hsa04350", "KEGG: hsa04350", "KEGG: hsa04350…
## $ annotation <chr> "Secreted Signaling", "Secreted Signaling", "Secret…
## $ interaction_name_2 <chr> "TGFB1 - (TGFBR1+TGFBR2)", "TGFB2 - (TGFBR1+TGFBR2)…
CellChatDB.use <- subsetDB(CellChatDB, search = "Secreted Signaling") # use Secreted Signaling
# set the used database in the object
cellchat@DB <- CellChatDB.use
## Preprocessing the expression data for cell-cell communication analysis
## subset the expression data of signaling genes for saving computation cost
cellchat <- subsetData(cellchat) # This step is necessary even if using the whole database
future::plan("multicore", workers = 1) # do parallel
cellchat <- identifyOverExpressedGenes(cellchat)
cellchat <- identifyOverExpressedInteractions(cellchat)
# 计算通信概率,推断细胞通信网络
cellchat <- computeCommunProb(cellchat)
## triMean is used for calculating the average gene expression per cell group.
## [1] ">>> Run CellChat on sc/snRNA-seq data <<< [2023-05-15 13:29:47]"
## [1] ">>> CellChat inference is done. Parameter values are stored in `object@options$parameter` <<< [2023-05-15 13:32:15]"
cellchat <- filterCommunication(cellchat, min.cells = 10)
# 在信号通路水平推断细胞间的通讯
cellchat <- computeCommunProbPathway(cellchat)
## Calculate the aggregated cell-cell communication network
cellchat <- aggregateNet(cellchat)
groupSize <- as.numeric(table(cellchat@idents))
细胞间通信网络系统分析
识别细胞群的信号作用以及主要的信号作用
CellChat通过计算每个细胞群的几个网络中心性度量,可以随时识别细胞间通信网络中的主要发送者、接收者、中介者和影响者。具体而言,我们在加权定向网络中使用了度量,包括出度、入度、流间性和信息中心性,分别确定了细胞间通信的主要发送者、接收者、中介者和影响者。在权重为计算的通信概率的加权有向网络中,输出度(计算为从一个细胞组发出的信令的通信概率的总和)和输入度(计算为从一个细胞组传入的信令的通信概率的总和)可分别用于识别信令网络中占优势的细胞发送者和接收器。
pathways.show <- c("CXCL")
# 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
netAnalysis_signalingRole_network(cellchat, signaling = pathways.show, width = 8,
height = 2.5, font.size = 10)
在二维空间中可视化主要的发送者(源)和接收者(目标)
# Signaling role analysis on the aggregated cell-cell communication network
# from all signaling pathways
gg1 <- netAnalysis_signalingRole_scatter(cellchat)
# > Signaling role analysis on the aggregated cell-cell communication network
# from all signaling pathways Signaling role analysis on the cell-cell
# communication networks of interest
gg2 <- netAnalysis_signalingRole_scatter(cellchat, signaling = c("CXCL", "CCL"))
# > Signaling role analysis on the cell-cell communication network from user's
# input
gg1 + gg2
识别对某些细胞群的输出或输入信号贡献最大的信号
# 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
识别和可视化分泌细胞的外向通信模式
library(NMF)
library(ggalluvial)
selectK(cellchat, pattern = "outgoing")
当输出模式数为3时,Cophenetic值和Silhouette值都开始突然下降。
nPatterns = 3
cellchat <- identifyCommunicationPatterns(cellchat, pattern = "outgoing", k = nPatterns)
river plot
netAnalysis_river(cellchat, pattern = "outgoing")
dot plot
netAnalysis_dot(cellchat, pattern = "outgoing")
识别和可视化目标细胞的传入通信模式
selectK(cellchat, pattern = "incoming")
当输入模式数为4时,相干值开始下降。
nPatterns = 4
cellchat <- identifyCommunicationPatterns(cellchat, pattern = "incoming", k = nPatterns)
# river plot
netAnalysis_river(cellchat, pattern = "incoming")
# > Please make sure you have load `library(ggalluvial)` when running this
# function
# dot plot
netAnalysis_dot(cellchat, pattern = "incoming")
信令网络的流形与分类学习分析
此外,CellChat能够量化所有重要信号通路之间的相似性,然后根据它们的细胞通信网络相似性对它们进行分组。可以根据功能或结构相似性进行分组。
功能相似性: 高度的功能相似性表明主要的发送者和接受者是相似的,这可以解释为两个信号通路或两个配体受体对表现出相似和/或冗余的作用。功能相似性分析要求两个数据集之间的细胞种群组成相同。
结构相似性: 使用结构相似性来比较它们的信令网络结构,而不考虑发送方和接收方的相似性。
基于功能相似性来识别信号组
cellchat <- computeNetSimilarity(cellchat, type = "functional")
cellchat <- netEmbedding(cellchat, type = "functional")
## Manifold learning of the signaling networks for a single dataset
# > Manifold learning of the signaling networks for a single dataset
cellchat <- netClustering(cellchat, type = "functional", do.parallel = FALSE)
## Classification learning of the signaling networks for a single dataset
# > Classification learning of the signaling networks for a single dataset
# Visualization in 2D-space
netVisual_embedding(cellchat, type = "functional", label.size = 3.5)
基于结构相似性识别信令组
cellchat <- computeNetSimilarity(cellchat, type = "structural")
cellchat <- netEmbedding(cellchat, type = "structural")
## Manifold learning of the signaling networks for a single dataset
# > Manifold learning of the signaling networks for a single dataset
cellchat <- netClustering(cellchat, type = "structural", do.parallel = FALSE)
## Classification learning of the signaling networks for a single dataset
# > Classification learning of the signaling networks for a single dataset
# Visualization in 2D-space
netVisual_embedding(cellchat, type = "structural", label.size = 3.5)
netVisual_embeddingZoomIn(cellchat, type = "structural", nCol = 2)
Reference
- Suoqin Jin et al., Inference and analysis of cell-cell communication using CellChat. Nature Communications, 12:1088 (2021). https://www.nature.com/articles/s41467-021-21246-9
这个软件包代码量还是很多的,需要具有一定 R 语言编程基础,并不是看起来那么简单,所有好多老师想直接自己学习教程来分析,但是实质上没有基础还是很难实现,每步报错都不知道该怎样处理,是最崩溃的!!!
本文使用 文章同步助手 同步