omicverse.pl.feature_heatmap¶
- omicverse.pl.feature_heatmap(adata, var_names, *, groupby=None, cell_orderby=None, max_cells=100, figsize=(8, 4), layer=None, use_raw=False, gene_symbols=None, standard_scale='var', cmap='RdBu_r', legend=True, legend_style='tight', border=False, show_row_names=True, show_column_names=False, save=False, save_pathway='', show=False)[source]¶
Plot cell-level feature expression ordered by groups or metadata.
- Parameters:
adata (
AnnData) – Annotated data matrix containing the expression values.var_names – Features to plot. Accepts a list of genes, a single gene name, or a mapping of group label to gene list.
groupby (
str(default:None)) – Optional categorical key inadata.obsused to color and group columns by cell identity.cell_orderby (
str(default:None)) – Optional continuous or categorical key inadata.obsused to order cells before plotting.max_cells (
int(default:100)) – Maximum number of cells retained per group whengroupbyis set.figsize (
tuple(default:(8, 4))) – 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')) – Optional scaling mode. Supported values are'obs','var','group', orNone.cmap (
str(default:'RdBu_r')) – Colormap used for the heatmap body.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.show_row_names (
bool(default:True)) – Whether to display feature labels on rows or cell labels on columns.show_column_names (
bool(default:False)) – Whether to display feature labels on rows or cell labels on columns.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 Marsilea plotter by default, or the rendered figure when rendering is triggered for saving/showing/tight legends.
- Return type:
marsilea.Heatmap or matplotlib.figure.Figure