A complete implementation of the Turner nearest-neighbor thermodynamic model — in pure Python/NumPy. No ViennaRNA. No external binaries. Just accurate RNA folding.
Enter any RNA sequence (A, U, G, C) and choose an algorithm. Results include MFE structure, free energy, base-pair probabilities, and an interactive arc diagram.
Each module is independent, pure Python, and uses published thermodynamic parameters from the Turner 2004 ruleset.
Turner nearest-neighbor model finds minimum free energy structure. O(N⁴) DP with Zuker algorithm. Also Nussinov O(N³) for fast base-pair maximization.
Turner + NussinovMcCaskill algorithm computes full partition function Z and derives base-pair probability matrices — reveals alternative folds and structural uncertainty.
McCaskill O(N³)Systematically evaluate every single-nucleotide variant. ΔMFE > 0 = destabilizing. Used for pathogenic variant prediction, sgRNA design, and mRNA engineering.
SNV scanningDesign an RNA sequence that folds into any target dot-bracket structure using simulated annealing. Useful for synthetic biology and mRNA vaccine design.
Simulated annealingCompute tree-edit distance between structures, detect covariation at paired positions, and identify conserved structural elements across homologues.
PhylogeneticsAll stacking, hairpin, interior loop, and bulge loop parameters from Mathews et al. 2004. Terminal AU/GU penalties and stable tetraloop bonus energies included.
ThermodynamicRNAStructure requires only NumPy, SciPy, Pandas, Plotly, and Matplotlib — all standard scientific Python packages.
# Install pip install rnastructure # Or from source git clone https://github.com/junior1p/RNAStructure.git cd RNAStructure pip install -e .
from rnastructure import turner_mfe, delta_mfe_scan, design_rna, partition_function # Predict MFE structure seq = "GCGGAUUUAGCUCAGUUGGGAGAGCGCCA" result = turner_mfe(seq) print(f"MFE: {result.mfe:.2f} kcal/mol") print(f"Structure: {result.structure}") # Partition function + probability matrix mfe_res, bp_matrix = partition_function(seq) # Scan all SNVs dmfe = delta_mfe_scan(seq) # Design RNA to target structure target = "(((...)))" designed_seq, designed_result = design_rna(target)
# Visualization from rnastructure.visualize import plot_bp_matrix, plot_dmfe_landscape, mountain_plot bp_fig = plot_bp_matrix(bp_matrix, seq, "Base-Pair Probability Matrix") bp_fig.write_html("bp_matrix.html")