PADZE (Pythonic Allelic Diversity Analyzer): a NumPy implementation and extension of ADZE allelic-rarefaction statistics with VCF and STRUCTURE input.
Project description
PADZE — Pythonic Allelic Diversity Analyzer
Rarefaction-based allelic diversity statistics for population genetics, as a modern, importable Python package with direct VCF input.
PADZE (padze) is a standalone Python successor to ADZE 1.0. It computes allelic richness, private allelic richness, and combination-private richness across standardized sample depths using the rarefaction approach of Szpiech, Jakobsson & Rosenberg (2008), and adds direct VCF input, an importable Python API, a padze command-line tool, and higher-order across-loci moments.
What it computes
For every rarefaction depth g, PADZE standardizes populations to a common sample size and reports:
- Allelic richness (
alpha) — expected number of distinct alleles per population at depth g. - Private allelic richness (
pi) — expected number of alleles unique to a single population. - Combination-private richness (
pihat) — expected number of alleles private to a combination of populations.
Each statistic is summarized across loci with the classical mean, variance, and standard error, and — new in PADZE — the skewness and excess kurtosis of its per-locus distribution.
Relationship to ADZE 1.0
PADZE is a genuine upgrade and successor to ADZE 1.0. It reimplements the rarefaction core in vectorized NumPy and extends it: reads VCF (including .vcf.gz) directly with a simple population map, exposes an importable Python API (from padze import ...), ships the padze command-line tool, and adds third- and fourth-moment (skewness, excess-kurtosis) summaries alongside the classical mean/variance/SE outputs. It retains the STRUCTURE input format for direct parity with ADZE 1.0, and its classical mode reproduces the original C++ ADZE output. PADZE is an independent implementation and is not endorsed by the original ADZE authors.
Install
Install the released package from PyPI:
pip install padze
This installs the padze command-line tool and the importable padze module. PADZE requires Python 3.10+ and depends only on NumPy at runtime.
To work from a checkout of this repository instead:
pip install . # runtime install from source
pip install -e ".[test]" # editable install with the test suite
pip install -e ".[dev]" # editable install with build/release tooling
Quick start
The commands below use the example inputs in examples/ and run from the repository root.
Inspect a VCF and its population map:
padze info --vcf examples/trio.vcf --popmap examples/trio.popmap
Compute the extended feature table (mean/variance/SE plus skewness/kurtosis, one row per depth):
padze features --vcf examples/trio.vcf --popmap examples/trio.popmap \
--population-order A B C --out features.csv
Write ADZE-compatible R/P/C output files, including per-locus FULL_R/FULL_P/FULL_C tables:
padze features --vcf examples/trio.vcf --popmap examples/trio.popmap \
--population-order A B C --adze-prefix out --adze-full
This writes out_r, out_r_fulldata, out_p, out_p_fulldata, out_c_2, and out_c_2_fulldata.
Running from a checkout without installing? Prefix any command with
PYTHONPATH=srcand use the module form, e.g.PYTHONPATH=src python -m padze info --vcf examples/trio.vcf --popmap examples/trio.popmap.
CLI overview
PADZE exposes two subcommands. Install the package to get the padze console command, or use python -m padze.
| Subcommand | Purpose |
|---|---|
padze info |
Read an input, print population/sample metadata and the maximum usable rarefaction depth. |
padze features |
Compute across-loci statistics and write CSV or ADZE-compatible output. |
Key features flags:
--population-order A B C— fix the population order used for numberedalpha/pi/pihatoutputs.--classical— emit the classical(mean, variance, se)table that reproduces the C++ ADZE output.--adze-prefix PREFIX— write ADZE-compatiblePREFIX_r,PREFIX_p, andPREFIX_c_kfiles.--adze-full— with--adze-prefix, also write the per-locusFULL_R/FULL_P/FULL_C-style*_fulldatafiles.--rolling-window W— compute the classical statistics over sliding genomic windows of sizeW(--step,--window-unit loci|bp).--max-depth,--pihat-sizes,--moments— control the depth range, which combination sizes to score, and which moments to emit.
Run padze features --help for the full flag list, including VCF filtering (--require-pass, --max-missing-fraction, --biallelic-only) and STRUCTURE input options.
Python API
from padze import compute_features, read_vcf
loci = read_vcf("examples/trio.vcf", "examples/trio.popmap",
population_order=["A", "B", "C"])
table = compute_features(loci) # one row per rarefaction depth
matrix, columns = table.to_frame() # NumPy array + column names
The public API also exposes read_structure, classical_features, rolling_window_features, and the rarefaction and moment primitives (locus_statistics, moments_from_values, MomentAccumulator). See the manual for details.
Outputs
- ADZE-compatible
R/P/Cfiles (--adze-prefix) — richness (_r), private richness (_p), and combination-private richness (_c_k) tables in the original ADZE text layout. - Per-locus
FULL_R/FULL_P/FULL_Cfiles (--adze-full) — the full per-locus values behind each summary, as*_fulldata. - Deleted-loci report — when missingness tolerances remove loci, a
*_p_deletedlocicompanion lists them. - Extended feature table (
--out) — a CSV with mean, variance, standard error, skewness, and excess kurtosis for every statistic at every depth.
Validation
PADZE ships with an automated test suite: 82 tests pass (11 skipped for optional external tools). The rarefaction core, the classical mean/variance/SE outputs, and the per-locus FULL_R/FULL_P/FULL_C outputs are validated against the original C++ ADZE. The VCF path is validated against matched STRUCTURE encodings, allele-coding permutations, and missingness edge cases. See docs/usage-and-verification.md for the commands and observed results.
pip install -e ".[test]"
pytest
Documentation
PADZE_Manual.pdf— the PADZE manual (printable PDF, at the repository root).docs/MANUAL.md— the same manual in Markdown for reading on GitHub.docs/adze-1.0-reference.md— mapping to ADZE 1.0 concepts and formats.docs/usage-and-verification.md— verified usage and validation commands.
Citation
If you use PADZE, please cite both the package and the original ADZE method.
PADZE:
del Castillo A, Shmalo Y. 2026. PADZE: Pythonic Allelic Diversity Analyzer (version 0.1.0). https://github.com/Andres42611/PADZE
Original ADZE method:
Szpiech ZA, Jakobsson M, Rosenberg NA. 2008. ADZE: a rarefaction approach for counting alleles private to combinations of populations. Bioinformatics 24:2498–2504. doi:10.1093/bioinformatics/btn478
License
PADZE is released under the MIT License.
Authors
- Andres del Castillo
- Yitzchak Shmalo — Hebrew University of Jerusalem (yitzchak.shmalo@mail.huji.ac.il)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file padze-0.1.0.tar.gz.
File metadata
- Download URL: padze-0.1.0.tar.gz
- Upload date:
- Size: 332.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88b1b1d94f6c0cefdde4aab1b965948c9f28c6d8ecc6716aba46337061f3b8c0
|
|
| MD5 |
cce8f9818de8e19818ffdad7c8c3ce65
|
|
| BLAKE2b-256 |
e6377d20fe5094d415aee32d06430845be6d3630521fb10ff23186f1172e5ed6
|
Provenance
The following attestation bundles were made for padze-0.1.0.tar.gz:
Publisher:
publish.yml on Andres42611/PADZE
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
padze-0.1.0.tar.gz -
Subject digest:
88b1b1d94f6c0cefdde4aab1b965948c9f28c6d8ecc6716aba46337061f3b8c0 - Sigstore transparency entry: 2093918101
- Sigstore integration time:
-
Permalink:
Andres42611/PADZE@b06611dd6bcf0783b8fc5de1fe04c6e4b42a24d6 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Andres42611
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b06611dd6bcf0783b8fc5de1fe04c6e4b42a24d6 -
Trigger Event:
release
-
Statement type:
File details
Details for the file padze-0.1.0-py3-none-any.whl.
File metadata
- Download URL: padze-0.1.0-py3-none-any.whl
- Upload date:
- Size: 33.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56648c4ea284d94235e75b092ad8cf3121eb05c3641b73afd5116f9351c94378
|
|
| MD5 |
9deac985bb31eb9ed6660fe01692f7fc
|
|
| BLAKE2b-256 |
6f7bfc7404ae9eaa0b8700af56f914398f525bb596849344547a0697ea20b3c9
|
Provenance
The following attestation bundles were made for padze-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on Andres42611/PADZE
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
padze-0.1.0-py3-none-any.whl -
Subject digest:
56648c4ea284d94235e75b092ad8cf3121eb05c3641b73afd5116f9351c94378 - Sigstore transparency entry: 2093918569
- Sigstore integration time:
-
Permalink:
Andres42611/PADZE@b06611dd6bcf0783b8fc5de1fe04c6e4b42a24d6 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Andres42611
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b06611dd6bcf0783b8fc5de1fe04c6e4b42a24d6 -
Trigger Event:
release
-
Statement type: