RNAfold is a program that calculates secondary structures of RNAs. RNAfold reads RNA sequences from stdin, calculates their minimum free energy (mfe) structure and prints to stdout the mfe structure in bracket notation and its free energy. My understanding is that the lowest energy structure i.e. minimum free energy, is the most thermodynamical stable one. Here I use the RNAfold web server to calculate the secondary structure of a pre-miRNA.
From miRBase, download hairpin.fa and use let-7a-1 as an example:
>hsa-let-7a-1 MI0000060 Homo sapiens let-7a-1 stem-loop
UGGGAUGAGGUAGUAGGUUGUAUAGUUUUAGGGUCACACC
CACCACUGGGAGAUAACUAUACAAUCUACUGUCUUUCCUA
Input the sequence in the RNAfold web server:
Results for minimum free energy prediction
The optimal secondary structure in dot-bracket notation with a minimum free energy of -36.10 kcal/mol is given below. [color by base-pairing probability | color by positional entropy | no coloring] 1 UGGGAUGAGGUAGUAGGUUGUAUAGUUUUAGGGUCACACCCACCACUGGGAGAUAACUAUACAAUCUACUGUCUUUCCUA 1 (((((.(((..((((((((((((((((...(((.....))).((....))....))))))))))))))))..))))))))
I took the 80bp sequence and randomised it 5 times and used these random sequences as input to RNAfold to compare minimum free energies:
>random1
AACGGUACUAUUCAAUUUGGCGCUUCGGUAUAACGUAAAA
UCCUAUAUGGUUCGUUUCCUCAGAGGGAAUGUUCGACGGA
Minimum free energy of -13.40 kcal/mol
>random2
UAUGCGAGGGGUUGGGUAAUGUAGCACCACAACCGUAUCU
AUCGUAAUGCUUAUAUGUAAACUUUUAGGUUCGCUGCACA
Minimum free energy of -18.00 kcal/mol
>random3
CUAUCUGCUUAUAUAUGAAAUCGGGUUCCGCCAUCCCAAA
ACAAAGCUUGACUGCUGGGGAUUAAUGUUGUUGGUAGUGA
Minimum free energy of -15.60 kcal/mol
>random4
AAACCCAAGGCAAUCGUUACAGUCGGUGUUUGAUUGAAUG
UGAAGAGAACGCUUCCCGUUACCGCUAUUUGGGUUUAAUU
Minimum free energy of -21.90 kcal/mol
>random5
AUCUGCCACGUACCUGACCUAGAAUUAUCUUGAGUUUGAG
UCUUACACUGGGGACAGGAUAUGAUUAAGCAGUUCUAGGU
Minimum free energy of -21.41 kcal/mol
Results for thermodynamic ensemble prediction
The free energy of the thermodynamic ensemble is -37.53 kcal/mol.
The frequency of the MFE structure in the ensemble is 9.86 %.
The ensemble diversity is 5.89 .
Pre-miRNAs are processed by Dicer into the mature miRNAs creating two overhangs. The corresponding mature miRNAs are also available at miRBase.
>hsa-let-7a-5p MIMAT0000062 Homo sapiens let-7a-5p
UGAGGUAGUAGGUUGUAUAGUU
>hsa-let-7a-3p MIMAT0004481 Homo sapiens let-7a-3p
CUAUACAAUCUACUGUCUUUC
>hsa-let-7a-2-3p MIMAT0010195 Homo sapiens let-7a-2-3p
CUGUACAGCCUCCUAGCUUUCC
Below I align the 5' and 3' mature let-7a-1 miRNAs back to the pre-miRNA, also including the secondary structure prediction and delimiting the miRNA boundaries:
hairpin UGGGAUGAGGUAGUAGGUUGUAUAGUUUUAGGGUCACACCCACCACUGGGAGAUAACUAUACAAUCUACUGUCUUUCCUA 1 (((((.(((..((((((((((((((((...(((.....))).((....))....))))))))))))))))..)))))))) mirna -----UGAGGUAGUAGGUUGUAUAGUU-----------------------------CUAUACAAUCUACUGUCUUUC--- ********************** ********************* | | -------------------------------------------------------------------------- | | -----------------------------
And finally in graphical form with the 5' and 3' mature miRNAs:

This work is licensed under a Creative Commons
Attribution 4.0 International License.
Dave, what did you use to align miRNA to hairpin and visualize hairpin structure with aligned sequences?
The alignment I did by eye and the visualisation was from the RNAfold web server. Not very high throughput.
Oh, because for some time I’ve been trying to figure out how to find specific sequence (structure) withing RNAfold figure.
See my question on Biostars.org
http://www.biostars.org/p/74614/
Oh right. Yeah I took the same approach as the person who made the figure in your question; I manually drew the mature miRNAs.