This is an open-access article distributed under the terms of the Creative Commons Attribution License (
The general problem of RNA secondary structure prediction under the widely used thermodynamic model is known to be NP-complete when the structures considered include arbitrary pseudoknots. For restricted classes of pseudoknots, several polynomial time algorithms have been designed, where the
We introduce the class of canonical simple recursive pseudoknots and present an algorithm that requires
RNA pseudoknots of medium size can now be predicted reliably as well as efficiently by the new algorithm.
Pseudoknots have been shown to be functionally relevant in many RNA mediated processes. Examples are the self-splicing group I introns [
Well established algorithms for the prediction of RNA secondary structures (MFOLD [
The first route is to consider pseudoknots in full generality, but resort to an even more simplistic energy model. An
The second route is the one followed here: We retain the established thermodynamic model, but restrict to a more tractable subclass of pseudoknots. For some quite general classes of pseudoknots, polynomial time algorithms have been designed: Rivas and Eddy achieve
The new contributions reported here are the following:
• We present an algorithm
• The algorithm considers the class of simple recursive pseudoknots, further restricted by three rules of canonization. Each simple recursive pseudoknot has a canonical representative that is recognized by
• While this class is more restricted than the one of the Rivas/Eddy algorithm, practical evaluation shows that our algorithm finds the same pseudoknots, while the length range of tractable sequences is increased significantly.
• We provide an evaluation of the class of pseudoknots introduced here against known examples from the literature.
• We perform a rigorous evaluation of our algorithm on 212 sequences from PseudoBase [
It is not easy to relate the classes of pseudoknots recognized by the different algorithms mentioned above. We refer the reader to the review by Lyngsø and Pedersen [
The algorithm developed here achieves time complexity
Following the terminology of [
Thermodynamic RNA folding is implemented via dynamic programming (DP). We start with a semi-formal discussion of how to estimate the efficiency of a DP algorithm for folding (or any kind of motif search)
m = f <<< a ~~~ b ~~~ c | | | g <<< c ~~~ a
we specify that the sequence motif
What is the computational effort of locating motif
This can be improved if there is an upper bound on the size of some motif involved. If motif
In the sequel, we shall exploit another source of efficiency improvement. If the lengths of two sub-motifs are coupled somehow, say
When the search space of a combinatorial problem seems to be too complex to be evaluated efficiently, heuristics are employed. Canonization restricts the search space in a well-defined way, arguing that all the relevant solutions in the full search space have a representative that is canonical, and hence, nothing relevant is overlooked. One such technique is the purging of structures that have isolated basepairs. Here the plausibility argument refers to the underlying energy model, where base pairings without stacking have little or no stabilizing effect. This canonization does not affect efficiency, but it achieves a significant reduction of the search space (figures in [
We shall introduce three canonization rules that reduce class sr-PK to the class of
knot = knt <<< a ~~~ u ~~~ b ~~~ v ~~~ a' ~~~ w ~~~ b'
with boundaries at sequence positions
Segment
(a) Both strands in a helix must have the same length, i.e. |
Note that (b) is a stronger restriction and trivially implies (a). Under the regime of Rule 1 we may conclude:
We are left with 6 out of 8 boundaries that vary independently, and runtime is down to
The helices
We observe that the maximal length of
Thus, we are left with only four independently moving boundaries –
A subtlety arises when both helices, chosen maximally, compete for the same bases of
If two maximal helices would overlap, their boundary is fixed at an arbitrary point between them.
Let
The language of pseudoknots in class csr-PK can be defined by a simple context free grammar over an infinite terminal alphabet. Let
for arbitrary
.. [[[......{{..]]]]..........}}.
This grammar is useful to judge how different an experimentally determined structure is from class csr-PK. It is not useful for programming, since it is ambiguous and does not distinguish the fine grained level of detail required in the energy model.
A careful discussion is required to show that each simple recursive pseudoknot, if not canonical by itself, has (a) a canonical representative of (b) similar free energy.
Rule 1 (b) affects the length of helices that are considered in forming the pseudoknot. Let there be a pseudoknot between
Rule 2 is justified by the fact that the energy model strongly favours helix extension. Clearly, for each family of pseudoknots delineated by
Finally, Rule 3 requires a decision where to draw the border between two helices facing each other and competing for the same bases. An arbitrary decision here can only slightly affect free energy, as the same base pairs are stacked either on the a –
Let
Finally, let us add that the implementation described below is actually slightly more general that the "pure" csr-PK model described above: We do allow a single nucleotide bulge in either helix of a pseudoknot, which complicates the program, but does not affect asymptotic efficiency.
To evaluate how well the class csr-PK covers known pseudoknots, we considered 212 pseudoknot structures from PseudoBase. The observations are shown in Table
We find 172 simple recursive pseudoknots, and 40 of more general shapes. We find that 135 out of the 172 pseudoknots lie in csr-PK, i.e. they are their own canonical representatives. 11 more fall into the relaxed csr-PK, where we allow a single nucleotide bulge in Canonization Rule 1. Thus, we cover 146 out of 212 (68%). 26 simple recursive pseudoknot do not fall in class csr-PK, since they contain isolated basepairs, non canonical basepairs or one of the helices has not maximal extent.
Considering the remaining 20% complex pseudoknots, note that often pseudoknots in more general classes also have a good representative in csr-PK. For example, the pseudoknot of Hepatitis delta virus (Figure
There are many reasons why "the" MFE structure may only be part of what we want to know about a molecule's foldings. To deal with the problem when the optimal (knotted) structure is non-canonical, and its canonical representative is dominated by an unrelated structure, we provide two means: First of all, our algorithm is non-ambiguous, the prerequisite for a non-redundant enumeration of near-optimal structures [
The best local pseudoknot motif is included by adding two cases:
bestPK = skipleft <<< base ~~~ bestPK ||| bestPKl
bestPKl = skipright<<< bestPKl ~~~ base ||| knot
These clauses have time complexity
We first consider the predictive accuracy achieved by our approach. We have already evaluated the class csr-PK against the known pseudoknots, and we know that our algorithm correctly implements this class in its search space. What is really tested in the following is the adequacy of the current thermodynamic model (which our algorithm shares with
We test our algorithm on the set of sequences listed in Table
We compare our results to the output of
In Table
We also folded 14 randomly selected human tRNAs (third line in Table
Since we use the same energy model as
Clearly, we are able to fold sequences that are longer than
For a fair comparison, the reader should keep in mind that the extra time spent by
In the following, we discuss extensions of the implemented model and their expected computational cost
Canonization Rule 1 can be relaxed further to allow larger bulges inside the helices forming a pseudoknot. As long as their number (and hence the length difference of the two arms of a helix) is bounded by a constant, asymptotic efficiency is not affected.
Two examples of non-simple pseudoknots are shown in Figure
kiss = kss <<< a~~~u~~~b~~~v~~~a'~~~w~~~c~~~x~~~b'~~~y~~~c'
triple = trp <<< a~~~u~~~b~~~v~~~c~~~w~~~a'~~~x~~~b'~~~y~~~c'
Canonization can be applied as above, with Rule 3 becoming more sophisticated for the triple interaction case. This would yield an algorithm of runtime
RNA folding
The MFE-structure found was quite different from the "true" structure taken from the literature. We hand-coded the experimental structure and evaluated its stability in our energy model. The result was striking: the experimental structure (-132.26 kcal/mole) was significantly far from the possible minimum of free energy (-155.64 kcal/mole). So far in fact that it seems infeasible to detect the structure by scanning the space of near-optimal structures. This could be interpreted as the energy model being incorrect, but since it works well for short sequences, we suggest that this is an indication that the kinetics of folding already have a strong influence with this size of sequence, at least when pseudoknots are involved.
While we have achieved a considerable speedup for predicting small pseudoknotted structures, it seems that minimum free energy approach is not meaningful with the largest structures which it now can handle algorithmically. However, the situation changes when we are looking for particular structural motifs (see below).
We presented an algorithm
Algorithm
Many functionally important RNAs like RNase P or group-I-introns have known structures that include pseudoknots. The search for such motifs using combinatorial matchers like RNAmotif [
Using the ideas presented so far, our folding algorithm can be implemented in any language suitable for dynamic programming, say FORTRAN or C. However, we are interested in a reusable implementation that can be integrated without change in specialized folding programs called thermodynamic matchers. Therefore
In ADP, the search space of a DP problem is defined on a declarative level, specified by clauses like the ones we have already seen above. Together they form a tree grammar, defining a tree language whose elements are all the candidates in the search space. In our case, the candidates are RNA structures represented as trees. The typical DP recurrences are implicit in this description. Scoring is achieved by interpreting the operators (e.g.,
The advantage of this method is its high level of abstraction. No subscripts, no errors. The perfect separation of search space definition and evaluation allows the same grammar to be used for different kinds of analyses, e. g. folding space statistics. Relevant algorithmic properties such as non-ambiguity and efficiency can be studied on this level of abstraction. Last not least, an ADP program can be executed as is, avoiding the explicit formulation of DP recurrences (and a whole universe of programming errors). A significant, but constant factor of speedup can be gained by explicitly formulating the recurrences and implementing them in a lower level language. Automating this process is part of our current work.
We start from an ADP algorithm for folding RNA secondary structures (excluding pseudoknots) provided by Dirk Evers [
The shown code abstracts from efficiency annotation and the treatment of dangling bases. The complete algorithm is found on the ADP WWW pages [
The implementation strictly follows the outline given in the methods section, except that a considerable amount of detail related to the energy model has to be taken care of. While ADP bans the use of subscripts, our canonization ideas require to explicitly manipulate subscripts. We show the concrete pseudoknot code, but explain only the essential points. A subscript pair (
knot (i, j) = [pk energy a u b v a' w b' | k <-[i+2 .. j-1], l<-[k+1 .. j-2],
These line chooses
The function
Left to be defined are the interior structures front, middle, and back. For reasons of space, we only show the definition of
This case takes care of a potentially dangling base from the
Overall, the energy of a pseudoknot consists of stabilizing and destabilizing terms. Where possible, we use the values from the current thermodynamic energy model [
The first clause (knot) chooses
The relative effort of implementing the three variants of
The three variants of the algorithm
RG had the initial idea for the algorithm. JR developed and evaluated the software. All authors read and approved the final manuscript.
Source code of pknotsRG-mfe
Click here for file
We gratefully acknowledge the help of Dirk Evers, whose ADP code for folding unknotted structures served as a starting point for our implementation. Marc Rehmsmeier helped with some delicate algorithmic aspects. Peter Steffen acted as a semi-automated compiler of ADP code into C. We also thank Elena Rivas for discussing effects of canonization at an early stage of this work.
Class membership of 212 pseudoknots from PseudoBase. The sequences were determined by comparative sequence analysis and/or by experimental techniques. The largest class of pseudoknots is simple recursive or even canonical simple recursive.
| simple recursive pseudoknots | |||||
| csr-PK | 1-nt bulge | Rule 2 violated | isolated basepair | G-A basepair | total |
|
|
|||||
| 135 | 11 | 6 | 17 | 3 | 172 |
|
|
|||||
| complex pseudoknots | |||||
|
|
|||||
| internal loop | triple helix | four helices | kissing hairpins | large bulge | total |
|
|
|||||
| 23 | 12 | 1 | 3 | 1 | 40 |
Sequences used for testing
| Sequence | Length | BP | Reference |
| PseudoBase | variable | variable | [14] |
| 7 HIVRT | 35 | 11 | [34] |
| 14 tRNAs | 71–82 | 18–19 | |
| HDV | 87 | 32 | [32] |
| ag-HDV | 91 | 25 | [32] |
| TYMV | 86 | 24 | [35] |
| TMV (up) | 85 | 25 | [36] |
| STNV | 252 | 69 | GenBank:M64479 |
Evaluation of predictive accuracy
| RNAfold | pknotsRE | pknotsRG-mfe | ||||||||
| Sequence | BP | FP(sel.) | K | TP(sens.) | FP(sel.) | K | TP(sens.) | FP(sel.) | K | |
| PseudoBase | 13.1 | 7.1(54.2) | 4.4(61.9) | - | 9.2(72.3) | 3.8(70.7) | - | 10.2(77.3) | 3.5(74.7) | - |
| HIVRT | 11 | 4.7(42.8) | 1.7(73.3) | 1/2 | 11(100) | 0(100) | 2/2 | 11(100) | 0(100) | 2/2 |
| tRNAs | 18.7 | 9.4(50.4) | 12.5(43.0) | 0/0 | - | - | - | 9.8(52.3) | 12.2(44.5) | 0/0 |
| HDV | 32 | 12(37.5) | 16(42.9) | 2/4 | 14(43.8) | 16(46.7) | 2/4 | 29(90.6) | 2(93.5) | 3/4 |
| ag-HDV | 25 | 4(16.0) | 24(14.3) | 1/2 | 24(96.0) | 9(72.7) | 2/2 | 21(84.0) | 11(65.6) | 2/2 |
| TYMV | 24 | 17(70.8) | 6(73.9) | 1/2 | 24(100) | 1(96.0) | 2/2 | 23(95.8) | 2(92.0) | 2/2 |
| TMV | 25 | 13(52.0) | 8(61.9) | 3/6 | 13(52.0) | 9(59.1) | 3/6 | 20(80.0) | 4(83.3) | 6/6 |
| STNV | 69 | 26(37.7) | 54(32.5) | 2/8 | - | - | - | 42(60.9) | 37(53.2) | 5/8 |
Performance results Performance results for random RNA sequences and comparison to
| Length | pknotsRE | pknotsRG-mfe | pknotsRG-enf | pknotsRG-enf bounded | ||||
| Time | Mem. | Time | Mem. | Time | Mem. | Time | Mem. | |
| 40 | 17.4 | - | 0.7 | 1 | 0.9 | 2 | 0.9 | 2 |
| 80 | 21:11 | 38 | 9.5 | 5 | 8.7 | 5 | 8.8 | 5 |
| 100 | 1:23:50 | 80 | 20.0 | 8 | 32.5 | 10 | 34.5 | 9 |
| 200 | - | - | 6:46 | 36 | 8:03 | 42 | 6:33.6 | 42 |
| 300 | - | - | 33:07 | 80 | 44:58 | 102 | 20:48.4 | 90 |
| 400 | - | - | 1:48:08 | 146 | 2:28:18 | 184 | 45:28.9 | 155 |
Program sizes
| Program variant | Nonterminals | Productions | Tables |
| pknotsRG-mfe | 27 | 74 | 8 |
| pknotsRG-loc | 27 | 68 | 8 |
| pknotsRG-enf | 40 | 119 | 11 |