Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

payload-compiler

CpG refactoring, payload linting and AAV vector size accounting for DNA payloads from the command line. Every edit is a synonymous codon substitution that preserves each annotated translation exactly, recorded in a reviewable audit trail and a self-contained HTML diff that opens from local disk.

Install

Install the prerelease from PyPI:

python -m pip install --pre norvara-payload-compiler

The Python package and command keep the shorter project name:

import payload_compiler
payload-compiler --version

Quickstart

Deplete the CpG sites in phiX174 gene D (annotated at 390..848) without changing the protein it encodes:

payload-compiler optimize --input examples/phix174.fasta --cds 390:848 \
  --max-length 5386 --output geneD.fasta
PASS NC_001422.1: CpG 267 → 231 (36 removed), 35 mutation(s)
Solver: greedy [locally_optimal] over 36 state(s); CpG policy strict_subset
Profile: human Homo sapiens CUTG, GenBank Release 160.0, 2007-06-15
  CDS cds_1: CAI 0.712, GC3 25.7%, 41 distinct codons, 2 rare, pair-bias n/a
WARNING 231 CpG site(s) remain outside editable CDS contexts or were retained under the selected constraints and search budget
WARNING No vector architecture supplied: length was checked against a flat 5386-nt limit with no ITR or component accounting
Sequence (fasta): geneD.fasta
Audit: geneD.fasta.report.json
Visual diff: geneD.fasta.diff.html

All 36 CpGs inside the CDS are gone, the 231 that remain lie outside it, and nothing outside 390..848 is touched. The HTML diff aligns both sequences by coordinate and lists every codon substitution.

Commands

Command Purpose
validate parse and check one record; report CDS findings
lint read-only metrics, motif, splice, structure and screen findings
optimize rewrite coding regions, with audit and visual diff
report rebuild the HTML diff from an audit and verify it replays
profiles list the bundled codon-use profiles

Options

-i, --input PATH         single-record FASTA, GenBank or EMBL
-o, --output PATH        optimized sequence output
    --cds START:END[:+|-]  FASTA reading frame, 1-based inclusive; repeatable
    --max-length N       payload length limit (default: 4700)
    --host NAME          bundled codon profile (default: human)
    --profile FILE       user-supplied versioned codon profile
    --solver {greedy,global}   greedy edits, or bounded exhaustive search
    --search-budget N    assignments the global solver may attempt
    --cpg-policy {strict-subset,count-only}
    --vector FILE        vector architecture for ITR-aware size accounting
    --protect START:END[:NAME]   intervals that must never change
    --forbid-motif NAME=IUPAC    motif never to introduce; repeatable
    --splice-scan        screen splice-consensus motifs
    --screen             enable the heuristic sequence screens
    --assembly-standard {golden-gate-bsai,golden-gate-bsmbi,biobrick}
    --rnafold {off,auto,seqfold,required}   folding backend
                         (on `lint` this is a plain on/off flag)
    --gc3-min N / --gc3-max N / --max-rare-codons N

payload-compiler optimize --help lists the complete set.

Outputs

Flag Output
--output PATH the optimized sequence; FASTA unless the suffix or --output-format selects the annotated source format
--json-report PATH the JSON mutation audit (default <output>.report.json)
--diff-report PATH the self-contained HTML diff (default <output>.diff.html)
--json the audit on stdout

Outputs are written as one rollback-capable set: if the run is unsafe, no stale sequence is left at the output path. Repeating a run with identical inputs, settings and software versions reproduces every byte.

Reading the output

  • Coordinates are 1-based and inclusive. --cds 390:848 names the forward-strand frame; append :- for the reverse strand.
  • Every accepted substitution is synonymous under the CDS translation table, and translation preservation is re-checked before anything is written. Start and stop codon identity is never altered.
  • --cpg-policy strict-subset (the default) requires that the optimized sequence carry CpGs only at coordinates that already had one, so a CpG is never relocated. count-only relaxes this to a falling total and lists any new coordinates in introduced_cpg_positions.
  • The solver line states what was established: locally_optimal means no improving single-codon edit remains; proven_optimal means the declared constraint space was exhausted; best_found means --search-budget was reached first. Proof is over the declared constraints only, never a claim of biological optimality.
  • Codon-frequency profiles break ties and record provenance; --profile carries a name, version, source and citation, and its SHA-256 appears in every audit. A profile is not an expression model.
  • report independently replays each base edit and recomputes hashes, CpG positions, codons and translations, so a mismatched sequence and audit cannot be presented as one result.

Native ViennaRNA

Folding works out of the box through the bundled seqfold backend, which reports a minimum free energy only. Installing ViennaRNA so that RNAfold is on PATH additionally enables --rnafold required and the ensemble statistics behind --structure-ensemble. The Dockerfile pins ViennaRNA 2.5.1 if you would rather not install it on the host:

docker build -t payload-compiler .
docker run --rm -v "$PWD:/data" -w /data payload-compiler \
  payload-compiler lint --input examples/phix174.fasta --rnafold --structure-ensemble

With no command, the image runs the test suite against that pinned RNAfold, which is how the native folding path is checked.

Limitations

  • Synonymous substitution preserves length, so an oversized payload cannot be shortened. With --vector the size problem is reported per component, with the shortest declared swap plan; the substitution itself is not performed.
  • Vector component identities and lengths are user-declared. ITR sequence integrity is not verified and packaging limits are screening thresholds, not yield predictions.
  • Splice, poly(A), promoter, Kozak, ORF, homopolymer and repeat screens are motif and threshold heuristics. They flag candidates for review and predict neither splicing, polyadenylation, promoter activity nor expression.
  • Secondary structure is scored on local windows, which does not model the complete transcript.
  • Sequences are treated as linear, and one record is processed per invocation.

Development

pip install -e ".[dev]"
pytest -q
ruff check src tests

License

Licensed under the PolyForm Noncommercial License 1.0.0. See LICENSE for the complete terms.

Metadata

Release files for norvara-payload-compiler 0.9.0rc1

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

Source distribution (sdist)

Source distribution for norvara-payload-compiler 0.9.0rc1
File Size Uploaded Provenance
norvara_payload_compiler-0.9.0rc1.tar.gz 67.2 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for norvara-payload-compiler 0.9.0rc1
File Interpreter ABI Platform
norvara_payload_compiler-0.9.0rc1-py3-none-any.whl Python 3 none any Details

Total release size: 125.4 kB

Release files / norvara_payload_compiler-0.9.0rc1.tar.gz

Download URL norvara_payload_compiler-0.9.0rc1.tar.gz
Size 67.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b9865a5dbbb77249accbcf4938af2c1b62e2b71ae8648325e0b09a31d126214e
BLAKE2b-256 checksum
How to use checksums
e84606acbadb8be066991902227ca97f401f83b1e848d2ba348c4e16d2650a5a
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 Oct 23, 2026.

Transparency log

Release files / norvara_payload_compiler-0.9.0rc1-py3-none-any.whl

Download URL norvara_payload_compiler-0.9.0rc1-py3-none-any.whl
Size 58.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c2ec98df897029b16d6aad126c79719a0fdc30540803b65ba3f77daa8bd76477
BLAKE2b-256 checksum
How to use checksums
7e1bc94f829a6c7eba2d7eaedbec0e3281316bb2c6d7397bd7d21eedc4fb87dd
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 Oct 23, 2026.

Transparency log

Security for norvara-payload-compiler 0.9.0rc1

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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for norvara_payload_compiler-0.9.0rc1.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 Oct 23, 2026.

Transparency log

A 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.

Release history Release notifications | RSS feed

This release
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