Skip to contents

Takes 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. NULL uses all shared identities.

group.merged

Named character vector or NULL. Maps identity names to broader categories for chord group aggregation. Names must match groups.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). Set thresh = 1 to 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 in cc@net$prob but not in cc@netP$pathways). Internally, all visualizations use the bundled netVisual_aggregate2-style functions which read cc@net$prob directly 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 the caffeinate system command. Default FALSE.

Value

A named list of the (possibly updated) CellChat objects.