troutpy.pl.gene_metric_heatmap#
- troutpy.pl.gene_metric_heatmap(sdata, metrics=None, probes_to_plot=None, title=None, cluster_axis='both', save=False, figures_path='', custom_plot_filename=None, cmap='coolwarm')#
Plot a heatmap or clustered heatmap of per-gene metrics.
Control probes are highlighted in the y-tick labels (when shown) by coloring them grey instead of black.
- Parameters:
sdata (
SpatialData) – SpatialData object that contains anxrna_metadatatable with avarDataFrame.metrics (
Optional[list[str]] (default:None)) – Columns insdata["xrna_metadata"].varto include as heatmap columns. IfNone, defaults to a fixed set of quality-control metrics.probes_to_plot (
Optional[list[str]] (default:None)) – If provided, restrict the heatmap to these probes/genes, and show y-tick labels if there are at most 20 of them.cluster_axis (
str(default:'both')) – Determines clustering:"none"(no clustering),"x"(cluster columns only),"y"(cluster rows only), or"both"(cluster rows and columns).save (
bool(default:False)) – Whether to save the figure.figures_path (
str(default:'')) – Directory path to save the figure.custom_plot_filename (
Optional[str] (default:None)) – Custom filename for saving the plot.cmap (
str(default:'coolwarm')) – Colormap for the heatmap, resolved viatroutpy.pl.get_colormap()if not a built-in Matplotlib colormap.
- Return type:
- Returns:
None