cellchat Algorithm

Purpose

Use cellchat for cell communication analysis

Usage

SDAS CCI cellchat -i st.h5ad --label_key anno_spotlight -o outdir \
--add_spatial \
--bin_size 100 \
--species human \
--type truncatedMean

Input Parameter Description

Parameter
Required
Default
Description

-i / --input

Yes

h5ad file, must contain raw expression matrix

-o / --output

Yes

Output folder

--label_key

Yes

Column name used to distinguish cell types in cell communication analysis

--layer

No

Name of the layer in h5ad containing the raw expression matrix

--gene_symbol_key

No

real_gene_name

Column name of gene in h5ad.var (_index means h5ad.var.index)

--add_spatial

No

Use "--add_spatial" if spatial information is considered in the analysis

--bin_size

No

If using "--add_spatial", you need to provide bin_size, such as cellbin, 10, 20, 50, 100

--species

No

human

Built-in database in cellchat, supports human, mouse, zebrafish, default 'human'; when --cellchat_database is specified, this parameter is ignored

--cellchat_database

No

Path to custom cellchat database file

--type

No

triMean

Used in computeCommunProb, computing the average gene expression per cell group. By default = 'triMean', producing fewer but stronger interactions; When setting type = "truncatedMean", a value should be assigned to trim, producing more interactions.

--trim

No

0.1

trim used in computeCommunProb when method is "truncatedMean", the fraction (0 to 0.25) of observations to be trimmed from each end of x before the mean is computed

--spatial_coords_scale

No

0.5

Global scaling factor for spatial coordinates. For stereo-seq, set to 0.5 to convert coordinates to microns for easier result interpretation

--scale_distance

No

2

scale.distance used in computeCommunProb when setting '--add_spatial'. A scale or normalization factor for the spatial distances when setting 'distance.use = TRUE'. For example, scale.distance equals 1, 0.1, 0.01, 0.001, 0.11, or 0.011. We choose this values such that the minimum value of the scaled distances is in [1,2]. This value is not necessary when setting 'distance.use = FALSE'.

--pathway.file

No

The selected pathway in csv file, show visualize the inferred communication network of signaling pathways using netVisual_aggregate, when setting --add_spatial will show spatial network diagram. png for each pathway, pdf for all pathways in one file.

--seed

No

42

Random seed

Custom database construction can refer to the cellchat official tutorial:

https://htmlpreview.github.io/?https://github.com/jinworks/CellChat/blob/master/tutorial/Update-CellChatDB.html

Output Results Display

Result File
Description

<input_name>_cellchat_LR.csv

Ligand-receptor interaction results (not output if no significant interactions found)

<input_name>_cellchat_LR_pathway.csv

Pathway results of ligand-receptor sets (not output if no significant interactions found)

<input_name>_interaction_strength_circle.png/pdf <input_name>_interaction_strength_heatmap.png/pdf

Circle and heatmap showing the strength of ligand-receptor interactions between cell clusters, outputs both pdf and png

<input_name>_number_of_interactions_circle.png/pdf <input_name>_number_of_interactions_heatmap.png/pdf

Circle and heatmap showing the number of ligand-receptor interactions between cell clusters, outputs both pdf and png

<input_name>_signalingRole_scatter.png/pdf

Scatter plot showing the role distribution of each cell cluster in the signaling network, outputs both pdf and png

<input_name>_pathway_communication_network.png/pdf

Network diagram of specified pathway between cells; when using "--add_spatial", outputs spatial network diagram, outputs both pdf and png (not output if no significant pathway found)

<input_name>_cellchat.rds

rds file containing cell communication results

  • Circle plot of the number of ligand-receptor interactions between cell clusters: <input_name>_number_of_interactions_circle.png/pdf shows the number of ligand-receptor interactions between cell clusters, reflecting the strength of interaction relationships. Circles represent cell clusters, lines represent ligand-receptor interactions, line thickness represents the number of interactions, and the size of the circle represents the total number of interactions the cell cluster participates in, allowing direct comparison of which cell clusters interact most frequently.

  • Circle plot of the strength of ligand-receptor interactions between cell clusters: <input_name>_interaction_strength_circle.png/pdf shows the strength of ligand-receptor interactions between cell clusters, reflecting the activity of signal transduction. Circles represent cell clusters, lines represent ligand-receptor interactions, line thickness represents interaction strength, and the size of the circle represents the total interaction strength the cell cluster participates in, allowing direct comparison of which cell clusters are most active in signal transduction.

  • Heatmap of the number of ligand-receptor interactions between cell clusters: <input_name>_number_of_interactions_heatmap.png/pdf shows the number of interactions in heatmap form for overall comparison. Both axes are cell clusters, color depth indicates the number of interactions, the deeper the color, the more interactions.

  • Heatmap of the strength of ligand-receptor interactions between cell clusters: <input_name>_interaction_strength_heatmap.png/pdf shows the strength of interactions in heatmap form for overall comparison. Both axes are cell clusters, color depth indicates interaction strength, the deeper the color, the stronger the signal transduction.

  • Scatter plot of signaling network role distribution: <input_name>_signalingRole_scatter.png/pdf shows the role distribution of each cell cluster in the signaling network. The axes represent different network features (such as sender, receiver, modulator, etc.), each point represents a cell cluster, and the position of the point reflects its functional role in the network, allowing identification of major signal senders and receivers.

  • Spatial network diagram of specified pathway: <input_name>_pathway_communication_network.png/pdf shows the spatial network structure of the specified pathway between cells. When spatial information analysis is added ("--add_spatial"), the spatial network diagram of the specified pathway is output. The axes are spatial coordinates, each point is a cell cluster, lines represent pathway-related cell communication, line thickness represents interaction strength, and the size of the node circle represents the total number of signal interactions the cell cluster participates in, allowing direct observation of the distribution and functional regions of specific pathways in space.

  • Network structure diagram of specified pathway between cells (no spatial): <input_name>_pathway_communication_network_nospatial.png/pdf shows the network structure of the specified pathway between cells. Nodes are cell clusters, lines represent pathway-related cell communication, line thickness represents interaction strength, and the size of the node circle represents the total number of signal interactions the cell cluster participates in. Suitable for observing pathway network structure when there is no spatial information.

Parameter Tuning Suggestions

  • type parameter: It is recommended to use the default triMean for stronger interactions. If you want to get more interactions, you can use truncatedMean and adjust trim (the smaller the trim, the more interactions); trim=0.1 means removing 10% of extreme values at both ends before calculating the mean.

  • scale_distance: Normalization factor for spatial distance. When comparing communication between different CellChat objects, use the same scaling factor. For single sample analysis, different normalization factors do not affect the ranking of receptor-ligand signals.

Last updated