troutpy.pl.cell_type_contacts

troutpy.pl.cell_type_contacts#

troutpy.pl.cell_type_contacts(sdata, kind='heatmap', celltype_key='cell type', vmax=None, vmin=None, cmap='BuPu', table_key='table', dendrogram_ratio=0.1, key='cell_contact_combined', **kwargs)#

Plot cell type-cell type interaction strength as a heatmap or chord diagram.

Parameters:
  • sdata (SpatialData) – The spatial data object containing interaction scores.

  • kind (str (default: 'heatmap')) – Type of plot, either "heatmap" or "chord".

  • celltype_key (str (default: 'cell type')) – Key in sdata[table_key].obs/.uns used to resolve per-cell-type colors.

  • vmax (Optional[float] (default: None)) – Max value for colormap scaling.

  • vmin (Optional[float] (default: None)) – Min value for colormap scaling.

  • cmap (str (default: 'BuPu')) – Colormap for the heatmap.

  • table_key (str (default: 'table')) – Key of the table in sdata holding the cell-type metadata and colors.

  • dendrogram_ratio (float (default: 0.1)) – Passed to seaborn.clustermap().

  • key (str (default: 'cell_contact_combined')) – Key in sdata[table_key].uns holding the cell type x cell type interaction matrix.

  • kwargs – Additional arguments passed to seaborn.clustermap() or mpl_chord_diagram.chord_diagram().

Return type:

None

Returns:

None