omicverse.pl.cpdb_heatmap

omicverse.pl.cpdb_heatmap(adata, interaction_edges, celltype_key, nodecolor_dict=None, ax=None, source_cells=None, target_cells=None, figsize=(3, 3), fontsize=11, rotate=False, legend=True, legend_kws={'bbox_to_anchor': (5, -0.5), 'fontsize': 8, 'loc': 'center left'}, return_table=False, **kwargs)[source]

Create a dot heatmap of CellPhoneDB interaction counts between cell types.

Parameters:
  • adata (AnnData) – Annotated data object with cell type information

  • interaction_edges (DataFrame) – DataFrame with SOURCE, TARGET, and COUNT columns

  • celltype_key (str) – Column name for cell type annotation

  • nodecolor_dict (default: None) – Custom color mapping for cell types (None, uses default)

  • ax (default: None) – Existing matplotlib axes object (None)

  • source_cells (default: None) – List of source cell types to include (None, uses all)

  • target_cells (default: None) – List of target cell types to include (None, uses all)

  • figsize (default: (3, 3)) – Figure dimensions as (width, height) ((3,3))

  • fontsize (default: 11) – Font size for labels (11)

  • rotate (default: False) – Whether to rotate the heatmap layout (False)

  • legend (default: True) – Whether to show legend (True)

  • legend_kws (default: {'fontsize': 8, 'bbox_to_anchor': (5, -0.5), 'loc': 'center left'}) – Legend keyword arguments ({‘fontsize’:8,’bbox_to_anchor’:(5, -0.5),’loc’:’center left’,})

  • return_table (default: False) – Whether to return data table instead (False)

  • **kwargs – Additional arguments passed to DotClustermapPlotter

Returns:

matplotlib.axes.Axes object or DataFrame if return_table=True

Return type:

ax