Skip to main content

PloidyPatch

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

Tests Release v1.0 PyPI Bioconda 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.1

Conda / Bioconda

PloidyPatch 1.0.0 is available from the Bioconda channel as a platform-independent noarch Python package. We recommend a dedicated environment:

mamba create -n ploidypatch \
  -c conda-forge -c bioconda \
  --strict-channel-priority \
  ploidypatch=1.0.0
conda activate ploidypatch
ploidypatch --version

conda can be used in place of mamba. To install into an existing compatible environment:

conda install -c conda-forge -c bioconda \
  --strict-channel-priority \
  ploidypatch=1.0.0

The channel package is built from the immutable v1.0 release and is tested on Python 3.11 or later. Research-evaluation and visualization features remain optional; see the installation guide for their dependency groups and for separately managed projection and synteny programs.

PyPI 1.0.1 is a metadata-correction release that records both software authors and updates this installation text. It does not change scientific methods or command behavior relative to the Bioconda 1.0.0 build.

For checksum-bound archival reproduction, the GitHub release also provides the same core as a standalone Conda artifact:

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

Alternatively, install the tagged source in an isolated environment:

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.1"
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 PloidyPatch v1.0 software is available from Zenodo under the all-version concept DOI 10.5281/zenodo.21875560. The immutable 1.0.0 archive remains record 21875561, with version DOI 10.5281/zenodo.21875561. The associated manuscript citation will be added after publication without changing the 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.1

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.1
File Size Uploaded
ploidypatch-1.0.1.tar.gz 1.3 MB Details

Built distribution (wheel)

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

Total release size: 1.6 MB

Release files / ploidypatch-1.0.1.tar.gz

Download URL ploidypatch-1.0.1.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
7403f56f10588fe49ff133c08614f7db39a23a2de0f7c48d5a480d114e079606
BLAKE2b-256 checksum
How to use checksums
001e02c68169a490f6152738e642b0dfc6572890c89c4ee02b952a68c3178ce5
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 24, 2026.

Transparency log

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

Download URL ploidypatch-1.0.1-py3-none-any.whl
Size 369.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d1ae6cba0cc1e3bdf33329721be2ebdb8e609ddeaf744508324eb98fcaa44156
BLAKE2b-256 checksum
How to use checksums
b4cbdb7f2d8455ba7cd9228222e94b16dc4c266b45c186693527ad00c75032a0
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 24, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

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