RNA Secondary Structure
Prediction & Design Engine

A complete implementation of the Turner nearest-neighbor thermodynamic model — in pure Python/NumPy. No ViennaRNA. No external binaries. Just accurate RNA folding.

MFE Prediction Partition Function ΔMFE Scanning Inverse Folding Comparative Analysis
Try Live Demo → pip install rnastructure
5
Core Modules
0
External Dependencies
100%
Pure NumPy
MIT
License
Live Demo

Predict RNA Secondary Structure

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.

Input Sequence

0 nt
Examples: tRNA fragment SARS-CoV-2 5' UTR Simple stem
Minimum Free Energy
MFE Structure (dot-bracket)
Algorithm
Base Pairs
Structure Arc Diagram
Base-Pair Probability Matrix
Mountain Plot
Architecture

Five Core Modules

Each module is independent, pure Python, and uses published thermodynamic parameters from the Turner 2004 ruleset.

Module 1

MFE Prediction

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 + Nussinov
Module 2

Partition Function

McCaskill algorithm computes full partition function Z and derives base-pair probability matrices — reveals alternative folds and structural uncertainty.

McCaskill O(N³)
Module 3

ΔMFE Scanning

Systematically evaluate every single-nucleotide variant. ΔMFE > 0 = destabilizing. Used for pathogenic variant prediction, sgRNA design, and mRNA engineering.

SNV scanning
Module 4

Inverse Folding

Design an RNA sequence that folds into any target dot-bracket structure using simulated annealing. Useful for synthetic biology and mRNA vaccine design.

Simulated annealing
Module 5

Comparative Analysis

Compute tree-edit distance between structures, detect covariation at paired positions, and identify conserved structural elements across homologues.

Phylogenetics
Energy

Turner 2004 Parameters

All stacking, hairpin, interior loop, and bulge loop parameters from Mathews et al. 2004. Terminal AU/GU penalties and stable tetraloop bonus energies included.

Thermodynamic
Getting Started

Install & Use

RNAStructure 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")