mcpField
C
cellchat-cell-communication

cellchat-cell-communication

github.com/jaechang-hits数据与数据库38480 次安装6 天前更新
代码仓库

关于 cellchat-cell-communication

CellChat 是用于单细胞 RNA-seq 数据的 R 分析包,面向研究细胞间信号传递的生物学研究者。它基于整理的配体—受体数据库推断并可视化通信网络,还能比较不同条件下的网络变化。

主要功能

  1. 01推断配体—受体相互作用
  2. 02计算细胞群间通信概率
  3. 03汇总通路级信号网络
  4. 04分析发送者与接收者角色
  5. 05比较不同条件的通信网络
  6. 06生成网络图、热图和气泡图

适用场景

  1. 01识别组织中的主要信号发送或接收细胞
  2. 02查找特定细胞群之间的配体—受体对
  3. 03比较健康与疾病样本的信号网络
  4. 04筛选可用于扰动实验的信号通路

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/jaechang-hits/sciagent-skills --skill cellchat-cell-communication

安装后在 Claude Code 中输入/cellchat-cell-communication确认已加载。

详细介绍

CellChat——细胞间通信分析

概述

CellChat 是一个 R 包,可从单细胞 RNA-seq 数据中推断并可视化细胞间信号网络。CellChat 以标准化表达矩阵和聚类标签为输入,利用 CellChatDB 识别配体-受体相互作用。CellChatDB 是一个人工整理的数据库,包含 2,000 多种经过验证的人类和小鼠配体-受体配对。通信概率通过质量作用定律建模,结合配体、受体和辅助因子的表达水平。CellChat 会将配对层面的概率汇总为通路层面的信号网络,并量化各细胞群作为信号发送者、接收者、介导者或影响者的作用。分析结果能清晰展现哪些细胞类型通过哪些信号通路相互交流,以及这些模式如何随条件变化。

适用场景

  • 在组织图谱或疾病样本中,确定哪些细胞类型是旁分泌和自分泌信号的主要发送者或接收者
  • 识别介导目标细胞群之间通信的特定配体-受体配对(例如,肿瘤细胞 → T 细胞、成纤维细胞 → 上皮细胞)
  • 比较两种条件下的细胞间信号网络(例如,健康与患病、治疗与对照),以发现通信的重构或丢失
  • 发现特定细胞间相互作用中富集的通路层面信号程序(例如,MHC-II、COLLAGEN、VEGF)
  • 按汇总通信强度或网络中心性对信号通路排序,为扰动实验优先筛选靶点
  • 对导出的表格绘制通用图形时,使用 omics-plotting SKILL(Python);网络弦图、热图和气泡图则使用 CellChat 的 R netVisual_*
  • 如果需要纯 Python 工作流,或需要对多个配体-受体数据库(CellChat、CellPhoneDB、Connectome、NicheNet)进行共识排序,则改用 liana(Python/R)
  • 如果需要配体到靶基因的调控推断——预测发送细胞中的哪些配体会调控接收细胞中的哪些靶基因,则改用 NicheNet(R)

前提条件

  • R 包:CellChat(>= 2.0)、Seurat(>= 4.0,用于基于 Seurat 的输入)、NMF、ggplot2、ggalluvial、igraph、dplyr、patchwork、reticulate(可选)
  • 数据要求:标准化的 scRNA-seq 计数矩阵(基因 × 细胞)和细胞群身份向量(聚类标签或细胞类型)。如果在 CellChat 内部进行标准化,也可以使用原始计数。
  • 物种:CellChatDB 提供人类和小鼠数据库;其他物种需要自定义构建数据库
  • 内存:对于包含 10,000–50,000 个细胞的数据集,至少需要 8 GB RAM;对于更大的数据集,建议使用 32 GB 以上
# Install CellChat from GitHub (CRAN version may lag)
if (!requireNamespace("BiocManager", quietly = TRUE))
  install.packages("BiocManager")
BiocManager::install(c("BiocNeighbors", "ComplexHeatmap"))

install.packages("devtools")
devtools::install_github("jinworks/CellChat")

# Core dependencies
install.packages(c("NMF", "ggplot2", "ggalluvial", "igraph",
                   "dplyr", "patchwork", "circlize", "RColorBrewer"))

分析前访谈

编写任何分析代码前,请先与用户确认以下事项。

decisions:
  - id: D1
    param: cellGroupLabels
    kind: derived
    source: upstream
    ask: "Which annotation column defines the sender and receiver groups?"
    default: "the cell-type labels assigned upstream"

  - id: D2
    param: ligandReceptorDatabase
    kind: required
    source: user
    ask: "Which species database, and should it cover all interactions or only secreted signalling, ECM-receptor, or cell-contact?"
    default: "species-matched, all interaction categories"

  - id: D3
    param: minCellsPerGroup
    kind: required
    source: user
    ask: "How few cells may a group have before its inferred signalling stops being trustworthy?"
    default: 10

  - id: D4
    param: expressionAggregation
    kind: optional
    source: user
    ask: "How should per-group expression be summarized - stringently, or more permissively so weaker signals survive?"
    default: "triMean, the most stringent option"

  - id: D5
    param: populationSizeWeighting
    kind: optional
    source: user
    ask: "Should communication probability account for how many cells each group has?"
    default: "weighted"

  - id: D6
    param: bootstrapIterations
    kind: optional_conditional
    source: user
    ask: "More bootstrap rounds give finer p-values at proportionally more runtime - is the default enough?"
    default: 100

  - id: D7
    param: communicationPatterns
    kind: optional_conditional
    source: data
    ask: "How many latent signalling patterns should the data be decomposed into?"
    default: "chosen from the selectK elbow"

  - id: D8
    param: centralityThreshold
    kind: optional
    source: user
    ask: "Which interactions are strong enough to enter the network-centrality analysis?"
    default: "p-value 0.05"

D1 是根据用户已在上游确定的分组注释推导出的;再次询问可能导致标签集与聚类所用标签不一致。D4 对结果的影响比其默认设置所暗示的更大——严格的汇总会剔除仅在部分群体中表达的相互作用,这通常是正确的,但有时会掩盖正在寻找的信号。

快速开始

library(CellChat)
library(Seurat)

# Assume `seurat_obj` is a processed Seurat object with cell type identities in Idents()
data.input <- GetAssayData(seurat_obj, assay = "RNA", slot = "data")  # normalized counts
meta       <- data.frame(labels = Idents(seurat_obj), row.names = names(Idents(seurat_obj)))

cellchat <- createCellChat(object = data.input, meta = meta, group.by = "labels")
cellchat@DB <- CellChatDB.human  # or CellChatDB.mouse

cellchat <- subsetData(cellchat)
cellchat <- identifyOverExpressedGenes(cellchat)
cellchat <- identifyOverExpressedInteractions(cellchat)
cellchat <- computeCommunProb(cellchat, type = "triMean")
cellchat <- filterCommunication(cellchat, min.cells = 10)
cellchat <- computeCommunProbPathway(cellchat)
cellchat <- aggregateNet(cellchat)

# Quick summary
print(cellchat)
# e.g. "An object of class CellChat created from a single dataset
#  with 8 cell groups and 312 inferred ligand-receptor pairs"

工作流

步骤 1:创建 CellChat 对象

根据 Seurat 对象,或根据附带元数据的原始计数矩阵,创建 CellChat 对象。

library(CellChat)
library(Seurat)

# --- Option A: from a Seurat object ---
# seurat_obj must have cell type identities set with Idents() or in meta.data
data.input <- GetAssayData(seurat_obj, assay = "RNA", slot = "data")  # log-normalized
meta <- data.frame(
  labels = Idents(seurat_obj),
  row.names = colnames(seurat_obj)
)
cellchat <- createCellChat(object = data.input, meta = meta, group.by = "labels")

# --- Option B: from a count matrix directly ---
# data.input: genes-by-cells normalized matrix (dgCMatrix or dense matrix)
# identity: named factor of cell group labels (length = ncol(data.input))
cellchat <- createCellChat(object = data.input, meta = data.frame(labels = identity),
                           group.by = "labels")

cat("Cell groups:", levels(cellchat@idents), "\n")
cat("Number of cells:", ncol(data.input), "\n")
# Cell groups: B_cell Endothelial Fibroblast Macrophage NK T_cell Tumor
# Number of cells: 12847
步骤 2:设置 CellChatDB 并筛选相互作用

加载适用于相应物种的配体-受体数据库,并可选择筛选感兴趣的信号类别。

# Load database for the appropriate species
CellChatDB <- CellChatDB.human   # use CellChatDB.mouse for mouse data

# Inspect available signaling categories
unique(CellChatDB$interaction$annotation)
# [1] "Secreted Signaling"    "ECM-Receptor"          "Cell-Cell Contact"

# Option 1: Use all interactions (recommended for discovery)
cellchat@DB <- CellChatDB

# Option 2: Subset to secreted ligand-receptor pairs only (reduces noise)
CellChatDB.use <- subsetDB(CellChatDB, search = "Secreted Signaling",
                           key = "annotation")
cellchat@DB <- CellChatDB.use

# Subset the CellChat data slots to only genes in the database
cellchat <- subsetData(cellchat)
cat("Genes retained after database subset:", nrow([email protected]), "\n")
# Genes retained after database subset: 1842
步骤 3:识别过表达基因和相互作用

针对每个细胞群,识别相较于其他群体显著过表达的配体和受体。

# Identify over-expressed genes per cell group (uses Seurat-style wilcoxon test)
cellchat <- identifyOverExpressedGenes(cellchat)

# Map over-expressed genes to ligand-receptor pairs in CellChatDB
cellchat <- identifyOverExpressedInteractions(cellchat)

# Inspect how many interactions were identified per group pair
df.net <- subsetCommunication(cellchat)
cat("Total inferred interactions:", nrow(df.net), "\n")
head(df.net[, c("source", "target", "ligand", "receptor", "prob")], 5)
#      source   target  ligand receptor      prob
# 1   B_cell Macrophage  CD22     PTPRC 0.0318
# 2 Fibroblast    Tumor   FN1     CD44  0.1072
# ...
步骤 4:推断细胞间通信概率

根据质量作用定律,计算每一对有序细胞群之间每个配体-受体对的通信概率。CellChat 会考虑多亚基复合物以及共刺激/共抑制辅因子。

# Compute pairwise communication probability
# type = "triMean": uses 25th percentile × mean × 25th percentile for robustness
# type = "truncatedMean": uses trimmed mean with threshold parameter trim
cellchat <- computeCommunProb(
  cellchat,
  type          = "triMean",   # recommended default
  trim          = 0.1,         # fraction to trim (only used if type="truncatedMean")
  nboot         = 100,         # bootstrap iterations for p-value estimation
  seed.use      = 42,
  population.size = TRUE       # weight by population size (recommended)
)

# Filter out interactions with too few cells in sender or receiver groups
cellchat <- filterCommunication(cellchat, min.cells = 10)

# Summary of retained interactions
df.net <- subsetCommunication(cellchat)
cat("Interactions after filtering:", nrow(df.net), "\n")
cat("Significant interactions (p<0.05):", sum(df.net$pval < 0.05), "\n")
# Interactions after filtering: 247
# Significant interactions (p<0.05): 189
步骤 5:计算通路层面的通信

将配体-受体对的概率汇总为信号通路层面的网络(例如,COLLAGEN、MHC-II、VEGF)。

# Aggregate to pathway level
cellchat <- computeCommunProbPathway(cellchat)

# Build aggregate interaction count and weight networks
cellchat <- aggregateNet(cellchat)

# View significant pathways
cat("Significant signaling pathways:\n")
print(cellchat@netP$pathways)
# [1] "MHC-II"    "COLLAGEN"  "FN1"       "VEGF"      "CXCL"
# [6] "CCL"       "MIF"       "APP"       "GALECTIN"  ...

# Extract pathway-level communication probabilities between groups
df.pathways <- subsetCommunication(cellchat, slot.name = "netP")
head(df.pathways[, c("source", "target", "pathway_name", "prob")], 5)
#        source    target pathway_name     prob
# 1  Fibroblast     Tumor     COLLAGEN   0.2341
# 2  Macrophage  Fibroblast     MIF    0.1876
# ...
步骤 6:分析网络中心性——发送者、接收者、影响者

通过计算信息流指标,识别每个细胞群在网络中的角色:出强度(发送者)、入强度(接收者)、介数中心性(中介者)和特征向量中心性(影响者)。

# Compute centrality measures for all pathways
cellchat <- netAnalysis_computeCentrality(cellchat, slot.name = "netP")

# Visualize centrality scores as a heatmap (rows=pathways, cols=cell groups)
# Each dot size: outgoing signal strength; color: incoming signal strength
netAnalysis_signalingRole_heatmap(
  cellchat,
  pattern    = "all",     # "outgoing", "incoming", or "all"
  signaling  = NULL,      # NULL = all pathways; or specify e.g. c("COLLAGEN","VEGF")
  height     = 10,
  color.heatmap = "OrRd"
)

# Identify dominant communication patterns using NMF
# outgoing patterns reveal which cell groups co-activate similar pathways
library(NMF)
selectK(cellchat, pattern = "outgoing")    # elbow plot to choose K
cellchat <- identifyCommunicationPatterns(
  cellchat,
  pattern = "outgoing",
  k       = 3,            # number of latent patterns; choose from selectK elbow
  width   = 8,
  height  = 6
)
步骤 7:可视化——弦图、热图、气泡图

CellChat 提供多种可视化函数,用于展示汇总交互和特定通路交互。

library(ggplot2)
library(patchwork)

# --- 7a. Chord diagram: aggregate interaction count and weight ---
par(mfrow = c(1, 2))
netVisual_circle(
  cellchat@net$count,
  vertex.weight = as.numeric(table(cellchat@idents)),
  weight.scale  = TRUE,
  label.edge    = FALSE,
  title.name    = "Number of interactions"
)
netVisual_circle(
  cellchat@net$weight,
  vertex.weight = as.numeric(table(cellchat@idents)),
  weight.scale  = TRUE,
  label.edge    = FALSE,
  title.name    = "Interaction strength"
)

# --- 7b. Heatmap: cell-group × cell-group interaction matrix ---
p1 <- netVisual_heatmap(cellchat, measure = "count",  color.heatmap = "Blues")
p2 <- netVisual_heatmap(cellchat, measure = "weight", color.heatmap = "Reds")
p1 + p2

# --- 7c. Chord diagram for a specific pathway ---
netVisual_aggregate(
  cellchat,
  signaling      = "COLLAGEN",
  layout         = "chord",
  vertex.receiver = NULL   # NULL = show all groups as receivers
)

# --- 7d. Bubble plot: all significant interactions for chosen pathways ---
netVisual_bubble(
  cellchat,
  sources.use = NULL,   # NULL = all senders
  targets.use = NULL,   # NULL = all receivers
  signaling   = c("COLLAGEN", "MIF", "VEGF"),
  remove.isolate = FALSE
)
ggsave("bubble_plot_selected_pathways.pdf", width = 10, height = 8)
步骤 8:比较不同条件下的两个 CellChat 对象

当存在两种条件(例如,健康和患病)时,合并 CellChat 对象并比较信号网络。

# Assume cellchat_ctrl and cellchat_disease are pre-computed CellChat objects
object.list <- list(Control = cellchat_ctrl, Disease = cellchat_disease)
cellchat_merged <- mergeCellChat(object.list, add.names = names(object.list))

# --- Compare total interaction count and strength ---
compareInteractions(cellchat_merged, show.legend = FALSE,
                    group = c(1, 2), measure = "count")
compareInteractions(cellchat_merged, show.legend = FALSE,
                    group = c(1, 2), measure = "weight")

# --- Differential interaction chord diagram (gained/lost connections) ---
netVisual_diffInteraction(cellchat_merged, weight.scale = TRUE)

# --- Identify signaling pathways specific to each condition ---
rankNet(cellchat_merged, mode = "comparison", stacked = TRUE, do.stat = TRUE)

# --- Scatter plot: pathways shifted in information flow ---
rankNetPairwise(
  cellchat_merged,
  comparison = c(1, 2),
  slot.name  = "netP",
  measure    = "prob"
)

关键参数

参数功能默认值范围/选项效果
typecomputeCommunProb"triMean""triMean"、"truncatedMean"、"thresholdedMean"、"median"组级表达的汇总方法;triMean 最严格
trimcomputeCommunProb0.10–0.25从每个尾部修剪的比例;仅适用于 type="truncatedMean"
nbootcomputeCommunProb10050–1000用于估算 p 值的自助法迭代次数;数值越高,速度越慢但准确度越高
population.sizecomputeCommunProbTRUETRUE、FALSE按细胞群大小调整通信概率;对于异质性数据,建议启用
min.cellsfilterCommunication105–50保留某项交互所需的发送者或接收者细胞群最少细胞数
kidentifyCommunicationPatternsrequired2–6(通过 selectK 选择)潜在通信模式的数量;使用 selectK 肘部法选择
threshnetAnalysis_computeCentrality0.050.01–0.1中心性分析中保留交互的 p 值阈值
sources.usenetVisual_bubbleNULL细胞群名称或索引限定气泡图中的发送者细胞群;NULL = 全部
targets.usenetVisual_bubbleNULL细胞群名称或索引限定气泡图中的接收者细胞群;NULL = 全部

关键概念

通信概率模型

CellChat 根据质量作用定律量化通信概率。对于在细胞群 A 中表达的配体 L,以及在细胞群 B 中表达的受体 R(可能是多亚基复合物):

P(A → B | L-R) = hill(expr_L_A) × hill(expr_R1_B) × hill(expr_R2_B) × ...

其中,hill(x) = x^n / (K^n + x^n)(Hill 函数,默认 n=1),表达值使用所选的 type 参数按细胞群汇总。多亚基受体复合物要求所有亚基均有表达;其概率为经过 Hill 转换的各亚基表达值的乘积。

CellChatDB 配体-受体数据库

CellChatDB 是一个经过整理的数据库,收录了经实验验证的配体-受体相互作用,并分为三类:

# Inspect the database structure
dim(CellChatDB.human$interaction)   # [1] 2293   17
head(CellChatDB.human$interaction[, c("interaction_name", "pathway_name",
                                       "ligand", "receptor", "annotation")], 4)
#   interaction_name pathway_name ligand receptor          annotation
# 1         TGFB1_TGFBR1_TGFBR2         TGFb  TGFB1  TGFBR1_TGFBR2  Secreted Signaling
# 2          WNT5A_FZD1_LRP5          WNT   WNT5A     FZD1_LRP5   Secreted Signaling
# 3             FN1_CD44             FN1    FN1      CD44        ECM-Receptor
# 4          NOTCH1_DLL4        NOTCH  NOTCH1       DLL4   Cell-Cell Contact

这三类涵盖不同的生物学机制:

  • 分泌信号:经典的旁分泌/自分泌配体(细胞因子、生长因子、形态发生因子)
  • ECM-受体:与膜受体结合的细胞外基质成分
  • 细胞间接触:需要细胞直接接触的并置型信号(Notch、Ephrin、Semaphorin)
网络中心性角色
角色中心性指标说明
发送者出度 / 出强度向许多目标发送信号的细胞群
接收者入度 / 入强度接收许多来源信号的细胞群
中介者中介中心性在其他细胞群之间连接通信的细胞群
影响者特征向量中心性与其他高度连接的细胞群相连的细胞群
信息流与交互数量

aggregateNet 会计算两个互补的矩阵:

  • cellchat@net$count:每对细胞群之间具有统计显著性的配体-受体对数量(原始交互数量)
  • cellchat@net$weight:所有配体-受体对通信概率之和(交互强度 / 信息流)

数量高、权重低表示存在许多较弱的交互;权重高、数量低则表示少数主导通路。

常用操作

操作:将所有显著交互提取为数据框

当你想导出结果、应用自定义筛选,或将交互数据用于下游通路分析时使用。

# All ligand-receptor level interactions (p < 0.05)
df.lr <- subsetCommunication(cellchat, slot.name = "net")
df.lr_sig <- df.lr[df.lr$pval < 0.05, ]
cat("Significant LR interactions:", nrow(df.lr_sig), "\n")

# All pathway-level interactions
df.path <- subsetCommunication(cellchat, slot.name = "netP")

# Interactions involving specific cell groups
df.tumor_recv <- subsetCommunication(cellchat,
                                      targets.use = "Tumor",
                                      slot.name   = "net")
cat("Interactions targeting Tumor cells:", nrow(df.tumor_recv), "\n")

# Save to CSV for downstream analysis
write.csv(df.lr_sig,    "cellchat_lr_interactions.csv",    row.names = FALSE)
write.csv(df.path,      "cellchat_pathway_interactions.csv", row.names = FALSE)
write.csv(df.tumor_recv, "cellchat_tumor_receivers.csv",   row.names = FALSE)
操作:可视化特定通路的信号角色

当你想详细了解哪些细胞类型通过某条通路发送和接收信号时使用。

# Show chord diagram + violin plots for a single pathway
pathway <- "COLLAGEN"

# Chord diagram
netVisual_aggregate(cellchat, signaling = pathway, layout = "chord")
title(main = paste0(pathway, " signaling network"))

# Contribution of each LR pair to the pathway
netAnalysis_contribution(cellchat, signaling = pathway)

# Gene expression of constituent ligands and receptors
plotGeneExpression(
  cellchat,
  signaling  = pathway,
  enriched.only = TRUE,     # show only significantly enriched genes
  type       = "violin"
)
操作:保存并重新载入 CellChat 对象

在可视化或比较之前,为已完成的运行结果创建检查点时使用。

# Save the completed CellChat object
saveRDS(cellchat, file = "cellchat_analysis.rds")
cat("Saved to cellchat_analysis.rds\n")

# Reload and resume analysis
cellchat_loaded <- readRDS("cellchat_analysis.rds")
cat("Cell groups:", levels(cellchat_loaded@idents), "\n")
cat("Pathways:", length(cellchat_loaded@netP$pathways), "\n")

# Verify the object is complete
slotNames(cellchat_loaded)
# [1] "data"          "data.signaling" "images"        "net"
# [5] "netP"          "meta"           "idents"        "var.features"
# [9] "DB"            "LR"             "options"
操作:使用 liana 实现 Python 等效工作流

当你的流水线基于 Python,或想要综合多个 LR 数据库的排名结果时使用。

# Install: pip install liana
import liana
import scanpy as sc
import pandas as pd

# Load preprocessed AnnData (cells x genes, log-normalized)
adata = sc.read_h5ad("my_scrna.h5ad")
# adata.obs["celltype"] must contain cluster/cell-type labels

# Run liana with CellChat resource (consensus across CellChatDB, CellPhoneDB, NATMI, etc.)
liana.mt.rank_aggregate(
    adata,
    groupby   = "celltype",
    resource_name = "consensus",   # or "cellchat" for CellChat-only LR pairs
    expr_prop = 0.1,               # min fraction cells expressing ligand/receptor
    verbose   = True
)

# Results stored in adata.uns["liana_res"]
df = adata.uns["liana_res"]
df_sig = df[df["magnitude_rank"] < 0.05].sort_values("magnitude_rank")
print(df_sig[["source", "target", "ligand_complex", "receptor_complex",
              "magnitude_rank"]].head(10))
df_sig.to_csv("liana_interactions.csv", index=False)

预期输出

输出类型说明
cellchat@net$countR 矩阵(n_groups × n_groups)每对细胞群之间显著 LR 交互的数量
cellchat@net$weightR 矩阵(n_groups × n_groups)细胞群之间的综合通信概率(信息流)
cellchat@netP$pathways字符向量推断出的所有信号通路名称
subsetCommunication(cellchat)data.frame包含来源、目标、配体、受体、概率和 p 值的所有 LR 层级交互表
subsetCommunication(cellchat, slot.name="netP")data.frame通路层级交互表
弦图(PDF/PNG)图形显示细胞群之间交互强度的环形图
热图(PDF/PNG)图形细胞群 × 细胞群的交互数量或权重热图
气泡图(PDF/PNG)图形显示每对细胞群中各 LR 对交互概率的点图
信号角色热图(PDF/PNG)图形通路 × 细胞群中心性得分(发送者 / 接收者角色)

故障排除

问题可能原因解决方案
Error in computeCommunProb: all probabilities are zeroCellChatDB 中的基因未检测到或已被过滤掉确认 subsetData() 保留了基因:nrow([email protected]) > 0;检查表达矩阵是否经过对数归一化(而非原始计数),并确认基因名称与 CellChatDB 匹配(人类:HGNC 符号;小鼠:MGI 符号)
警告:groups with fewer than min.cells cells are removed过滤步骤中移除了小型细胞簇在 filterCommunication() 中降低 min.cells(例如,min.cells = 5),或在创建 CellChat 对象前合并稀有细胞簇
identifyCommunicationPatterns NMF 错误或未收敛模式数 k 过高或数据过于稀疏使用 selectK() 根据共表型/离散度曲线的肘部选择 k;先尝试 k=2 或 k=3
在 computeCommunProb 期间发生内存错误/会话崩溃数据集对于可用 RAM 来说过大将每种条件的细胞数下采样至 ≤30,000;或使用 nboot = 50 运行 computeCommunProb,以减少引导法的内存占用
弦图难以阅读(细胞组过多)细粒度细胞簇过多在创建 CellChat 对象前将细胞簇汇总为更宽泛的类别;或使用 netVisual_heatmap,它在组数较多时扩展性更好
mergeCellChat 错误:细胞组标签不匹配对象间的细胞类型名称不同在合并前统一 levels(cellchat_ctrl@idents) 和 levels(cellchat_disease@idents);使用 setIdent() 重命名组
无法识别基因符号(所有概率均为 0)人类/小鼠基因命名规范混用确认物种:人类基因名称全为大写(例如,TGFB1);小鼠基因名称采用首字母大写(例如,Tgfb1)。小鼠数据请设置 CellChatDB.mouse

参考资料

评论

支持 Markdown