BACKGROUND
non-coding rnas  are transcribed rna molecules that do not encode proteins.
their functions often depend on their 3d-structures rather than their primary sequences.
the secondary structures of rna sequences can be identified by various methods, including minimization of the free energy  <cit> .
however, it is not always possible to obtain the accurate secondary structures.
more reliable predictions of the secondary structures are possible if we have a set of rna sequences with a common secondary structure.
for consensus structure prediction, rnaalifold  <cit> , pfold  <cit> , and mccaskill-mea  <cit>  are applicable only to sets of aligned rna sequences.
multiple alignment tools that consider only sequence similarities, e.g.
clustalw  <cit> , dialign  <cit> , and t-coffee  <cit> , however, have limited accuracy for rna sequences with low similarity.
simultaneous prediction of the common secondary structure and optimal alignment of rna sequences is computationally quite expensive, even if pseudo-knotted structures are excluded.
for example, the strict algorithm of sankoff  <cit>  requires o in time and o in memory for n sequences of length l. its faster variants that restrict the distances of the base pairs in the primary sequences are proposed for pairwise alignments  <cit> .
although structural alignment of multiple rna sequences with reasonable computational cost is difficult, several algorithms have been proposed.
hofacker et al.
proposed a method for progressive multiple alignments by direct comparison of the base-pairing probability matrices  <cit> , implemented in pmmulti which was recently reimplemented in foldalignm  <cit>  and locarna  <cit>  by torarinsson et al.
and will et al., respectively.
in stemloc, holmes et al.
incorporated a constraint approach that limits the range of structures and alignments to be considered by pre-processing the sequences  <cit> .
siebert et al.
proposed an approach distantly related to sankoff's algorithm and implemented it in marna  <cit>  that uses the structural information for pairwise alignments before combining them into multiple alignments with t-coffee  <cit> .
dalli et al.
developed a new scoring approach, stral, that takes into account sequence similarities as well as base-pairing probabilities  <cit> .
xu et al.
proposed a new sampling based algorithm that finds the common structure between input sequences by probabilistically sampling aligned stems based on stem conservation calculated from intrasequence base pairing probabilities and intersequence base alignment probabilities, which was implemented in rnasampler  <cit> .
bauer et al.
developed a graph based representation which modeled sequence-structured alignment as an integer linear program , and implemented it in rnalara  <cit> .
kiryu et al.
proposed a variant of sankoff's algorithm with marked reduction of computation, which was implemented in murlet  <cit> .
all of these methods, however, are still too slow to apply to the rna sequences longer than  <dig> bases.
seibel et al.
developed an alignment tool with an editor, which uses the secondary structure information of individual sequences to align multiple rna sequences with low time complexities   <cit> .
in order to extract the common secondary structure, it is also possible to find the structural motifs without aligning the whole sequences.
for structural motif finding, yao et al.
proposed an algorithm based on covariance models   <cit> , and hamada et al.
proposed a graph mining approach   <cit> .
here we propose a method, implemented in mxscarna, for fast multiple alignments of rna sequences.
this method extends our previous work in pairwise alignments   <cit>  to progressive multiple alignments with improved score functions, and simultaneously construct multiple alignments and the associated common secondary structures.
the pairwise alignment in this progressive alignment is an heuristic algorithm that separately aligns 5' parts and 3' parts of the stems with rough consistency considerations.
in benchmark experiments, our method was at least as accurate as currently available state-of-art multiple alignment methods, but unlike those methods, the computations were fast enough for large-scale analyses, though the accuracies for the alignments of long sequences have not yet been confirmed.
RESULTS
algorithm
overview of the algorithm
the proposed method, implemented in mxscarna, progressively aligns multiple rna sequences, in an extension of the pairwise structural alignment algorithm  of our previous work  <cit> .
first the guide tree for the progressive alignment is built by unweighted pair group method with arithmetic mean   <cit>  by using the pairwise similarities of the rna sequences.
second the base-pairing probability matrices are calculated for all the rna sequences by mccaskill's algorithm  <cit> .
those base-pairing probabilities are used for extracting the potential stems and for the matching scores in the dynamic programming  of the alignments.
third the rna sequences are progressively aligned along the guide tree using scarna's pairwise alignment algorithm with improved score functions introduced in this paper.
at the first stage of the progressive alignment, which corresponds to the bottom level of the guide tree, the pairs of rna sequences are aligned by engineered dp algorithm of scarna's pairwise alignment.
the pairwise alignment is very fast because the potential stems extracted from the base-pairing probability matrices are decomposed into 5' part and 3' part and those two parts are independently aligned.
in each upper-level step of the progressive alignment according to the guide tree, potential stems for groups of rna sequences are extracted from the averaged base-pairing probability matrices.
the dp algorithm of the pairwise alignment uses the approximated posterior probabilities as score functions.
the approximation uses the product of the pairwise posterior probabilities of maximum expected accuracy  alignments and the base-pairing probabilities of the sequences.
mea alignment maximizes the expected number of positions where the two nucleotides are correctly aligned.
to yield robust alignments, the pairwise posterior probabilities of mea alignments are modified by the probability consistency transformation.
definitions
definition 1: stem candidate
given a base-pairing probability matrix for an rna sequence and a threshold τ , stem candidate is a set of continuous base pairs of which the base-pairing probabilities are greater than τ.
definition 2: stem fragment
given a base-pairing probability matrix for an rna sequence, a threshold τ , and an integer w, stem fragment is a set of continuous base pairs of length w, of which the base-pairing probabilities are greater than τ.
a stem candidate longer than w is represented by a set of overlapping stem fragments of fixed-length w .
smaller values in w or τ increase the sensitivity of the predictions of the stems and decrease the specificity of them.
w and τ are set to  <dig> and  <dig>  respectively in all the computational experiments in this paper.
for each stem fragment, the 5' stem component and the 3' stem component, which are representatives of the 5' and 3' portions of the stem fragment, respectively, are defined as follows.
definition 3: stem component
for each stem fragment, a stem component xa, either a 5' stem component or a 3' stem component, is an object that has the following properties:
• p: position, the position of the leftmost base of the 5' or 3' part of the stem fragment.
• s: sequence, the nucleotide sequence of the 5' or 3' part of the stem fragment.
• c: partner component, the complementary  stem component.
• d: loop distance, the distance to the complementary  stem component.
a stem fragment is written as  by using the mutually complementary stem components, 5' stem component xa and 3' stem component xa', which represent the 5' and 3' parts of the stem fragment.
xa and xa' satisfy
xa = c and xa' = c.
the loop distance d can be written as
d = p) - p - w.
definition 4: stem component sequence
a stem component sequence  is a sorted sequence of all the stem components of an rna sequence, in order of their positions and, if the positions are the same, according to their loop distances.
for i <j, a scs x = x1x <dig> ... xm satisfies
p <p or p = p &d <d.
definition 5: relations of stem fragments without an overlap
two stem fragments,  and  of an rna sequence are, parallel if and only if
p <p <p <p or p <p <p <p,
nested if and only if p <p <p <p or p <p <p <p,
pseudo-knotted if and only if p <p <p <p or p <p <p <p.
definition 6: relations of overlapping stem fragments
two stem fragments,  and  of an rna sequence are, r-continuous if and only if
r = p - p = p - p,
ill-continuous if and only if xa overlaps xb and xa' overlaps xb' and
p - p ≠ p - p,
contradictory if and only if only one side, either 5' part or 3' part, of the stem fragments overlap.
the three possible relationships between stem fragments without an overlap: parallel, nested, and pseudo-knotted, may exist in the same secondary structure of an rna sequence.
however, among the three possible relationships between overlapping stem fragments, only r-continuous stem fragments may coexist in the same secondary structure of an rna sequence.
1-continuous, a special case of r-continuous, means that the two stem fragments are adjacent in the rna sequence and a part of a stem candidate with a length of w +  <dig> .
as described later, two overlapping stem components in the alignment are controlled to belong to two r-continuous stem fragments in dp.
building stem component sequences
in a base-pairing probability matrix, which is calculated by mccaskill's algorithm  <cit> , a potential stem is located in two symmetry locations as continuous counterdiagonal positions which have high base-pairing probabilities.
therefore, the stem components for each rna sequence defined in previous section are extracted by scanning counterdiagonal windows of length w in the base-pairing probability matrix and selecting the windows whose elements are greater than τ. smaller value in w or τ increase the sensitivity of the predictions of the stems and decrease the specificity of them.
w and τ are set to  <dig> and  <dig>  respectively in all the computational experiments in this paper.
the stem components are sorted in order of their positions and loop distances to construct a stem component sequence .
for each group alignment in the progressive alignment, the average of the base-pairing probability matrices is calculated directly according to the alignment of the group of rna sequences.
the stem components for the group are extracted from the averaged matrix, and the scs is constructed by sorting the stem components.
alignment of stem component sequences
before the pairwise alignments or group alignments, rna sequences or groups of rna sequences are represented by their stem component sequences .
those two scss are aligned by scarna's pairwise dp algorithm in each stage of the progressive alignment.
the alignment of the two scss uses two dp matrices, m and g. for two scss, {xi} and {yj}, m is the best score of the alignment of the pair xi and yj, given that xi matches yj, and g is the best score given that xi mismatches yj.
the recursions for m and g are written as:
m=max⁡{m+δsm+sg+s
g=max⁡{mmgg
with the initial conditions; m =  <dig>  m = m = g = g = g = -∞.
the first term of equation  controls the 1-continuous case where the continuous matches of two overlapping stem components form a match of the corresponding stem longer than w. αi/βj are the indices  of the components that are 1-continuous with xi/yj.
the positions of xαi/yβj are adjacent to xi/yj in the nucleotide sequences , i.e.
p=p+ <dig> p)=p)− <dig> p=p+ <dig> p)=p)− <dig>
δs corresponds to the incremental score for the match of the overlapping stem components, which is discussed in the next section.
the second and third terms of equation  keep the stem components in the adjacent dp match from overlapping in the nucleotide sequences.
pi/qj are the indices  of the nearest components that do not overlap with xi/yj .
s is a match score for xi and yj, which is discussed in the next section.
equation  refers only adjacent positions in dp matrix because overlaps of xi and yj with the other stem components are permitted.
because the 5' stem components and the 3' stem components are handled independently, there is no term for bifurcation in secondary structures in equations  and .
the traceback pointer keeps the triplets, indices of x, y, and the selection of m or g, in the recursion  and .
the first term of the triplet, the index of x, can be either αi, pi, i, or i -  <dig>  and the second term of the triplet, the index of y, can be either βj, qj, j, or j -  <dig>  in the traceback of the dp, m and g are used jointly to obtain the optimal path and to select m or g, which gives the maximum score of the alignment.
the alignments of scss are constructed by selecting the stem components that appear in the path with the selected m. all of the mismatched stem components are excluded from the alignment.
the algorithm makes the adjacent dp matches of stem components either not overlapping in the nucleotide sequences or consistently overlapping  as a match of the stems longer than w. pairwise alignment of the scss requires only o in time and in memory.
that computational complexities are evaluated as  for two rna sequences of length l because the number of the stem components is regarded as a linear function of the length of the nucleotide sequence  <cit> .
the pairwise alignment of scss allows some inconsistent matches by ignoring strict treatments of the complementary components.
for two stem fragments,  and , if xa matches yb in the scs alignment, xa' should match yb'.
let us define such a match as left-right consistent.
because 5' stem components and 3' stem components are aligned independently, left-right consistency is not guaranteed in general.
any match which is not left-right consistent is removed as a post process.
if any two of the stem components of a same scs appear in the scs alignment and their complementary components overlap , those complementary components do not appear together in the alignment because the alignment of complementary components are controlled to be either nonoverlapping or r-continuous.
therefore, the post process also guarantees that no pair of contradictory stem fragments appears in the alignment  <cit> .
the score function using the mea alignment
in our previous work  <cit> , a function of the ribosum  <cit>  score, loop distance, base-pairing probabilities, and the stacking energy were used as the score s in recursion .
in mxscarna, the score function is replaced by an approximated posterior probability according to the principle of maximum expected accuracy .
recent studies have shown that the accuracy of the resulting sequence alignment and secondary structure predictions is better than that of predictions made by the conventional maximum likelihood estimation  algorithms  <cit> .
in the following, for nucleotide sequences x and y, xi ~ yj means that xi ∈ x and yi ∈ y are aligned on the same column in the alignment, and xi ◇ xj means that xi, xj ∈ x form a base pair.
for two rna sequences, x, y and k, l ∈ { <dig>  ···, |x|}, m, n ∈ { <dig>  ···, |y|}, let p be the posterior probability, i.e.
the sum of the probabilities that two positions of the sequences, xk and ym, xl and yn, are aligned in the alignment, and that two pairs of the nucleotides, xk and xl, ym and yn, form base pairs in the secondary structures as well; this is computed by the inside-outside algorithm of the pair stochastic context free grammar   <cit>  for structural pairwise alignments of rna sequences.
we wanted to use posterior probability as the score function s, but the computational costs, o in time and o in memory for sequences of length l, are impractical.
we instead used the following approximated posterior probability introduced by kiryu et al.
<cit> .
p^=p˜p˜pp.
p and p are the base-pairing probabilities that the particular positions xk and xl, ym and yn, respectively, form base pairs; these probabilities are computed by mccaskill's algorithm  <cit> .
p˜ and p˜ are the posterior probabilities modified by probability consistency transformation  <cit> , which is computed as follows.
p˜=1|s|∑z∈s∑r∈{ <dig> ...,|z|}pp,
where s is the set of rna sequences to be aligned.
in this transformation, the probability of specific nucleotides of two sequences being aligned are replaced by the average over the products of probabilities that the two nucleotides are aligned to the same nucleotides in arbitrary third sequences.
this calculation requires o in time and o in memory.
the probability consistency transformations are applied twice in current implementation.
p is the posterior probability, i.e.
the sum of the probabilities that particular positions of the two sequences, xk and zr, are aligned in some alignment; this is computed by the forward-backward algorithm of the pair hidden markov model   <cit>  for pairwise alignment of the sequences.
our new matching scores in  are defined as follows.
s=∑0≤w<wp^+w~yp+w,xp+w−1−w~yp+w−1−w)
δs=p^+w−1~yp+w− <dig> xp~yp)
where x′i/y′j are the complementary stem components of xi/yj.
the sum of the probabilities, not the logarithms of the probabilities, is used for the matching score, in an effort to maximize the number of correctly aligned bases including the implicit prediction of the base pairs .
alignment of loop region
the remaining loop regions  are aligned by using the consistency-transferred posterior probabilities, p˜, as the matching scores.
the probabilities, not the logarithms of the probabilities, again are used, according to the mea principle.
the recursion is shown following.
a=max⁡{a+p˜aa
emission and transition probabilities for the pair hmm in mxscarna  were trained via expectation-maximization  on a set of unaligned sequences that is extracted from the rfam database and that do not overlap the sequences of the dataset for subsequent experiments.
computational experiments
datasets
to test the empirical performance of mxscarna, we used three datasets for the benchmark multiple alignments: an original multiple alignment dataset, the bralibaseii multiple alignment dataset  <cit> , and kiryu et al.
's multiple alignment dataset  <cit> .
our original dataset comprised  <dig> multiple alignments of  <dig> sequences, the secondary structures of which have been published, obtained from the rfam  <dig>  database  <cit> .
there are  <dig> families of rna sequences in the dataset and the sequence identities varied from 35% to 100%.
sequences that included bases other than a, c, g, and u were removed because some of the alignment programs were unable to align them.
the bralibaseii benchmark dataset included  <dig> multiple alignments of  <dig> sequences.
the sequences of each multiple alignment were extracted from trna, intron_gpii, 5s_rrna, and u <dig> families in the rfam  <dig>  database and the signal recognition particle rna family  in the srpdb database  <cit> .
because the dataset did not include consensus secondary structure annotations to the alignments, we used the secondary structure annotations recovered by kiryu et al.
<cit> .
kiryu et al.
's multiple alignment benchmark dataset was generated from selected seed alignments in the rfam  <dig>  database that have published consensus structures  <cit> .
for each sequence family, as many as  <dig> random combinations of  <dig> sequences were generated.
the alignments whose mean pairwise sequence identity exceeded 95% and whose gap characters accounted for more than 30% of the total number of characters aligned were removed.
as such, this dataset consisted of  <dig> multiple alignments of  <dig> sequences, generated from  <dig> sequence families, with five alignments for each.
the dataset was reasonably divergent, and its mean length varied from  <dig> to  <dig> bases, and mean pairwise sequence identities varied from 40% to 94%.
evaluation measures
the qualities of the alignments were evaluated by the sum-of-pairs score  for the accuracy of the alignments and by the matthews correlation coefficient   <cit>  for the accuracy of the secondary structure predictions.
the sps and mcc of the alignment to be evaluated  for the reference alignment were defined as follows.
the sps was defined as the proportion of correctly aligned nucleotide pairs:
sps=∑i=1ispit∑j=1jspjr
where i is the number of columns in the test alignment, j is the number of columns in the reference alignment, on column i in the test alignment spit is the total number of "correct" nucleotide pairs which also appear in the reference alignment, on column j in the reference alignment spjr is the total number of nucleotide pairs.
the mcc was defined as
mcc=tp×tn−fp'×fn,fp'=fp−ξ,
where tp indicates the number of correctly predicted base pairs, tn the number of base pairs that were correctly predicted as unpaired, fp the number of incorrectly predicted base pairs, and fn the number of true base pairs that were not predicted.
the term ξ accounts for predicted base pairs that were not present in the reference structure but were compatible with it.
compatible base pairs are not true positives but have to be neither inconsistent  nor pseudo-knotted with respect to the reference structure  <cit> .
in order to calculate mcc for each test alignment, the reference alignment and the "correct" consensus secondary structure are taken from the database.
in order to compare the accuracies of the alignments in terms of the implicitly predicted common secondary structures, the common secondary structures for each test alignment by the alignment programs were predicted by the pfold program  <cit> .
comparison of accuracies with those of other aligners
to compare the accuracies of the alignment methods we used a linux machine with an amd opteron processor .
we compared the performance of mxscarna with that of murlet  <cit> , probcons  <cit> , mafft  <cit> , clustalw  <cit> , stral  <cit> , marna  <cit> , rnasampler  <cit> , rnalara  <cit> , foldalignm  <cit> , locarna  <cit> , pmmulti  <cit> , and stemloc  <cit>  on the three datasets described earlier.
whereas probcons, mafft, and clustalw align rna sequences on the basis of sequence similarities only, stral, marna, rnasampler, rnalara, foldalignm, locarna, pmmulti, stemloc, and murlet weigh both sequence similarities and secondary structures.
the command line options for the programs in the experiments are shown in table  <dig>  the results for the original dataset are shown in table  <dig>  because marna, locarna, foldalignm, pmmulti, and stemloc impose high time and memory demands, those programs were executed only on families of which the average sequence lengths were less than or equal to  <dig> bases.
the sps of mxscarna was comparable to those of murlet and probcons, which currently are the best performing aligners  <cit> .
in addition, the mcc of mxscarna was one of the highest among aligners.
in particular, the mcc of mxscarna is similar to that of stemloc, which aligns only short sequences that have simple secondary structures.
the results from the bralibaseii benchmark multiple alignment dataset are shown in table  <dig>  because of their prohibitive requirements for memory and time, stemloc, foldalignm, pmmulti, and marna were not applied to the srp family data.
again, mxscarna was comparable to murlet and probcons in terms of sps and one of the best performers among multiple aligners according to the mcc.
these trends continue in table  <dig>  which contains the results from kiryu et al.
's benchmark dataset comprising  <dig> sequences for each alignment.
all results are summarized in table  <dig>
evaluation of new score function
in order to evaluate the performance of our new score function , we compared it in pairwise alignment with the previous score function of scarna, which is a linear combination of ribosum score, stacking energy, loop-distance penalty, base-pairing probability.
dowell's dataset  <cit> , which consists of r <dig> dataset and percid dataset, are used for the evaluation.
r <dig> is a dataset which consists of  <dig> pairwise alignments chosen randomly from trna and 5srrna families in rfam  <dig>  database  <cit>  and percid is a balanced dataset of  <dig> pairwise alignments from the same families.
the sps and mcc are shown in table  <dig>  it is observed that the new score function of mxscarna outperformed the previous score function of scarna.
time and memory
the computational complexities of the proposed method for n sequences of length l were evaluated as follows.
the construction of the guide tree using the alignments of all pairs of the sequences required o in time and o in memory.
the calculation of base-pairing probability matrices for n sequences by mccaskill's algorithm  <cit>  required o in time and o in memory.
the probability consistency transformation  in method) required o in time and o in memory.
pairwise alignment of stem component sequences required o in time and memory as is explained in method.
therefore, the total computational complexities were o in time and o in memory.
for the base-pairing probabilities, the computational time for each sequence can be reduced to o by restricting the maximum distance of the base pairs to a fixed constant w  <cit> .
the computation of probability consistency transformation for a pair of sequences can also be calculated in o time by restricting the effective width of transformation to a fixed value.
those reductions reduce total time complexity to o. we will address those improvements in future work.
comparisons of alignment tools in regard to execution time for nucleotide sequences of various lengths are presented in figures  <dig> and  <dig>  randomly generated sequences were allocated into groups of the same lengths and were used for alignment.
stemloc aligned sequences of not more than  <dig> bases; foldalignm and locarna were faster than stemloc and aligned sequences of  <dig> bases or less.
because the lengths of the sequences were the same in each alignment task, the banded dynamic programming  technique of these methods was effective.
although the murlet program returned results for sequences as long as  <dig> bases in the best case, it was much slower than mxscarna.
mxscarna required only  <dig> seconds to align  <dig> sequences of  <dig> bases and returns alignments for sequences as long as  <dig> bases, though the accuracies for sequences longer than  <dig> bases have not yet been evaluated.
similar comparisons for various numbers of the sequences are presented in figure  <dig>  the execution time of mxscarna is acceptable even for  <dig> sequences.
sequence identities and alignment accuracies
alignment methods based only on sequence similarities often fail to capture common secondary structures among their alignments, especially when the similarities between sequences are low.
in contrast, current alignment methods that rely on information about secondary structures tend to produce inaccurate alignments for sequences of moderate to high similarity by putting too much weight on common secondary structures.
the relationships between accuracy and sequence identity for three alignment tools mxscarna, probcons, and stemloc are shown in figures  <dig> and  <dig>  probcons, one of the best of the aligners that ignore information regarding secondary structure, maintains a high sps throughout low to high sequence similarities, but mcc markedly drops for low sequence identities.
stemloc, one of the best structural aligners , achieved robust accuracies in mcc but failed to compete among the other aligners in regard to sps for moderate sequence identities.
mxscarna, which incorporates information on maximum expected accuracy  alignment in its structural alignments, yielded robust accuracies in terms of both sps and mcc throughout the tested range of sequence similarities.
availability and requirements
project name: ncrna.org project;
project home page: ;
operating systems: linux with gcc  <dig>  and cygwin with gcc  <dig> ;
programming language: c++;
license: free software, except for inclusion to comertical software;
the source code of mxscarna and its web server, the dataset and its references are available at .
on the web server w and τ correspond to "scslength" and "baseprobthreshhold" respectively, and "basepairscoreconst" is a parameter of mccaskill-mea  <cit>  used for the secondary structure prediction, which controls the sensitivity and the specificity of the prediction .
CONCLUSIONS
we have developed mxscarna, a new structural multiple aligner of rna sequences, which progressively applies the pairwise alignment algorithm used in scarna.
the accuracies of mxscarna in terms of sps and mcc were evaluated for three datasets: an original dataset, the bralibaseii benchmark multiple alignment dataset, and kiryu et al.
's multiple alignment dataset.
mxscarna's accuracies were at least comparable to those of current state-of-art aligners.
in addition, the accuracies of mxscarna were robust over a broad range of sequence similarities, whereas the other aligners tested showed reductions in sps or mcc.
the computational complexities of mxscarna were evaluated as o in time and o in memory for n sequences of length l. in the comparison of execution time for benchmark datasets, mxscarna was by far the fastest among the structural aligners and was fast enough for large-scale analyses.
mxscarna aligns even 5000-base rna sequences with acceptable computational costs though the accuracies of alignments for long sequences are not yet confirmed.
the source code of mxscarna and its web server are available at the web site  <cit> .
authors' contributions
yt and ka developed the algorithm, and together they wrote the manuscript with the help of tk.
yt implemented the algorithm into the software  and executed all of the computational experiments.
hk contributed to the design of the new score function and closely collaborated in the computational experiments.
tk helped to design the computational experiments and to write the manuscript.
with the help of yt, ka organized the development of the web server.
all the authors have read and approved the final version of the manuscript.

 non-coding rnas are transcribed rna molecules that do not encode proteins. their functions often depend on their 3d-structures rather than their primary sequences. the secondary structures of rna sequences can be identified by various methods, including minimization of the free energy. however, it is not always possible to obtain the accurate secondary structures. more reliable predictions of the secondary structures are possible if we have a set of rna sequences with a common secondary structure. for consensus structure prediction, rnaalifold, pfold, and mccaskill-mea are applicable only to sets of aligned rna sequences. multiple alignment tools that consider only sequence similarities, e.g. clustalw, dialign, and t-coffee, however, have limited accuracy for rna sequences with low similarity. simultaneous prediction of the common secondary structure and optimal alignment of rna sequences is computationally quite expensive, even if pseudo-knotted structures are excluded. for example, the strict algorithm of sankoff requires o in time and o in memory for n sequences of length l. its faster variants that restrict the distances of the base pairs in the primary sequences are proposed for pairwise alignments. although structural alignment of multiple rna sequences with reasonable computational cost is difficult, several algorithms have been proposed. hofacker et al. proposed a method for progressive multiple alignments by direct comparison of the base-pairing probability matrices, implemented in pmmulti which was recently reimplemented in foldalignm and locarna by torarinsson et al. and will et al., respectively. in stemloc, holmes et al. incorporated a constraint approach that limits the range of structures and alignments to be considered by pre-processing the sequences. siebert et al. proposed an approach distantly related to sankoff's algorithm and implemented it in marna that uses the structural information for pairwise alignments before combining them into multiple alignments with t-coffee. dalli et al. developed a new scoring approach, stral, that takes into account sequence similarities as well as base-pairing probabilities. xu et al. proposed a new sampling based algorithm that finds the common structure between input sequences by probabilistically sampling aligned stems based on stem conservation calculated from intrasequence base pairing probabilities and intersequence base alignment probabilities, which was implemented in rnasampler. bauer et al. developed a graph based representation which modeled sequence-structured alignment as an integer linear program, and implemented it in rnalara. kiryu et al. proposed a variant of sankoff's algorithm with marked reduction of computation, which was implemented in murlet. all of these methods, however, are still too slow to apply to the rna sequences longer than bases. seibel et al. developed an alignment tool with an editor, which uses the secondary structure information of individual sequences to align multiple rna sequences with low time complexities. in order to extract the common secondary structure, it is also possible to find the structural motifs without aligning the whole sequences. for structural motif finding, yao et al. proposed an algorithm based on covariance models, and hamada et al. proposed a graph mining approach. here we propose a method, implemented in mxscarna, for fast multiple alignments of rna sequences. this method extends our previous work in pairwise alignments to progressive multiple alignments with improved score functions, and simultaneously construct multiple alignments and the associated common secondary structures. the pairwise alignment in this progressive alignment is an heuristic algorithm that separately aligns 5' parts and 3' parts of the stems with rough consistency considerations. in benchmark experiments, our method was at least as accurate as currently available state-of-art multiple alignment methods, but unlike those methods, the computations were fast enough for large-scale analyses, though the accuracies for the alignments of long sequences have not yet been confirmed.  algorithm overview of the algorithm the proposed method, implemented in mxscarna, progressively aligns multiple rna sequences, in an extension of the pairwise structural alignment algorithm of our previous work. first the guide tree for the progressive alignment is built by unweighted pair group method with arithmetic mean by using the pairwise similarities of the rna sequences. second the base-pairing probability matrices are calculated for all the rna sequences by mccaskill's algorithm. those base-pairing probabilities are used for extracting the potential stems and for the matching scores in the dynamic programming of the alignments. third the rna sequences are progressively aligned along the guide tree using scarna's pairwise alignment algorithm with improved score functions introduced in this paper. at the first stage of the progressive alignment, which corresponds to the bottom level of the guide tree, the pairs of rna sequences are aligned by engineered dp algorithm of scarna's pairwise alignment. the pairwise alignment is very fast because the potential stems extracted from the base-pairing probability matrices are decomposed into 5' part and 3' part and those two parts are independently aligned. in each upper-level step of the progressive alignment according to the guide tree, potential stems for groups of rna sequences are extracted from the averaged base-pairing probability matrices. the dp algorithm of the pairwise alignment uses the approximated posterior probabilities as score functions. the approximation uses the product of the pairwise posterior probabilities of maximum expected accuracy alignments and the base-pairing probabilities of the sequences. mea alignment maximizes the expected number of positions where the two nucleotides are correctly aligned. to yield robust alignments, the pairwise posterior probabilities of mea alignments are modified by the probability consistency transformation. definitions definition 1: stem candidate given a base-pairing probability matrix for an rna sequence and a threshold τ, stem candidate is a set of continuous base pairs of which the base-pairing probabilities are greater than τ. definition 2: stem fragment given a base-pairing probability matrix for an rna sequence, a threshold τ, and an integer w, stem fragment is a set of continuous base pairs of length w, of which the base-pairing probabilities are greater than τ. a stem candidate longer than w is represented by a set of overlapping stem fragments of fixed-length w. smaller values in w or τ increase the sensitivity of the predictions of the stems and decrease the specificity of them. w and τ are set to and respectively in all the computational experiments in this paper. for each stem fragment, the 5' stem component and the 3' stem component, which are representatives of the 5' and 3' portions of the stem fragment, respectively, are defined as follows. definition 3: stem component for each stem fragment, a stem component xa, either a 5' stem component or a 3' stem component, is an object that has the following properties: • p: position, the position of the leftmost base of the 5' or 3' part of the stem fragment. • s: sequence, the nucleotide sequence of the 5' or 3' part of the stem fragment. • c: partner component, the complementary stem component. • d: loop distance, the distance to the complementary stem component. a stem fragment is written as by using the mutually complementary stem components, 5' stem component xa and 3' stem component xa', which represent the 5' and 3' parts of the stem fragment. xa and xa' satisfy xa = c and xa' = c. the loop distance d can be written as d = p) - p - w. definition 4: stem component sequence a stem component sequence is a sorted sequence of all the stem components of an rna sequence, in order of their positions and, if the positions are the same, according to their loop distances. for i <j, a scs x = x1x... xm satisfies p <p or p = p &d <d. definition 5: relations of stem fragments without an overlap two stem fragments, and of an rna sequence are, parallel if and only if p <p <p <p or p <p <p <p, nested if and only if p <p <p <p or p <p <p <p, pseudo-knotted if and only if p <p <p <p or p <p <p <p. definition 6: relations of overlapping stem fragments two stem fragments, and of an rna sequence are, r-continuous if and only if r = p - p = p - p, ill-continuous if and only if xa overlaps xb and xa' overlaps xb' and p - p ≠ p - p, contradictory if and only if only one side, either 5' part or 3' part, of the stem fragments overlap. the three possible relationships between stem fragments without an overlap: parallel, nested, and pseudo-knotted, may exist in the same secondary structure of an rna sequence. however, among the three possible relationships between overlapping stem fragments, only r-continuous stem fragments may coexist in the same secondary structure of an rna sequence. 1-continuous, a special case of r-continuous, means that the two stem fragments are adjacent in the rna sequence and a part of a stem candidate with a length of w +. as described later, two overlapping stem components in the alignment are controlled to belong to two r-continuous stem fragments in dp. building stem component sequences in a base-pairing probability matrix, which is calculated by mccaskill's algorithm, a potential stem is located in two symmetry locations as continuous counterdiagonal positions which have high base-pairing probabilities. therefore, the stem components for each rna sequence defined in previous section are extracted by scanning counterdiagonal windows of length w in the base-pairing probability matrix and selecting the windows whose elements are greater than τ. smaller value in w or τ increase the sensitivity of the predictions of the stems and decrease the specificity of them. w and τ are set to and respectively in all the computational experiments in this paper. the stem components are sorted in order of their positions and loop distances to construct a stem component sequence. for each group alignment in the progressive alignment, the average of the base-pairing probability matrices is calculated directly according to the alignment of the group of rna sequences. the stem components for the group are extracted from the averaged matrix, and the scs is constructed by sorting the stem components. alignment of stem component sequences before the pairwise alignments or group alignments, rna sequences or groups of rna sequences are represented by their stem component sequences. those two scss are aligned by scarna's pairwise dp algorithm in each stage of the progressive alignment. the alignment of the two scss uses two dp matrices, m and g. for two scss, {xi} and {yj}, m is the best score of the alignment of the pair xi and yj, given that xi matches yj, and g is the best score given that xi mismatches yj. the recursions for m and g are written as: m=max⁡{m+δsm+sg+s g=max⁡{mmgg with the initial conditions; m = m = m = g = g = g = -∞. the first term of equation controls the 1-continuous case where the continuous matches of two overlapping stem components form a match of the corresponding stem longer than w. αi/βj are the indices of the components that are 1-continuous with xi/yj. the positions of xαi/yβj are adjacent to xi/yj in the nucleotide sequences, i.e. p=p+ p)=p)− p=p+ p)=p)− δs corresponds to the incremental score for the match of the overlapping stem components, which is discussed in the next section. the second and third terms of equation keep the stem components in the adjacent dp match from overlapping in the nucleotide sequences. pi/qj are the indices of the nearest components that do not overlap with xi/yj. s is a match score for xi and yj, which is discussed in the next section. equation refers only adjacent positions in dp matrix because overlaps of xi and yj with the other stem components are permitted. because the 5' stem components and the 3' stem components are handled independently, there is no term for bifurcation in secondary structures in equations and. the traceback pointer keeps the triplets, indices of x, y, and the selection of m or g, in the recursion and. the first term of the triplet, the index of x, can be either αi, pi, i, or i - and the second term of the triplet, the index of y, can be either βj, qj, j, or j - in the traceback of the dp, m and g are used jointly to obtain the optimal path and to select m or g, which gives the maximum score of the alignment. the alignments of scss are constructed by selecting the stem components that appear in the path with the selected m. all of the mismatched stem components are excluded from the alignment. the algorithm makes the adjacent dp matches of stem components either not overlapping in the nucleotide sequences or consistently overlapping as a match of the stems longer than w. pairwise alignment of the scss requires only o in time and in memory. that computational complexities are evaluated as for two rna sequences of length l because the number of the stem components is regarded as a linear function of the length of the nucleotide sequence. the pairwise alignment of scss allows some inconsistent matches by ignoring strict treatments of the complementary components. for two stem fragments, and, if xa matches yb in the scs alignment, xa' should match yb'. let us define such a match as left-right consistent. because 5' stem components and 3' stem components are aligned independently, left-right consistency is not guaranteed in general. any match which is not left-right consistent is removed as a post process. if any two of the stem components of a same scs appear in the scs alignment and their complementary components overlap, those complementary components do not appear together in the alignment because the alignment of complementary components are controlled to be either nonoverlapping or r-continuous. therefore, the post process also guarantees that no pair of contradictory stem fragments appears in the alignment. the score function using the mea alignment in our previous work, a function of the ribosum score, loop distance, base-pairing probabilities, and the stacking energy were used as the score s in recursion. in mxscarna, the score function is replaced by an approximated posterior probability according to the principle of maximum expected accuracy. recent studies have shown that the accuracy of the resulting sequence alignment and secondary structure predictions is better than that of predictions made by the conventional maximum likelihood estimation algorithms. in the following, for nucleotide sequences x and y, xi ~ yj means that xi ∈ x and yi ∈ y are aligned on the same column in the alignment, and xi ◇ xj means that xi, xj ∈ x form a base pair. for two rna sequences, x, y and k, l ∈ { ···, |x|}, m, n ∈ { ···, |y|}, let p be the posterior probability, i.e. the sum of the probabilities that two positions of the sequences, xk and ym, xl and yn, are aligned in the alignment, and that two pairs of the nucleotides, xk and xl, ym and yn, form base pairs in the secondary structures as well; this is computed by the inside-outside algorithm of the pair stochastic context free grammar for structural pairwise alignments of rna sequences. we wanted to use posterior probability as the score function s, but the computational costs, o in time and o in memory for sequences of length l, are impractical. we instead used the following approximated posterior probability introduced by kiryu et al.. p^=p˜p˜pp. p and p are the base-pairing probabilities that the particular positions xk and xl, ym and yn, respectively, form base pairs; these probabilities are computed by mccaskill's algorithm. p˜ and p˜ are the posterior probabilities modified by probability consistency transformation, which is computed as follows. p˜=1|s|∑z∈s∑r∈{...,|z|}pp, where s is the set of rna sequences to be aligned. in this transformation, the probability of specific nucleotides of two sequences being aligned are replaced by the average over the products of probabilities that the two nucleotides are aligned to the same nucleotides in arbitrary third sequences. this calculation requires o in time and o in memory. the probability consistency transformations are applied twice in current implementation. p is the posterior probability, i.e. the sum of the probabilities that particular positions of the two sequences, xk and zr, are aligned in some alignment; this is computed by the forward-backward algorithm of the pair hidden markov model for pairwise alignment of the sequences. our new matching scores in are defined as follows. s=∑0≤w<wp^+w~yp+w,xp+w−1−w~yp+w−1−w) δs=p^+w−1~yp+w− xp~yp) where x′i/y′j are the complementary stem components of xi/yj. the sum of the probabilities, not the logarithms of the probabilities, is used for the matching score, in an effort to maximize the number of correctly aligned bases including the implicit prediction of the base pairs. alignment of loop region the remaining loop regions are aligned by using the consistency-transferred posterior probabilities, p˜, as the matching scores. the probabilities, not the logarithms of the probabilities, again are used, according to the mea principle. the recursion is shown following. a=max⁡{a+p˜aa emission and transition probabilities for the pair hmm in mxscarna were trained via expectation-maximization on a set of unaligned sequences that is extracted from the rfam database and that do not overlap the sequences of the dataset for subsequent experiments. computational experiments datasets to test the empirical performance of mxscarna, we used three datasets for the benchmark multiple alignments: an original multiple alignment dataset, the bralibaseii multiple alignment dataset, and kiryu et al.'s multiple alignment dataset. our original dataset comprised multiple alignments of sequences, the secondary structures of which have been published, obtained from the rfam database. there are families of rna sequences in the dataset and the sequence identities varied from 35% to 100%. sequences that included bases other than a, c, g, and u were removed because some of the alignment programs were unable to align them. the bralibaseii benchmark dataset included multiple alignments of sequences. the sequences of each multiple alignment were extracted from trna, intron_gpii, 5s_rrna, and u families in the rfam database and the signal recognition particle rna family in the srpdb database. because the dataset did not include consensus secondary structure annotations to the alignments, we used the secondary structure annotations recovered by kiryu et al.. kiryu et al.'s multiple alignment benchmark dataset was generated from selected seed alignments in the rfam database that have published consensus structures. for each sequence family, as many as random combinations of sequences were generated. the alignments whose mean pairwise sequence identity exceeded 95% and whose gap characters accounted for more than 30% of the total number of characters aligned were removed. as such, this dataset consisted of multiple alignments of sequences, generated from sequence families, with five alignments for each. the dataset was reasonably divergent, and its mean length varied from to bases, and mean pairwise sequence identities varied from 40% to 94%. evaluation measures the qualities of the alignments were evaluated by the sum-of-pairs score for the accuracy of the alignments and by the matthews correlation coefficient for the accuracy of the secondary structure predictions. the sps and mcc of the alignment to be evaluated for the reference alignment were defined as follows. the sps was defined as the proportion of correctly aligned nucleotide pairs: sps=∑i=1ispit∑j=1jspjr where i is the number of columns in the test alignment, j is the number of columns in the reference alignment, on column i in the test alignment spit is the total number of "correct" nucleotide pairs which also appear in the reference alignment, on column j in the reference alignment spjr is the total number of nucleotide pairs. the mcc was defined as mcc=tp×tn−fp'×fn,fp'=fp−ξ, where tp indicates the number of correctly predicted base pairs, tn the number of base pairs that were correctly predicted as unpaired, fp the number of incorrectly predicted base pairs, and fn the number of true base pairs that were not predicted. the term ξ accounts for predicted base pairs that were not present in the reference structure but were compatible with it. compatible base pairs are not true positives but have to be neither inconsistent nor pseudo-knotted with respect to the reference structure. in order to calculate mcc for each test alignment, the reference alignment and the "correct" consensus secondary structure are taken from the database. in order to compare the accuracies of the alignments in terms of the implicitly predicted common secondary structures, the common secondary structures for each test alignment by the alignment programs were predicted by the pfold program. comparison of accuracies with those of other aligners to compare the accuracies of the alignment methods we used a linux machine with an amd opteron processor. we compared the performance of mxscarna with that of murlet, probcons, mafft, clustalw, stral, marna, rnasampler, rnalara, foldalignm, locarna, pmmulti, and stemloc on the three datasets described earlier. whereas probcons, mafft, and clustalw align rna sequences on the basis of sequence similarities only, stral, marna, rnasampler, rnalara, foldalignm, locarna, pmmulti, stemloc, and murlet weigh both sequence similarities and secondary structures. the command line options for the programs in the experiments are shown in table the results for the original dataset are shown in table because marna, locarna, foldalignm, pmmulti, and stemloc impose high time and memory demands, those programs were executed only on families of which the average sequence lengths were less than or equal to bases. the sps of mxscarna was comparable to those of murlet and probcons, which currently are the best performing aligners. in addition, the mcc of mxscarna was one of the highest among aligners. in particular, the mcc of mxscarna is similar to that of stemloc, which aligns only short sequences that have simple secondary structures. the results from the bralibaseii benchmark multiple alignment dataset are shown in table because of their prohibitive requirements for memory and time, stemloc, foldalignm, pmmulti, and marna were not applied to the srp family data. again, mxscarna was comparable to murlet and probcons in terms of sps and one of the best performers among multiple aligners according to the mcc. these trends continue in table which contains the results from kiryu et al.'s benchmark dataset comprising sequences for each alignment. all results are summarized in table evaluation of new score function in order to evaluate the performance of our new score function, we compared it in pairwise alignment with the previous score function of scarna, which is a linear combination of ribosum score, stacking energy, loop-distance penalty, base-pairing probability. dowell's dataset, which consists of r dataset and percid dataset, are used for the evaluation. r is a dataset which consists of pairwise alignments chosen randomly from trna and 5srrna families in rfam database and percid is a balanced dataset of pairwise alignments from the same families. the sps and mcc are shown in table it is observed that the new score function of mxscarna outperformed the previous score function of scarna. time and memory the computational complexities of the proposed method for n sequences of length l were evaluated as follows. the construction of the guide tree using the alignments of all pairs of the sequences required o in time and o in memory. the calculation of base-pairing probability matrices for n sequences by mccaskill's algorithm required o in time and o in memory. the probability consistency transformation in method) required o in time and o in memory. pairwise alignment of stem component sequences required o in time and memory as is explained in method. therefore, the total computational complexities were o in time and o in memory. for the base-pairing probabilities, the computational time for each sequence can be reduced to o by restricting the maximum distance of the base pairs to a fixed constant w. the computation of probability consistency transformation for a pair of sequences can also be calculated in o time by restricting the effective width of transformation to a fixed value. those reductions reduce total time complexity to o. we will address those improvements in future work. comparisons of alignment tools in regard to execution time for nucleotide sequences of various lengths are presented in figures and randomly generated sequences were allocated into groups of the same lengths and were used for alignment. stemloc aligned sequences of not more than bases; foldalignm and locarna were faster than stemloc and aligned sequences of bases or less. because the lengths of the sequences were the same in each alignment task, the banded dynamic programming technique of these methods was effective. although the murlet program returned results for sequences as long as bases in the best case, it was much slower than mxscarna. mxscarna required only seconds to align sequences of bases and returns alignments for sequences as long as bases, though the accuracies for sequences longer than bases have not yet been evaluated. similar comparisons for various numbers of the sequences are presented in figure the execution time of mxscarna is acceptable even for sequences. sequence identities and alignment accuracies alignment methods based only on sequence similarities often fail to capture common secondary structures among their alignments, especially when the similarities between sequences are low. in contrast, current alignment methods that rely on information about secondary structures tend to produce inaccurate alignments for sequences of moderate to high similarity by putting too much weight on common secondary structures. the relationships between accuracy and sequence identity for three alignment tools mxscarna, probcons, and stemloc are shown in figures and probcons, one of the best of the aligners that ignore information regarding secondary structure, maintains a high sps throughout low to high sequence similarities, but mcc markedly drops for low sequence identities. stemloc, one of the best structural aligners, achieved robust accuracies in mcc but failed to compete among the other aligners in regard to sps for moderate sequence identities. mxscarna, which incorporates information on maximum expected accuracy alignment in its structural alignments, yielded robust accuracies in terms of both sps and mcc throughout the tested range of sequence similarities. availability and requirements project name: ncrna.org project; project home page:; operating systems: linux with gcc and cygwin with gcc; programming language: c++; license: free software, except for inclusion to comertical software; the source code of mxscarna and its web server, the dataset and its references are available at. on the web server w and τ correspond to "scslength" and "baseprobthreshhold" respectively, and "basepairscoreconst" is a parameter of mccaskill-mea used for the secondary structure prediction, which controls the sensitivity and the specificity of the prediction.  we have developed mxscarna, a new structural multiple aligner of rna sequences, which progressively applies the pairwise alignment algorithm used in scarna. the accuracies of mxscarna in terms of sps and mcc were evaluated for three datasets: an original dataset, the bralibaseii benchmark multiple alignment dataset, and kiryu et al.'s multiple alignment dataset. mxscarna's accuracies were at least comparable to those of current state-of-art aligners. in addition, the accuracies of mxscarna were robust over a broad range of sequence similarities, whereas the other aligners tested showed reductions in sps or mcc. the computational complexities of mxscarna were evaluated as o in time and o in memory for n sequences of length l. in the comparison of execution time for benchmark datasets, mxscarna was by far the fastest among the structural aligners and was fast enough for large-scale analyses. mxscarna aligns even 5000-base rna sequences with acceptable computational costs though the accuracies of alignments for long sequences are not yet confirmed. the source code of mxscarna and its web server are available at the web site. authors' contributions yt and ka developed the algorithm, and together they wrote the manuscript with the help of tk. yt implemented the algorithm into the software and executed all of the computational experiments. hk contributed to the design of the new score function and closely collaborated in the computational experiments. tk helped to design the computational experiments and to write the manuscript. with the help of yt, ka organized the development of the web server. all the authors have read and approved the final version of the manuscript. 
the source code of mxscarna and its web server are available at. although many alignment methods for non-coding rnas, including sankoff's algorithm for strict structural alignments, have been proposed, they are either inaccurate or computationally too expensive. we propose a fast algorithm for multiple structural alignments of rna sequences that is an extension of our pairwise structural alignment method. the proposed method for structural alignment of multiple rna sequences is fast enough for large-scale analyses with accuracies at least comparable to those of existing algorithms. aligning multiple rna sequences is essential for analyzing non-coding rnas.
 aligning multiple rna sequences is essential for analyzing non-coding rnas. although many alignment methods for non-coding rnas, including sankoff's algorithm for strict structural alignments, have been proposed, they are either inaccurate or computationally too expensive. faster methods with reasonable accuracies are required for genome-scale analyses.  we propose a fast algorithm for multiple structural alignments of rna sequences that is an extension of our pairwise structural alignment method. the accuracies of the implemented software, mxscarna, are at least as favorable as those of state-of-art algorithms that are computationally much more expensive in time and memory.  the proposed method for structural alignment of multiple rna sequences is fast enough for large-scale analyses with accuracies at least comparable to those of existing algorithms. the source code of mxscarna and its web server are available at. 