Email updates

Keep up to date with the latest news and content from BMC Bioinformatics and BioMed Central.

Open Access Highly Accessed Methodology article

Efficient alignment of RNA secondary structures using sparse dynamic programming

Cuncong Zhong and Shaojie Zhang*

Author Affiliations

Department of Electrical Engineering and Computer Science, University of Central Florida, Orlando, FL 32816-2362, USA

For all author emails, please log on.

BMC Bioinformatics 2013, 14:269  doi:10.1186/1471-2105-14-269

The electronic version of this article is the complete one and can be found online at: http://www.biomedcentral.com/1471-2105/14/269


Received:17 January 2013
Accepted:3 September 2013
Published:8 September 2013

© 2013 Zhong and Zhang; licensee BioMed Central Ltd.

This is an Open Access article distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/2.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

Abstract

Background

Current advances of the next-generation sequencing technology have revealed a large number of un-annotated RNA transcripts. Comparative study of the RNA structurome is an important approach to assess their biological functionalities. Due to the large sizes and abundance of the RNA transcripts, an efficient and accurate RNA structure-structure alignment algorithm is in urgent need to facilitate the comparative study. Despite the importance of the RNA secondary structure alignment problem, there are no computational tools available that provide high computational efficiency and accuracy. In this case, designing and implementing such an efficient and accurate RNA secondary structure alignment algorithm is highly desirable.

Results

In this work, through incorporating the sparse dynamic programming technique, we implemented an algorithm that has an O(n3) expected time complexity, where n is the average number of base pairs in the RNA structures. This complexity, which can be shown assuming the polymer-zeta property, is confirmed by our experiments. The resulting new RNA secondary structure alignment tool is called ERA. Benchmark results indicate that ERA can significantly speedup RNA structure-structure alignments compared to other state-of-the-art RNA alignment tools, while maintaining high alignment accuracy.

Conclusions

Using the sparse dynamic programming technique, we are able to develop a new RNA secondary structure alignment tool that is both efficient and accurate. We anticipate that the new alignment algorithm ERA will significantly promote comparative RNA structure studies. The program, ERA, is freely available at http://genome.ucf.edu/ERA webcite.

Background

Non-coding RNAs (ncRNAs) have recently been recognized as important regulators of the biological systems [1,2]. They participate in the control of alternative splicing [3], gene transcription [4] and translation [5], and mRNA localization [6]. Most of the ncRNAs exert their biological functions by folding into specific structures, which makes the study of the RNA structurome a critical step towards complete understanding of the operational mechanism of the biological system [7]. Recently, genome-wide RNA structurome analysis has led to many interesting discoveries regarding novel regulatory mechanisms. For example, analysis of the RNA structural elements in Drosophila melanogaster 3’-UTR suggests a cluster of ncRNA elements that can direct the localization of their upstream genes within the spermatids [8]. Similar studies have also been applied to the Ciona intestinalis genome for novel ncRNA family discovery [9]. With the finishing of the ENCODE [10] and modENCODE [11] projects, we expect that much more RNA transcripts will be experimentally identified. Many of these RNA transcripts may have exceptionally large sizes [12], and calls for more efficient computational tools to analyze their structures.

As more RNA transcripts are being discovered, the experimental approaches for probing ncRNA structures are also being revolutionized, allowing more accurate functional investigation through exploiting the structure-function relationship. Traditional RNA three-dimensional (3D) structure determination techniques such as X-ray crystallography, NMR and cryo-EM are expensive, making them inappropriate for genome-wide survey of RNA structures. Currently, the emerging massive parallel sequencing technology has been incorporated into the traditional chemical probing methods, making genome-wide experimental determination of RNA secondary structures possible and with low cost. Available techniques in this category include PARS [13], FragSeq [14], and SHAPE-seq [15]. The RNA secondary structures determined by these techniques are much more accurate than those predicted by pure computational methods. For example, when coupled with SHAPE-seq data, the free energy minimization approach [16] is able to predict the secondary structure of a 16S rRNA with over 95% accuracy [17]. In this case, the major purpose of this work is to develop an efficient and accurate RNA secondary structure alignment algorithm to facilitate genome-wide comparative studies of these RNA secondary structures.

There are many existing algorithms that focus on the RNA secondary structure alignment problem [18-24]. RNA secondary structures can be represented as tree structures, and the edit-distance between the tree structures can be used to represent their structural similarity [19]. Algorithms using such strategy are usually called tree editing algorithms. Using heavy path decomposition, Klein [25] improved the time complexity of the tree editing algorithm to O(l3logl). Recently, Demaine et al.[26] further improved the time complexity to O(l3) based on Klein’s algorithm. However, Jiang et al.[20] proposed to compute tree alignment distance for the comparison of trees. Algorithms that compute such a measure are called tree alignment algorithms. The tree alignment algorithm is a special case of the tree editing algorithm [27]. The tree alignment algorithm has been implemented into an RNA secondary structure alignment tool called RNAforester[21]. Both the tree editing and tree alignment algorithms rely on tree representation of the RNA structure, and make sophisticated scoring functions difficult to implement (such as the affine gap penalty for the loop regions). In addition, both tree editing and tree alignment algorithms do not treat base pairs as units of comparison, and make it difficult to implement a complete set of base-pair edit operations for RNA secondary structures editing (base-pair match, mismatch, breaking, altering, and removing; as defined by Jiang et al.[24]). We demonstrate such a problem by showing a real example from the implementation of the widely-used RNA secondary structure alignment tool RNAforester[21].

Consider that the two RNA structures shown in Figure 1 (a) are being aligned as trees. In the first RNA structure, due to the insertion of a uracil (U), an additional base pair is predicted (dashed arc, Row 1). Both structures are enclosed by G-C base pairs, and we focus on the alignment of their inner regions (boxed regions, Row 1). Following RNAforester’s extended tree representation [21], the two RNA structures can be transformed into two trees (Row 2). The ‘P’ node represents a base pair formed between the two corresponding nucleotides. Because there is no base pair in the second structure, the only allowed operations are bond breaking and base-pair deletion (Row 3). For the bond breaking operation, the base pair formed between A and U is broken, leaving them aligned to A and G in the second structure, respectively (blue boxes, Row 3). The alignment between the U (first structure) and G (second structure) introduces an unnecessary mismatch, making the alignment incorrect (blue boxes, Row 4). For the base-pair deletion operation, the entire base pair (including the two nucleotides A and U) is deleted (red box, Row 3). This operation opens two unnecessary gaps in the alignment (red boxes, Row 4), making it underestimate the real structural similarity. On the other hand, we expect to handle the mis-predicted base pairs in a more straightforward way. As shown in Figure 1 (b), we simply break the base pair interaction and disassociate the two corresponding nucleotides completely (red cross, Row 2). These two nucleotides are then treated as regular unpaired nucleotides. We can use the standard sequence alignment algorithm [28] (with affine gap penalty for better alignment quality in the unpaired regions) to evaluate the pure sequence similarity between the boxed hairpin-loop regions (Row 3). The resulting alignment contains only one gap, and correctly interprets the true structural difference between the two RNA structures (red boxes, Row 4).

thumbnailFigure 1. Comparison between the tree-based alignment approach and the general edit-distance alignment approach in handling mis-predicted base pairs. (a) The tree-based alignment algorithm in handling mis-predicted base pairs. Row 1: The arcs on the sequences indicate the base pairs (solid arc indicates real base pairs, while dashed arc indicates mis-predicted base pairs). The structure regions indicated by the boxes are being aligned. Row 2: The two RNA structures are modeled into trees according to RNAforester[21]. The ‘P’ node was introduced to represent a base pair. Row 3: Either the bond breaking or the base-pair deletion operation is taken. The blue boxes indicate the aligned nucleotides in the bond-breaking case. The red box indicates the base pair (including its nucleotides) being deleted in the base-pair deletion case. Row 4: The corresponding alignments resulted from both operations. The boxes in the alignments correspond to those in the RNA structure trees. Neither of the alignments is correct. (b) The general edit-distance alignment algorithm in handling mis-predicted base pairs. Row 1: The same RNA structures are being aligned. Row 2: The base-pair interaction is deleted (red cross), leaving two free nucleotides. Row 3: The sequence similarity between the boxed regions is assessed using a traditional sequence alignment algorithm [28]. Row 4: The corresponding alignment is generated correctly. The boxes correspond to nucleotides that form the mis-predicted base pair.

The above example clearly shows the limitation of the implementation of the tree-based RNA secondary structure alignment algorithm RNAforester. Implementing the complete set of base-pair edit operations under the tree representation appears to be not a trivial task. Therefore, we propose to implement the general edit-distance alignment approach where all edit operations can be implemented naturally. To guarantee that the implementation is as efficient as the Demaine et al.’s algorithm (O(l3)), we incorporate the sparse DP technique into a simultaneous alignment and folding (SAF) algorithm RNAscf[29] and restrict its input to fixed RNA secondary structures (recall that the general edit-distance alignment algorithm is a restricted case of the SAF algorithm). Using this technique, we can reduce the original time complexity by reducing a factor from n2 to z, where n is the number of base pairs in the fixed RNA structures and n<z<n2. Under the assumption of the polymer-zeta property of RNA molecules [30], it is expected that zn2 and even zO(n). In this case, the new general edit-distance RNA structure-structure alignment algorithm will have a time complexity of O(zn2+zl2). The new time complexity has an expected cubic (z=O(n)=O(l)) growth behavior, and is the same as Demaime et al.’s algorithm [26]. In addition, we also devise a novel online pruning technique to further speedup the new algorithm, which deletes obsolete candidates on-the-fly. By combining both speedup techniques, the new RNA structure alignment algorithm is capable of comparing RNA secondary structures efficiently and accurately.

We have implemented the proposed RNA structure alignment algorithm into a program called ERA (Efficient RNA Alignment). The benchmark results showed that ERA has the expected O(zl2) time complexity. We showed the O(zl2) time complexity of ERA through aligning Rfam [31] RNA structures that were carefully chosen to represent a wide rage of input sizes. We also used a BraliBase II [32] benchmark to compare tools ERA, LocARNA and RNAforester when aligning RNAs with known structures. Nearly identical alignment quality can be observed for the general edit-distance alignment tools ERA and LocARNA, while both of them are more accurate than the tree alignment algorithm RNAforester. Finally, we also concluded that ERA is efficiently implemented by observing an average of 10 fold speedup over LocARNA, and RNAforester in terms of real RNA structure alignments. Based on these results, we confirmed that the sparse DP technique and the online pruning technique are successfully incorporated into the original RNAscf algorithm. We also anticipate that ERA will become an important bioinformatics tool for comparative RNA structure analysis.

Methods

In this section, we will present a novel general edit-distance RNA structure alignment algorithm by incorporating the sparse DP technique into the RNAscf algorithm. RNAscf was originally designed to identify the consensus structure between two RNA sequences. It guides the DP process though stacks and has a time complexity of O(n4+n2l2). Comparing to LocARNA (which has a time complexity of O(l4+n2l2)), the indexing scheme used by RNAscf makes it easier to incorporate the sparse DP technique, which aims to reduce the size of n instead of l. In addition to the sparse DP technique, we will also present an online pruning technique, which tries to reduce the search space of the algorithm as the DP proceeds. Through combining these two speedup techniques, the novel algorithm will have an expected O(zl2) time complexity, where n<zn2.

The Methods section is organized as follows: In Section ‘Preliminaries and definitions’, we will give the basic definition of RNA structures and the RNA alignment problem. In Section ‘The original O(n4+n2l2) algorithm’, we will reintroduce the RNAscf algorithm as a basis to understand the novel algorithm that is developed in this work. In Section ‘Triangular inequality and optimal pair matchings’, we will present the triangular inequality in RNA alignment with necessary proofs, which serves as a theoretical foundation for the sparse DP technique. In Section ‘Detection of optimal pair matchings’, we will further discuss the implementation details of incorporating the sparse DP technique. In Section ‘A new algorithm with cubic time complexity’, we will present the novel RNA alignment algorithm with the incorporation of the sparse DP technique. In Section ‘Online pruning of optimal pair matchings’, we will present the online pruning technique as an additional speedup step to the novel algorithm. Finally, in Section ‘Pseudo-code’, we will summarize the new algorithm using pseudo-code that can be directly implemented.

Preliminaries and definitions

We will begin with the introduction of the basic symbols and notations. The secondary structure of an RNA A of length lA is represented by a set of base pairs in A, denoted as <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M1','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M1">View MathML</a>. A base pair <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M2','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M2">View MathML</a> is an interaction formed between two nucleotides in the sequence of A, whose positions are denoted by l(pA) and r(pA) (without loss of generality, we assume l(pA)<r(pA)). The base pair pA can also be represented as (l(pA),r(pA)). The base pairs are partially ordered by the increasing order of their ending nucleotides, i.e. <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M3','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M3">View MathML</a> if and only if <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M4','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M4">View MathML</a>. Since we do not consider RNA ensembles, no crossing base pair is allowed. That is, we do not allow <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M5','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M5">View MathML</a>. The two base pairs <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M6','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M6">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M7','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M7">View MathML</a> are either enclosing or juxtaposing to each other. The base pair <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M8','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M8">View MathML</a> encloses <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M9','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M9">View MathML</a> if <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M10','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M10">View MathML</a>, denoted as <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M11','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M11">View MathML</a>. The base pair <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M12','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M12">View MathML</a> juxtaposes to and before<a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M13','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M13">View MathML</a> if <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M14','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M14">View MathML</a>, and is denoted by <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M15','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M15">View MathML</a>.

We also define loop regions (i.e. hairpin loop, internal/bulge loop, and multi-branch loop) whose sequence similarities are assessed by the alignment. The loop regions can be viewed as the unpaired regions in the RNA sequence that are segregated by the paired nucleotides. Let A[ ij] denote a continuous sequence region in RNA A, which begins with the ith nucleotide and ends with the jth nucleotide. Define L(pA) as the sequence A[ l(pA)+1…r(pA)-1] (hairpin loop). If <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M16','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M16">View MathML</a>, define <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M17','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M17">View MathML</a> as the sequence <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M18','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M18">View MathML</a>, and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M19','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M19">View MathML</a> as the sequence <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M20','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M20">View MathML</a> (internal or bulge loop). If <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M21','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M21">View MathML</a>, define <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M22','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M22">View MathML</a> as the sequence <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M23','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M23">View MathML</a> (multi-branch loop).

The structure alignment between RNA A and B is the optimal matching between their base-pair sets <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M24','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M24">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M25','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M25">View MathML</a> and the corresponding loop similarities. In other words, the alignment between RNAs A and B is a one-to-one binary relation<a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M26','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M26">View MathML</a> on the base-pair sets <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M27','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M27">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M28','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M28">View MathML</a>. To ensure that the alignment will not lead to conflicting base-pair matchings, for any <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M29','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M29">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M30','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M30">View MathML</a>, either <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M31','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M31">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M32','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M32">View MathML</a>, or <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M33','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M33">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M34','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M34">View MathML</a>. Given the alignment <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M35','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M35">View MathML</a>, the matched base pairs in <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M36','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M36">View MathML</a> will partition the RNA sequences A and B into two sets of loop regions, <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M37','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M37">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M38','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M38">View MathML</a>, respectively. The sequence similarity between these two sets of loop regions is added to compute the overall alignment score. The optimal alignment is the relation <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M39','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M39">View MathML</a> that maximizes overall alignment score M that combines both structure and sequence similarities:

<a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M40','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M40">View MathML</a>

(1)

Here, the first term is the summation of all structural similarities (Sstr) between the annotated base pairs. The structural similarity score for base-pair substitution is set using the RIBOSUM matrix [33], denoting such base-pair substitution matrix as R. We do not give penalty for base-pair deletion or insertion, as we may expect incorrectly predicted base pairs in the input RNA structures. The second term is the summation of the sequence similarities (Sseq) on all loop (unpaired) regions that are determined by base-pair matchings in<a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M41','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M41">View MathML</a>. The sequence similarity between two sequence regions is computed as traditional sequence alignment, with D as a 4-by-4 matrix that accounts for nucleotide substitution (set using the RIBOSUM matrix), g as the gap opening penalty, and e as the gap extension penalty [34] (g and e are both set to negative values and g<e). The weights w1 and w2 are used to balance the structural and sequence contribution to the overall alignment score, and we set w1>w2 to emphasize structural similarity. To simplify the expressions, in the rest of this article, we assume that w1 has been multiplied to all structural similarity terms (R), and w2 has been multiplied to all sequence similarity terms (D, g, and e).

We will now define the matrices that are used by the DP algorithm. Denote M[ pA,pB] as the optimal structure alignment score between the regions enclosed by pA and pB, given that pA is matched with pB. Denote Mh[ pA,pB] as the optimal alignment score when the matching of pA and pB corresponds to a hairpin loop in the consensus structure. Similarly, Ml[ pA,pB] stores the optimal alignment score when the matching of pA and pB corresponds to an internal, a bulge, or a multi loop in the consensus structure. Assume that <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M42','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M42">View MathML</a>, and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M43','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M43">View MathML</a>, Ml[ pA,pB] can be computed by referring to the matrix <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M44','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M44">View MathML</a>, which stores the optimal alignment score between the juxtaposed base-pair chains (each chain contains at least one base pair) that end with <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M45','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M45">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M46','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M46">View MathML</a>, respectively. The optimal alignment between A and B can be retrieved from <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M47','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M47">View MathML</a>, where <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M48','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M48">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M49','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M49">View MathML</a> are pseudo base pairs such that <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M50','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M50">View MathML</a>, <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M51','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M51">View MathML</a>, and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M52','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M52">View MathML</a>[29].

The original O(n4+n2l2) algorithm

In this section, we briefly reintroduce the RNAscf[29] algorithm for RNA consensus structure prediction as a basis for understanding the novel algorithm developed in this work. The recursive functions for the RNAscf algorithm are outlined as follows:

<a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M53','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M53">View MathML</a>

(2)

<a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M54','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M54">View MathML</a>

(3)

<a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M55','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M55">View MathML</a>

(4)

<a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M56','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M56">View MathML</a>

(5)

In these recursive functions, Sstr denotes the structural similarity between two base pairs pA and pB, Sseq denotes the sequence similarity between two unpaired regions, and G indicates the gap penalty for completely deleting the corresponding unpaired region. Note that G(|L|)=g+|L|∗e if |L|>0, and G(|L|)=0 otherwise. The base pair set <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M57','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M57">View MathML</a> contains all base pairs that are directly before and juxtaposed to <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M58','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M58">View MathML</a>. In other words, if <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M59','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M59">View MathML</a>, then there is no such base pair <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M60','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M60">View MathML</a>, such that <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M61','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M61">View MathML</a>. In most real scenarios, <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M62','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M62">View MathML</a> is considered as a constant [29,35]. This chaining technique based on the <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M63','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M63">View MathML</a> set enables us to handle the multi-loop case efficiently, by only considering <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M64','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M64">View MathML</a> cases when computing Mc.

Recall that the input RNA sequences have an average length of l and form an average of n base pairs. This algorithm can be computed with an expected time complexity of O(n4+n2l2). To see the time complexity, first note that all sequence similarity scores that are referred in the recursive functions can be computed within O(n2l2) time. Because all loop regions are segregated by base pairs, the number of loop regions is clearly bounded by O(n). Therefore, there are O(n2) combinations of loop matchings, and computing each matching requires O(l2) time using a standard sequence alignment algorithm [34]. To this point, we assume all sequence similarities are computed using O(n2l2) time, and are stored in a matrix for constant-time lookup. Now, observe that this algorithm computes the optimal alignment by filling up the DP table M, which contains O(n2) values. Computing each value in the matrix M depends on the corresponding values of Mh, Ml, and Mc. The computation of values in matrix Mh can be finished in a constant time due to the pre-computed sequence similarities. The computation of Ml requires O(n2) time, as determined by the necessity of traversing all possible combinations i and i (see Equation 4). Finally, Mc can also be expected to be computed in a constant time, as <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M65','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M65">View MathML</a> is assumed to be a constant. In this case, the computation of matrix M requires O(n4) time. Adding up the time required to pre-compute all sequence similarities of the loops, the overall time complexity for this algorithm thus becomes O(n4+n2l2).

Triangular inequality and optimal pair matchings

The triangular inequality property servers as the theoretical foundation for the sparse DP technique, which saves search space while maintaining the global optimality. For computational RNA studies, this technique has been used in RNA folding [30], RNA consensus folding (SAF) [36,37], as well as RNA-RNA interaction prediction [38] applications. In this work, our aim is to bring this technique into the RNA structure alignment application, where fixed RNA structures are considered instead of RNA structure ensembles.

Consider the alignment between the RNA secondary structures within the two regions A[ ij] and B[ ij] (see Figure 2 (a)). Denote M[ i,j;i,j] as the optimal alignment score for such alignment. The triangular inequality can be summarized using the following inequality:

<a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M66','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M66">View MathML</a>

where ik<j and ik<j. This is because the partitions of the regions A[ ij] and B[ ij] at positions k and k, respectively, do not necessarily compatible with the optimal alignment.

thumbnailFigure 2. Illustration of the triangular inequality property. (a) Triangular inequality property of RNA secondary structure alignment. The horizontal lines indicate RNA sequences A and B. The dashed arcs are the pseudo base pairs added to the specific nucleotides, while the shaded areas define the correspondence between regions that are being aligned. (b) Alternative paths that go through either pA and pB, or <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M67','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M67">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M68','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M68">View MathML</a>. The two shadings (dark and light gray) along the arcs represent the two alternative paths.

To simplify the expression of the triangular inequality property, we define a number of pseudo base pairs to indicate specific regions of interest. A pseudo base pair is a void interaction, such that the structural similarity between any two pseudo base pairs is defined to be 0. For instance, let p and p be two arbitrary pseudo base pairs, we will have Sstr(p,p)=0. The pseudo base pairs are only used for the sake of representational simplicity, and are not required for the implementation of the algorithm. Define a pseudo base pair pA=(i,j) and a pseudo base pair pB=(i,j). In this case, the optimal alignment score between the regions A[ ij] and B[ ij], i.e. M[ i,j;i,j], can be rewritten as M[ pA,pB]. Similarly, define pseudo base pairs <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M69','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M69">View MathML</a>, <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M70','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M70">View MathML</a>, <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M71','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M71">View MathML</a>, and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M72','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M72">View MathML</a> (see Figure 2 (a)). The triangular inequality can be simplified using the following observation:

Observation 1

<a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M73','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M73">View MathML</a>

.

Using Observation 1, we can detect potential redundant computations in the original algorithm. Consider the structural configurations shown in Figure 2 (b), and assume that the base pairs pA and pB are being aligned at the current stage. Let <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M74','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M74">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M75','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M75">View MathML</a> be arbitrary base pairs such that <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M76','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M76">View MathML</a>. Note that <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M77','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M77">View MathML</a> may also represent a pseudo base pair in order to consider an arbitrary subregion enclosed by pA. Define pseudo base pairs <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M78','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M78">View MathML</a>, <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M79','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M79">View MathML</a>, <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M80','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M80">View MathML</a>, <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M81','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M81">View MathML</a>, <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M82','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M82">View MathML</a>, and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M83','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M83">View MathML</a>. Pseudo base pairs are also added to B symmetrically (see Figure 2 (b)). We can then prove Lemma 1 using Observation 1:

Lemma 1

If <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M84','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M84">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M85','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M85">View MathML</a>, such that <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M86','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M86">View MathML</a>, then <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M87','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M87">View MathML</a>.

Proof

<a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M88','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M88">View MathML</a>

The first inequality is a direct application of Observation 1, and the second inequality is specified in the condition of Lemma 1.

Because <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M89','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M89">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M90','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M90">View MathML</a> are arbitrary base pairs, Lemma 1 implies that the matching between pA and pB is guaranteed to be suboptimal. That is, the overall alignment score, given that pA matches with pB, is always lower than that when assuming they do not match (as the matching of pA and pB is conflicted with the matching of <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M91','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M91">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M92','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M92">View MathML</a>, as well as the matching of <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M93','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M93">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M94','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M94">View MathML</a>). In this case, we can devise the DP algorithm to bypass the redundant references to the scenarios where pA matches pB. Conversely, for the implementation of this idea, the DP algorithm will refer to the scenarios of matching pA and pB only when the condition specified in Lemma 1 is NOT satisfied. These necessary base-pair matchings are called the Optimal Pair Matchings (OPMs). If the matching of pA and pB is an OPM, we denote this OPM as oA,B. Similarly, we represent the OPM formed by base pairs <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M95','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M95">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M96','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M96">View MathML</a> as <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M97','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M97">View MathML</a>. The new RNA alignment algorithm will maintain an OPM list <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M98','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M98">View MathML</a>, which is modified online as the DP proceeds, so as to include newly identified OPMs and remove obsolete OPMs (which will be discussed in Section ‘Online pruning of optimal pair matchings’). If we assume that the RNA molecules have the polymer-zeta property [30], restricting the search space of the DP using the OPM list <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M99','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M99">View MathML</a> will reduce the time complexity of the RNA alignment algorithm to O(zl2) (as will be discussed in Section ‘A new algorithm with cubic time complexity’).

Detection of optimal pair matchings

In the previous section, we have proved that Lemma 1 can be used to detect the OPMs and save redundant computations. In this section, we will briefly discuss how it will be implemented. Lemma 1 states that if the alignment score assuming pA matches pB (M[ pA,pB]) is higher than the alignment score assuming pA does not match pB, the matching between pA and pB is an OPM. Therefore, to detect the OPMs, we need to compute two alignment scores, i.e. the one when assuming pA matches pB and the one when assuming pA does not match pB.

Based on previous definition, the first alignment score is computed as M[ pA,pB]. In this case, we only need to compute the second alignment score. However, computing the second alignment score (assuming pA does not match pB) is difficult. Instead, we can compute the overall alignment score without assuming any restrictions. Apparently, the overall alignment score includes both cases disregarding whether pA matches with pB. Therefore, if M[ pA,pB] is greater than or equal to such an overall optimal alignment, it is guaranteed to be greater than the alignment score when assuming pA does not match pB, and ipso facto the matching of pA and pB is an OPM.

Recall that the alignment score M[ pA,pB] corresponds to the case where pA matches with pB, and therefore it can be decomposed as the sum of two parts: the structure similarity between the two base pairs themselves Sstr(pA,pB), and the optimal alignment score between the regions A[ l(pA)+1…r(pA)-1] and B[ l(pB)+1…r(pB)-1] without any restrictions. In this case, define two pseudo base pairs <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M100','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M100">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M101','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M101">View MathML</a>, then <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M102','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M102">View MathML</a> can also be decomposed as the sum of two parts: <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M103','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M103">View MathML</a>, and the optimal alignment score between the regions A[ l(pA)…r(pA)] and B[ l(pB)…r(pB)] without any restrictions. Note that <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M104','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M104">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M105','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M105">View MathML</a> are both pseudo base pairs, and thus based on the definition, we have <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M106','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M106">View MathML</a>. Therefore, <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M107','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M107">View MathML</a> is exactly the overall alignment score we need to detect the OPMs.

In this case, based on Lemma 1, if <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M108','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M108">View MathML</a>, we will consider the matching of pA and pB as an OPM, and add the OPM oA,B to the OPM list <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M109','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M109">View MathML</a>. The overhead for detecting the OPM is that we need to double the computation for each combination of pA and pB. However, such overhead will not raise the time complexity, and it is worthy as it will lead to a more significant speedup of the algorithm. In the following section, we will devise a new algorithm by assuming that the OPM list <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M110','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M110">View MathML</a> is available.

A new algorithm with cubic time complexity

In this section, we introduce a new general edit-distance RNA structure alignment algorithm, which improves the original RNAscf algorithm based on Lemma 1 and has a time complexity of O(z(n2+l2)). Here, z is the size of the OPM list <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M111','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M111">View MathML</a>, and we expect that zO(n) when assuming polymer-zeta property [30]. If we also assume O(n)=O(l) (with fixed input RNA structures or efficiently pruned RNA structure ensembles), the overall time complexity of the new algorithm becomes O(zl2).

The new algorithm is developed based on the RNAscf algorithm [29]. Therefore, we adopt the same definition and notation as introduced in Section ‘Preliminaries and definitions’, as well as the similar recursive functions style used in Section ‘The original O(n4+n2l2) algorithm’. Because the computations of M[ pA,pB] and Mh[ pA,pB] are boundary cases for the algorithm and are directly computed without referring to previous alignment results, the recursive functions for computing them are exactly the same as in the original algorithm:

<a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M112','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M112">View MathML</a>

(6)

<a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M113','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M113">View MathML</a>

(7)

The computation of Ml[ pA,pB], on the other hand, refers to the previous alignment results that assumes <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M114','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M114">View MathML</a> matches <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M115','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M115">View MathML</a> (see Equation 4). Using Lemma 1, it is clear to see that instead of traversing all combinations of <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M116','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M116">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M117','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M117">View MathML</a>, we only need to consider the cases when the matching of <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M118','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M118">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M119','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M119">View MathML</a> is an OPM:

<a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M120','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M120">View MathML</a>

(8)

Similarly, for the computation of <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M121','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M121">View MathML</a>, we need to refer to the scenarios where <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M122','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M122">View MathML</a> matches <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M123','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M123">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M124','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M124">View MathML</a> matches <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M125','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M125">View MathML</a>. The matching of <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M126','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M126">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M127','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M127">View MathML</a> is guaranteed to be an OPM, as ensured by Equation 8. Therefore, we only need to modify Equation 5 to ensure that the matching of <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M128','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M128">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M129','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M129">View MathML</a> is an OPM:

<a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M130','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M130">View MathML</a>

(9)

Here, the set <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M131','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M131">View MathML</a> contains all OPMs that are directly before the OPM <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M132','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M132">View MathML</a>. The <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M133','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M133">View MathML</a> set regarding the OPMs is defined as the follows. If an OPM <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M134','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M134">View MathML</a>, then either <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M135','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M135">View MathML</a> or <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M136','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M136">View MathML</a>.

Recall that the time complexity of the original algorithm is O(n4+n2l2). The first term O(n4) results from O(n2) computations by traversing all combinations of pA and pB (see Equation 2) and O(n2) time for computing Ml (see Equation 4). In the new algorithm, we introduce the OPM constraint to Equation 8 and Equation 9, and thus reduce the time complexity for computing Ml from O(n2) to O(z). In this case, the first term O(n4) of the original time complexity can be reduced to O(zn2).

The second term O(n2l2) in the original time complexity results from computing the sequence similarities between all loop regions. Note that all loop similarities required for computing Ml (Equation 8) and Mc (Equation 9) are associated with OPMs. For example, in Equation 8, all the loops are defined according to <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M137','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M137">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M138','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M138">View MathML</a>, whose matching is expected to be an OPM. And in Equation 9, all the loops are defined according to <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M139','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M139">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M140','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M140">View MathML</a>, as well as <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M141','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M141">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M142','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M142">View MathML</a>, where both of these matchings are assumed to be OPMs. In this case, we do not need to compute loop similarities for all O(n2) base-pair combinations, instead we only need to compute the loop similarities that are associated with the OPMs. In this case, the time complexity for computing the sequence similarities between all loops that are required by the computation of Ml and Mc can be finished in O(zl2) time.

The only exception for the sequence similarity computation is the hairpin loop similarity Sseq(L(pA),L(pB)), which is required for computing Mh (Equation 7). The computation of Mh is not constrained by the OPM list, and therefore O(n2l2) time is still required. To resolve this issue, we observe that most of the RNA structure alignment algorithms emphasize the structure similarity other than sequence similarity (w1>w2 in Equation 1). In this case, if there exist some base pairs within the regions enclosed by pA and pB to be matched, we can expect that Ml[ pA,pB]>Mh[ pA,pB] in Equation 6. In this case, to avoid the unnecessary computation of Mh[ pA,pB], we can derive an upper bound <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M143','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M143">View MathML</a>, which satisfies <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M144','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M144">View MathML</a> and can be estimated in unit time. Note that if <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M145','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M145">View MathML</a>, we are sure that Ml[ pA,pB]>Mh[ pA,pB] by transition, and thus can save the computation of Mh[ pA,pB]. The upper bound <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M146','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M146">View MathML</a> can be easily derived by assuming maximum number of nucleotide matchings and minimum number of gaps:

<a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M147','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M147">View MathML</a>

(10)

where dmax is the highest score in the 4-by-4 nucleotide substitution matrix D, and I is a boolean variable that is set to 1 if |L(pA)|≠|L(pB)| and set to 0 otherwise. For the computation of each M[ pA,pB], we first estimate the upper bound <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M148','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M148">View MathML</a> in a unit time, and then compute Ml[ pA,pB] in O(z) time. By comparing these two values, we will determine whether the computation of Mh[ pA,pB] is necessary. The computation of Mh[ pA,pB] is only necessary when there are only a few base pair enclosed by pA and pB to be matched. Such condition implies the scenarios that either pA or pB is a real hairpin loop in the RNA structures, whose number is bounded by O(n). Overall, the hairpin loop similarity matrix Mh can be computed in O(nl2) time, and the overall time complexity of this algorithm is thus O(z(n2+l2)).

Online pruning of optimal pair matchings

In the previous sections, we have presented our approaches for detecting OPMs and building an OPM list <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M149','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M149">View MathML</a>, as well as a more efficient algorithm that is developed based on <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M150','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M150">View MathML</a>. Time complexity analysis of the algorithm claims that O(z(n2+l2)) time is sufficient for this new algorithm. The size of the OPM list <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M151','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M151">View MathML</a>, i.e. z, thus becomes an important factor that determines the efficiency of the novel algorithm. Under the current algorithmic setup, as well as other similar works that implement a candidate list [30,37], z continuously grows as the algorithm proceeds. In this case, it is desirable to devise an online pruning technique, which can remove the obsolete OPMs from <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M152','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M152">View MathML</a>, and thus achieve further speedup of the algorithm.

In this section, we will present such an online pruning technique to reduce the size of the OPM list <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M153','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M153">View MathML</a>. The intuition of this online pruning technique comes from the following observation. The RNA structures are primarily stabilized by a number of helices, or perfectly stacked base pairs. If <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M154','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M154">View MathML</a> is perfectly stacked on <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M155','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M155">View MathML</a>, then <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M156','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M156">View MathML</a>, and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M157','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M157">View MathML</a>. Consider the alignment between two helices, where each one of them contains m+1 perfectly stacked base pairs. Assume that the first helix contains base pairs <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M158','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M158">View MathML</a>, and the second helix contains base pairs <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M159','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M159">View MathML</a>. Based on Lemma 1, there will be at least m OPMs detected from such alignment, i.e. <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M160','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M160">View MathML</a>. Apparently, maintaining all these m OPMs is unnecessary, as these base pairs should be aligned together as two complete helices, rather than be aligned separately as two sets of individual base pairs. In this case, maintaining only one OPM, i.e. <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M161','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M161">View MathML</a>, is sufficient to represent such an alignment. The other m OPMs become obsolete as soon as the OPM <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M162','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M162">View MathML</a> is detected, and can be removed from the OPM list <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M163','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M163">View MathML</a> to improve computational efficiency. In the following paragraphs, we will extend this idea to consider all situations in addition to the perfectly stacked scenario, as well as give formal description of this technique and related proofs.

We will demonstrate the major idea of our novel online OPM pruning technique using Figure 2 (b). Imagine that at the current stage, M[ pA,pB] has just been computed and oA,B has been identified as an OPM, where <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M164','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M164">View MathML</a> is an arbitrary OPM that has been previously identified and is enclosed by oA,B (<a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M165','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M165">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M166','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M166">View MathML</a>). Our aim is to estimate whether the detection of the OPM oA,B will make <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M167','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M167">View MathML</a> obsolete. Let <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M168','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M168">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M169','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M169">View MathML</a> be arbitrary base pairs such that <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M170','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M170">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M171','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M171">View MathML</a>. The regions enclosed by <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M172','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M172">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M173','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M173">View MathML</a> can be partitioned using at least one of the following ways: <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M174','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M174">View MathML</a> (which is indicated by dark gray in Figure 2 (b)) and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M175','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M175">View MathML</a> (which is indicated by light gray in Figure 2 (b)). If the corresponding score for the first path is higher than the second, <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M176','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M176">View MathML</a> will not be referred to by any future matching between arbitrary base pairs <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M177','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M177">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M178','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M178">View MathML</a>, and thus making the OPM <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M179','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M179">View MathML</a>obsolete. In this case, the OPM <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M180','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M180">View MathML</a> can be removed from <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M181','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M181">View MathML</a>.

We can summarize the criterion for removing <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M182','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M182">View MathML</a> as an obsolete OPM using the following inequality:

<a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M183','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M183">View MathML</a>

which can be rewritten as:

<a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M184','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M184">View MathML</a>

To utilize such criterion, we need to have access to all values included in the above inequality. However, we only know the values at the left hand side of the inequality (M[ pA,pB] and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M185','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M185">View MathML</a>), while the other values at the right hand side are unknown. This is because the definitions of these pseudo base pairs are determined by <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M186','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M186">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M187','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M187">View MathML</a>, which are arbitrary base pairs that have not yet been computed by the DP algorithm. To solve this issue, observe that the score <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M188','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M188">View MathML</a> is strongly related to the regions <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M189','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M189">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M190','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M190">View MathML</a>, and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M191','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M191">View MathML</a> is strongly related to the regions <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M192','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M192">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M193','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M193">View MathML</a>. Note that the regions <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M194','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M194">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M195','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M195">View MathML</a> can be determined when pA and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M196','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M196">View MathML</a> are known, which makes the estimation of their impact on future alignments possible (similarly for the regions <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M197','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M197">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M198','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M198">View MathML</a>). In this case, we can develop two upper bounds <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M199','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M199">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M200','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M200">View MathML</a>, such that:

<a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M201','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M201">View MathML</a>

In this case, if <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M202','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M202">View MathML</a>, we are sure that the criterion for characterizing <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M203','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M203">View MathML</a> as an obsolete OPM will be satisfied, and we will be able to remove <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M204','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M204">View MathML</a> from <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M205','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M205">View MathML</a> immediately.

Now, we can discuss the details for setting up the upper bounds <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M206','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M206">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M207','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M207">View MathML</a>. Because <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M208','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M208">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M209','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M209">View MathML</a> are defined symmetrically, we only discuss the computation of <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M210','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M210">View MathML</a>. Note that the upper bound <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M211','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M211">View MathML</a> needs to satisfy the condition <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M212','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M212">View MathML</a>. Clearly, the difference between <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M213','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M213">View MathML</a> directly comes from concatenating the region <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M214','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M214">View MathML</a> to the region <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M215','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M215">View MathML</a>, as well as concatenating the region <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M216','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M216">View MathML</a> to the region <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M217','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M217">View MathML</a>. The best case scenario for such an operation, is to assume that the concatenation of the regions <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M218','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M218">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M219','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M219">View MathML</a> will result in as many new base-pair and nucleotide matches as possible.

Assume that there are <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M220','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M220">View MathML</a> base pairs that are annotated in the region <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M221','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M221">View MathML</a>, and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M222','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M222">View MathML</a> base pairs that are annotated in the region <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M223','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M223">View MathML</a>. Also assume the maximum base-pair substitution score in the RIBOSUM matrix R is rmax. By concatenating the regions <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M224','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M224">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M225','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M225">View MathML</a>, we introduce at most <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M226','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M226">View MathML</a> more base-pair matchings to the alignment indicated by <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M227','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M227">View MathML</a>. This implies the maximum structure alignment score increment of <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M228','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M228">View MathML</a>. Similarly, at most <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M229','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M229">View MathML</a> more nucleotide matches, or gap fill-ups, are possible, compared to the existing alignment indicated by the score <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M230','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M230">View MathML</a>. The corresponding alignment score for such case is thus: <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M231','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M231">View MathML</a>. To explicitly represent the upper bound using only the identified OPMs, we rename <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M232','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M232">View MathML</a> as <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M233','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M233">View MathML</a> (similarly, we rename <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M234','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M234">View MathML</a> as <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M235','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M235">View MathML</a>). Therefore, <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M236','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M236">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M237','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M237">View MathML</a> can be computed using the following equations:

<a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M238','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M238">View MathML</a>

(11)

With the upper bounds <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M239','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M239">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M240','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M240">View MathML</a>, we are able to formally prove the correctness of the online OPM pruning technique:

Lemma 2

If <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M241','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M241">View MathML</a>, where <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M242','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M242">View MathML</a> and <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M243','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M243">View MathML</a>, then <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M244','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M244">View MathML</a>.

Proof

<a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M245','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M245">View MathML</a>

As a result, when the condition given in Lemma 2 is satisfied, the enclosed OPM <a onClick="popup('http://www.biomedcentral.com/1471-2105/14/269/mathml/M246','MathML',630,470);return false;" target="_blank" href="http://www.biomedcentral.com/1471-2105/14/269/mathml/M246">View MathML</a> can be readily removed.

Pseudo-code

The pseudo-code for the new RNA secondary structure alignment algorithm that implements both speedup techniques is summarized in Figure 3.

thumbnailFigure 3. Pseudo-code for the implementation of the speedup techniques.

Results

We implemented the proposed general edit-distance RNA structural alignment algorithm into a program called ERA (Efficient RNA Alignment) using GNU C++. In this section, we will show that (1) ERA has the expected O(zl2) time complexity; (2) ERA is as accurate as the other state-of-the-art RNA alignment tools; and (3) ERA runs much faster than the other RNA alignment tools. In addition to these goals, we have also benchmarked ERA to demonstrate its O(l2) space complexity. For details regarding the space complexity issues please refer to the Additional file 1: Section S1 (also see Figure S1, Figure S2, and Table S1).

Additional file 1. Supplementary information. This file contains four sections. In Section S1, we briefly discuss the space issue of ERA and provide related experimental results. In Section S2, we document the randomly selected RNA structures used for experiments mentioned in the main article. In Section S3, we evaluate the impact of the online OPM pruning technique in speeding up ERA. In Section S4, we give examples of the pruned base-pairing probability matrix for executing LocARNA.

Format: PDF Size: 684KB Download file

This file can be viewed with: Adobe Acrobat ReaderOpen Data

We benchmarked the ERA with two other state-of-the-art RNA alignment tools: LocARNA as a representative of the general edit-distance RNA structure alignment algorithms and RNAforester as a representative of the tree-based RNA structure alignment algorithms. Note that although LocARNA is developed to compare RNA structure ensembles, its flexible parameter setup makes it easy to prune its input RNA ensembles (see Section ‘Running LocARNA’ for more details). However, the readers should note that LocARNA is used in a restricted case for fair comparison with ERA, and more potential applications of LocARNA should be recognized. We do not compare ERA with its predecessor RNAscf, because RNAscf is implemented to find consensus helical configurations that do not include individual base pairs [29]. Both LocARNA and RNAforester were invoked using their default parameters.

Running LocARNA

Note that LocARNA was originally developed to compare two RNA structure ensembles [39]. Due to the recent technical advances in experimental RNA structure probing, we anticipate that RNA structures can be predicted with much higher accuracy. Therefore, we develop ERA to compare two fixed RNA structures. In this case, we need to prune the original inputs of LocARNA, so as to ensure that they only represent the fixed structures rather than any additional information.

The input RNA ensembles for LocARNA are represented using the base-pairing probability matrices, which can be computed using the McCaskill’s algorithm [40,41]. In a base-pairing probability matrix, each base pair (possibly crossing) is assigned with a probability to indicate its thermodynamic stability. Our goal is to prune such a base-pair probability matrix, such that it only contains information regarding the fixed RNA structure (in our experiment, we take the Rfam [31] annotation or the BraliBase II [32] annotation as the fixed structure for an RNA sequence). For each base pair in the matrix, if it is not presented in the annotated structure, its corresponding probability is reset to 0. On the other hand, if it is included in the annotated structure, its probability is reset to 1. In this case, the pruned base-pairing probability matrix contains only the information regarding the fixed RNA structure. We show an original and a pruned base-pairing probability matrix in Additional file 1: Figure S3 as an example. All LocARNA inputs for experiments mentioned in this article are preprocessed using this strategy.

Time complexity

In this section, we expect to show that the proposed sparsification is successfully implemented, and ERA has the expected O(zl2) time complexity. To show the O(zl2) time complexity, we chose a number of RNA families from Rfam that have a wide range of sequence lengths. We then randomly selected two individual RNA structures from each family (see Additional file 1: Table S2) to run ERA alignment. The running time for their alignments, versus n3 (note that n<l for annotated structures and O(n)=O(l)), is plotted in Figure 4 (a). We can clearly observe the expected O(zl2) time complexity from the figure. In addition, we are also able to show that the speedup ratio, when comparing to the O(l4+n2l2)LocARNA algorithm, is strongly correlated with the efficiency of pair matching reduction due to the sparse DP technique (the ratio n2/z, see Figure 4 (b)). The relatively large deviations are observed for biocoid_3UTR and snR86 RNA structures. This is because they contain a large number of base pairs and have a high base pair to sequence length ratio. In this case, the overhead for maintaining the OPM list becomes apparent and makes the speedup less significant. In summary, we have shown that the sparse DP technique is successfully implemented, ERA has an expected time complexity of O(zl2).

thumbnailFigure 4. Time complexity and OPM reduction of ERA. (a) Running time versus n3, where n is the average number of base pairs in the RNA structures. (b) OPM reduction ratio versus running time speedup ratio. The OPM reduction ratio is computed by n2/z, where z is the number of OPMs.

Alignment quality

In addition to time complexity improvement, we also expect to show that ERA is as accurate as the other state-of-the-art general edit-distance RNA structure alignment tools. We used BraliBase II [32] as the reference data set, and used its corresponding structure annotations as the fixed input structures. We adopted two measures to indicate the alignment quality, i.e., the Sum-of-Pair Score (SPS) [32] and the Structure Conservation Index (SCI) [42]. The benchmark results are shown in Figure 5. The alignment qualities of ERA and LocARNA are nearly identical, since incorporating the sparse DP technique will not compromise global optimality. The benchmark results also show that ERA and LocARNA can produce more accurate alignments when compared to RNAforester. This is because ERA and the restricted version of LocARNA are both general edit-distance RNA alignment algorithms that are capable of flexibly handling incorrectly predicted base-pairs, while RNAforester is more sensitive to such errors, since it implements tree alignment.

thumbnailFigure 5. Alignment quality comparison of ERA, LocARNA and RNAforester. The comparison of (a) Sum-of-Pair Score and (b) Structure Conservation Index between ERA, LocARNA and RNAforester on BraliBase II data set with fixed input structures. The sequence identity range is between 0.37 to 0.99. The curves are generated using LOWESS smoothing with a smoothing factor of 0.3.

Running time speedup

Finally, after benchmarking the time complexity and alignment accuracy of ERA, we also expect to show that ERA is an efficient implementation and can run faster than other state-of-the-art RNA alignment tools. We compared the real running time of ERA, LocARNA, and RNAforester on the selected RNA structures from Rfam. The benchmark results are summarized in Table 1. We can observe that ERA is capable of speeding up LocARNA by a minimum of 5.2 fold and a maximum of 91.5 fold. ERA can also speedup RNAforester by a minimum of 2.8 fold and a maximum of 242.6 fold, with only one exception in which RNAforester is 9.6 times faster than ERA. This is because the RNA structures being aligned (snR86) contain only one stem-loop structure; and in such a special case, the time complexity of RNAforester becomes O(l2) [21].

Table 1. Comparison on running time of ERA, LocARNA, and RNAforester

To further investigate the real running time speedup of ERA on randomly selected RNA structures, we compiled a much larger data set that contains 1,000 pairs of randomly selected RNA structures from Rfam. The benchmark results on this large data set are summarized in Figure 6. In Figure 6, we can see that ERA (blue triangle) runs much faster than LocARNA (red cross) and RNAforester (green star). In addition, we can also observe that the running time of ERA grows slower than those of LocARNA and RNAforester, which further confirms our previous time complexity analysis (see Figure 4 (a)). This speedup is significant, and renders ERA with the power of aligning long ncRNAs that are revealed by recent research advances. In summary, ERA is an efficient and accurate RNA structure alignment tool as compared to its state-of-the-art counterparts LocARNA and RNAforester.

thumbnailFigure 6. Computational efficiency comparison between ERA, LocARNA and RNAforester on aligning randomly selected RNA structures from Rfam. The running time for ERA (blue triangles), LocARNA (red crosses) and RNAforester (green stars) on aligning 1,000 pairs of randomly selected RNA structures from the Rfam database. The x-axis corresponds to the average sizes of the RNA structures being aligned, which is computed as the product of their average length (l) and their average number of base pairs (n). The y-axis corresponds to the actual running time in the unit of second. We can see that ERA is significantly faster than the other two tools.

Discussion and conclusions

In this article, we have presented a novel algorithm for efficient alignment of RNA secondary structures by incorporating the sparse DP technique. The major theoretical contribution of this work lies in two parts. First, to our knowledge, this is the first application of the sparse DP technique to RNA structure-structure alignment. Second, the novel online OPM pruning technique can provide insights for future algorithm designs that need to maintain a candidate list. The implementation of this novel algorithm is a tool called ERA, which can run in O(zl2) time and O(l2). Such time and space complexity make ERA one of the most efficient RNA structure alignment tools that are currently available.

The online OPM pruning technique is newly developed from this work, which aims at deleting obsolete candidates as the DP proceeds. Although this technique cannot improve the computational complexity, it is efficient in reducing the real running time. In Additional file 1: Table S3, we summarized the running time of ERA in aligning individual RNA structures, with or without the online OPM pruning technique. We observed that by incorporating this technique, the running time of ERA was reduced by an average of 2.3 fold. Meanwhile, the speedup ratio is highly uniform (with 1.7 fold as the lowest and 3.1 fold as the highest) across RNA structures with different sizes, meaning that it reduces running time by a constant factor. The online OPM pruning technique can also be modified and incorporated into other related algorithms that implement the candidate list, such as the sparse DP algorithms for RNA folding [30], RNA consensus folding [36,37], and RNA-RNA interaction [38].

The speedup of ERA is most significant when the number of base pairs in the RNA structures is small. This is because the algorithm is indexed by base pairs and has a time complexity of O(z(n2+l2)). As n increases, the term O(zn2) will dominate the overall time complexity. In this case, an ideal application of ERA is to align fixed RNA structures, because it guarantees that n<l. Note that as a sparsified version of the SAF algorithm RNAscf[29], the new algorithm developed here is also capable of handling RNA structure ensemble alignments. However, we do not implement this feature into ERA, because one cannot guarantee n<l for RNA ensemble alignments. This would make the speedup of ERA less significant. Besides, there are other alternative tools [36,37] available for such a purpose.

With the completion of the ENCODE [10] and modENCODE [11] projects, more and more RNA transcripts will be experimentally revealed. At the same time, with the advance of high-throughput RNA structure probing techniques [13-15], the secondary structures of these RNA transcripts will also be predicted with a much higher accuracy. In this case, ERA, which can compare fixed RNA structure efficiently and accurately, becomes an ideal computational tool to evaluate the structural similarities of these RNA transcripts. ERA can be used to perform all-against-all alignments on these RNA transcripts, which will then be subsequently summarized as the distance matrix for clustering purposes. Various clustering algorithms [8,39] can then be applied to identify ncRNA families with similar secondary structures and infer their amazing cellular and molecular functionalities.

Competing interests

The authors declare that they have no competing interest.

Authors’ contributions

SZ contributed with the conception of the research. SZ and CZ designed the algorithm. CZ implemented the algorithm and performed benchmark analysis. SZ and CZ wrote the manuscript. Both authors read and approved the final manuscript.

Acknowledgements

This work is supported by the National Institute of General Medical Sciences of the National Institutes of Health, USA (R01GM102515).

References

  1. Eddy S: Non-coding RNA genes and the modern RNA world.

    Nat Rev Genet 2001, 2:919-929. PubMed Abstract | Publisher Full Text OpenURL

  2. Storz G: An expanding universe of noncoding RNAs.

    Science 2002, 296:1260-1263. PubMed Abstract | Publisher Full Text OpenURL

  3. Tripathi V, Ellis JD, Shen Z, Song DY, Pan Q, Watt AT, Freier SM, Bennett CF, Sharma A, Bubulya PA, Blencowe BJ, Prasanth SG, Prasanth KV: The nuclear-retained noncoding RNA MALAT1 regulates alternative splicing by modulating SR splicing factor phosphorylation.

    Mol Cell 2010, 39:925-938. PubMed Abstract | Publisher Full Text OpenURL

  4. Tucker BJ, Breaker RR: Riboswitches as versatile gene control elements.

    Curr Opin Struct Biol 2005, 15:342-348. PubMed Abstract | Publisher Full Text OpenURL

  5. Bartel DP: MicroRNAs: target recognition and regulatory functions.

    Cell 2009, 136:215-233. PubMed Abstract | Publisher Full Text | PubMed Central Full Text OpenURL

  6. Crucs S, Chatterjee S, Gavis ER: Overlapping but distinct RNA elements control repression and activation of nanos translation.

    Mol Cell 2000, 5:457-467. PubMed Abstract | Publisher Full Text OpenURL

  7. Wan Y, Kertesz M, Spitale RC, Segal E, Chang HY: Understanding the transcriptome through RNA structure.

    Nat Rev Genet 2011, 12:641-655. PubMed Abstract | Publisher Full Text | PubMed Central Full Text OpenURL

  8. Zhong C, Andrews J, Zhang S: Discovering non-coding RNA elements in Drosophila 3’ un-translated regions. In Proceedings of the 2nd IEEE International Conference of Computational Advances in Bio and Medical Sciences.. IEEE; 2012:1-6. OpenURL

  9. Will S, Reiche K, Hofacker IL, Stadler PF, Backofen R: Inferring noncoding RNA families and classes by means of genome-scale structure-based clustering.

    PLoS Comput Biol 2007, 3:e65. PubMed Abstract | Publisher Full Text | PubMed Central Full Text OpenURL

  10. Bernstein BE, Birney E, Dunham I: An integrated encyclopedia of DNA elements in the human genome.

    Nature 2012, 489:57-74. PubMed Abstract | Publisher Full Text | PubMed Central Full Text OpenURL

  11. Celniker SE, Dillon LA, Gerstein MB, Gunsalus KC, Henikoff S, Karpen GH, Kellis M, Lai EC, Lieb JD, MacAlpine DM, Micklem G, Piano F, Snyder M, Stein L, White KP, Waterston RH: Unlocking the secrets of the genome.

    Nature 2009, 459:927-930. PubMed Abstract | Publisher Full Text | PubMed Central Full Text OpenURL

  12. Mercer TR, Dinger ME, Mattick JS: Long non-coding RNAs: insights into functions.

    Nat Rev Genet 2009, 10:155-159. PubMed Abstract | Publisher Full Text OpenURL

  13. Kertesz M, Wan Y, Mazor E, Rinn JL, Nutter RC, Chang HY, Segal E: Genome-wide measurement of RNA secondary structure in yeast.

    Nature 2010, 467:103-107. PubMed Abstract | Publisher Full Text | PubMed Central Full Text OpenURL

  14. Underwood JG, Uzilov AV, Katzman S, Onodera CS, Mainzer JE, Mathews DH, Lowe TM, Salama SR, Haussler D: FragSeq: transcriptome-wide RNA structure probing using high-throughput sequencing.

    Nat Methods 2010, 7:995-1001. PubMed Abstract | Publisher Full Text | PubMed Central Full Text OpenURL

  15. Lucks JB, Mortimer SA, Trapnell C, Luo S, Aviran S, Schroth GP, Pachter L, Doudna JA, Arkin AP: Multiplexed RNA structure characterization with selective 2’-hydroxyl acylation analyzed by primer extension sequencing (SHAPE-Seq).

    Proc Natl Acad Sci USA 2011, 108:11063-11068. PubMed Abstract | Publisher Full Text | PubMed Central Full Text OpenURL

  16. Reuter JS, Mathews DH: RNAstructure: software for RNA secondary structure prediction and analysis.

    BMC Bioinformatics 2010, 11:129. PubMed Abstract | BioMed Central Full Text | PubMed Central Full Text OpenURL

  17. Deigan KE, Li TW, Mathews DH, Weeks KM: Accurate SHAPE-directed RNA structure determination.

    Proc Natl Acad Sci USA 2009, 106:97-102. PubMed Abstract | Publisher Full Text | PubMed Central Full Text OpenURL

  18. Tai KC: The tree-to-tree correction problem.

    J ACM 1979, 26:422-433. Publisher Full Text OpenURL

  19. Zhang K, Shasha D: Simple fast algorithms for the editing distance between trees and related problems.

    SIAM J Comput 1989, 18:1245-1262. Publisher Full Text OpenURL

  20. Jiang T, Wang L, Zhang K: Alignment of trees - an alternative to tree edit.

    Theor Comput Sci 1995, 143:137-148. OpenURL

  21. Höchsmann M, Töller T, Giegerich R, Kurtz S: Local similarity in RNA secondary structures. In Proceedings of the 2nd IEEE Computer Society Bioinformatics Conference. Washington DC: IEEE Computer Society; 2003:159-168. OpenURL

  22. Chen S, Zhang K: An improved algorithm for tree edit distance with applications for RNA secondary structure comparison.

    J Comb Optim 2012, 1-20. OpenURL

  23. Bafna V, Muthukrishnan S, Ravi R: Computing similarity between RNA strings. In Proceedings of the 6th Annual Symposium on Combinatorial Pattern Matching. Berlin Heidelberg: Springer-Verlag; 1995:1-16. OpenURL

  24. Jiang T, Lin G, Ma B, Zhang K: A general edit distance between RNA structures.

    J Comput Biol 2002, 9:371-388. PubMed Abstract | Publisher Full Text OpenURL

  25. Klein PN: Computing the edit-distance between unrooted ordered trees. In Proceedings of the 6th Annual European Symposium on Algorithms. Berlin Heidelberg: Springer-Verlag; 1998:91-102. OpenURL

  26. Demaine ED, Mozes S, Rossman B, Weimann O: An optimal decomposition algorithm for tree edit distance.

    ACM Trans Algo 2009, 6:1-19. OpenURL

  27. Bille P: A survey on tree edit distance and related problems.

    Theor Comput Sci 2005, 337:217-239. Publisher Full Text OpenURL

  28. Needleman SB, Wunsch CD: A general method applicable to the search for similarities in the amino acid sequence of two proteins.

    J Mol Biol 1970, 48:443-453. PubMed Abstract | Publisher Full Text OpenURL

  29. Bafna V, Tang H, Zhang S: Consensus folding of unaligned RNA sequences revisited.

    J Comput Biol 2006, 13:283-295. PubMed Abstract | Publisher Full Text OpenURL

  30. Wexler Y, Zilberstein C, Ziv-Ukelson M: A study of accessible motifs and RNA folding complexity.

    J Comput Biol 2007, 14:856-872. PubMed Abstract | Publisher Full Text OpenURL

  31. Griffiths-Jones S, Bateman A, Marshall M, Khanna A, Eddy SR: Rfam: an RNA family database.

    Nucleic Acids Res 2003, 31:439-441. PubMed Abstract | Publisher Full Text | PubMed Central Full Text OpenURL

  32. Gardner PP, Wilm A, Washietl S: A benchmark of multiple sequence alignment programs upon structural RNAs.

    Nucleic Acids Res 2005, 33:2433-2439. PubMed Abstract | Publisher Full Text | PubMed Central Full Text OpenURL

  33. Klein R, Eddy S: RSEARCH: finding homologs of single structured RNA sequences.

    BMC Bioinformatics 2003, 4:44. PubMed Abstract | BioMed Central Full Text | PubMed Central Full Text OpenURL

  34. Myers E, Miller W: Optimal alignment in linear space.

    Comput Appl Biosci 1988, 4:11-17. PubMed Abstract OpenURL

  35. Zhong C, Tang H, Zhang S: RNAMotifScan: automatic identification of RNA structural motifs using secondary structural alignment.

    Nucleic Acids Res 2010, 38:e176. PubMed Abstract | Publisher Full Text | PubMed Central Full Text OpenURL

  36. Ziv-Ukelson M, Gat-Viks I, Wexler Y, Shamir R: A faster algorithm for RNA co-folding. In Proceedings of the 8th Workshop on Algorithms in Bioinformatics. Berlin Heidelberg: Springer-Verlag; 2008:174-185. OpenURL

  37. Backofen R, Tsur D, Zakov S, Ziv-Ukelson M: Sparse RNA folding: time and space efficient algorithms.

    J of Discrete Algorithms 2011, 9:12-31. Publisher Full Text OpenURL

  38. Salari R, Mȯhl M, Will S, Sahinalp SC, Backofen R: Time and space efficient RNA-RNA interaction prediction via sparse folding. In Proceedings of the 14th International Conference on Research in Computational Molecular Biology. Berlin Heidelberg: Springer-Verlag; 2010:473-490. OpenURL

  39. Will S, Reiche K, Hofacker IL, Stadler PF, Backofen R: Inferring noncoding RNA families and classes by means of genome-scale structure-based clustering.

    PLoS Comput Biol 2007, 3:e65. PubMed Abstract | Publisher Full Text | PubMed Central Full Text OpenURL

  40. McCaskill JS: The equilibrium partition function and base pair binding probabilities for RNA secondary structure.

    Biopolymers 1990, 29:1105-1119. PubMed Abstract | Publisher Full Text OpenURL

  41. Hofacker IL, Fontana W, Stadler PF, Bonhoeffer LS, Tacker M, Schuster P: Fast folding and comparison of RNA secondary structures.

    Monatsh Chem 1994, 125:167-188. Publisher Full Text OpenURL

  42. Washietl S, Hofacker I, Stadler P: Fast and reliable prediction of noncoding RNAs.

    Proc Natl Acad Sci USA 2005, 102:2454-2459. PubMed Abstract | Publisher Full Text | PubMed Central Full Text OpenURL