scHopfield.plotting.plot_perturbation_effect_heatmap
- scHopfield.plotting.plot_perturbation_effect_heatmap(adata: AnnData, cluster_key: str = 'cell_type', n_genes: int = 30, figsize: Tuple[float, float] = (12, 8), cmap: str = 'RdBu_r', center: float = 0, cluster_cols: bool = True, cluster_rows: bool = False, order: List[str] | None = None, colors: Dict[str, str] | None = None) ClusterGrid[source]
Plot heatmap of perturbation effects across clusters and genes.
- Parameters:
adata (AnnData) – Annotated data object with simulation results (delta_X layer)
cluster_key (str, optional (default: 'cell_type')) – Key in adata.obs for cluster labels
n_genes (int, optional (default: 30)) – Number of top affected genes to show
figsize (tuple, optional) – Figure size
cmap (str, optional (default: 'RdBu_r')) – Colormap
center (float, optional (default: 0)) – Center value for colormap
cluster_cols (bool, optional (default: True)) – If True, cluster columns (clusters) with dendrogram
cluster_rows (bool, optional (default: False)) – If True, cluster rows (genes) with dendrogram
order (list, optional) – Order of clusters to plot. Ignored if cluster_cols=True.
colors (dict, optional) – Dictionary mapping cluster names to colors for column color bar
- Returns:
ClusterGrid object with the heatmap
- Return type:
sns.matrix.ClusterGrid