COMMOTR (Cell-cell cOMmunication inference via cOllective opTimal tRansport) is an R package for inferring cell-cell communication (CCC) in spatial transcriptomics data. It implements the COMMOT algorithm from Cang et al., Nature Methods 2023.
COMMOTR includes built-in databases from CellChat and CellPhoneDB:
The main function spatial_communication() computes
cell-cell communication matrices:
seurat_obj <- spatial_communication(
seurat_obj,
df_ligrec = df_ligrec_filtered,
database_name = "CellChat",
dis_thr = 500, # Distance threshold in spatial units
cot_eps_p = 0.1, # Entropy regularization
cot_rho = 10, # Penalty for unmatched mass
pathway_sum = TRUE, # Compute pathway-level totals
n_workers = 4, # Parallel workers
verbose = TRUE
)# Get all results
results <- get_communication_results(seurat_obj, "CellChat")
# Get specific communication matrix
total_comm <- get_communication_matrix(seurat_obj, "CellChat", pathway_name = "total")
# Get sender/receiver summaries
sender_df <- get_sender_receiver_df(seurat_obj, "CellChat", "sender")Compute spatial vector fields showing communication directions:
# Compute direction for a specific pathway
seurat_obj <- communication_direction(
seurat_obj,
database_name = "CellChat",
pathway_name = "TGFb",
k = 5 # Neighbors for smoothing
)
# Visualize with vector field
plot_cell_communication(
seurat_obj,
database_name = "CellChat",
pathway_name = "TGFb",
plot_method = "grid",
color_by = "signal",
arrow_scale = 1.5
)Test if communication directions are spatially coherent:
Aggregate communication to cluster-cluster level:
seurat_obj <- cluster_communication(
seurat_obj,
database_name = "CellChat",
clustering = "seurat_clusters",
pathway_name = "TGFb",
n_permutations = 100
)# Network plot
plot_cluster_communication(
seurat_obj,
database_name = "CellChat",
clustering = "seurat_clusters",
key = "TGFb",
layout = "circle",
p_threshold = 0.05
)
# Heatmap
plot_communication_heatmap(
seurat_obj,
database_name = "CellChat",
clustering = "seurat_clusters",
key = "TGFb"
)
# Chord diagram (requires circlize)
plot_chord_diagram(
seurat_obj,
database_name = "CellChat",
clustering = "seurat_clusters",
key = "TGFb"
)Identify genes whose expression varies with communication intensity:
Analyze which signaling pathways impact specific genes:
spatial_communication()| Parameter | Description | Recommended |
|---|---|---|
dis_thr |
Maximum communication distance | Based on tissue type (100-1000) |
cot_eps_p |
Entropy regularization | 0.1 (default) |
cot_rho |
Unmatched mass penalty | 10 (default) |
cot_strategy |
COT strategy | “cot” for most cases |
If you use COMMOTR in your research, please cite:
Cang, Z., Zhao, Y., Almet, A.A. et al. Screening cell–cell communication in spatial transcriptomics via collective optimal transport. Nat Methods 20, 218–228 (2023). https://doi.org/10.1038/s41592-022-01728-4