Skip to content
Station 11·experiments/exp11_rna_folding.py · MIT

The fold is an ensemble, both stems in play.

Station 11 of the MIT-licensed thermo-physics suite samples the Boltzmann ensemble of RNA secondary structures. Written for academic RNA, biophysics, and riboswitch labs. The script runs on the lab machine.

Riboswitch function depends on the structures a chain occupies, including bistable stems that share probability. A static minimum-free-energy drawing keeps one structure and drops the rest of the distribution.

// station 11 · contact arcsensemble draw

Tier 1 · 24-nt contact arcs

Illustrative simulation

simulated benchmark result, results may vary (not customer results). A horizontal 24-nucleotide backbone with two arcs leaving position 0.5'3'G0C12C20
  • G0-C2048.7%
  • G0-C1233.9%

Arc weight follows the published Tier 1 occupancies. simulated benchmark result, results may vary (not customer results).

Illustrative simulation · This station runs on standard hardware. No thermodynamic hardware is required.

// 01 · the research problem

Function sits in the ensemble

RNA function depends on the Boltzmann ensemble of structures. A riboswitch is the clearest case: two stems can both be occupied, and the biology lives in that balance.

A single static minimum-free-energy structure is one point in that distribution. It does not say how the other contacts are populated, or whether the chain is bistable. Station 11 samples the ensemble.

// 02 · the open-source tool

Gibbs sampling over contacts

Station 11 is in the MIT-licensed thermo-physics suite. The file experiments/exp11_rna_folding.py builds a quadratic energy over candidate base pairs and samples those binary contacts with Gibbs sampling in JAX. The suite's sampler is block Gibbs on Extropic thrml. This experiment draws the contact ensemble with a JAX scan.

Candidate contacts are Watson-Crick pairs and G-U wobble pairs. The energy has a term for each pair, a stacking bonus when neighboring pairs continue a stem, a steric penalty when one nucleotide would pair twice, and a crossing penalty for pseudoknots.

When the contact graph is small enough, the script enumerates every contact state and records the exact minimum free energy. It also records contact occupancies, the Shannon entropy of the conformations it visits, the Sokal integrated autocorrelation time, and the effective sample size. A classical simulated-annealing run uses the same step budget as a baseline.

The file describes the energy as a coarse model. It is not the full Turner nearest-neighbor parameter set, and it is not a replacement for ViennaRNA.

thermo-physics on GitHub ↗ (opens in a new tab)

// 03 · published run

Station 11, the published run

Copied from the Experiment 11 section of the suite README. simulated benchmark result, results may vary (not customer results).

Tier 1 · 24-nt bistable switch

Exact MFE, exhaustive enumeration
-10.0000 kcal/mol
Empirical MFE
-10.0000 kcal/mol
Match against exhaustive enumeration
100.0% exact match
Stem occupancy G0-C20
48.7%
Stem occupancy G0-C12
33.9%
tau_int
38.22 steps
ESS
654.1

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

Tier 2 · 50-nt aptamer

MFE
-66.0000 kcal/mol
Shannon entropy at 37 C
3.06 bits
Shannon entropy at 95 C
14.56 bits

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

This station runs on standard hardware. No thermodynamic hardware is required.

// 04 · on the lab machine

Run it locally. Data stays in the lab.

From the repository root, as the README states:

pip install -e .
python experiments/exp11_rna_folding.py

Sequences never leave the lab's machine. The script reads the chain locally and prints the run in the terminal. It does not send the sequence anywhere.

Open experiments/exp11_rna_folding.py ↗ (opens in a new tab)

// open source · academic & foundry access

Request a free academic trial

For academic RNA, biophysics, and riboswitch labs. Email is required. Paid plans come after a verified audit.

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)

or email trials@getnexusaisolutions.com

Discuss your workflow (opens in a new tab)