- Open Access
RNA Accessibility in cubic time
Algorithms for Molecular Biology volume 6, Article number: 3 (2011)
The accessibility of RNA binding motifs controls the efficacy of many biological processes. Examples are the binding of miRNA, siRNA or bacterial sRNA to their respective targets. Similarly, the accessibility of the Shine-Dalgarno sequence is essential for translation to start in prokaryotes. Furthermore, many classes of RNA binding proteins require the binding site to be single-stranded.
We introduce a way to compute the accessibility of all intervals within an RNA sequence in (n3) time. This improves on previous implementations where only intervals of one defined length were computed in the same time. While the algorithm is in the same efficiency class as sampling approaches, the results, especially if the probabilities get small, are much more exact.
Our algorithm significantly speeds up methods for the prediction of RNA-RNA interactions and other applications that require the accessibility of RNA molecules. The algorithm is already available in the program RNAplfold of the ViennaRNA package.
The importance of RNA within living cells has been realized in the last two decades. RNA provides a layer of regulation in eukaryotes, e.g. via miRNA, but also in prokaryotes via small RNAs (sRNAs) and riboswitches. Many of these regulatory functions are mediated by RNA interactions. These interactions are mainly realized through Watson-Crick or wobble base pairing between two RNA molecules. For the initialization of these interactions, a part of the interacting molecules has to be single-stranded. The tendency to be single-stranded is thus also important for the quality of putative target sites of miRNAs , siRNAs  and most probably sRNAs. Furthermore, the accessibilities of the Shine-Dalgarno sequence and the start codons are indicators of translational efficacy . In addition, RNA accessibility will also influence the efficacy of single-strand binding proteins like HuR. As it is not known how big exactly a putative target site is, and where it is located, it is best to know the accessibilities of all possible intervals within a RNA molecule. In particular, programs like RNAup [5, 6] or IntaRNA  predict RNA-RNA interactions by computing a total binding energy δGtot = δGint + δGopen, composed of a stabilizing energy for the intermolecular duplex δGint and the cost of opening the binding sites δGopen. The opening energy can be computed from the accessibility, defined as the probability pu that the binding site is unpaired in equilibrium, via δGopen = -RT ln(pu ).
The most naive approach to compute the accessibility of a certain stretch of bases is to use a constrained folding where no base pairs are allowed within a certain stretch of bases and dividing the respective restricted partition function by the unrestricted one. This is done for example in the miRNA target predictor PITA . However, doing this for all n2 possible intervals requires (n5) time. Ding and Lawrence  proposed to compute accessibilities by stochastically sampling structures from the Boltzmann ensemble. Sampling structures can be done in (n3), but necessarily introduces sampling errors which become large if the accessibilities get small, as is necessarily the case for longer regions. In , we introduced an algorithm that computes the accessibilities of all intervals of a given length l in cubic time. This leads to a (n4) algorithm when applied to intervals of all possible lengths. In addition, the algorithm could be used as a scanning algorithm that considers only local structures of a maximum length L and runs in (nL2l).
Here we introduce an algorithm to compute the accessibilities or single-strandedness of all intervals of an RNA molecule in (n3) time and (n2) memory. This is the same complexity as the algorithm to compute the partition function, which is underlying the sampling approaches, like sfold , commonly used for this task. However, the probabilities to be accessible for different intervals are not independent. Therefore, if one is interested in more complex questions, e.g. the joint probability that two intervals are accessible, this is no way around sampling the structures of the molecules.
The first predecessor of our algorithm, not yet fully (n3), has been used in RNAup . The RNAplfold program of the ViennaRNA package  originally used the algorithm introduced in , but has been rewritten to use the efficient version of the algorithm presented below.
Since our algorithm is based on McCaskill's dynamic programming (DP) algorithm for the partition function , we briefly recapitulate the algorithm as implemented in the ViennaRNA package. As usual, we consider only (pseudo)knot-free secondary structures and use the Turner nearest-neighbor energy model . In the inside (forward) recursion, the partition function Q(i, j) of a sequence interval i, j is split into a part where i is unpaired and a part where i is paired:
Here, QB (i, j) is the partition function for a stretch between i, j given that (i, j) form a base pair and Q(a, b) = 1 if a ≥ b. A base pair can either close a hairpin loop, an interior loop (including bulge loops and stacks) or a multi(branch) loop.
Here is short for the Boltzmann factor of a hairpin loop closed by the base pair (i, j): (, with ), stands for the Boltzmann factor of the interior loop enclosed by the base pairs (i, j) and (k, l). For the multi loop contributions, QM (i, j) holds the partition function for a part of a multi loop, and QM 1(i, j) are multi loop contributions that contain exactly one stem, where i belongs to the outermost base pair of this stem.
QM 1(i, j) is needed to keep the multi loop decomposition unambiguous. The factors a, b and c are Boltzmann weighted contributions for closing a multi loop, adding a base pair or an unpaired base to the multi loop, respectively. Note that here, the size of the interior loops is limited to keep the algorithm cubic in time. See Figure 1 for a graphical representation of the recursion.
In the outside (backward) recursion (see Figure 2), the pair probabilities of a RNA molecule of length n, that is the quotient between the partition function of all states containing the base pair, Qbp (i, j) and the total partition function is computed.
Here, Qbp (i, j) is decomposed into an outer () and an inner (QB (i, j)) partition function. The computation of the outer partition function of a base pair is split into two cases: The trivial case where no base pair is enclosing the base pair (i, j), and the case where there exists at least one base pair (k, l) with k < i < j < l.
The interior loop contribution is again kept cubic by the size restriction of the interior loops. However, to keep the multi loop part of the algorithm (n3), we need to split the double sums over k and l into two sequential ((n)) sums with the help of two auxiliary arrays:
With these arrays, the multi loop part of Eqn 5 becomes:
Each entry of the arrays and can be computed in linear time. In fact, can be computed recursively in constant time. The full probability computation is then:
We now extend the McCaskill Algorithm to compute the probabilities pu (x, x + L) that a sequence interval x ... x + L contains no paired bases. As can be seen in Figure 3, an unpaired stretch x ... x + L is either not enclosed by a base pair, which again is the trivial case, or there is a base pair (i, j) enclosing the unpaired region such that i < x < x + L < j (we call the sum of these contributions Qub (x, x + L)).
The enclosing base pair (i, j) can again either close a hairpin, an interior loop or a multi loop.
To keep the computational complexity low, we use decompositions akin to the ones used for the pair probability and partition function computation. Hairpin terms are computed in two steps: First, we consider the case where the 5' base of the enclosing pair is directly adjacent to our region of interest:
Suppose the enclosing pair starts at some position i - 1 ≤ x - 1, then the 3' end of the pair, j, has to be downstream of the unpaired region, i.e. at least at position x + L + 1. This gives rise to a contribution QH (i, x + L). Summing over i yields the complete partition function for the hairpin case:
For the interior loop contributions, we do a similar, but a little more complicated decomposition. We note that our region of interest can be located either in the 5' or 3' side of the interior loop and start by computing the partition function QI 5(i, k) (QI 3(l, j)) over all structures in which i ... k (l ... j) forms the 5' (3') side of an interior loop (see Figure 3 row 3):
In analogy to QH in the hairpin case, QI (x, x + L) sums over all cases where the position x - 1 preceding our region is paired. The final summation takes care of the cases where the interior loop starts before x - 1:
The multi loop contributions can be split into three parts, depending on where within the multi loop the unpaired interval is situated. If the unpaired interval is between the closing base pair and the first stem of the multi loop (i.e. at the 5' side of the multi loop), we compute:
The terms for unpaired intervals that are located between the components of the multi loop and between the closing base pair and the last stem of the multi loop (3' side) are similar to each other:
Here, the contributions and stand for the partition function over all partial structures where x - 1 is paired with some g < x - 1, closing a multi loop component (i.e. (g, x - 1) is one of the interior pairs of the multi loop). The multi loop is closed by a pair (i, j), where i < g. The region between x ... j - 1 is a part of the multi loop not yet determined. In the case of , x ... j - 1 has to contain at least one other multi loop component. In , at least one other multi loop component exists between g and i, so that no additional multi loop component is needed.
Using the matrices from above, it is easy to see that the total computation for a single interval is linear in time:
The matrices needed for the computation of the accessibilities mostly contain terms that are computed anyway during the inside or outside recursions. These matrices can thus be committed to memory with little additional cost. The two contributions QI 5and QI 3are saved during the computation of the base pair probabilities in Eqn 4. The multi loop terms and are also computed during the computation of the pair probabilities in Eqn 5, while QM 2is saved during the forward recursion Eqn 2. The computation of the accessibilities is thus conveniently performed after the outside recursion. Some of the matrices needed for the computation of Qub can be computed recursively:
and thus require negligible additional computational costs. Due to the layout of this algorithm, it is easily possible to split the terms and e.g. find the probability of an interval to be within a hairpin loop or an interior loop. This can be useful if special types of RNA interactions, for example kissing hairpin interactions, are to be considered.
Minimum free energy version
The minimum free energy (MFE) version of this algorithm can be used to compute one optimal structure that has an unpaired stretch x ... x + L for every single interval x ... x + L. In principle, the computation of the optimal energy and the backtracking procedure of its structure are similar to the partition function version described above. Because ambiguity is of no concern, only one matrix for multi loop contributions has to be filled. Thus, after computing the "usual" matrices for RNA minimum free energy prediction (the minimum free energy F (i, j), the minimum energy given that i and j form a base pair C(i, j), and the minimum free energy for multi loop segments M (i, j)), we need to fill the following matrices:
Here, I is the energy of an interior loop. The minimum energy f a (x, x + L) with an accessible interval between x and x + L is then:
In our current implementation, computation of the structure on the outside of a base pair is done by doubling the sequence, doing a simple cofolding and backtracking j, i + n for the base pair (i, j). This leaves room for improvement, as the memory consumption is twice as high as is strictly necessary. Backtracking the f a (i, j)s gives the secondary structures to the energies.
As one possible application, the f a (i, n) subset of the secondary structures can be viewed as the minimum free energy structures during transcription of a RNA molecule. The unpaired interval in this case is regarded as the part of the molecule that is not yet transcribed. As an example, we show the ydhL Adenine riboswitch in Figure 4.
The method presented here is currently available in the RNAplfold program of the Vienna RNA package, versions 1.8.x and newer. In addition to global folding the program allows to compute accessibilities for local structures using a sliding window approach. In this case accessibilities for a region are averaged over all sequence windows containing this region. Technically, all that has to be done for the local folding version, is to replace the outside partition function by averaged versions . The computation of the s has to reflect the fact that sub-sequences of different length will appear in a different number of windows. For example, using a window size W, the contribution of to the computation of , k < i < j < l, would be:
The are subsequently also used in the computation of the accessibilities. This makes the program applicable to even the largest sequences, such as complete chromosomes or all mRNAs of an organism. Several programs, like RNAxs , IntaRNA , and RNAplex  are already using the accessibility computations implemented in RNAplfold with great success to rapidly predict accessibilities of putative target sites on mRNAs.
Kertesz M, Iovino N, Unnerstall U, Gaul U, Segal E: The role of site accessibility in microRNA target recognition. Nat Genet. 2007, 39 (10): 1278-84. 10.1038/ng2135
Tafer H, Ameres S, Obernosterer G, Gebeshuber C, Schroeder R, Martinez J, Hofacker I: The impact of target site accessibility on the design of effective siRNAs. Nat Biotechnol. 2008, 26 (5): 578-83. 10.1038/nbt1404
Wikström P, Lind L, Berg D, Björk G: Importance of mRNA folding and start codon accessibility in the expression of genes in a ribosomal protein operon of Escherichia coli. J Mol Biol. 1992, 224 (4): 949-66.
Hackermüller J, Meisner N, Auer M, Jaritz M, Stadler P: The effect of RNA secondary structures on RNA-ligand binding and the modifier RNA mechanism: a quantitative model. Gene. 2005, 345: 3-12.
Mückstein U, Tafer H, Hackermüller J, Bernhart S, Stadler P, Hofacker I: Thermodynamics of RNA-RNA binding. Bioinformatics. 2006, 22 (10): 1177-82.
Mückstein U, Tafer H, Bernhart SH, Hernandez-Rosales M, Vogel J, Stadler PF, Hofacker IL: Translational Control by RNA-RNA Interaction: Improved Computation of RNA-RNA Binding Thermodynamics. Bioinformatics Research and Development, Volume 13 of Communications in Computer and Information Science. Edited by: Elloumi M, Küng J, Linial M, Murphy R, Schneider K, Toma C. 2008, 114-127. Springer,
Busch A, Richter A, Backofen R: IntaRNA: efficient prediction of bacterial sRNA targets incorporating target site accessibility and seed regions. Bioinformatics. 2008, 24 (24): 2849-56. 10.1093/bioinformatics/btn544
Kertesz M, Iovino N, Unnerstall U, Gaul U, Segal E: The role of site accessibility in microRNA target recognition. Nat Genet. 2007, 39 (10): 1278-84. 10.1038/ng2135
Ding Y, Lawrence CE: Statistical prediction of single-stranded regions in RNA secondary structure and application to predicting effective antisense target sites and beyond. Nucleic Acids Res. 2001, 29 (5): 1034-46. 10.1093/nar/29.5.1034
Bompfünewerer A, Backofen R, Bernhart S, Hertel J, Hofacker I, Stadler P, Will S: Variations on RNA folding and alignment: lessons from Benasque. J Math Biol. 2008, 56 (1-2): 129-44.
Ding Y, Lawrence C: A statistical sampling algorithm for RNA secondary structure prediction. Nucleic Acids Res. 2003, 31 (24): 7280-301. 10.1093/nar/gkg938
Hofacker IL, Fontana W, Stadler PF, Bonhoeffer S, Tacker M, Schuster P: Fast Folding and Comparison of RNA Secondary Structures. Monatsh Chemie. 1994, 125 (2): 167-188. 10.1007/BF00818163
McCaskill JS: The Equilibrium Partition Function and Base Pair Binding Probabilities for RNA Secondary Structure. Biopolymers. 1990, 29: 1105-1119. 10.1002/bip.360290621
Turner DH, Mathews DH: NNDB: the nearest neighbor parameter database for predicting stability of nucleic acid secondary structure. Nucleic Acids Res. 2010, D280-2. 38 Database,
Tafer H, Amman F, Eggenhofer F, Stadler PF, Hofacker IL: Fast Accessibility-Based Prediction of RNA-RNA Interactions. Bioinformatics. 2011, ,
Serganov A, Yuan YR, Pikovskaya O, Polonskaia A, Malinina L, Phan AT, Hobartner C, Micura R, Breaker RR, Patel DJ: Structural basis for discriminative regulation of gene expression by adenine- and guanine-sensing mRNAs. Chem Biol. 2004, 11 (12): 1729-1741. http://www.hubmed.org/display.cgi?uids=15610857 10.1016/j.chembiol.2004.11.018
This work was funded, in part, by the austrian GEN-AU projects "regulatory non coding RNA" and "Bioinformatics Integration Network III". The authors want to thank Ronny Lorenz for thoroughly checking the indices.
The authors declare that they have no competing interests.
UM developed the first versions of the algorithm, SHB developed the current algorithm and integrated it into RNAplfold. ILH initiated and supervised the work. Regrettably, UM died during the preparation of this manuscript. She will always be remembered fondly. ILH and SHB jointly wrote and approved the manuscript.
About this article
Cite this article
Bernhart, S.H., Mückstein, U. & Hofacker, I.L. RNA Accessibility in cubic time. Algorithms Mol Biol 6, 3 (2011). https://doi.org/10.1186/1748-7188-6-3
- Partition Function
- Minimum Free Energy
- Pair Probability
- Hairpin Loop
- Base Pair Probability