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
| Name | Type | Default | Description |
|---|---|---|---|
data | `anndata.AnnData | pandas.DataFrame` | required |
key_added | `str | None` | None |
include_combined | bool | False | Append 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)