spcoral.plot.show_cross_anchor_heatmap#
- spcoral.plot.show_cross_anchor_heatmap(adata_omics1, adata_omics2, registering_parameters, celltype_label=None, heatmap_cmap='viridis', bar_palette=None, figsize=None, dpi=None, title=None, norm_axis=None, show=True, save=None, omics1_bar_kwargs=None, omics2_bar_kwargs=None, **kwargs)#
Visualize the cross-modality anchor correspondence as a heatmap with optional cell-type side bars.
- Parameters:
adata_omics1 (anndata.AnnData) – First (source) omics AnnData object containing anchor spots.
adata_omics2 (anndata.AnnData) – Second (target) omics AnnData object containing corresponding anchor spots.
registering_parameters (dict) – Dictionary or list from registration output, expected to contain: - Index 1: array of anchor indices in
adata_omics1- Index 2: array of corresponding anchor indices inadata_omics2(typicallyregistering_parameters = [T, omics1_index, omics2_index])celltype_label (str, optional) – Column name in
.obscontaining cell-type or cluster annotations. If None, raw counts without labels are used (indices as categories).heatmap_cmap (str, optional (default: 'viridis')) – Colormap for the central correspondence heatmap.
bar_palette (list or dict, optional) – Custom color palette for cell-type side bars. If list, colors are assigned sequentially; if dict, maps cell types to colors. If None, automatically generated using
_get_color.figsize (tuple of (float, float), optional) – Figure size passed to matplotlib.
dpi (float, optional) – Figure resolution.
title (str, optional) – Figure title.
norm_axis ({0, 1}, optional) – Axis along which to normalize heatmap values to proportions: - 0: row-wise (proportion of omics2 types per omics1 type) - 1: column-wise - None: raw counts
show (bool, optional (default: True)) – Whether to display the figure immediately.
save (str or PathLike, optional) – Path to save the figure. If provided, figure is saved (format inferred from extension).
omics1_bar_kwargs (dict, optional) – Additional keyword arguments passed to the horizontal/vertical side bar plots.
omics2_bar_kwargs (dict, optional) – Additional keyword arguments passed to the horizontal/vertical side bar plots.
**kwargs (Any) – Additional arguments passed to the underlying
_heatmap_with_dendrogram_and_barfunction.
- Returns:
Figure and axes if
show=False; otherwise None (figure is displayed).- Return type:
tuple of (matplotlib.figure.Figure, axes) or None