peach.pl.pattern_heatmap#
- peach.pl.pattern_heatmap(pattern_df, adata, top_n=30, cluster_patterns=True, cluster_features=True, figsize=(10, 12), cmap='RdBu_r', save_path=None, **kwargs)[source]#
Create heatmap showing pattern expression across archetypes.
- Parameters:
pattern_df (pd.DataFrame) – Pattern analysis results
adata (AnnData) – Annotated data object with archetype assignments and scores
top_n (int, default: 30) – Number of top features to show
cluster_patterns (bool, default: True) – Whether to cluster patterns (rows)
cluster_features (bool, default: True) – Whether to cluster features (columns)
figsize (tuple, default: (10, 12)) – Figure size
cmap (str, default: 'RdBu_r') – Colormap for the heatmap
save_path (str, optional) – Path to save the figure
**kwargs – Additional arguments passed to sns.heatmap
- Returns:
The heatmap figure
- Return type:
plt.Figure