veryMADpy
MAD-based quality control for cell-level metrics in AnnData and pandas, designed for Scanpy workflows.
Overview
veryMADpy fits median absolute deviation (MAD) thresholds to existing per-cell QC metrics. It flags potential outliers for review and leaves filtering decisions to the analyst. It reads metrics from adata.obs, stores flags there and fit provenance in adata.uns["verymad"], and also supports pandas DataFrames. Scanpy and plotting dependencies are optional.
The default policy applies four scaled MADs to both tails of log-transformed total counts and detected genes, and the upper tail of mitochondrial percentage. Sample-wise fitting, custom metrics and thresholds, filtering, summaries, and diagnostic plots are supported.
Installation
Install veryMADpy from PyPI:
python -m pip install veryMADpy
Install Scanpy separately to calculate QC metrics. Install the plot extra only when using vm.pl:
python -m pip install "veryMADpy[plot]"
Quick start
Given raw counts in adata.X, a Boolean mitochondrial annotation in adata.var["mt"], and a sample_id column in adata.obs:
import scanpy as sc
import verymadpy as vm
sc.pp.calculate_qc_metrics(adata, qc_vars=["mt"], out=False)
vm.pp.flag_mad_outliers(adata, batch_key="sample_id")
adata_filtered = vm.pp.filter(adata)
For Scanpy versions whose calculate_qc_metrics() does not support out=False, use inplace=True. Undefined QC classifications raise during filtering by default; review the guide to choose an explicit policy.
Documentation
Read the veryMADpy documentation for tutorials, generated API reference, methodology, and the four-donor PBMC validation. Source documentation and build instructions are in docs/.
Methodological inspiration
These publications motivate MAD-based QC practice; they did not introduce, evaluate, or endorse veryMADpy. Cite the software itself using CITATION.cff.
- Lun, A. T. L., McCarthy, D. J., & Marioni, J. C. (2016). A step-by-step workflow for low-level analysis of single-cell RNA-seq data with Bioconductor. F1000Research, 5, 2122. doi:10.12688/f1000research.9501.2.
- Heumos, L., et al. (2023). Best practices for single-cell analysis across modalities. Nature Reviews Genetics, 24, 550–572. doi:10.1038/s41576-023-00586-w.
- Single-cell Best Practices: Quality control.
- Amezquita, R. A., et al. (2020). Orchestrating single-cell analysis with Bioconductor. Nature Methods, 17, 137–145. doi:10.1038/s41592-019-0654-x. See OSCA quality control.
License
MIT. See LICENSE.
Metadata
Release files for veryMADpy 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| verymadpy-0.1.0.tar.gz | 32.9 kB | With provenance | Details for verymadpy-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| verymadpy-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for verymadpy-0.1.0-py3-none-any.whl |
Total release size: 58.3 kB
Release files / verymadpy-0.1.0.tar.gz
| Download URL | verymadpy-0.1.0.tar.gz |
|---|---|
| Size | 32.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3ce6758ae5bd30f8bc739ec5662b7d27f352e52f210e971d3912537e6e92abfc
|
|
BLAKE2b-256 checksum How to use checksums |
9123dfe2600b8e62825726524d41b962625e5cc1894282f74634de0b2f2ad80e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Transparency logRelease files / verymadpy-0.1.0-py3-none-any.whl
| Download URL | verymadpy-0.1.0-py3-none-any.whl |
|---|---|
| Size | 25.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
181c07b615bc267c9140a010a43aa2b9fd3b0be9d92666f6edc1952852101f1c
|
|
BLAKE2b-256 checksum How to use checksums |
19dbf80b479e912ab59c688441b3c3546be339a12736306e6bceb85a1608ffef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Transparency logSecurity for veryMADpy 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for verymadpy-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.