API reference#

All plot_* functions return a matplotlib.figure.Figure; all *_table functions return a pandas.DataFrame. Call set_publication_style() once to style every subsequent figure consistently.

Loading & style#

load_dataset

Load a prepared .h5ad and return a Dataset handle.

Dataset

A loaded, viewer-ready dataset.

set_publication_style

Apply a single, coherent publication style to all subsequent plots.

set_style

Set global matplotlib defaults for all subsequent plot_* calls.

get_palette

Return a named qualitative colour palette as a list of hex strings.

Embedding plots#

plot_embedding

Scatter of a 2-D embedding colored by a metadata column or a gene.

plot_multigene

Grid of embedding scatters, one panel per gene.

plot_embedding_3d

3-D scatter of the first three dimensions of an embedding.

Expression plots#

plot_violin

Violin or box plot of a gene's expression grouped by a metadata column.

plot_stacked_violin

Stacked violin plots: one violin per gene, grouped by a metadata column.

plot_dotplot

Dot plot: mean expression × fraction expressing across groups.

plot_matrixplot

Mean-expression matrix heatmap: groups × genes.

plot_heatmap

Expression heatmap: genes × cells, grouped by a metadata column.

plot_tracksplot

Track-style expression plot: one horizontal color strip per gene.

plot_bar

Grouped comparison bar chart: mean gene expression per group ± error bar.

plot_trend

Trend line: mean gene expression along an ordered x variable.

plot_radar

Radar (spider) plot: mean expression of several genes per group.

Composition & relationships#

plot_composition

Stacked bar of group composition across split categories.

plot_correlation

Pairwise correlation matrix between groups (based on mean expression).

Tables & export#

markers_table

Return the per-group DE / marker table as a DataFrame.

composition_table

Return the group × split composition matrix as a DataFrame.

metadata_table

Return the per-cell metadata (obs) as a DataFrame.

export_figures

Render the standard view set and write them to outdir.

export_tables

Write marker, composition, and metadata tables to outdir.

Preparation (CLI + API)#

Turn a raw .h5ad into a viewer-ready object. For atlases larger than RAM, see Large data.

prepare.prepare

Prepare an AnnData for the scPyviewer app.

prepare.prepare_subsample

Write a stratified cell subsample of a too-big .h5ad for fast, low-RAM viewing.