流程
手动建立CellChat受配体数据库(1a): CellChatDB考虑了已知的配体受体复合物的组成,包括配体和受体的多聚复合物,以及几种辅助因子类型:可溶性激动剂、拮抗剂、共刺激和共抑制膜结合受体。CellChatDB包含2021种已验证的L-R 对,包括60%的分泌相互作用(secreting interactions)。 此外,有48%的相互作用涉及异质分子复合物。
单细胞数据输入与预处理(1b) :CellChat将细胞的基因表达数据和细胞注释的meta信息(也可以运行无标签模式)作为输入,预处理会先在每个类群细胞中鉴定过表达的基因。
细胞通讯模型计算(1c) :CellChat对通信概率进行建模,并识别重要通信。① 交叉引用配体-受体相互作用数据库;②使用质量作用定律(law of mass action)定量细胞通讯概率;③ 推断统计学和生物学上显著的细胞通信。
细胞通讯结果可视化提供了三种模式(1d) :层次图(hierarchy plot), 圈图 (Circle plot),气泡图(bubble plot)
细胞通讯模式分析(1e) : CellChat通过图论、模式识别和流形学习等方法对网络进行定量测量,从而更好地解释细胞间通信网络。使用网络中心性分析识别细胞的信号角色,发现主要的细胞通讯模式,信号通路拓扑和功能相似性的分类。
cellchat计算的作用模式
cellchat可以分析的是直接作用,旁分泌,自分泌作用(左边三种)
Cellchat配受体激活考虑到多种因素
CellChat database
1. 通过计算配受体对来计算细胞通讯强度
2. 通过将前面配受体对map到信号通路中,来看信号通路激活的情况,以及配受体对这种信号激活情况的作用占比
3. 细胞交流可视化
- cellchat可以接收不同的数据类型--包括细胞的类型,分散的数据,轨迹分析的数据
- 细胞种类很多的时候使用Hierarchy plot进行展示
- 细胞种类少的时候可以使用Circle plot进行展示
- 固定配受体类型,看他们在不同细胞类型之间的表达的话用Bubble plot
-
4. 评估不同细胞到底扮演了什么角色,是信号发出还是信号接收(细化的刻画细胞亚群的作用)
-
细胞群如何与信号通路联系在一起
-
细胞内信号网络的相似性
-
不同细胞群信号通路的共享性与独特性(流式)
library(Seurat)
library(SeuratData)
library(tidyverse)
library(CellChat)
library(NMF)
library(ggalluvial)
library(patchwork)
library(ggplot2)
library(svglite)
options(stringsAsFactors = FALSE)
复制代码
###数据准备,先split找高变基因,再进行integrated,然后将每组细胞再split出来###
LoadData("immnue")
# 将数据集分组
immune_split.list <- SplitObject(immune, split.by = "orig.ident")
# 按照组标化数据并找到数据的特征分子
immune_split.list <- lapply(X = immune_split.list, FUN = function(x) {
x <- NormalizeData(x)
x <- FindVariableFeatures(x, selection.method = "vst", nfeatures = 2000)
})
# 选择不同数据集重复的特征分子进行整合
features <- SelectIntegrationFeatures(object.list = immune_split.list)
immune.anchors <- FindIntegrationAnchors(object.list = immune_split.list, anchor.features = features)
immune.combined <- IntegrateData(anchorset = immune.anchors)
DefaultAssay(immune.combined) <- "integrated"#这样整合的数据只有高变基因,
saveRDS(immune.combined,"immune.combined.RDS")
# 根据需要,split数据
# immune_split.list <- subset(immune.combined, idents = c('CD14 Mono','CD4 Memory T','CD8 T','NK'))#这里是选择想要分析的细胞,如果有需要的话
Idents(immune.combined) <-'orig.ident'
AA <- subset(immune.combined, idents = 'AA')
BB <- subset(immune.combined, idents = 'BB')
CC <- subset(immune.combined, idents = 'CC')
# 创建cellchat对象
AA <- createCellChat(AA@assays$RNA@data, meta = AA@meta.data, group.by = "celltype2")
BB <- createCellChat(BB@assays$RNA@data, meta = BB@meta.data, group.by = "celltype2")
CC <- createCellChat(CC@assays$RNA@data, meta = CC@meta.data, group.by = "celltype2")
save(AA, BB,CC,file = "cellchat.rda")
# 创建存放文件的文件夹
dir.create("./Compare")
setwd("./Compare")
#设置cellchart对象
AA <- setIdent(AA, ident.use = "celltype2")#cellchart对象设置Ident的方式
BB <- setIdent(BB, ident.use = "celltype2")
CC <- setIdent(CC, ident.use = "celltype2")
#建立配受体连接
cellchat <- AA
cellchat@DB <- CellChatDB.mouse
cellchat <- subsetData(cellchat)
cellchat <- identifyOverExpressedGenes(cellchat)
cellchat <- identifyOverExpressedInteractions(cellchat)
#cellchat <- projectData(cellchat, PPI.human)
cellchat <- computeCommunProb(cellchat, raw.use = TRUE, population.size = TRUE)
#cellchat <- filterCommunication(cellchat, min.cells = 5)
df.net <- subsetCommunication(cellchat)
write.csv(df.net,'net_lr.csv') #保存配受体水平细胞通讯网络
cellchat <- computeCommunProbPathway(cellchat)
df.netp <- subsetCommunication(cellchat,slot.name='netP')
write.csv(df.netp,'net_pathway.csv') #保存信号通路水平的细胞通讯网络
cellchat <- aggregateNet(cellchat)#统计细胞之间通讯的数量和强度
cellchat <- netAnalysis_computeCentrality(cellchat, slot.name = "netP")
#cellchat <- computeNetSimilarity(cellchat, type = "functional")
#cellchat <- netEmbedding(cellchat, type = "functional")
#cellchat <- netClustering(cellchat, type = "functional")
#cellchat <- computeNetSimilarity(cellchat, type = "structural")
#cellchat <- netEmbedding(cellchat, type = "structural")
#cellchat <- netClustering(cellchat, type = "structural")
AA <- cellchat
saveRDS(AA, "AA.rds")
复制代码
#合并cellchat对象
scRNA.list <- list(AA=AA, BB=BB,CC=CC)
cellchat <- mergeCellChat(scRNA.list, add.names = names(scRNA.list), cell.prefix = TRUE)
复制代码
可以看什么
1. 看总的不同细胞类群间的互作数量和强度(配受体)
groupSize <- as.numeric(table(cellchat@idents))
netVisual_circle(cellchat@net$count, vertex.weight = groupSize, weight.scale = T, label.edge= F, title.name = "Number of interactions")
netVisual_circle(cellchat@net$weight, vertex.weight = groupSize, weight.scale = T, label.edge= F, title.name = "Interaction weights/strength")
复制代码
2. 看全部各个细胞类群的Signaling pathway情况
a 自动(批量)保存每个信号通路的互作结果
# 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 = c(1,2,4,6) #不画层次图就不需要这一步
dir.create("all_pathways_com_circle") #创建文件夹保存批量画图结果
setwd("all_pathways_com_circle")
for (i in 1:length(pathways.show.all)) {
# Visualize communication network associated with both signaling pathway and individual L-R pairs
netVisual(cellchat, signaling = pathways.show.all[i], out.format = c("pdf"),
vertex.receiver = vertex.receiver, layout = "circle") #绘制网络图
# Compute and visualize the contribution of each ligand-receptor pair to the overall signaling pathway
gg <- netAnalysis_contribution(cellchat, signaling = pathways.show.all[i])
ggsave(filename=paste0(pathways.show.all[i], "_L-R_contribution.pdf"),
plot=gg, width = 5, height = 2.5, units = 'in', dpi = 300)
}
setwd("../")
复制代码
b 通过heatmap看outgoing和incoming的communication probability
netAnalysis_SignalingRole_heatmap(cellchat, pattern = "outgoing")
netAnalysis_SignalingRole_heatmap(cellchat, pattern = "incoming")
复制代码
c 通过点图看outgoing和incoming的pattern
netAnalysis_dot(cellchat, pattern = "outgoing")
netAnalysis_dot(cellchat, pattern = "incoming")
复制代码
3. 看特定细胞群体之间的互作
3.1.a 通过气泡图看互作--配受体
选择好sources.use和targets.use,展示对应细胞群体间所有互作
netVisual_bubble(cellchat, sources.use = 4, targets.use = c(5:11), remove.isolate = FALSE)
复制代码
3.1.b 通过Signaling参数选定部分pathway中的互作-比如选择趋化因子和趋化因子受体对或者TGF-B信号通路
netVisual_bubble(cellchat, sources.use = 4, targets.use = c(5:11), Signaling = c("CCL","CXCL"), remove.isolate = FALSE)
复制代码
3.1.c 通过pairLR.use选择特定互作?
pairLR.use <- extractEnrichedLR(cellchat, Signaling = c("CCL","CXCL","FGF"))
netVisual_bubble(cellchat, sources.use = c(3,4), targets.use = c(5:8), pairLR.use = pairLR.use, remove.isolate = TRUE)
复制代码
3.2 通过弦图看互作
#targets.use可以设置为多个receiver
netVisual_chord_gene(cellchat, sources.use = 4, targets.use = c(5:11), lab.cex = 0.5,legend.pos.y = 30)
#sources.use可以设置为多个sender
netVisual_chord_gene(cellchat, sources.use = c(1,2,3,4), targets.use = 8, legend.pos.x = 15)
#参数Signaling可以用来选择特定pathway
netVisual_chord_gene(cellchat, sources.use = c(1,2,3,4), targets.use = c(5:11), Signaling = c("CCL","CXCL"),legend.pos.x = 8)
#设置slot.name为netP使得输出为pathway而不是单一的互作
netVisual_chord_gene(cellchat, sources.use = c(1,2,3,4), targets.use = c(5:11), slot.name = "netP", legend.pos.x = 10)
复制代码
4. 看特定细胞群体作为sender与其他细胞群体的联系--总的看互作的数量或者强度,不显示配受体或者信号通路的名字
mat <- cellchat@net$weight
par(mfrow = c(3,4), xpd=TRUE)
for (i in 1:nrow(mat)) {
mat2 <- matrix(0, nrow = nrow(mat), ncol = ncol(mat), dimnames = dimnames(mat))
mat2[i, ] <- mat[i, ]
netVisual_circle(mat2, vertex.weight = groupSize, weight.scale = T, edge.weight.max = max(mat), title.name = rownames(mat)[i])
}
复制代码
5. 看特定通路在细胞群体间的联系
pathways.show <- c("CXCL")
vertex.receiver = seq(1,4)
默认为Hierarchy plot
netVisual_aggregate(cellchat, Signaling = pathways.show, vertex.receiver = vertex.receiver)
#或者
netVisual_aggregate(cellchat, Signaling = pathways.show, layout = "circle")
#或者弦图
netVisual_aggregate(cellchat, Signaling = pathways.show, layout = "chord")
#或者热图
netVisual_heatmap(cellchat, Signaling = pathways.show, color.heatmap = "Reds")
#以上都可以选择只展示特定互作
pairLR.CXCL <- extractEnrichedLR(cellchat, Signaling = pathways.show, geneLR.return = FALSE)
LR.show <- pairLR.CXCL[1,] # show one ligand-receptor pair
netVisual_individual(cellchat, Signaling = pathways.show, pairLR.use = LR.show, layout = "circle") 作者:dooooob https://www.bilibili.com/read/cv12949609 出处:bilibili
复制代码
6. 看细胞群体在特定pathway中的角色--精确判别身份,信息函量少,但是强度大小比较容易看,就是说,谁作为主要的Sender或者Receiver
netAnalysis_SignalingRole_network(cellchat, Signaling = “CXCL”, width = 8, height = 2.5, font.size = 10)
复制代码
netAnalysis_contribution(cellchat, Signaling = “CXCL”)
复制代码
7. 看pathway中相关基因的表达--细致到基因层面
plotGeneExpression(cellchat, Signaling = "CXCL")
复制代码
上述内容是单数据集分析,下面开始的分析是两组分析,多组的话增加分组,放在一起进行分析
8. 细胞互作数量对比网络图--两组
8.1 所有细胞群总体观:通讯数量与强度对比
gg1 <- compareInteractions(cellchat, show.legend = F, group = c(1,2), measure = "count")
gg2 <- compareInteractions(cellchat, show.legend = F, group = c(1,2), measure = "weight")
p <- gg1 + gg2
ggsave("Overview_number_strength.pdf", p, width = 6, height = 4)
复制代码
8.2 数量与强度差异网络图
par(mfrow = c(1,2))
netVisual_diffInteraction(cellchat, weight.scale = T)
netVisual_diffInteraction(cellchat, weight.scale = T, measure = "weight")
# save as Diff_number_strength_net.pdf
红色是case相对于control上调的,蓝色是下调的。
复制代码
8.2-1 数量与强度差异热图
par(mfrow = c(1,1))
h1 <- netVisual_heatmap(cellchat)
h2 <- netVisual_heatmap(cellchat, measure = "weight")
h1+h2
# save as Diff_number_strength_heatmap.pdf
# case和control对比,红色是上调,蓝色是下调
复制代码
8.3 细胞互作数量对比网络图
par(mfrow = c(1,2))
weight.max <- getMaxWeight(cco.list, attribute = c("idents","count"))
for (i in 1:length(cco.list)) {
netVisual_circle(cco.list[[i]]@net$count, weight.scale = T, label.edge= F,
edge.weight.max = weight.max[2], edge.width.max = 12,
title.name = paste0("Number of interactions - ", names(cco.list)[i]))
}
# save as Counts_Compare_net.pdf
#左图是control,右图是case,可以直接对比数量变化。
复制代码
8.4 指定细胞互作数量对比网络图
par(mfrow = c(1,2))
s.cell <- c("CD4+ T cells", "CD8+ T cells", "Monocytes")
count1 <- cco.list[[1]]@net$count[s.cell, s.cell]
count2 <- cco.list[[2]]@net$count[s.cell, s.cell]
weight.max <- max(max(count1), max(count2))
netVisual_circle(count1, weight.scale = T, label.edge= T, edge.weight.max = weight.max, edge.width.max = 12,
title.name = paste0("Number of interactions-", names(cco.list)[1]))
netVisual_circle(count2, weight.scale = T, label.edge= T, edge.weight.max = weight.max, edge.width.max = 12,
title.name = paste0("Number of interactions-", names(cco.list)[2]))
# save as Counts_Compare_select.pdf 10*6.5
# 红色是case相对于control上调的,蓝色是下调的
复制代码
9. 看表达流---举例是两组的对比
9.1 保守和特异性信号通路的识别与可视化
gg1 <- rankNet(cellchat, mode = "comparison", stacked = T, do.stat = TRUE)
gg2 <- rankNet(cellchat, mode = "comparison", stacked = F, do.stat = TRUE)
p <- gg1 + gg2
ggsave("Compare_pathway_strengh.pdf", p, width = 10, height = 6)
#左图最下面5个信号通路是case组独有的
复制代码
9.2 流行学习识别差异信号通路--细胞多了用R根本跑不通
cellchat <- computeNetSimilarityPairwise(cellchat, type = "functional")
cellchat <- netEmbedding(cellchat, type = "functional")
cellchat <- netClustering(cellchat, type = "functional")
#netVisual_embeddingPairwise(cellchat, type = "functional", label.size = 3.5)
#netVisual_embeddingPairwiseZoomIn(cellchat, type = "functional", nCol = 2)
cellchat <- computeNetSimilarityPairwise(cellchat, type = "structural")
cellchat <- netEmbedding(cellchat, type = "structural")
cellchat <- netClustering(cellchat, type = "structural")
#netVisual_embeddingPairwise(cellchat, type = "structural", label.size = 3.5)
#netVisual_embeddingPairwiseZoomIn(cellchat, type = "structural", nCol = 2)
p <- rankSimilarity(cellchat, type = "structural") + ggtitle("Structural similarity of pathway")
ggsave("Pathway_Similarity.pdf", p, width = 8, height = 5)
saveRDS(cellchat, "cellchat.rds")
复制代码
9.3 细胞信号模式对比
library(ComplexHeatmap)
总体信号模式对比
pathway.union <- union(cco.list[[1]]@netP$pathways, cco.list[[2]]@netP$pathways)
ht1 = netAnalysis_signalingRole_heatmap(cco.list[[1]], pattern = "all", signaling = pathway.union,
title = names(cco.list)[1], width = 8, height = 10)
#pattern = "all"通过修改pattern来显示是全部的信号,发出的信号pattern = "outgoing",还是接受的信号pattern = "incoming"。
ht2 = netAnalysis_signalingRole_heatmap(cco.list[[2]], pattern = "all", signaling = pathway.union,
title = names(cco.list)[2], width = 8, height = 10)
draw(ht1 + ht2, ht_gap = unit(0.5, "cm"))
# save as Compare_signal_pattern_all.pdf 10*6
复制代码
10. 特定信号通路的对比
网络图
pathways.show <- c("IL16")
weight.max <- getMaxWeight(cco.list, slot.name = c("netP"), attribute = pathways.show)
par(mfrow = c(1,2), xpd=TRUE)
for (i in 1:length(cco.list)) {
netVisual_aggregate(cco.list[[i]], signaling = pathways.show, layout = "circle",
edge.weight.max = weight.max[1], edge.width.max = 10,
signaling.name = paste(pathways.show, names(cco.list)[i]))
}
# save as Compare_IL16_net.pdf 10*6.5
热图
par(mfrow = c(1,2), xpd=TRUE)
ht <- list()
for (i in 1:length(cco.list)) {
ht[[i]] <- netVisual_heatmap(cco.list[[i]], signaling = pathways.show, color.heatmap = "Reds",
title.name = paste(pathways.show, "signaling ",names(cco.list)[i]))
}
ComplexHeatmap::draw(ht[[1]] + ht[[2]], ht_gap = unit(0.5, "cm"))
# save as Compare_IL16_heatmap.pdf 12*6.5
和弦图
par(mfrow = c(1,2), xpd=TRUE)
for (i in 1:length(cco.list)) {
netVisual_aggregate(cco.list[[i]], signaling = pathways.show, layout = "chord", pt.title = 3, title.space = 0.05,
vertex.label.cex = 0.6, signaling.name = paste(pathways.show, names(cco.list)[i]))
}
# save as Compare_IL16_chord.pdf 10*6.5
复制代码
11. 配体-受体对比分析
11.1 气泡图展示所有配体受体对的差异
levels(cellchat@idents$joint)
p <- netVisual_bubble(cellchat, sources.use = c(4,5), targets.use = c(1,2,3,6), comparison = c(1, 2), angle.x = 45)
ggsave("Compare_LR_bubble.pdf", p, width = 12, height = 8)
复制代码
case和control配对的图,文章中常见。cellphoneDB找到的结果,也可以用这种方式呈现。
11.2 气泡图展示上调或下调的配体受体对
p1 <- netVisual_bubble(cellchat, sources.use = c(4,5), targets.use = c(1,2,3,6), comparison = c(1, 2),
max.dataset = 2, title.name = "Increased signaling in TIL", angle.x = 45, remove.isolate = T)
p2 <- netVisual_bubble(cellchat, sources.use = c(4,5), targets.use = c(1,2,3,6), comparison = c(1, 2),
max.dataset = 1, title.name = "Decreased signaling in TIL", angle.x = 45, remove.isolate = T)
pc <- p1 + p2
ggsave("Compare_LR_regulated.pdf", pc, width = 12, height = 5.5)
上调下调分开展示
和弦图
par(mfrow = c(1, 2), xpd=TRUE)
for (i in 1:length(cco.list)) {
netVisual_chord_gene(cco.list[[i]], sources.use = c(4,5), targets.use = c(1,2,3,6), signaling = "MHC-I",
lab.cex = 0.6, legend.pos.x = 10, legend.pos.y = 20,
title.name = paste0("Signaling from Treg - ", names(cco.list)[i]))
}
# save as Compare_LR_chord.pdf 10*6.5
复制代码
12. cellchat 加深理解
使用层次结构图、圆图或和弦图可视化每个信号通路
- 层次结构图:用户应定义vertex.receiver,这是一个数字矢量,将细胞群的索引作为层次图左侧的目标。此分层图由两个部分组成:左部分显示自分泌和旁分泌向某些感兴趣的细胞组(即定义的)发出信号,右部分显示自分泌和旁分泌向数据集中剩余的细胞组发出信号。因此,层级图提供了一种信息性和直观的方式来可视化自分泌和旁分泌信号之间的细胞群之间的感兴趣通信。例如,在研究成纤维细胞和免疫细胞之间的细胞-细胞通信时,用户可以定义为所有成纤维细胞组。
- 和弦图:CellChat 提供两种功能
netVisual_chord_cell
和netVisual_chord_gene,并可视化具有不同目的和不同级别的细胞通信。netVisual_chord_cell用于可视化不同细胞群之间的细胞-细胞通信(和弦图中的每个部分是细胞组),netVisual_chord_gene用于可视化由多个配体受体或信号通路调节的细胞-细胞通信(和弦图中的每个部分都是配体、受体或信号通路)。 - 边缘颜色/权重、节点颜色/大小/形状的解释:在所有可视化图中,边缘颜色与发送者源一致,边缘权重与交互强度成正比。较厚的边缘线表示信号更强。在层次结构图和圆图中,圆的大小与每个细胞组中的细胞数量成正比。在层次图中,实心和开放的圆分别代表源和目标。在和弦图中,内条颜色表示从相应的外条接收信号的目标。内条大小与目标接收的信号强度成正比。这种内条有助于解释复杂的和弦图。请注意,有一些内条没有与任何一些细胞组链接,请忽略它,因为这是一个本包尚未解决的问题。
- 不同层次的细胞通信可视化:可以使用netVisual_aggregate可视化信号通路的推断通信网络,并使用netVisual_individual可视化与该信号通路相关的单个L-R对的推断通信网络。
cellchat@DB <- CellChatDB.mouse
cellchat <- subsetData(cellchat)
这一步会首先需要选取在上一步选择的interaction database中的基因,这一步并不是一般意义的subset,因为它还会将对应基因的表达矩阵赋值给cellchat@data.Signaling,所以不是可选项,而是必须有的一步
cellchat <- identifyOverExpressedGenes(cellchat)
cellchat <- identifyOverExpressedInteractions(cellchat)
各个细胞类型过表达的基因是基于表达该基因的细胞比例,差异倍数,和p值来判定的。默认参数是,细胞比例阈值为0(thresh.pc = 0),差异倍数为0(thresh.fc = 0,only.pos = TRUE),p值0.05(thresh.p = 0.05)(这里不是校正后的p值,虽然源码中有做bonferroni矫正,但是没有用这个值做判定)。
最后过表达的基因会存于object@var.features,基因名存在形式为cellchat@var.features$feature
差异基因计算结果的表格存在形式为cellchat@var.features$features.info
然后这些过表达基因所在的互作即过表达互作。过表达互作会存于cellchat@LR$LRsig
cellchat <- computeCommunProb(cellchat)
首先计算得到每一个互作的communication probability(具体原理参见发表原文),并通过permutation test得到对应互作的p值。这些结果存在于cellchat@net
这里默认是用cellchat@data.Signaling中的表达数据做分析,如果希望使用引入了蛋白质互作网络处理之后的数据,则加入参数raw.use = FALSE
默认使用的Ligand和Receptor是cellchat@LR$LRsig,对应参数为LR.use = NULL
可选的计算每个细胞类群基因表达均值方法有三种,"triMean", "truncatedMean", "median",
默认使用的是triMean,具体实现为
triMean <- function(x, na.rm = TRUE) {mean(stats::quantile(x, probs = c(0.25, 0.50, 0.50, 0.75), na.rm = na.rm))}
truncatedMean的具体实现为
truncatedMean = function(x) mean(x, trim = trim, na.rm = TRUE)
cellchat <- computeCommunProbPathway(cellchat)
再通过求和每个pathway中所有互作的communication probability得到基于pathway的,存于cellchat@netP 。这里默认(thresh = 0.05)不计入p值大于0.05的
cellchat <- aggregateNet(cellchat)
之后再统计细胞类型之间所有pathway的互作数量和communication probability ,这里同样默认(thresh = 0.05)不计入p值大于0.05的
不同细胞间各种相互作用最终形成了一套通讯网络,这里可以分析互作过程中的不同角色,包括dominant senders, receivers, mediators and influencers。即weighted-directed network中,计算out-degree, in-degree, flow betweenesss,以及information centrality。其中,out-degree和in-degree是直接求和各个细胞类群对应outgoing Signaling和incoming Signaling的communication probabilities
cellchat <- netAnalysis_computeCentrality(cellchat, slot.name = "netP")
首先是计算这些network centrality scores,结果会存在于cellchat@netP$centr
之后可以关注communication pattern(outgoing和incoming),得到cellchat@netP$pattern 先寻找合适的k,即pattern数目,以outgoing为例
selectK(cellchat, pattern = "outgoing")
cellchat <- identifyCommunicationPatterns(cellchat, pattern = "outgoing", k = 3) 这里根据上面的结果设置pattern为3,因为两种score都在4的时候下降很多
参考: 1.# 单细胞分析之细胞交互-3:CellChat
2.# CellChat三部曲1:使用CellChat对单个数据集进行细胞间通讯分析