Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

vm.pl.outlier_summary

Plot flagged and undefined counts for each metric and the combined flag.

Signature

def outlier_summary(
    data: ad.AnnData | pd.DataFrame,
    *,
    key_added: str | None = None,
    percent: bool = False,
    combined_only: bool = False,
    order: Sequence[str | None] | None = None,
    palette: str | Sequence = ("#a03526", "#747983"),
    figsize: tuple[float, float] | None = None,
    ax: Axes | None = None,
    show: bool = True,
    save: str | Path | None = None,
) -> Axes | None: ...

Parameters

NameTypeDefaultDescription
data`ad.AnnDatapd.DataFrame`required
key_added`strNone`None
percentboolFalsePlot percentages of all current observations in each batch, including undefined observations. Otherwise plot counts.
combined_onlyboolFalseShow mutually exclusive retained, flagged, and undefined outcomes from the combined flag for each batch.
order`Sequence[strNone]None`
palette`strSequence`('#a03526', '#747983')
figsize`tuple[float, float]None`None
ax`AxesNone`None
showboolTrueDisplay the figure.
save`strPathNone`

Returns

matplotlib.axes.Axes or None

Plot axes when show is False.

Raises

ImportError

If the optional plotting dependencies are not installed.

KeyError

If fitted run or flag metadata is missing.

ValueError

If the requested batch order is invalid.

Notes

Per-metric bars may overlap because an observation can be flagged on more than one metric. combined_only=True shows mutually exclusive retained, flagged, and undefined counts. Percentages use all current observations in each group, including undefined classifications. The plot is built from the output of :func:verymadpy.pp.summarize_mad and does not refit.

See Also

Examples

import verymadpy as vm

ax = vm.pl.outlier_summary(adata, percent=True, show=False)