Drosophila melanogaster and Drosophila pseudoobscura. This alignment draws on existing heuristics for dividing whole genomes into small pieces for alignment, and it relies on advances we have made in computing convex polytopes that allow us to parametrically align non-coding regions using biologically realistic models. We demonstrate the utility of our parametric alignment for biological inference by showing that cis-regulatory elements are more conserved between Drosophila melanogaster and Drosophila pseudoobscura than previously thought. We also show how whole genome parametric alignment can be used to quantitatively assess the dependence of branch length estimates on alignment parameters.The classic algorithms of Needleman–Wunsch and Smith–Waterman find a maximum a posteriori probability alignment for a pair hidden Markov model (PHMM). To process large genomes that have undergone complex genome rearrangements, almost all existing whole genome alignment methods apply fast heuristics to divide genomes into small pieces that are suitable for Needleman–Wunsch alignment. In these alignment methods, it is standard practice to fix the parameters and to produce a single alignment for subsequent analysis by biologists. As the number of alignment programs applied on a whole genome scale continues to increase, so does the disagreement in their results. The alignments produced by different programs vary greatly, especially in non-coding regions of eukaryotic genomes where the biologically correct alignment is hard to find. Parametric alignment is one possible remedy. This methodology resolves the issue of robustness to changes in parameters by finding all optimal alignments for all possible parameters in a PHMM. Our main result is the construction of a whole genome parametric alignment of  Drosophila melanogaster and Drosophila pseudoobscura. The parametric alignment consists of all optimal alignments of the two Drosophila genomes for all choices of parameters for some widely used scoring schemes. Computation and analysis of the parametric alignment requires the integration of ideas from mathematics, algorithms, and biology. Mathematically, the parametric analysis rests on the geometric principle of convexity. In particular, the alignment polytope, which organizes the alignments according to the optimal alignments, is introduced and described. Algorithmically, efficient procedures are developed for computing alignment polytopes on a large scale and for models with more parameters than had previously been practical. Biologically, the utility of parametric analysis is demonstrated by showing that the degree of conservation between cis-regulatory elements in Drosophila melanogaster and Drosophila pseudoobscura is higher than previously thought, and by assessing the dependence of branch length estimates on alignment parameters.Dewey and colleagues describe a parametric alignment of the genomes of  Drosophila melanogaster CG9935-RA gene  locatedM, mismatch X, and space penalty S), these two orthologous introns have the following optimal alignment when the parameters are set to M = 5, X = −5, S = −5:Using the basic 3-parameter scoring scheme  is called the alignment summary. As an example, consider the above pair of orthologous Drosophila introns. The first (shorter) alignment has the alignment summary  while the second (longer) alignment has the alignment summary .Our approach to parametric alignment rests on the idea that the score of an alignment is specified by a short list of numbers derived from the alignment. For instance, given the standard three-parameter scoring scheme, we summarize each alignment by the number 46.Remarkably, even though the number of all alignments of two sequences is very large, the number of alignment summaries that arise from Needleman–Wunsch alignment is very small. Specifically, in the example above, where the two sequences have lengths 61 and 60, the total number of alignments is 1,511,912,317,060,120,757,519,610,968,109,962,170,434,175,129 ≈ 1.5×10M,X,S. For biologically reasonable choices, i.e., when we require M > X and 2S < X, only six of the 13 summaries are optimal. These six summaries account for a total of 8,362 optimal alignments  satisfyNote that the basic model discussed above has only l + l′ for the six summaries in x,s).This relation holds with l and l′, the number of optimal alignment summaries is bounded from above by a polynomial in l and l′ of degree d(d − 1)/(d + 1), where d is the number of free parameters in the model [d = 2, this degree is 0.667, and so the number of optimal alignment summaries has sublinear growth relative to the sequence lengths. Even for d = 5, the growth exponent d(d − 1)/(d + 1) is only 3.333. This means that all optimal alignment summaries can be computed on a large scale for models with few parameters.In general, for two DNA sequences of lengths he model ,10. For d(d − 1)/(d + 1) was derived by Gusfield et al. [d = 2 and by Fernandez-Baca at al. [d. d = 2 and d = 3, and it generates a representation of all optimal alignments with respect to all reasonable choices of parameters. Although XPARAL has a convenient graphical interface, it seems that this program has not been widely used by biologists, perhaps because it is not designed for high throughput data analysis and the number of free parameters is restricted to d ≤ 3.The growth exponent d et al.  for d = a at al.  and Pacha at al.  for genet al. d. . This soconvexity, which was absent in the earlier studies [d of free parameters is greater than three.In this paper, we demonstrate that parametric sequence alignment can be made practical on the whole-genome scale, and we argue that computing output such as  studies ,6,9. Our46 alignments, and the “needles” are the 8,362 optimal alignments. The summaries of the optimal alignments are the vertices of the alignment polytope. The alignment polytope is the convex hull of the summaries of all  alignments. Background on convex hulls and how to compute the alignment polytopes are provided in the section From Genomes to Polytopes , the polytope is a convex polygon, as shown in Convexity is the organizing principle that reveals the needles in the haystack. In our example, the “haystack” consists of more than 10see also ). Thus, d = 3), Kimura-2 (d = 4), and Kimura-3 (d = 5). The models are reviewed in the section “Models, alignment summaries, and robustness cones.”The basic model is insufficient for genomics applications. More realistic PHMMs for sequence alignment include gap penalties. We consider three such models. The symmetries of the scoring matrices for these models are derived from those of the evolutionary models known as Jukes–Cantor  exact matching non-coding sequences, 2) ungapped high scoring aligned coding sequences, 3) segment pairs between two other constraints where one of the segments has length zero, so the non-trivial segment must be gapped, and 4) single nucleotide mismatches that are squeezed between other constraints.D. melanogaster segments range from one to 80,676 base pairs. The median length is 42 bp and the mean length is 99 bp. In all, 90.4% of the D. melanogaster genome and 88.7% of the D. pseudoobscura genome were aligned by our method.We then removed all segments where the sequences contained the letter N . This process resulted in 877,982 pairs of segments for parametric alignment. The lengths of the For each of the 877,982 pairs of orthologous segments, we constructed all optimal Needleman–Wunsch alignments, with respect to various scoring schemes that are derived from PHMMs. We considered models with two, three, four, and five parameters. See  for a rebasic model, discussed in the Introduction, has three natural parameters, namely, M for match, X for mismatch, and S for space. If the numbers M, X, and S are fixed, then we seek to maximize M · m + X · x + S · s, where  runs over the summaries of all alignments. In light of Equation 1, this model has only two free parameters and there is no loss of generality in assuming that the match score M is zero. From now on we set M = 0 and take X and S as the free parameters. We define the alignment summary to be the pair .The w whose rows and columns are both indexed by A, C, G, T, and -. The matrix w for the basic model is the leftmost matrix in Following the convention of Pachter and Sturmfels , we summ3d model is the most commonly used scoring scheme for computing alignments. This model includes the number g of gaps. A gap is a complete block of spaces in one of the aligned sequences; it either begins at the start of the sequence or is immediately preceded by a nucleotide, and it either follows the end of the sequence or is succeeded by a nucleotide. The 3d alignment summary is the triple . The score for a gap, G, is known as the affine gap penalty. If X, S, and G are fixed, then the alignment problem is to maximize X · x + S · s + G · g where  runs over all 3d alignment summaries. The parametric version is implemented in XPARAL. Introducing the gap score G does not affect the matrix w, which is still the leftmost matrix in Our 4d model is derived from the Kimura-2 model of sequence evolution. The 4d alignment summary is the vector  where s and g are as above, x is the number of transversion mismatches (between a purine and a pyrimidine or vice versa) and y is the number of transition mismatches (between purines or between pyrimidines). The four parameters are X, Y, S, and G. The matrix w of scores, as specified in [Our ified in , is now 5d scoring scheme is derived from the Kimura-3 model. Here the matrix w is the rightmost matrix in 5d alignment summary is the vector , where s counts spaces, g counts gaps, x is the number of mismatches y is the number of mismatches z is the number of mismatches Drosophila intron alignments at the beginning of the Introduction are  and . Even the 5d model does not encompass all scoring schemes that are used in practice. See the section “Assessment of the BLASTZ alignment” for a discussion of the BLASTZ scoring matrix [Our 3,3,4,29,. Even throbustness cone of that alignment is the set of all parameter vectors that have the following property: any other alignment that has a different alignment summary is given a lower score. As a mathematical object, the robustness cone is an open convex polyhedral cone in the space dR of free parameters.Suppose we are given a specific alignment of two DNA sequences. Then the optimal, relative to one of our four models, if its robustness cone is not empty. Equivalently, an alignment summary is optimal if there exists a choice of parameters such that the Needleman–Wunsch algorithm produces only that alignment summary. Such a parameter choice will be robust, in the sense that if we make a small enough change in the parameters then the optimal alignment summary will remain unchanged. Each robustness cone is specified by a finite list of linear inequalities in the model parameters.An alignment summary is said to be x,s) = , labeled D in X,S) such that the score 23X + 9S is larger than the score of all other alignments summaries other than . This cone is specified by the two linear inequalities S > X and 4S < 3X.For example, consider the first alignment in the Introduction. Its 2d alignment summary is the pair  and called a convex polytope. There exists a unique smallest subset V ⊆ S for which conv(S) = conv(V). The points in V are called the vertices of the convex polytope. The vertices lie in higher-dimensional faces on the boundary of the polytope. Faces include edges, which are one-dimensional, and facets, which are (d − 1)-dimensional. Introductions to these concepts can be found in the textbooks [computing the convex hull of a finite set S ⊂ d,R we mean identifying the vertices and the facets of conv(S), and, if possible, all faces of all dimensions.The extbooks ,19. By calignment polytope of two DNA sequences is the convex polytope conv(S) ⊂ d,R where S is the set of alignment summaries of all alignments of these two sequences. For instance, the 3d alignment polytope of two DNA sequences is the convex polytope in R3 that is formed by taking the convex hull of all alignment summaries . x,s)-plane is the polygon depicted in Consider one of the four models discussed in the previous section. The V of vertices of the alignment polytope. The Needleman–Wunsch algorithm efficiently solves the linear programming problem over this polytope. For instance, for the 3d model with fixed parameters, the alignment problem is the linear programming problemIt is a basic fact of convexity that the maximum of a linear function over a polytope is attained at a vertex. Thus, an alignment of two DNA sequences is optimal if and only if its summary is in the set X = −200, S = −80, and G = −400, which represent an approximation of the BLASTZ scoring scheme . The solution to Equation 2 is attained at the vertex  = , which is the 3d summary of the following alignment of our two Drosophila intronsFor a numerical example, consider the parameter values The 3d summary of this alignment is the marked vertex in S). See also [normal cone of the polytope at that vertex. The alignment fan is the normal fan of the alignment polytope. See [The problem of computing a parametric alignment is now specified precisely. The input consists of two DNA sequences. The output is the set of vertices and the set of facets of the alignment polytope conv. The polytope propagation algorithm was introduced in ,11.Needleman–Wunsch (NW) subroutine that is an efficient implementation of the classical Needleman–Wunsch algorithm. For fixed values of the parameters, this subroutine returns an optimal alignment summary. For instance, for the 3d model, the input to the NW subroutine is a parameter vector  and the output is an optimal summary .The incremental convex hull algorithm, on the other hand, gradually builds the alignment polytope by successively finding new optimal alignment summaries, the vertices of the polytope. To find the new optimal summaries, the algorithm repeatedly calls a P be the convex hull of the summaries in d,R and we assume that P is already d-dimensional. We maintain a list of all vertices and facets of P. Each facet is either tentative or confirmed, where being confirmed means that its affine span is already known to be a facet-defining hyperplane of the final alignment polytope. In each iteration, we pick a tentative facet of P and an outer normal vector U of that facet. We then call the NW subroutine with U as the input parameter. The output of the NW subroutine is an optimal summary v. If the optimal score U · v equals the maximum of the linear function U · w over all w in P, then we declare the facet to be confirmed. Otherwise, the score U · v is greater than the maximum and we replace P by the convex hull of P and v. This convex hull computation utilizes the beneath–beyond construction [Suppose we have already found a few optimal alignment summaries, by running the NW subroutine with various parameter values. We let truction , which eP at that iteration is the final alignment polytope. The number of iterations of this incremental convex hull algorithm equals the number of vertices plus the number of facets of the final polytope P. So for a given model, the running time of the incremental convex hull algorithm scales linearly in the size of the output. This was confirmed in practice by our computations , the alignments are then constructed using the Needleman–Wunsch algorithm with the HOXD70 matrix.We initiated such a study for the BLASTZ alignment  of D. meRecall that our orthology map consisted of 1,999,817 segment pairs: 1,116,792 consisted of segments for which we fixed the alignment (constrained segment pairs), and 883,025 were unconstrained segment pairs for which we constructed alignment polytopes. We found that the BLASTZ alignment agreed with 623,710 of our unconstrained segment pairs, of which 622,173 did not contain Ns. For each of these 622,173 segment pairs, we computed the 2d, 3d, and 4d alignment summaries for the BLASTZ alignments, and we determined whether or not they are optimal for some choice of model parameters.We found that 269,186 (43.3%) of the BLASTZ alignments are vertices of the 3d polytope, but not the 2d polytope, and 201,982 (32.5%) are vertices of both the 2d and 3d polytopes. Only 151,004 (24.3%) of the BLASTZ alignments are not vertices of either the 2d or 3d alignment polytopes. In summary, our computations show that 32.5% of the BLASTZ alignments correspond to vertices of the 2d polytope and 75.7% correspond to vertices of the 3d polytope. These numbers are even higher for the 4d and 5d alignment polytopes.Curiously, there is precisely one sequence pair where the BLASTZ alignment is a vertex of the 2d polytope but not the 3d polytope. This alignment isX,S,G). However, it is optimal for the 2d model since the edge maps onto the vertex  of the 2d polygon.The 3d summary of this alignment is , which is the midpoint of the edge with vertices  and  on the 3d polytope. Hence this alignment is not optimal for any choice of parameters  that are suitable for the alignment of cis-regulatory elements. Any user of the BLASTZ alignments may now use the alignment polytopes we provide to assess whether or not the fixed choice of the HOXD70 matrix is the right one for their particular biological application.D. melanogaster and D. pseudoobscura than previously thought. Specifically, we used our alignment polytopes to examine the degree of conservation for 1,346 transcription factor binding sites [http://www.flyreg.org (we excluded 16 sites that were located in segment pairs containing Ns). The 1,346 sites include the 142 sites examined by Richards et al. [D. pseudoobscura and D. melanogaster.A central question in comparative genomics is the extent of conservation of cis-regulatory elements and the implications for genome function and evolution. Using our parametric alignment, we discovered that cis-regulatory elements may be more conserved between ng sites  availabls et al.  in theirSpecifically, for each of the 1,346 elements, we identified the orthologous segment pairs from our orthology map that contained the elements. We then extracted the polytopes from our whole genome parametric alignment. For each polytope, we determined an optimal alignment for which the number of matching bases of the corresponding element was maximized.D. melanogaster (Adf1-> Antp:06447 in the flyreg database). The BLASTZ alignment for this element isAs an example, consider the transcription factor Adf1. It binds to a cis-regulatory element at chr3R:2,825,118–2,825,144 in D. melanogaster cis-regulatory element is not conserved in D. pseudoobscura. However, there are many optimal alignments that indicate that this element is conserved. Examining our constrained segment pairs, we found that the prefix TGTG was at the end of a 13-bp exact match. The remaining D. melanogaster element was part of a segment pair which has 813 distinct optimal alignments in the 3d model. Among these, we found the following alignment with parameters G = −3, S = −8, X = −18:This alignment suggests that the percent identity for an element as follows:Note that we include the TGTG prefix to show a complete alignment of the cis-regulatory element. The second alignment has 24 matches instead of the BLASTZ alignment with eight. The number of matches can be used to calculate the G = −882, S = −87, X = −226) is more reasonable, even though it has a lower percent identity (67%):Percent identity was used in  as a criD. melanogaster cis-regulatory element is likely to have been conserved in D. pseudoobscura.This alternative alignment suggests that the percent identity criterion may not be the best way to judge the conservation of elements. Regardless, we believe our parametric alignment indicates that in this particular case, the Our overall results are summarized in D. melanogaster and D. pseudoobscura than previously thought. The alignment polytopes should be a useful tool for further investigation of the extent of conservation of cis-regulatory elements among the Drosophila genomes.Our results seem to indicate that cis-regulatory elements are more conserved between l,l′, with 2d alignment summary , one computes the Jukes–Cantor distance of the two genomes as follows:An important problem in molecular evolution is the estimation of branch lengths from aligned genome sequences. A widely used method for estimating branch lengths is based on the Jukes–Cantor model of evolution . Given aJukes–Cantor correction of the two aligned sequences. The Jukes–Cantor distance can be interpreted as the expected number of mutations per site.See  for a deJCd depends on the underlying pairwise sequence alignment summary, which in turn depends on the alignment parameters, it is natural to ask how the branch length estimate depends on the parameters in a 2d-scoring scheme. We therefore introduce the Jukes–Cantor distance function which is the function JC: 2R → [0,∞) given by  X · x + S · s.Because the Jukes–Cantor distance JC for the entire genomes of D. melanogaster and D. pseudoobscura. As the result of this computation, we now know the Jukes–Cantor distances for all whole genome alignments that are optimal for some choice of biologically reasonable parameters .We computed the Jukes–Cantor distance function X,S), the optimal 2d alignment summary  for the two genomes is the sum of the optimal summaries of all 877,982 unconstrained segment pairs plus the sum of the alignment summaries of the non-coding constrained segment pairs (which do not depend on the parameters). We determined that the constrained segment pairs contained 91,355 mismatches and 16,339,305 matches. The genome alignment polytope is the Minkowski sum of the 877,982 alignment polytopes. The vertices of the genome alignment polytope correspond to optimal summaries of whole genome alignments.The notion of “optimal” used here rests on the following precise definitions. Given parameters . The finding that there are so few vertices constitutes a striking experimental validation of Elizalde's Few Inference Functions Theorem [We computed the genome alignment polytope for the 2d model. Remarkably, this convex polygon, which is the Minkowski sum of close to one million small polygons as in  Theorem  in the cJC of D. melanogaster and D. pseudoobscura is a piecewise constant function on the -plane. Indeed, JC is constant on the cones in the normal fan of the genome alignment polygon. Note that JC is undefined when  is perpendicular to one of the 1,183 edges of the genome alignment polygon. For such , the Jukes–Cantor distance function jumps between its values on the two adjacent cones in the normal fan.The Jukes–Cantor distance function S, and monotonically increasing as a function of X. We found it interesting that at the line X = S, there is a large “Jukes–Cantor jump” where the value of the function increases from 0.1683 to 0.2225.The graph of the Jukes–Cantor distance function is shown in The Jukes–Cantor distance function is a new tool for parametric reconstruction of phylogenetic trees. Instead of estimating a single distance between each pair of genomes in a multiple species phylogenetic reconstruction, one can now evaluate the Jukes–Cantor function at vertices of the Minkowski sum of the whole genome alignment polytopes. These can be used for parametric phylogenetic reconstruction using distance-based methods such as neighbor joining.The summary of a pair of aligned sequences is a list of numbers that determine the score for a scoring scheme. The alignment polytope is a geometric representation of the summaries of all alignments. It is an organizing tool for working with all alignments through their summaries. We view the Needleman–Wunsch algorithm as a fast subroutine for finding vertices of the alignment polytope. The construction of alignment polytopes is useful for biological studies based on sequence alignments where the conclusions depend on parameter choices.We have highlighted three biological applications of our parametric alignments, namely the problem of parameter selection for sequence alignment, functional element conservation, and estimation of evolutionary rate parameters. In each case, our perspective suggests new directions for further research.Alignment polytopes offer a systematic approach to solving the parameter selection problem. Although this paper did not address statistical aspects of parameter selection, we wish to emphasize that the vertices of the polytopes represent maximum a posteriori estimates of alignments for PHMMs. Our polytopes provide a setting for developing statistically sound methods for parameter selection that are not dependent on pre-existing alignments.Drosophila genome projects (consisting of sequencing 12 genomes of related species) offer an extraordinary opportunity for extending our study and further exploring cis-regulatory element conservation. This leads to the question of multiple alignment, which we have not addressed in this paper, but which we believe presents a formidable and important challenge in biological sequence analysis. In particular, it will be interesting to explore the geometric point of view we have proposed and to develop parametric algorithms for multiple sequence alignment.Our results on cis-regulatory elements show that they may be significantly more conserved than previously thought, and suggest that, in contrast to the analysis of ultra-conserved elements, sequence alignment procedures can be crucial in the analysis of certain functional elements. The ongoing The Jukes–Cantor distance function, computed here for the first time, will be important for determining the robustness of evolutionary studies based on sequence alignments. Estimates of the neutral rate of evolution, which are crucial for comparative genomics studies, can hopefully be improved and further developed using our mathematical tools. The Jukes–Cantor distance function opens up the possibility of parametric distance–based phylogenetic reconstruction. An immediate next step is the extension of our results to other phylogenetic models.Drosophila genomes has revealed mathematical insights that should be explored further. For example, we observed empirically that alignment polytopes have few facets. Although we have not explored the combinatorial structure of alignment polytopes in this paper, this offers a promising direction for improving our parametric alignment algorithms and is an interesting direction for future research.The construction of millions of alignment polytopes from two D. melanogaster (April 2004 BDGP release 4) and D. pseudoobscura (August 2003 freeze 1).The data analyzed are the genome sequences of ab initio predictions. For D. melanogaster, we used Flybase [D. pseudoobscura. Annotations were obtained from the UCSC genome browser, except for SNAP which we ran ourselves.Gene annotations for identifying exons were based on reference gene sets and  Flybase , SNAP, gMUMmer version 3.18  was usedhttp://bio.math.berkeley.edu/parametric/.The Beneath–Beyond and polytope propagation algorithms were implemented in C++. Source code and binaries are available at D. melanogaster. The resulting alignment blocks were compared with our constraints.The BLASTZ alignment was obtained from the UCSC genome browser. The “net” and “chain” tracks were used to determine the best alignment for each interval in http://www.flyreg.org. 16 sites were excluded because of segment pairs containing Ns.The transcription factor binding sites used in the cis-regulatory element study were obtained at Computations were carried out on an 18-node (36 CPU at 2.3 GhZ each) cluster. Each node had 2 Gb RAM.http://bio.math.berkeley.edu/parametric/.The alignment polytopes, software, and supplementary material can be downloaded at


The genomes of many species are dominated by short sequences repeated consecutively. It is estimated that over 10% of the human genome consists of tandemly repeated sequences. Finding repeated regions in long sequences is important in sequence analysis.We develop a software, LocRepeat, that finds regions of pseudo-periodic repeats in a long sequence. We use the definition of Li et al.  for the LocRepeat is available at  The gCCTCCTCCTCCACCTCCTCCTCCTCCTCCTCCTCCTCCGCCTTCTCATCCTCCTCCACTTCCTCCTCCTCCTCCTCCTCCCCTTCTCATCCTCCTCCTCTTCATCTACCCThis tandem repeat consists of 35 approximate copies of the repeated pattern CCT.Variation in the pseudo-periodic repeats demonstrates biologically important information. Sensitive tools for finding those regions containing pseudo-periodic repeats are required in practice. Repeats occur frequently in biological sequences, but they may not be exact in many cases. If the repeats are exact, the problem can be easily solved from computation point of view. However, repeats are seldom exact in biological sequences. The errors in those repeats make it difficult to find regions of those repeats. Many measures and algorithms have been proposed.n such that the edit distance (a match costs 0 and a mismatch/indel costs 1) between the two copies is at most k. The running time of the algorithm is O(kn log k log(n/kL)). Schmidt [n. The algorithm can handle any score scheme. It requires O(n2 log n) time and Θ(n2) space. In both [Landau and Schmidt  studied  Schmidt  used wei In both  and 5],,n such tThree measures can be used to give partitions of repeated regions.Wan and Song proposed a measure in which all the repeated copies (except the last one) have the same length . For thiapproximate period) using edit distance or relative edit distance. The problem in general is defined as follows: given a string x, find a repeated pattern p such that x can be partitioned as x = p1p2...pk and  is minimized. Here d is the relative edit distance which is  the edit distance, where L = (|p| + |pl|)/2 is the average length of the two strings p and pl. Note that, the normalization of the edit distance is important for finding repeated patterns since otherwise, one can give a partition in which each pattern has one letter and the edit distance is at most 1 . The problem in general is NP-hard   approximDB:1SRY)  has weakpseudo-periodic repeats. Given a repeated region (a string) x and a partition X = s1s2...sk, the pseudo periodic score isLi et al.  gave thed(·) is the edit distance, |si| is the length of si, and c is a factor that control the penalty of the two ends of the partition. Li et al.  be the substring of s that consists of the first j letters. Informally, we use w to denote the maximum self-alignment value of a suffix tj of s such that there are i letters at the right end of the self-alignment of tj that are aligned with spaces and scored as . Note that, the right end of the self-alignment of tj could contain more than i spaces. However, only the last i spaces are scores as  each and the rest of them are scored as the score for μ.Let Tj be the set of all suffixes of s. For a substring t of s and an integer i, Π = {π(t)|π(t) ∈ Π(t) and |tk-1tk| ≥ i}, where tk-1, tk are the last two repeats in π(t). We defineLet V value of all the partitions in Π, where t is a substring in Tj. To compute w using dynamic programming method, we first consider the boundary values of w. We set w = -∞ since we do not allow suf to be empty. Note that, by definition, i ≤ j.to be the maximum Lemma 1 For a sequence s of length n, w = c·j for 1 ≤ j ≤ n.Proof. For a partition π(t) = {t1, t2, ..., tk} satisfying t ∈ Tj and π(t) ∈ Π, from the definition of Π, |tk-1tk| ≥ j. Since t is a suffix of s and |t| ≥ |tk-1tk| ≥ j, we have t = s and 1 ≤ k ≤ 2. Consider the self alignment of π(t) such that the last j letters in t are mapped to spaces with score . Two cases arise. Case 1: k = 1 and t = t1 = s. In this case, the middle alignment is empty. Thus, V(π(t), c, j) =  × (|t1| + j) = c·j. Case 2: k = 2 and t = t1t2 = s. In this case, the middle alignment is the alignment between |t2| spaces and t2. By the assumption that  >μ, V(π(t), c, j) = |t2| × μ +  × (|t1| + j) <c·j. □From the above analysis, the initial and boundary values arew = -∞, w = c·j     (2)Theorem 2 For a sequence s of length n and 2 ≤ j ≤ n, 1 ≤ i <j,Proof. Consider the partition π(t) = {t1, t2, ..., tk} such that t ∈ Tj, π(t) ∈ Π and V(π(t), c, i) = w. We analyze the value of V(π(t), c, i) based on different cases.case 1. π(t) has only one repeat. We have |t| = |t1| = i and the middle alignment is empty. Therefore V(π(t), c, i) =  × (|t1| + i) = c·i.case 2. π(t) has k ≥ 2 repeats. In this case, the middle alignment is not empty since it contains tk. The last column in the middle alignment has three configurations: (a) the last column contains two letters s[j - i] and s[j], (b) the last column contains a space and the letter s[j], (c) the last column contains the letter s[j - i] and a space. For sub-case (a), if we take away the last letter s[j] from the self alignment of π(t), we can get a self alignment of π'(t'), where t' ∈ Tj-1, π'(t') ∈ Π and V(π'(t'), c, i) = w. By comparing the two self alignment, we have V, c, i) + μ = w + μ. For sub-case (b), if we take away the last letter s[j] and space aligned with s[j] from the self alignment of π(t), we can get a self alignment of π'(t'), where t' ∈ Tj-1, π'(t') ∈ Π and V(π'(t'), c, i) = w. Notice that in the end of the self alignment of π'(t'), there are only i - 1 letters mapped to spaces with score , and there is one more letter in the self alignment of π(t) mapped to spaces with score . Thus, V(π(t), c, i) = w + μ + . For sub-case (c), π(t) ∈ Π. We can impose that the alignment of the letter s[j - i] and the space is scored as , not μ. From V(π(t), c, i + 1) = w, we have V(π(t), c, i) = w + μ - . □n be the length of the input sequence s. We compute w in the order shown below:Based on Theorem 2, a dynamic programming algorithm is designed. Let for j = 1 to n dofor i = j downto 1 dow based on Theorem 2.compute O(n2), where n is the length of the whole string. A standard backtracking process allows us to find the local optimal pseudo-periodic region t.Obviously, the time complexity is s = CAGAGT. We set c = -2 and use the following score scheme: a match costs 10, a mismatch costs -10, and an insertion or a deletion costs -10. The table constructed by using the dynamic programming algorithm is shown in Figure w's are computed from left to right. From the table, it is easy to see that the maximum value of w is w = 16. From the maximum value w = 16, we know that the local optimal pseudo-periodic region t is a suffix of s = CAGAG and there are 2 letters aligned with spaces and scored as  at the right end of the self alignment of the local optimal pseudo-periodic region t. From w, we can backtrack w → w → w and stop at w since w gets its value from c·i indicating the first segment of the partition of t ends at 3-th letter in s and the length of the segment is 2. Thus, we get t = AGAG. From the self alignment, it is easy to get the partition of π(t) = {AG, AG}.The following example illustrates the algorithm. Let O(n2) if we are not careful. However, we can release the space whenever they are no longer useful. Thus, only two columns, are required for the computation. For each of the two columns, we use two arrays: one array stores the value of w and the other array stores the starting position of the subsequence t that maximizes w. Therefore, the space complexity is O(n) for computing all w's. After w's are computed, we know the substring t that leads to the optimal w value. Therefore, we can reconstruct the alignment for t in  time and space, where n1 is the length of t, the repeated region. If n1 is still big, we can use the standard technique in , that contains 5 pseudo-periodic units . The length of the sequence is 828. We use PAM120 as the similarity score matrix and find the local units Table .In conclusion, the algorithm presented in this paper offers the possibility to find regions of pseudo-periodic repeats in a long sequence.


Percentage Identity (PID) is frequently quoted in discussion of sequence alignments since it appears simple and easy to understand. However, although there are several different ways to calculate percentage identity and each may yield a different result for the same alignment, the method of calculation is rarely reported. Accordingly, quantification of the variation in PID caused by the different calculations would help in interpreting PID values in the literature. In this study, the variation in PID was quantified systematically on a reference set of 1028 alignments generated by comparison of the protein three-dimensional structures. Since the alignment algorithm may also affect the range of PID, this study also considered the effect of algorithm, and the combination of algorithm and PID method.The maximum variation in PID due to the calculation method was 11.5% while the effect of alignment algorithm on PID was up to 14.6% across three popular alignment methods. The combined effect of alignment algorithm and PID calculation gave a variation of up to 22% on the test data, with an average of 5.3% ± 2.8% for sequence pairs with < 30% identity. In order to see which PID method was most highly correlated with structural similarity, four different PID calculations were compared to similarity scores (Sc) from the comparison of the corresponding protein three-dimensional structures. The highest correlation coefficient for a PID calculation was 0.80. In contrast, the more sophisticated Z-score calculated by reference to randomized sequences gave a correlation coefficient of 0.84.Although it is well known amongst expert sequence analysts that PID is a poor score for discriminating between protein sequences, the apparent simplicity of the percentage identity score encourages its widespread use in establishing cutoffs for structural similarity. This paper illustrates that not only is PID a poor measure of sequence similarity when compared to the Z-score, but that there is also a large uncertainty in reported PID values. Since better alternatives to PID exist to quantify sequence similarity, these should be quoted where possible in preference to PID. The findings presented here should prove helpful to those new to sequence analysis, and in warning those who seek to interpret the value of a PID reported in the literature. Statistical measures of sequence similarity are routinely applied to quantify the results of sequence database searches ,2. HowevRecently, May comparedOut of 1028 aligned pairs there were only 20 pairs where all four percentage identity measures had the same value. 711 pairs had differences in PID between 2% and 5%. There were 87 pairs for which the difference was greater than 5%. The greatest difference seen was 11.5%.The difference between the maximum and minimum PID decreases slightly with increasing minimum PID. Thus, the average difference in PID for alignments with a minimum PID ≤ 30% was 3.3 ± 1.5 %, while the average difference for alignments with PID > 30% was 2.2 ± 1.5%.PID2 was always largest since it considers only the aligned positions. PID4 was ≤ PID1 on most of the pairs. Differences between PID4 and PID1 were observed in pairs where one sequence overhangs at the N-terminal and other at the C-terminal. For most of the alignments, PID3 was higher than PID1 or PID4. PID4 gave slightly more consistent values of PID that were less prone to artefactually high or low values as a result of overhangs. PID4 also gave a slightly better correlation with structural similarity as shown in Table Ideally, one would calculate the PID between two sequences from the comparison of the protein three – dimensional structures. In the absence of structures for both proteins, sequence alignment techniques must be applied. Since alignment of sequences is an optimisation based on the parameters and algorithm, the resulting alignment depends on these factors. Accordingly, the range of PID4 was examined for the reference structural alignment and for sequence alignments obtained by the AMPS,10 alignIn order to understand the effect of the alignment algorithm on the PID, the same sequence pairs were aligned by AMPS , CLUSTALIn the real-world situation where one is comparing PID values calculated in different ways by different algorithms, the results presented here suggest the range in PID difference will be between 0 and 21.8 %. The average difference for PID ≤ 30% was 5.3 ± 2.8% and > 30% was 2.7 ± 1.9%.In this article it has been shown that the PID value was affected both by the way in which it was calculated, and by how the alignment was generated. While neither of these facts is particularly surprising, to our knowledge, this is the first time the range of PID has been reported for these effects. The combined effect of algorithm and calculation gave rise to differences in PID of up to 22%. Given these limitations, which PID calculation gave the most reliable estimate of similarity?r = 0.82), while PID4 was best correlated (r = 0.86), with PID1 marginally worse (r = 0.85). This suggests the order of reliability to be PID4 ≥ PID1 > PID3 > PID2. Table The STAMP structural comparison algorithm that was used to generate the reference alignments in this study provides a measure of structural similarity (Sc) which takes account of distance and conformational similarity, for each pair of proteins . The corwhere, V is the alignment score for two sequences, σ and  & Barton. The corIn this paper we have quantified the variation in reported percentage identity seen in 1028 structural alignments, due to different denominators in the PID calculation and due to alignment method. The overall conclusions are:1. The four different PID denominators considered, gave up to 11.5% difference in PID on a single alignment in the test set.2. Sequence alignments by three different methods resulted in variation of up to 14.6% PID on a single alginment in the test set.3. Combination of PID calculation and alignment method led to variation of up to 22% PID on a single alignment in the test set.4. PID calculations that take account of gaps (PID1 and PID4) were more highly correlated with the STAMP Sc score for structural similarity between the proteins, than those that do not consider gaps (PID2 and PID3).5. All PID calculations were less well correlated with the STAMP Sc score than the Z-score obtained by comparison to shuffled sequence scores.These overall conclusions are not surprising to those expert in sequence analysis, but to our knowledge this is the first time that the variation in PID has been quantified explicitly. Quantification of the variation in PID is valuable, since although PID is a poor substitute for more sophisticated scoring methods that take account of the physico-chemical properties of the amino acids and correct for sequence length, PID remains widely quoted. The findings presented here should prove helpful to those new to sequence analysis, and as a guide to those who seek to interpret the value of a PID reported in the literature.Protein domain families were taken from the OxBench database of reference alignments . OxBenchFor each reference structural alignment, the percentage identity was calculated in four different ways.PID1 was calculated as described by Doolittle, (1981):PID2 only considers matched residues ,4:PID3 only considers the shortest sequence  :PID4 considers the shortest length (sequence plus gap positions).TGA and TGB are the sum of the number of residues and internal gap positions in sequences A and B in the alignment.Where In this study, all PID values were calculated over the complete alignment rather than the structurally conserved core. This reflects the situation when aligning two protein sequences where neither protein has a known three-dimensional structure and so the structurally conserved core is unknown.GPSR ran the programs, wrote analysis code and drafted the paper. GJB conceived and directed the project, and finalised the analysis and manuscript.


High quality multiple alignments are crucial in the transfer of annotation from one genome to another. Multiple alignment methods strive to achieve ever increasing levels of average accuracy on benchmark sets while the accuracy of individual alignments is often overlooked.We have previously developed a method to automatically assess the accuracy and overall difficulty of multiple alignments. This was achieved by a per-residue comparison between alternate alignments of the same sequences. Here we present a key extension to this method, an algorithm to extract similarly aligned regions from several alignments and merge them into a new consensus alignment.We demonstrate that the fraction of correctly aligned residues within the resulting alignments is increased by 25 – 100 percent compared to the original input alignments, as only the most reliably aligned parts are considered. Multiple alignments are of key importance in transferring annotation from model organism to humans . The impIt is often more desirable in practice to create alignments in which only reliable regions are aligned and unreliable regions remain unaligned. Misaligned regions can give the impression of conservation where in fact there is none. This is particularly true in multi-domain cases where alignment programs often fail to insert large gaps corresponding to the loss, or gain, of entire domains. In phylogenetic reconstruction such misaligned regions essentially contribute noise that can lead to false tree topologies -10. PrevHere we present a new algorithm that extracts identically aligned regions from several multiple alignments and creates new alignments out of them. Within these alignments, unreliably aligned residues from the input alignments are disentangled and therefore we term them relaxed alignments.The input of our method is a set of multiple alignments of the same sequences generated either by different alignment methods or by a few methods employing different parameter settings.An important concept in our algorithm are pairs-of-aligned residues (POARS) as defined in Lassmann and Sonnhammer (2005). Briefly, within an alignment two residues form a POAR when they occur in different sequences (rows) but within the same column.The algorithm for the extraction of reliable regions from a set of alignments follows a few simple steps:M are atomized into POARs.1. All input alignment in the set of alignments M, P(M) is created. For example if |M| = 3, the following list of sub-sets is created: {},{A},{B},{C},{AB},{AC},{BC},{ABC} where A, B, C are alignments.2. The power set of P(M) depending on its occurrence within the input alignments. For example, an aligned pair of residues occurring in alignment A, B and C will be assigned to set {A, B, C} but not to any other set such as {A, B}.3. Each individual POAR is assigned to a single subset of P(M) containing f alignments, select the one containing the maximum number of POARs (X). The parameter f is the stringency criterion for including residues in the final alignment: f = 3 requires all POARs in the final alignment occur in at least three input alignments, while f = 2 only requires POARs to occur in at least two alignments.4. Among the subsets of Y including all POARs that belong to X or sub-sets of P(M) of which X is a subset itself. If X = {A, B}, include POARs from this set but also from set {A, B, C}.5. Build a set 6. Assemble alignment by :(a) Start with an alignment that contains only single residues in each columny.(b) Sequentially merge columns if their residues form a POAR present in (c) Sort the alignment columns to preserve the order of the residues in the initial sequences.The previous version of Mumsa required that all input alignments to be in the Fasta format and contain the sequences in the same order. Both of these limitations were removed in this version to make it easier for users to use several different alignment methods.A this reliability score is the sum of the occurrences of all POARs, that A is involved in, normalized by the maximum reliability score attainable . These reliability scores can be visualized by Kalignvu [Mumsa can produce output alignments in Fasta, Clustal and Macsim  alignmenKalignvu  to aid uAlignment accuracy is measured by comparing a test alignment to a reference alignment. The sum-of-pairs score (SPS)  and Q-scTo test our method we used a selection of alignment methods Table  in combi1. All 12 alignment programs are run on all test cases in Balibase.f.2. Mumsa is run on the resulting alignments with varying stringency parameter 3. All alignments are scored using the PRA function.In addition, we calculated the percentage of aligned residues, or the number of aligned residues divided by the total number of possible aligned residues.The computational properties of Mumsa were tested by comparing the cumulative running time of alignment methods to the running time of Mumsa using three settings. We used the program ROSE  to generThe PRA scores for all alignment methods used in this study are surprisingly low Table . For reff does not have to be high to give good accuracy gains. Residues occurring in more than 25 percent, here three or more, of input alignments are reliable and lead to good relaxed alignments.The relaxed alignments created by Mumsa have a much higher per-residue accuracy than those of the input alignment. Depending on the overall difficulty of the subset of benchmark alignments, the increase in accuracy is dramatic. This is especially true for the first Balibase reference set where the accuracy is almost doubled. It is particularly striking that the stringency cutoff f the fewer residues are aligned. Another observation is that the difficulty of the alignment cases affects the number of aligned residues in the merged alignments. For example, fewer aligned residues are present in the Mumsa alignments for the set 11, the most difficult one, compared to the other ones. In fact, the Pearson correlation coefficient between the average accuracy of input alignments  and the percentage of aligned residues of the most relaxed alignments is 0.98. This supports the notion that alignment programs usually disagree in difficult cases – more precisely in regions that are difficult to align.As expected, the alignments generated by Mumsa contain fewer aligned residues than the input alignments. Moreover, the higher the cutoff The alignment viewer Kalignvu can be used to display the output alignments of Mumsa Figure . A heat-f. It is clear that the running time is influenced by the choice of f. Nevertheless, the running time of Mumsa remains two to three orders of magnitude lower than that required by the input alignment methods.The running time of Mumsa is very low in comparison to that required by the input alignments Figure . We ran Much emphasis has been given to alignment methods that focus on aligning a large fractions of residues because this often gives high scores on benchmark sets. We argue that it is equally relevant to increase the ration of correctly aligned residues within generated alignments. For this purpose we have introduced an algorithm to extract identically aligned parts from several multiple alignments and have shown that those are very reliable. Our method operates on pairs of aligned residues rather than columns. In addition to being able to identify blocks of high conservation, our method can therefore also identify correctly aligned regions which only few input sequences share.f) to more compact but less reliable alignments (low f). Due to the good computationally properties of Mumsa little extra computing time is required to perform such an analysis. A direct application of relaxed alignments is in phylogenetics where alignment accuracy is of prime importance. An alignment in which 60 percent of the residues are aligned with an accuracy of more than 95 percent is clearly more desirable than an alignment where 90 percent of the residues are aligned, but incorrectly so in a quarter of cases.In contrast to alignments generated by most popular direct alignment method, the relaxed alignments generated by Mumsa contain more gaps and are therefore less compact. As such they are inherently different from traditional alignments and users will have to decide whether these are suitable to be used directly in their specific studies. However, relaxed alignments can always be used to get an overview of conservation, a sense of how trustworthy alignments are and, more importantly, which regions are reliable. Users may wish to examine Mumsa alignments in a hierarchical manner, starting from the most reliable (high stringency cutoff  or by request from T. Lassmann.The Mumsa program is freely available at The authors declare that they have no competing interests.TL had the idea of extracting similarly aligned regions from alternate alignments of the same sequences, implemented the method and carried out the evaluation. ELLS supervised the work. All authors read and approved the final manuscript.


Sequence alignment is a common tool in bioinformatics and comparative genomics. It is generally assumed that multiple sequence alignment yields better results than pair wise sequence alignment, but this assumption has rarely been tested, and never with the control provided by simulation analysis. This study used sequence simulation to examine the gain in accuracy of adding a third sequence to a pair wise alignment, particularly concentrating on how the phylogenetic position of the additional sequence relative to the first pair changes the accuracy of the initial pair's alignment as well as their estimated evolutionary distance.The maximal gain in alignment accuracy was found not when the third sequence is directly intermediate between the initial two sequences, but rather when it perfectly subdivides the branch leading from the root of the tree to one of the original sequences . Evolutionary distance estimation in the multiple alignment framework, however, is largely unrelated to alignment accuracy and rather is dependent on the position of the third sequence; the closer the branch leading to the third sequence is to the root of the tree, the larger the estimated distance between the first two sequences.The bias in distance estimation appears to be a direct result of the standard greedy progressive algorithm used by many multiple alignment methods. These results have implications for choosing new taxa and genomes to sequence when resources are limited. DNA sequence alignment is a common step in molecular evolutionary analysis. Aligned sequences are used for many purposes, including estimation of patterns of divergence, selection, the tempo and mode of evolutionary change, identification of functional elements and constraints, and phylogenetic history, just to name a few. Alignments are a hypothesis of site homology; as evolutionary distance among sequences increases, alignments are known to become less accurate -7. The eMultiple sequence alignment, the alignment of more than two sequences, is generally thought to lead to more accurate alignments than simple pair wise alignments . There aBeyond simple accuracy, multiple sequence alignment may affect downstream sequence analysis in unexpected ways relative to pair wise sequence alignment. In a previous study , I show The primary goal of this study was to use simulation to examine the improvement in alignment accuracy when going from pair wise to multiple alignments, profiling the change versus the position of the additional sequences. How much is the accuracy of alignment of a pair of sequences improved by the addition of a third sequence with an intermediate evolutionary history ? Where should the third sequence be in order to maximize the accuracy of the initial pair's alignment? In addition, the effects of these multiple sequence alignment on evolutionary distance estimation were also profiled. Does the position of the third sequence have an effect on the estimation of evolutionary distance of the initial pair, independent of the accuracy of the alignments?Figure d = 0.5 and d = 1.0) were extremely congruent with both showing a peak reduction of about 15% error in the multiple alignment versus the pair wise alignment. The larger divergence (d = 2.0) is essentially flat since the changes in absolute error seen in Figure d = 0.5, 60 sites for d = 1.0, and 15 sites for d = 2.0.Figure Additional simulations for 4-taxon trees were also performed (results not shown). As would be expected from the above results, the maximal improvement in the alignment of sequences A and B was found when the fourth sequence was added to the center of the branch leading from the root to sequence B. Simulations of 16-taxon model trees were also conducted to investigate how much improvement can be made with the addition of even more sequences. Two extreme 16-taxon trees were used as initial simulation models, a perfectly balanced tree and a perfectly pectinate tree Figure  were 68%These results add an additional spin to the debate over the importance of taxon sampling in phylogeny reconstruction. Although it is generally thought that increased taxon sampling yields more accurate phylogenies, simulation studies have proven to be equivocal and controversial -29. HoweCebus albifrons) or the blind mole rat . In contrast, inclusion of sequences from the completed rat genome )Multiple sequence alignments do improve upon pair wise sequence alignments. The optimal taxon sampling strategy for maximally improving alignments is to bisect long branches in a balanced framework. Independent of alignment accuracy, however, multiple alignment using a progressive algorithm can bias evolutionary distance estimates, with larger estimates consistently found as intermediate sequences appear deeper in the phylogeny.C = πG = 0.3, πT = πA = 0.2. The transition-transversion bias was set to that observed at neutral sites in mammals, κ = 3.6 .MR designed, programmed, executed, and analyzed all parts of this study.


The quality of progressive sequence alignments strongly depends on the accuracy of the individual pairwise alignment steps since gaps that are introduced at one step cannot be removed at later aggregation steps. Adjacent insertions and deletions necessarily appear in arbitrary order in pairwise alignments and hence form an unavoidable source of errors.Here we present a modified variant of progressive sequence alignments that addresses both issues. Instead of pairwise alignments we use exact dynamic programming to align sequence or profile triples. This avoids a large fractions of the ambiguities arising in pairwise alignments. In the subsequent aggregation steps we follow the logic of the Neighbor-Net algorithm, which constructs a phylogenetic network by step-wisely replacing triples by pairs instead of combining pairs to singletons. To this end the three-way alignments are subdivided into two partial alignments, at which stage all-gap columns are naturally removed. This alleviates the "once a gap, always a gap" problem of progressive alignment procedures.The three-way Neighbor-Net based alignment program aln3nn is shown to compare favorably on both protein sequences and nucleic acids sequences to other progressive alignment tools. In the latter case one easily can include scoring terms that consider secondary structure features. Overall, the quality of resulting alignments in general exceeds that of clustalw or other multiple alignments tools even though our software does not included heuristics for context dependent (mis)match scores. A large part of comparative genomics thus hinges on our ability to construct accurate MSAs. Since the multiple sequence alignment problem is NP hard  with theIn this contribution we present a novel approach to progressive sequence alignment that alleviates both shortcomings at the expense of utilizing an exact algorithm to compute alignment of sequence and profile triples. Instead of using a single guide tree, we follow here the logic of phylogenetic networks as constructed by the Neighbor-Net algorithm  which caThe contribution is organized as follows: In the following section we outline the algorithms aspects of our approach. Furthermore we describe a straightforward way of incorporating RNA secondary information. Section 3 summarizes benchmark data in comparison to other multiple alignment tools. We conclude with a brief discussion of future improvements.n3) time and space, which we use here with minor modifications.The basic dynamic programming scheme for pairwise sequence comparison, known as the Needleman-Wunsch algorithm  requiresA, B, and C denote the three sequences. We use Ai, Bj, and Ck to refer to the ith, jth, and kth position in A, B, and C, respectively, counting from 1. As usual, '-' denotes the gap character. Scores for the alignment of two or three non-gap characters are denoted by S and S, resp. Gap penalties are determined from gap open (go) and gap extensions (ge) scores. The best score of the alignments of the prefixes Ai, Bj, and Ck is denoted by M if the residues  are aligned; Ixy the best score given that  is the last column of the partial alignment, and Ix the best score given that the last column is of the form . Ixz, Iyz, Iy, and Iz are defined analogously. It is not hard to verify that these quantities must satisfy the recursions summarized in Fig. S as described by [S = S + S + S.Let ribed by , we restAs in the case of pairwise sequence alignments, the recursions immediately generalize to alignments of profiles so that a single sequence becomes a special case of a profile. Match and gap scores are simply added up over all triples of sequences, one from each profile.n even on modern workstations. Several approaches have been explored in the past to reduce the search space so that long sequences can be dealt with, see e.g. [The resource requirements of this algorithm, in particular the cubic memory consumption, are acceptable only for relative small sequence lengths see e.g. -16.l are subsequently subdivided into smaller sequences until the length criterion is fulfilled. The partial sequences are aligned separately and the emerging alignments are concatenated afterward. The result is an approximate solution of the global multiple sequence alignment problem. The choice of the threshold length depends on sequence properties and the available amount of memory and CPU resources. For the following simulations we have chosen a length of l = 150. The methods described by [We utilized here the Divide-&-Conquer approach described by  to limitribed by ,15 are kThe order in which sequences and profiles are aligned has an important influence on the performance of progressive alignment algorithms. In programs that are based on pairwise alignments such as clustalw or pileup, binary guide trees, which encapsulate at least an approximation to the phylogenetic relationships of the input sequences, are used to determine the alignment order. The input sequences form the leaves of this tree; each interior node corresponds to an alignment, so that the root of the guide tree represents the desired multiple alignment of all input sequences.implicitly defines a circular split system, which can be shown to be consistent in the sense that for any distance matrix that is a linear combination of split metrics deriving from a circular split system, Nnet recovers the original circular split system, see [B) has two neighbors, while the other two (A and C) have only a single one. Following this rule, we choose to split the alignment ABC such the sequences contained in B are distributed between two subsets B' and B" so as to maximize the scores of partial alignments AB' and B''C. In practice, we start with partial alignments AB and BC obtained from ABC. Then each of the duplicated B sequences is removed from either AB or BC using a greedy rule, i.e., we remove the copy that yields the smaller average score contribution. Of course, other division strategies are conceivable. For example, one could subdivide the alignment along the longest internal edge of its Neighbor-Joining tree, or along non-trivial splits that are optimal according to other criteria. At this stage, one can either approximate the profile distances to all other intermediate alignments using Nnet's distance recursions , or one could recompute these distances based on the alignments.Instead of a phylogenetic tree aln3nn uses a phylogenetic network to calculate the alignment order. The network is constructed using the Neighbor-Net (Nnet) approach, a distance based clustering algorithm that can be seen as a proper generalization of Neighbor-Joining ,18. The tem, see  for the tem, see -22. In oABC alignment into AB' and B''C frequently results in all-gap columns in the two parts. These are removed in order to recover valid MSAs. This constitutes a mechanism by which gaps introduced in early agglomeration steps can be removed again in later steps. This removal is guided by the increasing amount of information that is implicit in profiles composed of a larger number of sequences. Our software keeps track of gaps that appear in intermediate alignments but that are not present in the final result to demonstrate that gap removal is not a rare phenomenon in practice.The division of the n3) space and time (where n is length of the input sequences). Thus the alignment of all N sequences takes Nn3) time. If the Divide-&-Conquer approach with the cutoff length l is used, the complexity of the alignment of one triplet can be reduced to n2 + l3) space. This is the space needed to store the additional-cost matrices (see [l. The time complexity is given by n2 + nl2). The term n2 results from the time that is needed to calculate the additional cost matrices plus the time to search for the optimal slicing positions. The term nl2 comes from the alignment of the triplet itself. We assume for simplicity that all sequences have the same length n = l·2D  and all slicing positions are located exactly at the midpoint of the (sub)sequences. The total time complexity of the alignment is therefore Nn2 + Nnl2). The determination of the alignment order runs in N3) time and N) space. The calculation of the necessary pairwise distances takes N2n2) time and n2) space. Typical running times for various sets of alignments with different numbers and lengths of sequences are shown in Figure The dynamic programming algorithm for the three-way alignment requires ces (see ) plus thRecent discoveries of a large number of small RNAs with distinctive secondary structures has prompted the development of specialized multiple alignment programs for this class of molecules. Most of these approaches make explicit use of structural alignment techniques such as tree editing (MARNA ), tree aPij for each input sequence and derive for each sequence position the probabilities p1(i) = ∑j<i Pij, p2(i) = ∑j>i Pij, and p3(i) = 1 - p1(i) - p2(i) that sequence position i is paired with a position j <i, a position j > i, or that it remains unpaired, resp. The px(i)-values are used as structure annotation. For a pair of annotated input sequences A and B we define structural score contributions for positions i and j by Sfinal = ψ·Sseq + (1 - ψ)·Sstruct with a balance term ψ that measure the relative contribution of sequence and structure similarity. In the case of very similar sequence one should use ψ ≈ 1 since inaccuracies in the structure prediction are more harmful than the extra information in this case. Conversely, very dissimilar sequences have to be aligned with a score dominated by the structural component.We use McCaskill's algorithm  . On the other hand, ignoring the sequence information (ψ = 0) yields even worse results. The reason is that RNA secondary structure prediction has limited accuracy so that alignments based on predicted structures for individual sequences are based on very noisy data [ψ parameter varies between different RNA families. While alignments of group II introns and U5 spliceosomal RNAs are fairly robust against variations in ψ, we observe large variations for miRNA and 5S rRNA alignments.We find that aln3nn produces high quality alignments of structured RNAs that are at least competitive with the other methods, including computationally very expensive structure-based methods. In particular, no other program systematically outperforms aln3nn in terms of alignment quality according to either the SCI or the SPS. Interestingly, aln3nn achieves significantly higher SCI values than even the reference alignment on the 5S rRNA data set. Not surprisingly, the performance of structure enhanced alignments depends on the proper weighting of sequence and structure information. Figure isy data ,32. The f of gaps that are removed at intermediate division steps and that are not re-introduced at later stages. We find that in some data sets one fifth of the gaps in the early stages of the progressive alignment are later removed again. This observation emphasizes the fact that the "once a gap, always a gap" property of pair-wise progressive alignment algorithms is a major shortcoming.The possibility to correct gaps that are introduced at early stages was a major motivation for developing aln3nn. We therefore investigated to what extent the algorithm actually utilizes this feature. Table We have presented here a novel progressive alignment tool, aln3nn, that uses exact dynamic programming to construct three-way alignments of sequences and profiles and that uses a three-to-two aggregation procedure in the spirit of Neighbor-Net. A direct comparison of exact three-way alignments with progressive alignments of the same three sequences shows that the progressive approach leads to significantly suboptimal scores. The discrepancy increases with sequence diversity and in/del probability. While incurring significant additional computational costs compared to pair-wise, guide-tree based, approaches, aln3nn achieves competitive alignment accuracies on both protein and nucleic acid data on BAliBASE and BRaliBase benchmark data set. The software furthermore provides an option to compute structure enhanced RNA alignments.Programs such as clustalw employ a variety of heuristic rules that introduce local modifications of the scoring scheme to  compensate for problematic sections of intermediate alignments. In contrast, aln3nn achieves this encouraging performance without any heuristic modifications of the scoring schemes. This indicates that three-way alignments and the more sophisticated aggregation steps provide a significant advantage of pair-wise methods. In particular, the comparison with the performance of t_coffee shows that the shortcoming of initial pairwise alignments cannot be fully overcome even by utilizing consensus information of a collection of pairwise alignments. In particular, we observe that the three-to-two aggregation step, with its division procedure, removed up to one fifth of the previously introduced gap characters, emphasizing that the inability to correct misplaced gaps is major shortcoming of traditional progressive alignment algorithms.In its present implementation, aln3nn demonstrates that progressive alignment schemes can produce competitive high quality alignments even without sophisticated scoring functions. This leaves ample room for future improvements. In particular, one might want to include gap penalties that depend on local sequence context in particular in the intermediate profile alignment steps. The division-step for the three-way alignments could also be modified in several ways. A possible approach would infer a phylogenetic tree that is is then subdivided at the longest or the most central edge. In its present implementation, aln3nn is relatively slow compared to many recent multiple alignment methods, although it typically outperforms some of the standard tools. This lack of performance could be alleviated in the future e.g. by improving the branch and bound approach and by anchoring the alignments at very well conserved regions. Overall, aln3nn shows that progressive alignments are a competitive approach that is worth-while to explore.Project name:     aln3nn  Project homepage: Operating system(s):   platform independent in principle, tested for LINUX and other UNIX dialects.  An ANSI C compiler is required.   Programming language: C  License: GNU GPL.  Restrictions to use by non-academics: none.  MK and PFS closely collaborated in design and algorithmic aspects of this study and wrote the manuscript together. MK implemented the software and carried out all benchmark simulations.Supplementary figureClick here for file