crested.pl.corr.heatmap_self

Contents

crested.pl.corr.heatmap_self#

crested.pl.corr.heatmap_self(adata, log_transform=False, vmin=None, vmax=None, reorder=False, cmap='coolwarm', cbar=True, cbar_kws=None, plot_kws=None, ax=None, **kwargs)#

Plot self correlation heatmaps of ground truth for different cell types.

Parameters:
  • adata (AnnData) – AnnData object containing the data in X and predictions in layers.

  • log_transform (bool (default: False)) – Whether to log-transform the data before plotting.

  • vmin (float | None (default: None)) – Minimum value for heatmap color scale.

  • vmax (float | None (default: None)) – Maximum value for heatmap color scale.

  • reorder (bool (default: False)) – Whether or not to order the clases by similarity.

  • cmap (str | Colormap (default: 'coolwarm')) – Colormap to use.

  • cbar (bool (default: True)) – Whether to draw a colorbar.

  • cbar_kws (dict | None (default: None)) – Extra keyword arguments passed to the colorbar. Default is {'label': "Pearson correlations (of log1p-transformed values)"}

  • plot_kws (dict | None (default: None)) – Extra keyword arguments passed to heatmap(). Adjusted defaults compared to the base function are {'square': True, 'fmt': '.2f'}.

  • ax (Axes | None (default: None)) – Axis to plot values on. If not supplied, creates a figure from scratch.

  • width – Width of the newly created figure if ax=None. Default is 10, or 8 if cbar=False.

  • height – Height of the newly created figure if ax=None. Default is 8.

  • kwargs – Additional arguments passed to render_plot() to control the final plot output. Please see render_plot() for details. Custom defaults for correlations_self: xtick_rotation=90, layout='compressed'.

Return type:

tuple[Figure, Axes] | None

Examples

>>> crested.pl.corr.heatmap_self(
...     adata,
...     log_transform=True,
...     vmin=0,
...     vmax=1,
...     title="Self-correlations heatmap",
... )
../../_images/corr_heatmap_self.png