commot.pl.plot_cell_communication
- commot.pl.plot_cell_communication(adata, database_name=None, pathway_name=None, lr_pair=None, keys=None, plot_method='cell', background='summary', background_legend=False, clustering=None, summary='sender', cmap='coolwarm', cluster_cmap=None, pos_idx=array([0, 1]), top_k=5, interp_k=5, ndsize=1, scale=1.0, normalize_v=False, normalize_v_quantile=0.95, arrow_color='#333333', grid_density=1.0, grid_knn=None, grid_scale=1.0, grid_thresh=1.0, grid_width=0.005, stream_density=1.0, stream_linewidth=1, stream_cutoff_perc=5, filename=None, ax=None)
Plot cell-cell communication in space.
- Parameters
adata (
AnnData
) – The data matrix of shapen_obs
×n_var
. Rows correspond to cells or positions and columns to genes.pathway_name (
Optional
[str
]) – Name of the signaling pathway.lr_pair – A tuple of ligand name and receptor name. If None, the total communication of the pathway will be plotted.
keys – A list of keys for the vector field as tuples (pathway_name, ligand, receptor). If given, pathway_name and lr_pair will be ignored. If more than one is given, the average will be plotted.
plot_method (
str
) – ‘cell’ plot vectors on individual cells. ‘grid’ plot interpolated vectors on regular grids. ‘stream’ streamline plot.background (
str
) – ‘summary’ scatter plot with color representing total sent or received signal. ‘image’ the image in Visium data. ‘cluster’ scatter plot with color representing cell clusters.summary (
str
) – ‘sender’ node color represents sender weight. ‘receiver’ node color represents receiver weight.cmap (
str
) – matplotlib colormap name for node summary if numerical. plotly colormap name for node color if summary is ‘cluster’pos_idx (
ndarray
) – The coordinates to use for plotting (2D plot).top_k (
int
) –