Skip to content
01 / 03·thermo_physics.codon · Offline Potts Codon Sampler (MIT)

Codons anneal into place.

Open-source (MIT) Python package. Free permanently for academic labs and university biofoundries. Designed for local, air-gapped execution on proprietary construct libraries.

A synonymous mRNA can be written in astronomical numbers of ways. Greedy codon adaptation frequently introduces Type IIS restriction sites, homopolymer tracts, or tight 5′ hairpins that stall ribosome initiation. thermo_physics.codon formulates multi-objective sequence design as an Ising/Potts Hamiltonian relaxed via simulated thermal annealing.

// station 13 · biofoundry ribbonlive Potts anneal

Fifteen codons on one ribbon

Illustrative simulation

HAEGTFTSDVSSYLE · CACGCTGAGGGCACATTTACCAGCGACGTGTCTAGCTACCTGGAG

Codons are annealing.

Hot (low β), the Metropolis sampler keeps uphill swaps. Cold, downhill swaps stick and the hairpin arcs drop out. β 3.5 is the setting in the station script. This run is shorter than the published 20,000 steps and uses a different random generator, so it will not match the published energy exactly.

peptide HAEGTFTSDVSSYLEIllustrative simulation · All three run today as JAX simulations on ordinary computers. No special sampling hardware is required.
// 01 · published run

Station 13, the published run

Target peptide HAEGTFTSDVSSYLE, a 15-residue fragment. Search space 84,934,656 synonymous transcripts. Hairpins here are the station's inverted-repeat detector (stem of 3, loop of 3-8), not a ViennaRNA free-energy fold.

Greedy CAI-only Baseline
CAI 1.0000 · GC 66.7% · 4 hairpins · energy 9.1111
Potts Sampler Anneal
CAI 0.9326 · GC 57.8% · 0 hairpins · energy 1.2891

Energy advantage 7.822 versus greedy baseline. The ribbon on the left is a shorter browser anneal, labeled as an illustration, and it is not that published energy. All three run today as JAX simulations on ordinary computers. No special sampling hardware is required.

Note: simulated benchmark result, results may vary (not customer results).

Inspect thermo_physics/codon source on GitHub ↗

// 02 · host tables

1. Supported Host Profiles

Native host codon usage frequencies, tRNA adaptation tables, and GC baseline targets:

  • · s_cerevisiae - Saccharomyces cerevisiae (target GC 39%)
  • · e_coli - Escherichia coli K-12 (target GC 51%)
  • · d_discoideum - Dictyostelium discoideum (AT-rich, target GC 27%)
  • · b_subtilis - Bacillus subtilis 168 (target GC 43%)
  • · c_griseus - Chinese Hamster Ovary / CHO (target GC 50%)
  • · h_sapiens - Homo sapiens (target GC 52%)
// 03 · synthesis rules

2. Assembly & Synthesis Exclusions (Configurable)

Deterministic verification and penalty filters evaluated on both strands across codon boundaries (disabled by default for homology assembly):

  • ·Type IIS Golden Gate / MoClo: Excludes BsaI, BsmBI / Esp3I, BbsI / BpiI, SapI / LguI, and AarI recognition motifs across all frames and junctions.
  • ·Homopolymer Tracts: Flags and disfavors single-nucleotide runs greater than or equal to 5 nt (poly-A, poly-T, poly-G, poly-C) to prevent DNA synthesis slippage and sequencing dropouts.
// 04 · potts hamiltonian

3. Decomposed Potts Hamiltonian H(s)

Energy formulation balances translation efficiency against thermodynamic and structural stability:

H(s) = -w_cai · CAI(s) + w_doublet · E_doublet(s) + w_5p · ΔG_5p(s) + w_hairpin · N_hairpins(s) + w_gc · (GC(s) - GC_target)²
  • ·Host CAI: Mean log-relative adaptiveness of synonymous codons.
  • ·Rare-Codon Doublets: Penalizes sequential rare tRNAs that trigger translation stalling.
  • ·Turner 2004 5′ Initiation Structure: Optimizes secondary structure free energy over nt 1 to 54 to ensure unhindered ribosome pre-initiation loading.
  • ·50-nt Sliding Window GC: Maintains GC homeostasis across the entire transcript.
// 05 · air-gapped cli

4. 100% Local / Air-Gapped Retrospective CLI

Zero telemetry, zero external network calls. Validate historical expression libraries completely offline:

python scripts/agf_local_codon_benchmark.py correlate \
  --csv constructs.csv --host s_cerevisiae --enzymes none \
  --summary-out summary_correlations_only.json

The --summary-out flag exports strictly aggregated validation statistics: sample counts, Spearman rho, Pearson r, p-values, and classification ROC-AUC. Zero construct sequences, IDs, or proprietary metadata leave your perimeter.

// open source · academic & foundry access

Request academic partnership & foundry access

Open-source (MIT) Python package. Free permanently for academic labs and university biofoundries. Designed for protein expression cores, synthetic biology labs, and CDMOs. Email is required.

We use this only to follow up with you. We don't sell or share it.

Prefer to talk first? Book a call (opens in a new tab)

Discuss your workflow (opens in a new tab)