omicverse.pl.dynamic_heatmap¶
- omicverse.pl.dynamic_heatmap(adata, var_names, pseudotime, *, lineage_key=None, lineages=None, max_lineages=2, top_features=None, cell_bins=100, use_cell_columns=True, use_fitted=True, aggregate='mean', smooth_window=15, score_smooth_window=21, fitted_window=31, figsize=(8, 6), layer=None, use_raw=False, gene_symbols=None, standard_scale='var', cmap='viridis', pseudotime_cmap='cividis', order_by='peak', reverse_ht=None, n_split=None, split_method='kmeans-peaktime', cluster_features_by=None, row_cluster=False, col_cluster=False, show_row_names=False, show_column_names=False, pseudotime_label=None, cell_annotation=None, separate_annotation=None, separate_annotation_type='auto', separate_smooth_window=21, feature_labels=None, top_label_features=10, legend=True, legend_style='tight', border=False, save=False, save_pathway='', show=False)[source]¶
Plot dynamic feature trends along pseudotime, optionally by lineage.
- Parameters:
adata (
AnnData) – Annotated data matrix containing the expression values.var_names – Features to plot. Accepts a list of genes, a single gene name, a mapping of group label to gene list, or
Noneto start from all available features.pseudotime (
str) – Key inadata.obscontaining the continuous ordering variable.lineage_key (
str(default:None)) – Optional key inadata.obsdescribing lineage membership.lineages (default:
None) – Optional lineage subset to include.max_lineages (
int(default:2)) – Maximum number of lineages retained after ordering.top_features (
int(default:None)) – Keep only the highest-scoring dynamic features after ranking.cell_bins (
int(default:100)) – Number of bins used when aggregating cells along pseudotime.use_cell_columns (
bool(default:True)) – Whether to keep columns at cell/bin resolution instead of grouped lineage blocks.use_fitted (
bool(default:True)) – Whether to smooth/fitted the matrix before plotting.aggregate (
str(default:'mean')) – Aggregation function used when binning cells, for example'mean'.smooth_window (
int(default:15)) – Window sizes used for smoothing, feature scoring, and fitted trends.score_smooth_window (
int(default:21)) – Window sizes used for smoothing, feature scoring, and fitted trends.fitted_window (
int(default:31)) – Window sizes used for smoothing, feature scoring, and fitted trends.figsize (
tuple(default:(8, 6))) – Figure size(width, height)in inches.layer (
str(default:None)) – Expression source selection passed through toobs_df.use_raw (
bool(default:False)) – Expression source selection passed through toobs_df.gene_symbols (
str(default:None)) – Expression source selection passed through toobs_df.standard_scale (
str(default:'var')) – Scaling mode. Supported values include'var','zscore','group','minmax','obs','raw', orNone.cmap (
str(default:'viridis')) – Colormaps for the heatmap body and pseudotime annotations.pseudotime_cmap (
str(default:'cividis')) – Colormaps for the heatmap body and pseudotime annotations.order_by (
str(default:'peak')) – Feature ordering strategy, e.g.'peak'or'valley'.reverse_ht (default:
None) – Optional lineage names or positions whose pseudotime direction should be reversed before plotting.n_split (
int(default:None)) – Controls for splitting dynamic features into blocks.split_method (
str(default:'kmeans-peaktime')) – Controls for splitting dynamic features into blocks.cluster_features_by (
str(default:None)) – Optional metadata-driven feature clustering mode.row_cluster (
bool(default:False)) – Whether to add hierarchical dendrograms for rows or columns.col_cluster (
bool(default:False)) – Whether to add hierarchical dendrograms for rows or columns.show_row_names (
bool(default:False)) – Whether to show row or column labels directly on the plot.show_column_names (
bool(default:False)) – Whether to show row or column labels directly on the plot.pseudotime_label (default:
None) – Optional custom label for the pseudotime annotation.cell_annotation (default:
None) – Optionaladata.obskey or keys to annotate cells/bins above the heatmap.separate_annotation (default:
None) – Controls for auxiliary smoothed annotation tracks.separate_annotation_type (
str(default:'auto')) – Controls for auxiliary smoothed annotation tracks.separate_smooth_window (
int(default:21)) – Controls for auxiliary smoothed annotation tracks.feature_labels (default:
None) – Explicit feature labels to force-display.top_label_features (
int(default:10)) – Number of automatically selected feature labels to display whenfeature_labelsis not provided.legend (
bool(default:True)) – Legend visibility and layout strategy.legend_style (
str(default:'tight')) – Legend visibility and layout strategy.border (
bool(default:False)) – Whether to draw a visible border around heatmap axes after rendering.save (
bool|str(default:False)) – Output controls.savemay beTrue/Falseor a concrete path.save_pathway (
str(default:'')) – Output controls.savemay beTrue/Falseor a concrete path.show (
bool(default:False)) – Output controls.savemay beTrue/Falseor a concrete path.
- Returns:
Returns the assembled Marsilea board by default, or the rendered figure when rendering is triggered for saving/showing/tight legends.
- Return type:
marsilea.StackBoard or matplotlib.figure.Figure