Skip to main content

PloidyPatch

Duplication-aware, review-first plant gene-model repair

Tests Release v1.0 PyPI Zenodo v1.0 DOI BSD-3-Clause license Python 3.11–3.13 Cite this software

PloidyPatch is a plant-specific, duplication-aware toolkit for preserving and reviewing gene structures that conventional annotation transfer workflows can suppress in duplicated genomes. It integrates candidate models from mature projection tools, preserves distinct phased CDS chains, adds copy-aware evidence when applicable, and compiles explicit reviewer decisions into immutable, reversible GFF3 patches.

Design boundary: PloidyPatch is a repair and consistency layer, not a replacement gene predictor. It never infers gene absence from a missing GFF feature, never silently approves a candidate, and never modifies the source annotation in place.

PloidyPatch workflow: role-separated plant inputs, exact-chain candidate generation, evidence-aware review ranking, prospective validation, and human-authorized reversible output

Why PloidyPatch?

Plant gene annotation is unusually sensitive to whole-genome duplication, fractionation, tandem duplication, and homeologous sequence similarity. Projection pipelines can therefore produce multiple biologically meaningful structures at one locus—or suppress one valid copy as an apparent overlap. PloidyPatch makes that uncertainty explicit and reviewable.

Capability What it provides
Chain-preserving consensus Retains structurally distinct CDS chains instead of collapsing by span alone
Plant duplication context Adds copy, synteny, and optional WGD-topology evidence without making it universally mandatory
Multi-tool provenance Tracks support from Miniprot, GeMoMa, LiftOn, and normalized external models
Human-in-the-loop decisions Requires an explicit accept_addition review decision; automatic_approval=false
Reversible annotation repair Applies a content-bound patch and verifies byte-identical source recovery
Reproducible evaluation Uses checksums, immutable manifests, hidden-truth custody, and formal positive/negative/not-evaluable states

Installation

Pip / PyPI

python -m pip install ploidypatch==1.0.0

Conda / Bioconda

The release includes a tested noarch Conda package and a Bioconda-ready recipe bound to the same v1.0 registry source archive (1.0.0). The package can be installed directly from the immutable GitHub release while the Bioconda recipe completes community review:

conda create -n ploidypatch python=3.11
conda install -n ploidypatch \
  https://github.com/707728642li/PloidyPatch/releases/download/v1.0/ploidypatch-1.0.0-py_0.conda

After the community recipe is merged, the equivalent channel installation is:

conda install -c conda-forge -c bioconda ploidypatch=1.0.0

Alternatively, create an isolated environment and install the tagged source:

conda create -n ploidypatch -c conda-forge python=3.11 pip
conda activate ploidypatch
python -m pip install \
  "ploidypatch @ git+https://github.com/707728642li/PloidyPatch.git@v1.0"
ploidypatch --version

From a source checkout

git clone https://github.com/707728642li/PloidyPatch.git
cd PloidyPatch
conda create -p envs/ploidypatch -c conda-forge python=3.11 -y
conda run -p envs/ploidypatch --no-capture-output python -m pip install .
conda run -p envs/ploidypatch --no-capture-output ploidypatch --version

For development and the reproducible public test suite:

conda run -p envs/ploidypatch --no-capture-output \
  python -m pip install -e ".[test]"
conda run -p envs/ploidypatch --no-capture-output \
  python scripts/run_public_test_suite_v1.py

The dependency-light core does not silently install external gene predictors, aligners, or synteny programs. Miniprot, GeMoMa, LiftOn, DIAMOND, WGDI, SynGAP, and long-read preprocessing tools belong to separately pinned workflow environments; see the installation guide.

Platform support

Production annotation and validation workflows are supported on Linux. The portable review/patch core is also tested through the Bioconda macOS build, but availability of the external bioinformatics programs varies by platform. Native Windows is not an officially supported bioinformatics platform and no Windows-specific PloidyPatch package is published. Windows users should run the Linux workflow through WSL2, a Linux server, or the documented container.

Five-minute verified tutorial

The bundled example is a complete, checksum-bound miniature dataset. It contains a source GFF3, three candidate models, one mutually exclusive conflict, an immutable candidate-pool manifest, and an explicit review ledger.

python examples/minimal_reviewed_patch/run_example.py \
  --output-dir work/minimal_reviewed_patch

The runner performs five public CLI operations:

  1. compile only explicitly accepted candidates;
  2. create a source-bound patch;
  3. apply it to a new annotation; and
  4. revert it and require byte-identical recovery of the input GFF3; and
  5. generate a checksum-bound interactive report with no network dependency.

Successful output includes run_summary.json, command_log.jsonl, the applied and reverted annotations, report/index.html, and SHA256SUMS. The expected result contains two accepted additions, no automatic approval, and identical source/reverted SHA-256 values. Continue with the step-by-step tutorial or inspect the example data dictionary.

Interactive result-report preview

Open the tracked validated example report to inspect ranked triage queues, exact method intersections, shared-axis conflict structures, topology explanations, editable review-ledger workflow, and complete checksum provenance. The HTML is a self-contained demonstration generated from the same eight checksum-bound files shipped in the package.

PloidyPatch result report with triage metrics, exact method intersections, candidate table, and shared-axis CDS-chain comparison

The preview is the complete offline workbench, not a static dashboard mock-up: search, filters, keyboard selection, conflict-set comparison, machine-readable exports, and a review-ledger template are all generated together and bound by SHA256SUMS.

Command-line interface

ploidypatch
├── audit       validate an annotation bundle and its identifiers
├── baseline    adapt and summarize external projection baselines
├── benchmark   generate and evaluate controlled annotation perturbations
├── evidence    construct copy, synteny, topology, and review evidence
├── graph       combine explicit evidence into auditable decisions
├── normalize   normalize provider-specific GFF3/FASTA bundles
├── patch       compile, create, apply, and revert annotation patches
└── report      build an offline interactive review report

There are 87 executable leaf commands in the current source tree. Use built-in help at every level:

ploidypatch --help
ploidypatch patch --help
ploidypatch patch compile-reviewed-copy-additions --help

The CLI reference explains every command family, input schemas, outputs, and failure behavior. The generated complete parameter reference lists every required and optional argument, type, default, and choice. The exact parser-derived inventory is also available as CLI_COMMAND_INVENTORY_v0.1.json.

Typical reviewed-patch workflow

# 1. Compile explicit review decisions into addition events.
ploidypatch patch compile-reviewed-copy-additions \
  --annotation-gff source.gff3 \
  --candidate-gff candidate.gff3 \
  --pool-decisions decisions.tsv \
  --pool-manifest candidate.gff3.manifest.json \
  --review-decisions review_decisions.tsv \
  --output-edits-json reviewed.edits.json

# 2. Bind those edits to the exact source annotation.
ploidypatch patch create \
  --source-gff source.gff3 \
  --edits-json reviewed.edits.json \
  --output-patch reviewed.patch.json

# 3. Write a new annotation; the source is not overwritten.
ploidypatch patch apply \
  --source-gff source.gff3 \
  --patch reviewed.patch.json \
  --output-gff annotation.reviewed.gff3

# 4. Prove reversibility.
ploidypatch patch revert \
  --patched-gff annotation.reviewed.gff3 \
  --patch reviewed.patch.json \
  --output-gff annotation.reverted.gff3

See the user guide for preparing manifests, recording review decisions, interpreting abstention, and auditing identifiers.

Evidence snapshot

The manuscript evidence is frozen; revealed systems are not retuned.

  • In prospective Populus trichocarpa confirmation, the chain-preserving pool recovered 731/800 exact phased CDS chains versus 663/800 after legacy overlap suppression (paired delta 0.0850; 95% interval 0.06625–0.1050).
  • In prospectively frozen Actinidia chinensis, the structural endpoint improved from 333/800 to 406/800. The composite result remains formally negative because topology covered 62.07% of positive candidates, below the preregistered 70% gate.
  • In untouched allotetraploid Coffea arabica, recovery improved from 597/800 to 672/800, with zero collateral transcript loss in all six arms.
  • A Golden Delicious apple audit found 433 strict multi-exon candidates with full-length long-read support.
  • The largest scaling run processed 76,434 candidates and 16,011 conflicts in 70.48 seconds with 1.16 GiB peak resident memory.
  • A cross-species experimental ranker was retired after failing transfer gates; duplication topology remains optional, applicability-gated evidence.

The research status, frozen protocols, and checksum-bound examples preserve the complete claim boundary.

Documentation

Document Audience
Installation Core, optional evaluation, containers, and workflow dependencies
Tutorial New users following the verified example step by step
User guide Real-data workflow, review ledger, and failure handling
Result report Interactive summary, candidate explorer, and interpretation guide
Public versioning Public v1.0 identity and immutable internal-snapshot provenance
v1.0 readiness Engineering gates, verification results, and publication boundary
CLI reference Commands, parameters, schemas, and outputs
Testing guide Public CI suite, fixture checks, and archival-test boundary
Reproducibility guide Checksums, manifests, frozen protocols, and truth isolation
Container guide Digest-pinned non-root execution
Contributing Development setup and pull-request rules
Support Bug reports, questions, and private contact

Reproducibility and testing

  • CI tests Python 3.11, 3.12, and 3.13.
  • The public runner executes every test supported by a clean clone; six named manuscript-archive audits remain available to maintainers with the frozen upstream result tree.
  • Wheel and source distributions are built independently twice and must be byte-identical.
  • Both distributions are installed into clean environments and run through the verified example without source-tree imports.
  • The core container runs as 10001:10001, read-only and without network access during the example.
  • Scientific holdouts distinguish formal_positive, formal_negative, not_evaluable, and invalid_run; failures are retained rather than tuned away.

Citation

Use GitHub's Cite this repository panel or CITATION.cff. The archived v1.0 software release is available from the stable Zenodo record 21875561, with version DOI 10.5281/zenodo.21875561. Zenodo retains the all-version concept DOI in the record metadata. The associated manuscript citation will be added after publication without changing the immutable software-release identity.

License and contact

PloidyPatch is released under the BSD 3-Clause License.

Please do not send confidential genomes, credentials, or unpublished sample metadata through public issues.

Metadata

Release files for ploidypatch 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ploidypatch 1.0.0
File Size Uploaded
ploidypatch-1.0.0.tar.gz 1.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for ploidypatch 1.0.0
File Interpreter ABI Platform
ploidypatch-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.6 MB

Release files / ploidypatch-1.0.0.tar.gz

Download URL ploidypatch-1.0.0.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
f63772f27a432e18da44f544d6a98a7b27c934a532e4079d7cb624d9ba0af38c
BLAKE2b-256 checksum
How to use checksums
34f6c79a4f4e471bbae88a5157869c6d832e866fe19543a1b773d48f41efa8d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 18, 2026.

Transparency log

Release files / ploidypatch-1.0.0-py3-none-any.whl

Download URL ploidypatch-1.0.0-py3-none-any.whl
Size 369.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e7064cdaad4114a8cd5bde3da16aadc9495d737334fbcb7bfd959530827fda61
BLAKE2b-256 checksum
How to use checksums
dad28f3f6c3b86a2c0c8e5f44477e99d9fd76ad357ced60ab3ba0ec2fe3d2a71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 18, 2026.

Transparency log

Release history Release notifications | RSS feed

1.0.1

2 release files

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page