spac.visualization.threshold_heatmap(adata, feature_cutoffs, annotation, layer=None, swap_axes=False, **kwargs)[source]

Creates a heatmap for each feature, categorizing intensities into low, medium, and high based on provided cutoffs.

Parameters:
  • adata (anndata.AnnData) – AnnData object containing the feature intensities in .X attribute or specified layer.

  • feature_cutoffs (dict) – Dictionary with feature names as keys and tuples with two intensity cutoffs as values.

  • annotation (str) – Column name in .obs DataFrame that contains the annotation used for grouping.

  • layer (str, optional) – Layer name in adata.layers to use for intensities. If None, uses .X attribute.

  • swap_axes (bool, optional) – If True, swaps the axes of the heatmap.

  • **kwargs (keyword arguments) – Additional keyword arguments to pass to scanpy’s heatmap function.

Returns:

A dictionary contains the axes of figures generated in the scanpy heatmap function. Consistent Key: ‘heatmap_ax’ Potential Keys includes: ‘groupby_ax’, ‘dendrogram_ax’, and ‘gene_groups_ax’.

Return type:

Dictionary of Axes