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
| Name | Type | Default | Description |
|---|---|---|---|
data | `ad.AnnData | pd.DataFrame` | required |
key_added | `str | None` | None |
percent | bool | False | Plot percentages of all current observations in each batch, including undefined observations. Otherwise plot counts. |
combined_only | bool | False | Show mutually exclusive retained, flagged, and undefined outcomes from the combined flag for each batch. |
order | `Sequence[str | None] | None` |
palette | `str | Sequence` | ('#a03526', '#747983') |
figsize | `tuple[float, float] | None` | None |
ax | `Axes | None` | None |
show | bool | True | Display the figure. |
save | `str | Path | None` |
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)