
Compare CellChat objects across groups for all shared pathways
CompareCellChat.RdTakes a named list of CellChat objects (or paths to RDS files) and for each pathway present in any object, generates a multi-panel comparison PDF with circle, chord, and heatmap layouts.
Usage
CompareCellChat(
cellchat_list,
output_dir,
groups.show = NULL,
group.merged = NULL,
colors = NULL,
species = "human",
thresh = 0.05,
caffeinate = FALSE
)Arguments
- cellchat_list
Named list. Each element is either a CellChat object or a character path to an RDS file. Names are used as panel titles.
- output_dir
Character. Directory for comparison PDFs.
- groups.show
Character vector or
NULL. Cell identities to include.NULLuses all shared identities.- group.merged
Named character vector or
NULL. Maps identity names to broader categories for chord group aggregation. Names must matchgroups.show.- colors
Named character vector mapping identity names to colors.
- species
Character.
"human"or"mouse". Default"human".- thresh
Numeric. P-value threshold applied to individual ligand-receptor interactions when drawing circle, chord, and heatmap plots. Default
0.05(matches CellChat's standard significance filter). Setthresh = 1to display all predicted interactions regardless of statistical significance - this is essential for comparing pathways that are active in some conditions but did not reach pathway-level significance in others (i.e. the pathway is incc@net$probbut not incc@netP$pathways). Internally, all visualizations use the bundlednetVisual_aggregate2-style functions which readcc@net$probdirectly so the comparison is not limited to pathways that passed CellChat's aggregation threshold.- caffeinate
Logical. If
TRUE, prevents the Mac from sleeping during the run using thecaffeinatesystem command. DefaultFALSE.