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.pp.summarize_mad

Summarize fitted thresholds and current observation flags.

Signature

def summarize_mad(
    data: anndata.AnnData | pandas.DataFrame,
    *,
    key_added: str | None = None,
    include_combined: bool = False,
) -> pandas.DataFrame: ...

Parameters

NameTypeDefaultDescription
data`anndata.AnnDatapandas.DataFrame`required
key_added`strNone`None
include_combinedboolFalseAppend one combined row per batch (or one pooled row), including the unique number flagged and the number flagged by multiple metrics.

Returns

pandas.DataFrame

One row per fitted metric and batch. Fitted counts describe the original fit. Current counts reflect the supplied observations. Flagged fractions use classified observations as the denominator.

Raises

KeyError

If the selected run or one of its flag columns is missing.

TypeError

If stored threshold metadata has an invalid type.

ValueError

If the metadata schema version is not supported.

Notes

The returned table distinguishes historical fit counts (columns ending in _fit) from counts on the supplied object. Combined rows report unique flagged observations and, where requested, observations flagged by more than one metric. This function does not modify data.

See Also

Examples

import verymadpy as vm

summary = vm.pp.summarize_mad(adata, include_combined=True)