# RNA secondary structure: dot-bracket notation and MFE explained

> RNA secondary structure is the set of base pairs an RNA strand forms with itself: stems, hairpins, bulges, internal loops and multiloops. Learn how dot-bracket notation encodes it, what the minimum free energy (MFE) means in the nearest-neighbor model, and how accurate thermodynamic prediction is.

Almost every transfer RNA folds into the same cloverleaf: four short double helices radiating from a central junction, three of them capped by loops. Feed the 76 nucleotides of yeast phenylalanine tRNA into [RNAfold](/app/rnafold) and it returns exactly that cloverleaf, every one of its 21 base pairs in the right place, with a free energy of -22.40 kcal/mol.

The same calculation also reports that this structure accounts for only 6% of the molecule's thermodynamic ensemble, and that the anticodon stem, the arm that reads the codon, forms with a probability of about 0.27. Both numbers are correct. The prediction is right, and it is also far less certain than a single drawing suggests. Reading RNA secondary structure well means holding both facts at once.

## What RNA secondary structure is

An RNA strand folds back on itself wherever two stretches can pair. The list of those base pairs is its secondary structure. The 3D arrangement of the resulting helices, and the contacts between them, is tertiary structure. Secondary structure carries most of the folding energy, so it is the level most prediction works at.

Three pairs count as canonical. G-C forms three hydrogen bonds and A-U two, both Watson-Crick pairs. G-U, the wobble pair, fits into a helix with little distortion and is common in natural RNAs. Yeast tRNA-Phe has one at G4-U69 in its acceptor stem. Anything else, such as A-G or U-U, is treated as a mismatch by standard prediction tools.

Paired bases stack into stems, and the unpaired nucleotides between them form loops. Each loop type is defined by how many stems close it.

| Element | What it is | In yeast tRNA-Phe |
| --- | --- | --- |
| Stem (helix) | Consecutive stacked base pairs | Acceptor stem, 7 pairs |
| Hairpin loop | Unpaired nucleotides closed by a single pair | Anticodon loop, 7 nt |
| Bulge | Unpaired nucleotides on one side of a stem only | None |
| Internal loop | Unpaired nucleotides on both sides between two stems | None |
| Multiloop (junction) | A loop from which three or more stems leave | The central four-way junction |
| External loop | Unpaired nucleotides outside every pair, including the ends | The 3′ ACCA tail |
| Pseudoknot | Pairs that cross pairs already present | G19-C56, between the D and T loops |

![Cloverleaf secondary structure of yeast tRNA-Phe with acceptor stem, D arm, anticodon arm, variable loop and T arm](/images/guides/rna-secondary-structure/trna-phe-cloverleaf.webp '**Figure 1. The minimum free energy structure of yeast tRNA-Phe.** Shaded nucleotides are paired. The dashed rung is the G4-U69 wobble pair. G19 and C56, outlined, pair with each other in the folded 3D structure; that pair crosses the D and T stems, so it is a pseudoknot and is absent from the predicted secondary structure. Layout drawn from RNAplot coordinates; sequence from PDB 1EHZ without its modified bases.')

Pseudoknots are where the simple picture breaks. In the cloverleaf, every pair sits either inside or outside every other pair, like nested parentheses. G19 in the D loop and C56 in the T loop, however, pair with each other when the tRNA folds into its L shape. Along with G18 and Ψ55 they hold the elbow of nearly all tRNAs together. Because G19-C56 crosses the D and T stems, it cannot be drawn on a flat cloverleaf without lines crossing.

## Dot-bracket notation

Dot-bracket notation writes a secondary structure as a string exactly as long as the sequence. A `.` is an unpaired nucleotide. A `(` pairs with its matching `)`, matched the way parentheses are in arithmetic: count opening brackets as you read right, and the closing bracket that brings the count back pairs with that opener.

Here is the RNAfold output for yeast tRNA-Phe, with a position ruler above it:
```text
         1         2         3         4         5         6         7
1234567890123456789012345678901234567890123456789012345678901234567890123456
GCGGAUUUAGCUCAGUUGGGAGAGCGCCAGACUGAAGAUCUGGAGGUCCUGUGUUCGAUCCACAGAAUUCGCACCA
(((((((..((((........)))).(((((.......))))).....(((((.......)))))))))))).... (-22.40)
```
The first seven `(` open the acceptor stem, and the last run of `)` closes it, so the first `(` pairs with the last `)`, at position 72. Inside it, three blocks of the pattern `(((...)))` are the three arms. Each block is one hairpin: a run of opening brackets, a run of dots for the loop, and a run of closing brackets.

| Arm | Positions | Dot-bracket | Pairs | Loop |
| --- | --- | --- | --- | --- |
| Acceptor stem | 1-7 with 66-72 | `(((((((` ... `)))))))` | 7 | Closes the multiloop |
| D arm | 10-25 | `((((........))))` | 4 | 8 nt hairpin |
| Anticodon arm | 27-43 | `(((((.......)))))` | 5 | 7 nt hairpin, anticodon GAA at 34-36 |
| T arm | 49-65 | `(((((.......)))))` | 5 | 7 nt hairpin |

The dots between the arms are the junction: positions 8 and 9, position 26, and the variable loop at 44 to 48. The four dots at the end are the single-stranded ACCA tail that carries the amino acid.

Plain parentheses can only describe nested pairs, so a pseudoknot needs a second bracket type. The extended notation allows `[]`, `{}` and `<>`, and pairs of different types may cross. Adding the G19-C56 tertiary pair to the tRNA string gives:
```text
(((((((..((((.....[..)))).(((((.......))))).....(((((..]....))))))))))))....
```
The `[` at position 19 sits inside the D arm and its `]` at position 56 sits inside the T arm, so this pair is not nested with the parentheses around it. RNAfold never writes such a string, because its algorithm only considers nested pairs.

When you run RNAfold with the partition function, a third string appears with characters such as `{`, `}`, `,` and `|`. That is a different, summary notation of how strongly each nucleotide tends to pair upstream or downstream across the whole ensemble, not a structure. A `|` marks a base that is mostly paired with partners on both sides.

To turn any valid dot-bracket string into a drawing, paste it into [RNAplot](/app/rnaplot); to count the pairs by which two structures differ, use [RNAdistance](/app/rnadistance).

## What the minimum free energy means

Folding an RNA releases free energy, and the minimum free energy (MFE) structure is the fold that releases the most. The energy is a change measured from the fully unfolded strand, so it is negative for any stable fold and more negative for a more stable one.

The nearest-neighbor model splits a structure into its stacks and loops and gives each a free energy from a table. A stack of two adjacent base pairs is stabilizing, with a value that depends on both pairs. A loop is destabilizing, by an amount that depends on its type, its size and the pairs and mismatches that close it. The total for structure $S$ is a sum:

$$
\begin{aligned}
\Delta G^{\circ}_{37}(S) ={}& \sum_{\text{stacks}} \Delta G_{\text{stack}} + \sum_{\text{hairpins, bulges, internal loops}} \Delta G_{\text{loop}} \\
&+ \sum_{\text{multiloops}} \Delta G_{\text{multi}} + \Delta G_{\text{external}}
\end{aligned}
$$

The standard parameter set is Turner 2004, the free energies at 37 °C and enthalpies collected in the Nearest Neighbor Database (NNDB) and fitted to thermodynamic measurements of short model RNAs. ViennaRNA uses it by default, and RNAstructure, the Mathews lab's program, was built around it. The enthalpies let programs rescale the energies to other temperatures.

[RNAeval](/app/rnaeval) prints this decomposition for any structure. For the tRNA cloverleaf it gives:

| Contribution | Elements | ΔG (kcal/mol) |
| --- | --- | ---: |
| Acceptor stem stacks | 6 stacks | -10.60 |
| D stem stacks | 3 stacks | -7.90 |
| D hairpin loop | 8 nt, closed by C13-G22 | +4.00 |
| Anticodon stem stacks | 4 stacks | -9.90 |
| Anticodon hairpin loop | 7 nt, closed by A31-U39 | +5.90 |
| T stem stacks | 4 stacks | -8.50 |
| T hairpin loop | 7 nt, closed by G53-C61 | +5.00 |
| Multiloop | Four-way junction | +1.30 |
| External loop | Unpaired bases next to the acceptor stem | -1.70 |
| Total | | -22.40 |

The stacks contribute -36.90 kcal/mol and the loops give back +16.20. Every hairpin is a cost the stems have to pay for. The 4-pair D stem only just covers its 8-nucleotide loop, which is why it has the lowest pair probabilities of the four stems below.

Finding the lowest sum among the astronomically many possible structures does not require trying them all. Zuker and Stiegler showed in 1981 that dynamic programming finds the optimum exactly, and modern implementations take time proportional to $N^3$ for a sequence of length $N$. The speed depends on the nesting rule. Allowing even a restricted class of pseudoknots raises the cost to $O(N^6)$ time and $O(N^4)$ memory, which is why standard tools leave them out.

## Why the MFE is not the whole story

A real RNA does not sit in one structure. At 37 °C it moves between many folds, each populated according to its free energy. McCaskill's partition function sums over all of them:

$$
\begin{aligned}
Z &= \sum_{S} e^{-\Delta G(S)/RT} \\[4pt]
P(S) &= \frac{e^{-\Delta G(S)/RT}}{Z} \\[4pt]
G_{\text{ensemble}} &= -RT \ln Z
\end{aligned}
$$

Here $R$ is the gas constant and $RT$ is 0.616 kcal/mol at 37 °C. Every structure gets a Boltzmann probability $P(S)$. The probability of a single base pair $i$-$j$ is the sum of $P(S)$ over every structure that contains it, which the same algorithm computes for all pairs at once.

For yeast tRNA-Phe the ensemble free energy is -24.13 kcal/mol, 1.73 kcal/mol below the MFE. That gap puts the probability of the exact MFE structure at $e^{-1.73/0.616} \approx 0.06$. RNAfold reports a frequency of 0.061 and an ensemble diversity, the average number of base pairs by which two structures drawn from the ensemble differ, of 23.4.

The pair probabilities show where that uncertainty lives:

| Arm | Base-pair probabilities |
| --- | --- |
| Acceptor stem, pairs 1-72 to 6-67 | 0.92 to 0.98 |
| Acceptor stem, U7-A66 | 0.61 |
| T stem | 0.39 to 0.43 |
| Anticodon stem | 0.25 to 0.27 |
| D stem | 0.20 |

The acceptor stem is nearly certain. Each of the three arms is a minority choice, even though the MFE structure contains all three.

[RNAsubopt](/app/rnasubopt) explains why: it finds 16 different structures within 1 kcal/mol of the MFE, 70 within 2 kcal/mol and 248 within 3 kcal/mol. One of them, at -22.10 kcal/mol, keeps the acceptor stem and the T arm but pairs the D region with the first half of the anticodon stem, and folds the rest into a small hairpin with the variable loop. A gap of 0.3 kcal/mol changes the relative probability of two structures by a factor of only 1.6 at 37 °C.

The MFE is also fragile to conditions. Fold the same tRNA at 25 °C instead of 37 °C and the MFE is no longer the cloverleaf. The real molecule keeps its cloverleaf, helped by 14 modified nucleotides, magnesium ions and tertiary contacts that the model does not include. Wuchty and colleagues found that in tRNAs, base modifications sharpen the ground state by making the structures closest to it in energy also similar to it in shape.

The practical reading is to treat the MFE as the best single guess and the ensemble as the evidence. A stem with pair probabilities above about 0.9 is a confident prediction. A stem at 0.2 is a hypothesis that needs other support.

Stochastic sampling, which draws structures in proportion to their probability, is another way to see the ensemble when it splits into distinct families of folds. The [RNAfold](/app/rnafold) results page explains its MEA and centroid structures, which summarize the ensemble in one string.

## How accurate thermodynamic prediction is

Prediction accuracy is measured against structures known from comparative analysis or crystallography, with two numbers. Sensitivity is the fraction of known base pairs that the prediction contains. Positive predictive value (PPV) is the fraction of predicted pairs that are in the known structure. Their harmonic mean is the F1 score. Many benchmarks count a pair as correct if it is shifted by one nucleotide on one side, which changes scores by about 2%.

With Turner 2004 parameters, free energy minimization recovered 73% ± 9% of known canonical base pairs, averaged over about 150,000 nucleotides of RNA divided into domains under 700 nucleotides.

On a large database tested by Lu and colleagues, MFE structures reached the same 73% sensitivity at 66% PPV, so about a third of predicted pairs are wrong. The correct structure is usually close by: the best of up to 750 suboptimal structures averaged 87% of known pairs, and 97% of known pairs appeared in at least one of them.

Accuracy depends strongly on the RNA family. In a 2022 benchmark of 3,865 RNAs up to 512 nucleotides from the ArchiveII set, RNAstructure's MFE prediction averaged an F1 of 0.60 over nine RNA families, ranging from 0.80 for tRNAs to 0.43 for tmRNAs. Short, compact, well-studied RNAs fold well. Long RNAs with many competing helices, or with structures shaped by proteins, fold worse.

Two kinds of extra information help. Chemical probing data, which mark nucleotides that are accessible to modification and so probably unpaired, raised the average accuracy of one test set from 67% to 76% when used as folding constraints.

Deep learning predictors report high scores, but mostly when tested on RNA families also present in their training data. Tested on families they had not seen, MXfold2 averaged an F1 of 0.51 and UFold 0.44, both below the 0.60 of the thermodynamic baseline in the same benchmark.

## Comparative methods and covariation

Evolution offers a test that thermodynamics cannot. If two positions pair in a conserved structure, a mutation at one is usually followed in related species by a compensating change at the other: a G-C pair becomes A-U, or C-G, while the helix stays intact. Positions that change together in an alignment of homologous sequences, but keep their ability to pair, are evidence of a base pair.

That covariation signal is how the ribosomal RNA secondary structures were worked out, starting in the late 1970s, from thousands of sequences. When the crystal structures of the ribosomal subunits arrived some twenty years later, nearly all of the covariation-based base pairs, including some tertiary interactions, were present in them.

[RNAalifold](/app/rnaalifold) combines both kinds of evidence. It folds a multiple sequence alignment into one consensus structure, scoring each candidate pair by the free energy it gives across the aligned sequences and by the covariation behind it. In its first benchmark on ribosomal RNAs, an alignment of only five related sequences was enough to reach more than 80% reliability. The method is only as good as the alignment, and it needs sequences divergent enough to show compensatory changes.

Covariation can also show that a proposed structure lacks support. Rivas, Clements and Eddy built R-scape to test whether covariation in an alignment exceeds what shared ancestry alone would produce. Applied to published structural models of the long noncoding RNAs HOTAIR, SRA and Xist, it found no statistically significant support for them. Low free energy alone does not establish that a structure is conserved or functional.

## RNA secondary structure tools on ProteinIQ

All of these tools run the [ViennaRNA Package](/app/viennarna) 2.7.2 with Turner 2004 parameters. [RNAfold](/app/rnafold) predicts the MFE structure of one or many sequences and, with the partition function on, adds ensemble free energy, MFE frequency, ensemble diversity and base-pair probability dot plots. [RNAsubopt](/app/rnasubopt) lists every structure within an energy range of the MFE or samples structures from the ensemble, the check that showed the tRNA's 16 rivals within 1 kcal/mol.

[RNAeval](/app/rnaeval) scores a structure you already have, such as a published model or a hypothesis from probing data, and breaks the energy into loops as in the table above. [RNAplot](/app/rnaplot) draws any dot-bracket string. For homologous sequences, [RNAalifold](/app/rnaalifold) predicts the consensus structure from an alignment, which you can build with [MAFFT](/app/mafft) or [Clustal Omega](/app/clustal-omega).

Two tools answer neighboring questions. [RNAcofold](/app/rnacofold) folds two strands together, for duplexes, guide RNAs and their targets. [RNAinverse](/app/rnainverse) runs the problem backwards and searches for sequences that fold into a target dot-bracket structure.

For choosing between these methods for a project, the [RNA secondary structure prediction workflow](/use-cases/rna-secondary-structure-prediction) compares them side by side, and [RNA 3D structure prediction](/use-cases/rna-3d-structure-prediction) covers the step from base pairs to atomic coordinates.

## Frequently asked questions

### What are the four main types of RNA secondary structure?

Most textbooks list hairpin loops, bulges, internal loops and multiloops (junctions), all closed by stems of stacked base pairs. Pseudoknots are often added as a fifth, although strictly they are where secondary structure meets tertiary structure. The [types of RNA](/guides/how-many-types-of-rna-are-there) differ in which elements dominate: tRNAs form a compact cloverleaf, while ribosomal RNAs contain dozens of helices and junctions.

### What does a dot mean in dot-bracket notation?

A dot is a nucleotide that is unpaired in that structure. It can sit in a hairpin loop, a bulge, an internal loop, a multiloop or a free end. Each `(` and its matching `)` mark the two nucleotides of one base pair, so the string always has as many characters as the sequence has nucleotides.

### Is a more negative MFE always better?

It means a more stable structure, but MFE values are sums and grow with length and G-C content, so they cannot rank sequences of different size or composition. Compare a sequence with shuffled copies of itself, or use the MFE frequency and ensemble diversity, which describe how dominant the predicted fold is.

### Can RNAfold predict pseudoknots?

No. RNAfold and the other standard dynamic programming tools only consider nested base pairs, so a pseudoknot never appears in their output. The pseudoknotted pairs are usually predicted as unpaired, or the rest of the structure adjusts around them. Algorithms that include pseudoknots exist but are restricted to certain topologies and are much slower.

### How is RNA secondary structure determined experimentally?

The most reliable evidence comes from crystal or cryo-EM structures and from comparative analysis of many homologous sequences. Chemical probing with reagents such as dimethyl sulfate marks nucleotides that are exposed, and so probably unpaired, in solution, and those data can be used as constraints during folding to improve prediction.
