Over the last decade, dramatic advances have been made in developing methods for large-scale phylogeny estimation, so that it is now feasible for investigators with moderate computational resources to obtain reasonable solutions to maximum likelihood and maximum parsimony, even for datasets with a few thousand sequences. There has also been progress on developing methods for multiple sequence alignment, so that greater alignment accuracy (and subsequent improvement in phylogenetic accuracy) is now possible through automated methods. However, these methods have not been tested under conditions that reflect properties of datasets confronted by large-scale phylogenetic estimation projects. In this paper we report on a study that compares several alignment methods on a benchmark collection of nucleotide sequence datasets of up to 78,132 sequences. We show that as the number of sequences increases, the number of alignment methods that can analyze the datasets decreases. Furthermore, the most accurate alignment methods are unable to analyze the very largest datasets we studied, so that only moderately accurate alignment methods can be used on the largest datasets. As a result, alignments computed for large datasets have relatively large error rates, and maximum likelihood phylogenies computed on these alignments also have high error rates. Therefore, the estimation of highly accurate multiple sequence alignments is a major challenge for Tree of Life projects, and more generally for large-scale systematics studies. Species trees are typically estimated from a collection of genes (or other genomic regions), in one of two ways.  The first way produces alignments on each gene, and then runs a phylogeny estimation method on the concatenation of these alignments; the second way estimates trees for each gene based upon an alignment of the sequences, and then combines these estimated gene trees into a species tree. In both cases, therefore, the accuracy of the resultant species tree depends directly or indirectly upon the alignments that are produced for each gene     Evaluations of these methods on both simulated and biological datasets show that alignment accuracy impacts tree accuracy, and that some methods (notably MAFFT and SATé) can produce highly accurate alignments on large datasets, and hence make it possible to construct highly accurate trees when trees are computed using maximum likelihood (ML)     In this paper, we explore the performance of alignment methods on a collection of nucleotide datasets containing large numbers of sequences. We report computational requirements, including running time and memory usage, and also the accuracy of the alignments and of maximum likelihood (ML) trees estimated on these alignments.   These comparisons show striking differences between methods. Alignment methods differ in their computational requirements, with some methods incapable of analyzing datasets beyond a few hundred sequences, and others able to analyze datasets with tens of thousands of sequences. Running time and memory usage for some alignment methods can be enormous, sometimes exceeding the computational requirements of RAxML     The main observation in this study is that only a small number of multiple sequence alignment methods can be run on datasets with several thousand sequences. Furthermore, of those methods that can be run on large datasets, none produces alignments of sufficient accuracy to be useful in estimating highly accurate phylogenies.  Therefore, when datasets are large and have evolved with many indels, the input to species tree estimations  are likely to be of poor accuracy; consequently, this suggests that species tree estimates will also have reduced accuracy for large datasets, directly because of alignment difficulties. We used several rRNA biological datasets  and one simulated dataset  to evaluate the alignment methods. The biological datasets have curated alignments based upon secondary structure and reference trees produced by computing maximum likelihood trees with bootstrapping on each curated alignment, retaining only the high support edges. For the simulated dataset, we have the true alignment and true tree. See Table 1 and the supplementary online materials     For each dataset, we attempted to compute alignments using a collection of alignment methods, and for each alignment that we generated, we computed a maximum likelihood tree using either RAxML or FastTree The biological datasets were drawn from Robin Gutell’s Comparative RNA Website (CRW)     The simulated dataset was obtained from     Reference alignments and trees were computed as follows. For the Price 78K dataset, we used the true alignment as the reference alignment, and the true tree as the reference tree; these are known because the Price 78K dataset is simulated. For the biological datasets, the curated alignment, modified by our minor cleaning operations, is the reference alignment. We computed unaligned sequences from the reference alignments by simply deleting indels (“-”). To obtain reference trees for the biological datasets, we performed rapid bootstrapping analyses with RAxML Table 1:  Empirical statistics for reference alignments and reference trees for each dataset. “# Taxa” is the number of taxa. “# Sites” is the number of sites in the reference alignment, which is the curated alignment for the CRW datasets and the true alignment for the Price 78K dataset. “Indels” is the percentage of cells in the reference alignment matrix that consist of indels. “Res” is the resolution of the reference tree, or the percentage of internal edges present in the reference tree out of the total possible number of edges. The p-distance between two sequences is the percentage of sites in which the two sequences have different nucleotides, and is denoted by "p-dist".  “Avg p-dist” is the average p-distance across all pairs of sequences in the reference alignment, and “Max p-dist” is the maximum p-distance across all pairs of sequences in the reference alignment. “Gap Len” is the average length of a gap (contiguous string of indels) in the reference alignment. n=1 for all reported values. We estimated alignments using SATé, Prank+GT     The SATé analysis we performed depended on the dataset size. The default setting for SATé was used on the six smallest datasets. The default version begins by computing four trees, formed by running RAxML to completion on MAFFT, Prank+GT     We modified this default setting for the four larger datasets, as follows. First, we replaced the expensive initial stage by only computing RAxML on the MAFFT-PartTree alignment. Second, instead of running the next stage for 24 hours, we set the number of iterations in advance. On the 16S.3 dataset we ran SATé for five iterations, and we ran SATé for ten iterations on the 16S.T dataset. We attempted to run SATé on the largest biological dataset , but it failed to complete its first iteration. We therefore did not attempt to run SATé on the largest dataset (the Price 78K dataset).Maximum Likelihood Estimation MethodsWe ran RAxML to compute trees on all but the Price 78K dataset, but tailored the specific RAxML command according to the dataset size; see the Appendix for details. For the Price 78K dataset, we computed the ML tree using FastTree, since our other analyses suggested that the RAxML analysis would require many months to complete.For each alignment produced on each dataset, we used custom code     We also recorded the running time and the memory requirement. For the running time, we report the clock time; this is approximate, since analyses were performed on machines that were not dedicated to these analyses. For the memory requirement, we only report the memory available in the machine on which the method was able to run.The six smallest datasets, 16S.M.aa_ag, 16S.M, 23S.M, 23S.M.aa_ag, 23S.E.aa_ag, and 23S.E, range in size from 117 taxa to 1028 taxa, and from 4722 sites to 10,738 sites (see Table 1). Thus, none of these is particularly large. On these datasets, all alignment and maximum likelihood analyses succeeded using a dedicated computing core with dedicated access to at least 512 MB and at most 4 GB of main memory (Tables 2 and 3). The Appendix provides further details about the hardware used for these computations.     The recorded running times for the alignment methods varied on these datasets (Table 3). The fastest of the alignment methods is the PartTree variant of MAFFT, which completed on these datasets in at most three minutes (most datasets completed in about one minute), and the slowest is SATé.    Prank+GT tended to be the most computationally intensive of the remaining methods, using several hours on the smallest datasets, on which most of the other alignment methods completed in under an hour. The next most computationally intensive method was Opal. However, all alignment methods (except for Quicktree and PartTree) took several hours on most of these “small" biological datasets. In fact, alignment estimation took more time than maximum likelihood tree estimation on many of these datasets.    The SP-FN alignment error rates of the different alignment estimators on these smaller biological datasets also varied (Table 2). The alignment estimation methods with the least average SP-FN error were MAFFT and SATé with roughly 23-24% error. The next group, with 27-30% error, was PartTree, Muscle, and Opal. Finally, Prank+GT, ClustalW, and QuickTree had 39-40% SP-FN error.      Performance with respect to average missing branch rates showed SATé and MAFFT with the lowest average missing branch rates of 6-8%, followed by PartTree, Prank+GT, Muscle, and ClustalW with average missing branch rates of 13-16%, and then by Opal and Quicktree with 18-19% average missing branch rates. Thus, alignment error, measured using SP-FN, is not particularly predictive of tree error; for example, Opal and Prank+GT change their positions quite dramatically with respect to these criteria.The four largest datasets consist of three biological datasets ranging in size from 6323 to 27,643 taxa, and having from 6,857 to 11,856 sites; in addition, we have one simulated dataset with 78,132 taxa and 1287 sites. Thus, these four datasets present substantial computational challenges. Table 4 gives the comparison between methods in terms of alignment and tree accuracy, and Table 5 gives the running time of these methods on the large datasets.    We focus first on the three biological datasets, which range in size from 6323 sequences to 27,643 sequences. Many methods aborted on these datasets: five failures on the 16S.B.ALL dataset (the largest), and three on the 16S.3 dataset. Only two alignment methods completed successfully on the 16S.B.ALL dataset, six on the 16S.T dataset, and four on the 16S.3 dataset. In addition, several methods ran for 35 days on  a machine with 256 GB of main memory without returning an alignment, and are still running ("s.r."): Muscle is still running on all three of the largest biological datasets and Prank+GT is still running on the 16S.T dataset. Thus, these datasets are very difficult for these alignment methods.    The smallest of these datasets is 16S.3, with 6323 sequences.  Only four methods completed on the 16S.3 dataset, three failures occurred ,  and one method (Muscle) is still running. In terms of alignment error, PartTree had less error than CLustalW and Quicktree.  In terms of tree error, SATé had the least error (7%), followed by ML with 9.29%, and then ML(PartTree)  with 11.83%. ML(Quicktree) had very high error of 31.47%.    On the next largest CRW dataset, 16S.T (with 7350 sequences), six methods completed,  two methods (Prank+GT and Muscle) are still running, and no failures occurred. In terms of alignment SP-FN error, MAFFT is best, followed by PartTree, then SATé, and then Opal, but all four methods are fairly close in SP-FN error (roughly 31%-39%). ClustalW and Quicktree have much higher SP-FN error rates (56% and 63%).  In terms of tree error, ML(MAFFT) is best (7.29%) followed closely by SATé (7.59%), and then by ML at 10.21% error. ML(PartTree) and ML are next, at 16.73% and 18.62%, respectively. Finally, ML(Quicktree) has the highest error at 34.23%.      The largest of these three CRW datasets is the 16S.B.ALL dataset, which contains 27,643 sequences. Only two methods, PartTree and QuickTree, succeeded in producing alignments on the 16S.B.ALL dataset.  PartTree's alignment has 41.7% error and QuickTree's alignment has 54.4% error. Maximum likelihood analyses of these two alignments produced trees with high error: 13% for ML(QuickTree) and 32% for ML(PartTree). Running times for Quicktree and PartTree alignment methods were very large–-175 and 262 hours, respectively. The maximum likelihood analyses of these alignments took even longer, 1328 and 1254 hours, respectively. The memory requirements for these methods are unknown, but each failed during an individual run with dedicated access to all 32 GB of main memory on one machine and succeeded with dedicated access to all 256 GB of main memory on another machine.    A comparison of the alignment methods on the 16S.3 and 16S.T datasets shows that PartTree is extremely fast on these datasets, finishing in 1.3 hours on the 16S.T dataset and in less than an hour on the 16S.3 dataset, and QuickTree is in second place at 41.2 and 20.4 hours, respectively. ClustalW and SATé take much longer: ClustalW uses 506 hours on the 16S.T dataset and 440 hours on the 16S.3 dataset, while SATé takes 1505.8 hours on the 16S.T dataset and 563.2 hours on the 16S.3 dataset.  Maximum likelihood analyses of the four alignment methods that completed on these two datasets were also computationally intensive: on the 16S.T dataset, RAxML analyses ranged from 121 to 156 hours , while on the 16S.3 dataset, these analyses ranged from 55 to 91 hours. We were able to run SATé successfuly on the 16S.T and 16S.3 datasets using machines with 32 GB main memory available for each run, whereas MAFFT and Opal both were unable to analyze the 16S.T dataset on a machine with 32 GB main memory available for each run and failed on the 16S.3 dataset.    The Price 78K dataset is the largest of these datasets, and so presents a particularly difficult challenge to the alignment methods. On the other hand, the model condition under which this dataset was generated produced a very low number of indels . Therefore, the Price 78K dataset represents primarily a scalability test – i.e., can the alignment method be run on this dataset?  – rather than a test of accuracy for the resultant alignment. Because of the failures of most alignment methods on the 16S.B.ALL dataset, we only attempted to run the Quicktree and PartTree alignments on the Price 78K dataset. Quicktree failed on this dataset, but PartTree completed. PartTree used 71.5 hours to complete on this dataset (less than it used on the 16S.B.ALL dataset). We used FastTree to compute an ML tree on the PartTree alignment, which produced a tree with 9.14% missing branch rate in 2.9 hours. While this is a fairly high error rate, by comparison, FastTree on the true alignment (which took 3.7 hours to complete) had 8% missing branch rate. Since the true alignment has a relatively low number of sites (1287) for the large number of leaves , it seems likely that the 8% of the edges missing in the FastTree analysis of the true alignment are weakly supported. Therefore, the FastTree analysis of the PartTree alignment of the Price 78K dataset is actually highly accurate. Table 2:  Comparison of missing branch rates and alignment SP-FN errors on the six smallest datasets.  Each row gives results for a method, and each column corresponds to a dataset. All analyses succeeded using a dedicated computing core with dedicated access to at least 512 MB and at most 4 GB of main memory. The Appendix provides further details about the hardware used for these computations. Missing branch rates (%) are with respect to the reference tree. Alignment SP-FN errors (%) are with respect to the curated alignment. ML tree estimation was performed using RAxML. Table 3:  Runtimes (in hours) for each method on the smaller datasets.  Each row lists results for a method, and each column corresponds to a dataset. All analyses succeeded using a dedicated computing core with dedicated access to at least 512 MB and at most 4 GB of main memory. The Appendix provides further details about the hardware used for these computations. ML tree estimation was performed using RAxML. The runtimes given for SATé include the initial phase, which includes the calculation of the four two-phase methods, followed by a 24 hour analysis. We do not divide SATé’s runtime into time used for alignment and tree estimation, but just show the total. Table 4:  Comparison of missing branch rates and alignment SP-FN errors on the four largest datasets.  Each row lists results for a method, and each column corresponds to a dataset. Missing branch rates (%) are with respect to the reference tree. Alignment SP-FN errors (%) are with respect to the reference alignment. ML estimation was performed using RAxML on all alignments with the exception of alignments estimated on the Price 78K dataset, for which we used FastTree (we note this by using the prefix “FT:" before the missing branch rate for the Price 78K dataset). “F” indicates that the method aborted on the dataset, and “s.r." indicates that the method was still running on a 256 GB machine, at the time of submission of this manuscript. Entry “n.a.” means "not attempted"; in the case of the results for ML trees produced on estimated alignments, this meant that either we did not attempt to run the alignment, or that the alignment estimation did not complete. Entry “n.c." for alignment SP-FN error means "not computed";  this is given for those datasets that are so large that computing the alignment SP-FN error is infeasible due to computational challenges. The Appendix provides further details about the hardware used for these computations. Table 5:  Runtimes (in hours) for each method on each of the four largest datasets.  Each row lists results for a method, and each column corresponds to a dataset. ML tree estimation performed using RAxML for all alignments with the exception of alignments estimated for the Price 78K dataset; we note this by using the prefix “FT:" before the missing branch rate for the Price 78K dataset. “F” indicates that the method aborted on the dataset. “s.r” indicates that the method was still running at the time of submission of this manuscript on a machine with 256 GB main memory. Entry “n.a” indicates a method that we did not attempt to run.  The Appendix provides further details about the hardware used for these computations.  These analyses show that the choice of alignment method has a very large impact on phylogenetic accuracy. On the datasets with at most (about) 1000 sequences, all the alignment methods can be run, although they differ substantially in terms of alignment and tree accuracy, as well as in terms of computational requirements. More specifically, highly accurate trees and alignments can be computed on the smaller datasets (up to approximately 1000 sequences), provided that the most accurate alignment and tree estimation methods are used . By contrast, the other alignment methods we tested produced alignments that were much less accurate, so that trees estimated on these alignments also had much higher error rates. Finally, although all methods were successfully able to complete their analyses with at most 4 GB of main memory, many alignment methods took about 10 hours to run on many of these datsets, so that alignment estimation took more time than phylogeny estimation in some cases.    On the larger datasets, with upwards of 6,000 sequences, the analyses show that most methods are unable to run, even when provided with very large amounts of main memory; instead, only the Quicktree option within ClustalW and the PartTree option with MAFFT were able to complete analyses on all the datasets we studied with 6,000 to 28,000 sequences , and PartTree was the only method that succeeded on the largest dataset, with 78,132 sequences. Running times on the largest datasets were substantial, anywhere from several days to several weeks, just to obtain the sequence alignment . Memory requirements were also high, as many methods could not run even when given dedicated access to all 32 GB of main memory on a machine, and had to be run on machines with more memory.    One of the interesting outcomes of this study is the observation that two methods – PartTree and QuickTree – are both able to analyze many large datasets. Even these methods, however, can be computationally intensive on large datasets. For example, on the 16S.B.ALL dataset, with almost 28,000 sequences, QuickTree used about a week and PartTree used almost 11 days. Unfortunately, neither Quicktree nor PartTree is reliable in terms of alignment accuracy: the ML tree on the QuickTree alignment of the 16S.T dataset had 34% missing branch rate, and the ML tree on the PartTree alignment of the 16S.B.ALL dataset had 32% missing branch rate. Thus, the alignment methods that can be run on large datasets are not reliably accurate, and phylogenies based upon these alignments can have high error.    Finally, we note that these results show that evaluating alignment accuracy using the SP-FN measure is not necessarily predictive of phylogenetic accuracy. For example, ML trees on Prank+GT alignments have reasonably low missing branch rates although Prank+GT alignments have high SP-FN error, and ML trees on Opal alignments have high missing branch rates, although Opal alignments have low SP-FN error. Hence, evaluations of alignment methods in terms of their consequences for phylogenetic accuracy must be performed with care.5  Conclusions    This study shows that highly accurate alignments can be estimated when the datasets are small enough (at most a few thousand sequences) and only the best methods are used , or when the sequences have evolved under sufficiently low rates of indels. However, under other conditions, such as datasets with tens of thousands of sequences, very few alignment methods can even run at all, even when run on machines with very large memories. Furthermore, the alignment methods that can be run on the very largest datasets  are not methods with high accuracy. While accurate alignments can still be computed using these methods if the datasets have almost no indels, alignments estimated when indels are present will generally be poor. The consequence is that maximum likelihood trees estimated on these alignments will be far from highly accurate. Since maximum likelihood tree estimation has become the dominant method for use in large-scale phylogenetic studies, this study shows that trees estimated on alignments of single genes will be likely to fail to recover many of the well-supported edges of trees estimated on the true alignments.      What are the consequences of this study for large-scale phylogenetic estimation? Our study shows clearly that alignments of large datasets that have evolved with many indels will likely have high error rates, and so gene trees estimated from these alignments will also have high error.  At a minimum, this means that the input to species tree estimations  will have high error.  This suggests that  both of the dominant ways of estimating species trees--either  computing trees on concatenated alignments or combining gene tree estimates into a species tree--are likely to have difficulty in producing accurate species tree estimates.  Thus,  the consequence for Tree of Life studies is potentially serious.       In summary, the failure of alignment methods to be able to produce highly accurate alignments on large datasets is a limiting factor in phylogenetic estimation, possibly greater than those confronting phylogeny estimation when the true alignment is given. Clearly, new methods need to be developed to enable highly accurate alignment estimation for large datasets, or to construct trees without depending upon multiple sequence alignments of very large datasets. We thank TACC (The Texas Advanced Computing Center) at the University of Texas for assistance in analyzing the 16S.B.ALL dataset.  The research was supported by the US National Science Foundation DEB 0733029, and by Microsoft Research through support to TW.The authors have declared that no competing interests exist.We used ClustalW version 2.0.4, MAFFT version 6.240, Muscle version 3.7, Prank+GT using Prank version 080904, and Opal version 1.0.2, which required Java version 1.6.0_02.   In the commands for each method, given below, <input> is a FASTA-formatted input file containing unaligned sequences and <output> is the resulting FASTA-formatted output file.      • ClustalW:       clustalw2 -align -infile=<input>      -outfile=<output> -output=fasta      • ClustalW-Quicktree:       clustalw2 -align -infile=<input>      -outfile=<output> -output=fasta      -quicktree      • MAFFT L-insi-i:       mafft --localpair --maxiterate 1000      --quiet <input> > <output>      • MAFFT-PartTree:       mafft --parttree --retree 2       --partsize 1000 <input> > <output>      • Muscle:       muscle -in <input> -out <output> -quiet      • Prank+GT:       prank -d=<input> -o=<output>      -t=<RAxML(MAFFT) guide tree> -noxml -notree      -nopost +F -matinitsize=5 -uselogs      • Opal:       java -jar Opal.1.0.2.jar --in <input>      --out <output>For all two-phase methods , we computed the ML trees using either RAxML version 7.0.4 or FastTree version 2.1.3, but FastTree was used only on the Price 78K dataset. All two-phase ML estimations were run to completion.   The commands used are as follows :      • RAxML default:       raxmlHPC -m GTRMIX -w <work dir>      -n <identifying suffix> -s <input>      • FastTree:       FastTree -nt -gtr -nosupport      -log <log file> <input alignment> > <output tree>  The use of RAxML within SATé is also performed as given above, except for the three largest biological datasets. On these datasets , the SATé search utilized an alpha-version 7.2.4_sse3 of RAxML which makes use of a stopping rule that permits faster runs than the default RAxML version 7.0.4 search.      • RAxML alpha-version 7.2.4_sse3 fast search, used for SATé:       raxmlHPC-SSE3  -F -D -m GTRMIX      -n <identifying suffix> -s <input>  Finally, for the purposes of constructing a reference tree on the biological datasets, other than the three largest biological datasets, we used the following command in RAxML version 7.0.4 to estimate an ML tree on the curated alignment and assign support values to the edges of the ML tree using a rapid bootstrapping analysis with 500 bootstrap replicates:      • RAxML rapid bootstrap:       raxmlHPC -f a -m GTRGAMMA -s <input>      -n <identifying suffix> -x <random number>      -p <random number> -N <number of replicates>    To construct a reference tree on the 16S.3 and 16S.T datasets, we first estimated an ML tree on the curated alignment using RAxML version 7.2.6 with the RAxML default command. Then, we performed a rapid bootstrap analysis to assign support values to the edges of the ML tree using RAxML version 7.0.4 with the RAxML rapid bootstrap command. This analysis consisted of 500 rapid bootstrap replicates for the 16S.3 dataset and 346 rapid bootstrap replicates for the 16S.T dataset.    To construct a reference tree on the 16S.B.ALL dataset, we first estimated an ML tree on the curated alignment using RAxML version 7.0.4 with the RAxML default command. We then assigned support values to the edges of the ML tree using 573 bootstrap replicates from two different bootstrap analyses. 129 out of the 573 bootstrap replicates were obtained using RAxML version 7.0.4 with the RAxML rapid bootstrap command listed above. 444 out of the 573 bootstrap replicates were obtained using RAxML version 7.2.5 to perform a standard bootstrap analysis on TACC's Ranger supercomputer. RAxML was run in parallel on each bootstrap replicate using the four cores of a single compute node on Ranger via the following command:RAxML analysis of a single standard bootstrap replicate: raxmlHPC-PTHREADS-SSE3 -m GTRCAT -s <input> -n <identifying suffix> -b <random number> -p <random number> -N 1 -T 4  When necessary, we enabled multithreading for the above RAxML runs either by recompiling with PTHREADS • SATé 24-hour search on six smallest datasets:        ./sate_basic.pl -r <name of run>         -w <empty temporary work directory with full path>          -d <input unaligned sequences file with full path>          -l 1 -s -1 -a 5• SATé search for 10 iterations on four largest datasets:        ./sate_large_64.pl -r <name of run>        -w <empty temporary work directory with full path>        -d <input unaligned sequences file with full path>To compute alignment SP-FN and missing branch error rates, we used custom code, available at the Supplementary Materials online webpage We ran the two-phase methods and SATé on the six smaller biological datasets using a heterogeneous Condor All analyses of the four largest datasets were run using a very high-memory machine with 256 GB main memory and a 16-core 64-bit 2.5 Ghz AMD Opteron CPU, with the following exceptions: each of the successful runs of ML(MAFFT-PartTree), ML, and SATé on the 16S.T and 16S.3 datasets and each of the failed runs of ML(MAFFT-PartTree) and ML on the 16S.B.ALL dataset were performed on an individual machine with dedicated access to all 32 GB of main memory and 8-core 64-bit 2.83 Ghz processors. For the runs that failed on the four largest datasets, i.e. SATé and ML on the 16S.B.ALL dataset and ML(MAFFT), ML(Prank+GT), and ML on the 16S.B.ALL and 16S.3 datasets, we performed each run with dedicated access to the entire very high-memory machine and thus each run had exclusive access to all 256 GB of main memory available on that machine. For the runs that succeeded or are still running on the four largest datasets using the very high-memory machine, the minimum amount of memory available to each run was the total amount of main memory available on the machine divided by the number of cores on the machine; however, the memory typically available to each run was much closer to the total amount of main memory available on the machine.


The first group is used for intra-species alignments, among which are successful ones with high specificity and speed. The other group contains more sensitive methods which are usually applied in aligning inter-species sequences.The main two sorts of automatic gene annotation frameworks are CAT (for Cross-species Alignment Tool). It is designed to align mRNA sequences to mammalian-sized genomes. CAT is implemented using C scripts and is freely available on the web at .Here we present a new algorithm called CAT outperforms other extant alignment tools. Tested against all available mouse-human and zebrafish-human orthologs, we demonstrate that CAT combines the specificity and speed of the best intra-species algorithms, like BLAT and sim4, with the sensitivity of the best inter-species tools, like GeneWise.Examined from different angles,  Compared to  finding , this meng [BLAT  and sim4AT [sim4 . They arBLAT, sim4, est_genome [exonerate [exonerate-aa and GeneWise. Although it is believed that protein comparisons are intrinsically better at detecting distant homologies, we will show that this need not be the case. The real difference is that protein comparisons are better at determining exon-intron boundaries, since they can incorporate phase information. However, for aligning non-coding un-translated regions (UTRs), nucleotide comparisons are the only option. The second issue has to do with the tradeoffs between dynamic programming (DP) and heuristic methods. A full DP implementation like est_genome and GeneWise is good for specificity and sensitivity, but not for speed. Heuristic methods have been developed to increase the speed, often with a sacrifice in specificity and/or sensitivity, although as we will show, this too need not be the case. BLAST [BLAT, sim4, exonerate, and exonerate-aa also qualify. Such methods are most readily applied to nucleotide comparisons. The third issue is a consequence of the fact that one must allow for frequent gaps and mismatches to accommodate distant homologies in inter-species alignments; but in doing so, one increases the likelihood of false alignments. These typically appear as poorly matched terminal exons, a long distance from the end of the true alignment, and must be removed by statistical rules.From a technical perspective, there are three issues. First, sequence comparisons can be made at nucleotide or protein level. Examples of the former are t_genome , and exoxonerate , while ee. BLAST  is a welCAT is a nucleotide level alignment tool that uses improved heuristics to effectively balance specificity, sensitivity, and speed. It is designed for both intra-species and inter-species alignments. CAT can be freely downloaded at the website .CAT (version 0.8.2) against the following algorithms: BLAT (version 27), sim4 (version 2003-09-21), GeneWise (version 2.2.0), est_genome (located in EMBOSS [exonerate and exonerate-aa (version 0.8.2). Two comparisons were done. First, we aligned mouse mRNAs to human genome sequences, and then zebrafish mRNAs to human genome sequences. All the sequence data, including mRNAs, exon coordinates and genomes, were taken from the UCSC Genome Browser [HomoloGene [RefSeq [We benchmarked moloGene   orthologous mRNAs against the human genome. Although orthologous mRNAs in different species may differ at a few exons for a particular mRNA, a good overall agreement on the 10,395 orthologous pairs must indicate the good performance of a program. This is the basic assumption in our benchmark.When we know what the correct answer is, performance can then be evaluated in the traditional manner . We defiTP = number of aligned bases that overlap with the orthology annotationFP = number of aligned bases that do not overlap with the orthology annotationFN = number of bases in the orthology annotation that remain unalignednSn) and specificity (nSp) are the proportion of correctly aligned bases with respect to the known and predicted alignment, respectively.At the nucleotide level, sensitivity (eSn) and specificity (eSp) are defined as follows.At the exon level, sensitivity  and predicted one  match end-to-end, which means the exon boundaries are identical between them.Depending on the circumstances, we compute sensitivity and specificity in two ways, counting only the coding region (CDS) or counting the entire transcript (CDS+UTR).CAT, est_genome, and GeneWise are the only ones that also show good sensitivities at the lowest CDS identities. If we insist that UTRs be included, then CAT and est_genome are by far the best algorithms. Although sim4 is the fastest  localized in a window instead of on a whole chromosome. This allows CAT to find multiple hits on a chromosome and reduces the time spent on chaining. For sim4, chaining all the HSPs on a whole chromosome is the bottleneck of its speed.CAT improves the sensitivity by using the techniques implemented in several previous softwares. Non-contiguous seeds [us seeds , approprus seeds  and 2-rous seeds  all helpCAT uses a simple statistical test to improve the specificity in genome-wide alignments. As a matter of fact, most of false alignments are extremely short and poorly aligned. They typically appear at the first or last few exons. These false fragments are mainly due to random matches in seed finding, in cases where the true match is too divergent to be detected at our default thresholds. Only keeping statistically significant terminal exons, CAT is able to rule out most of false alignments.CAT sensitivity is competitive with algorithms like est_genome and GeneWise, which are based on a full dynamic programming implementation. The advantage is that CAT is much faster. It is not as fast as BLAT and sim4, but neither of these algorithms can compete with CAT on sensitivity. As to the utility of CAT for gene annotation, the reality of large-scale production projects is that mRNA sequencing cannot keep up with genome sequencing. In vertebrates, genome sequences have been released for human, chimpanzee, rhesus, mouse, rat, dog, chicken, tetraodon, and fugu. Many more are 'in the pipeline'. But, only in human [CAT therefore fulfills a need for practical gene annotation.As a rule, speed and sensitivity are in conflict with each other. Alignment algorithms must make a suitable compromise. Our data show that in human , and espin human , is therBLAT and sim4, have relatively low sensitivity, while existing inter-species alignment tools, like GeneWise, fail to process sequences in a high-throughput style.Existing intra-species alignment algorithms, like CAT offers an improved process that aligns mRNA sequences to mammalian-sized genomes. With respect to the performance of alignment, it achieves a winning combination of the specificity and speed of the best intra-species algorithms, like BLAT and sim4, with the sensitivity of the best inter-species tools, like GeneWise. Given how large-scale production of mRNA sequences tends to lag behind large-scale production of genome sequences, and how for certain genes the only available mRNAs are from another species, CAT fulfills a growing need for reliable genome annotation rooted in the experimental evidence of a real transcript.CAT is adapted from sim4, BLASTZ [PatternHunter [BLAST, but with some important differences, like multiple rounds of seeding and seeds that need not be contiguous. Together with the scoring matrix by Chiaromonte et al. [CAT to run on mammalian-sized genomes. Here, we describe the basic idea  method, keeping the five windows with the highest total aligned lengths, and discarding all the others.5. Expand windows to 1 Mb. Patch small gaps in a new round of seeding and extension, discarding conflicting alignments as required.6. Patch large gaps using smaller seeds and lower thresholds.7. Identify splice sites with banded DP algorithm.8. Remove false exons using statistical test described below.9. Do global alignment to close remaining gaps.Detailed description of each step follows:CAT keeps the genome sequences in the physical memory and loads, typically, about 1000 mRNAs each time in the main loop. It then scans all the mRNAs nucleotide by nucleotide, extracts the sequence according the seeding template [CAT, the default template is 111010010100110111 [template , and sto00110111 .CAT then scans the whole genome window by window and searches for seeding hits against the hash table. The initial hits are extended without gaps by maximizing the alignment score. Only high-scoring ones  are retCAT extends the window to 1 Mb, putting the 50 Kb window in the center. Adjacent 50 Kb windows are merged to avoid overlaps in window extension.For each mRNA and each 50 Kb window stored in the heap, sim4 and BLASTZ.In a new 1 Mb window, seeding, gap-free extension and HSP chaining is performed again because HSP coordinates are not stored in previous steps in attempt to reduce the memory usage. Furthermore, in the mRNA regions where no hit is found, a second round of seeding-extending-chaining is applied to patch gaps. The seeding template used in this round is 11011011, which actually captures the fact that the first two nucleotides in a codon tend to be more conservative. This 2-round alignment can increase sensitivity and has been used in both The backbone alignment is actually a chain of gap-free fragments. A banded affine-gap Smith-Waterman  is applisim4, CAT determines exon boundaries in a heuristic way. If two adjacent extended segments have overlaps, CAT tries to find the break points where there is a GT-AG signal; if the two segments have no overlap, CAT looks for GT-AG 7 bp ahead and adds gaps arbitrarily to meet the splicing signal. If no GT-AG signals can be found anyway, CAT will arbitrarily choose a splicing sites without the signal.Like CAT rules out low-confidence terminal exons based on the statistical model described below. If there are still unaligned regions between adjacent exons, CAT will perform an adapted global alignment to close the gaps on mRNAs. This adapted algorithm adds an "intron state" to the original global alignment. Its recursion functions resemble the ones used in EXALIN [For exons with gaps added at the ends to meet GT-AG signals, a banded affine-gap Needdleman-Wunsch algorithm is further applied to pinpoint the positions of these gaps. After that, n EXALIN . The resq for a gap-free alignment of length l and score s:According to the central limit theorem, we can approximate the probability erfc is the complement of the error function, μl is the mean, and σl is the variance of the scores of random gap-free alignments of length l. Both μl and σl are calculated from the scoring matrix.In the above formula, e1 is correct, we can calculate the probability p for finding an adjacent exon alignment e2 (with length l and score s) in a distance at most d from e1:On the assumption that we know an exon alignment We recognize that above formula discriminates against large introns, some of which might be real, but if we had not adopted such a formula, there would have been too many false alignments. Exons are allowed  according to the following three rules.e1 satisfying q <t1 are kept in the final alignment1. Exons e1 is kept in the final alignment, exon e2 is kept if p <t22. When exon 3. Exons between kept exons are also kept in the final alignment-14 and 10-9 for t1 and t2, respectively. The first rule ensures that if the alignment is significant on its own, that exon is naturally kept in the final alignment. The second rule says that, even if the alignment is not so significant on its own  ≥ t1), it will be kept in the final alignment if it is sufficiently close to another exon that has already been kept in the final alignment. The third rule ensures continuity. We remove terminal exons, not interior exons. A simple test demonstrates how effective this is Project home page: Operating system: All POSIX (Linux/BSD/UNIX-like OSes)Programming language: COther requrements: NoneLicense: GNU General Public License (GPL)Any restrictions to use by non-academics: NoneThe author(s) declares that there are no competing interests.JW and GKSW brought the initial ideas and supervised the project. HL and WMZ developed the methods and algorithms. LG and HL implemented the software. TL collected data and evaluated the performance of different programs. HL and YG drafted the manuscript and WMZ and GKSW revised it. All authors have read and approved the final manuscript.


Biological sequence repeats arranged in tandem patterns are widespread in DNA and proteins. While many software tools have been designed to detect DNA tandem repeats (TRs), useful algorithms for identifying protein TRs with varied levels of degeneracy are still needed.To address limitations of current repeat identification methods, and to provide an efficient and flexible algorithm for the detection and analysis of TRs in protein sequences, we designed and implemented a new computational method called XSTREAM. Running time tests confirm the practicality of XSTREAM for analyses of multi-genome datasets. Each of the key capabilities of XSTREAM  are demonstrated using anecdotal examples, and the utility of XSTREAM for identifying TR proteins was validated using data from a recently published paper.We show that XSTREAM is a practical and valuable tool for TR detection in protein and nucleotide sequences at the multi-genome scale, and an effective tool for modeling TR domains with diverse architectures and varied levels of degeneracy. Because of these useful features, XSTREAM has significant potential for the discovery of naturally-evolved modular proteins with applications for engineering novel biostructural and biomimetic materials, and identifying new vaccine and diagnostic targets. The work described in this paper focuses exclusively on non-evolutionary TRs  are formally defined as two identical copies of finite non-empty words with no intervening characters . Since bion, see ), each oBioinformatics studies of TRs have primarily focused on DNA. DNA TRs are traditionally classified on the basis of increasing period into microsatellites, minisatellites, and large-scale duplications. In some human TR loci, copy number changes are associated with triplet-repeat expansion diseases that include Huntington's disease and Fragile X Syndrome . Becausea priori identification and analysis of TRs from protein sequence databases will be critical.Nucleotide repeats occurring in protein coding genes can result in protein sequences containing repetitive elements. Though less studied than DNA repeats, peptide repeats are likewise known to be widespread in nature -8. Peptide novo repeat detection in DNA and protein sequences. One class of tools utilizes sequence self-alignment (SSA) , with n denoting the number of tandem copies of substring x. An example of TR nesting that shows two levels of nesting is presented in Figure In addition to extensive degeneracy, TRs may have very long periods and nested architectures. XSTREAM implements a novel long-period filtering procedure (see Appendix) to find TRs with periods ≥1000. The utility of this method is demonstrated by some of the DNA examples in Table minP = 1, minD = 90 and minimum copy number minC = 2, or 3. These parameter values were chosen to emulate the TR criteria used in  = the character at index j in S with j ≥ 0· S = the subsequence in S from index i to index j inclusively· Xi = TR domain i• Xi| = length of entire TR domain Xi· |Xi[j] = repeat copy j in Xi with j ≥ 0· Xi[j]| = length of copy j· |Xi| = size of array Xi· |XiS = lowest index of Xi; starting position in S· XiE = highest index of Xi; ending position in S· XiSE = index range · Ei = copy number (exponent) of Xi· Ci = consensus sequence of Xi· Pi = period of Xi = period of Ci· CEi = consensus error of Xi =· Without gaps: # of mismatching characters to consensus/total # of characters in aligned Xi- With gaps: see Consensus Building- Ii = indel error of Xi = # of gaps in aligned Xi/total # of characters in aligned Xi· Ri = referential repeat copy of Xi: used during TR domain expansion and maximality· X} = {X0, X1,..., Xn} = set of all identified TR domains• {S, XSTREAM looks, by default, for exact repetitions (seeds) of lengths 3 and 5. Length 7 is also used if |S| ≥ 2000. Seed lengths are user-adjustable. XSTREAM records the distance between each pair of adjacent seeds, |p - q|, where the lowest index in S of each seed in the pair is represented by p and q respectively, and p <q. All seed positions and distances between adjacent seeds are stored and accessed using a hash table. In addition, XSTREAM records in an integer array M, the hashcodes and sequence indices for all seeds of minimum length L, where L = 3 by default. For instance, a seed of length L starting in position 5 in S would have its hashcode stored in M[5]. The utility of M is explained shortly.To find repeats of various periods in any FASTA-formatted input sequence S in order of increasing indices. For a given seed pair, let p, q be defined the same as previously and let x, y be the starting positions of two sequence iterators, where x = p + L, y = q + L. Further, let d = |p - q|, p* = p + d - 1, and q* = q + d + ε - 1 where 0 ≤ ε ≤ g  and q* < |S|. Because the seeds of each matching pair are of length L, x and y iterate through S in the regions S and S. Note that in the case L = 3, the minimum copy number is 2 for all periods except periods 1 and 2, which cannot have copy number less than 4 and 2.5 respectively. We now refer to array M, which was constructed during seed detection. To bypass individual character comparison, M is interrogated for matching hashcodes. If M[x] = M[y] and (x + L) = p* and (y + L) ≤ q*, x and y are incremented by L (since each hashcode in M corresponds to a repeat of length L), and a match of L characters is recorded. By comparing hashcodes instead of substrings and by allowing jumping in blocks of L characters, usage of M can decrease XSTREAM running time. If M[x] = M[y] and x ≤ p* < (x + L), a match of length min) is recorded, and SE terminates. If M[x] ≠ M[y] and g = 0, XSTREAM compares the character pair in S at S[x] and S[y]. Whether or not S[x] = S[y], if (x + 1) ≤ p* and (y + 1) = q*, x and y are incremented by 1, and XSTREAM returns to hashcode comparison using M.XSTREAM traverses the distance list in order of increasing distance, and for each set of identical distances, moves down M[x] ≠ M[y] and g > 0, a novel procedure termed "comparison wobble" (CW) is invoked. CW allows for efficient approximation of indels using array M and parameter g. This procedure is one-sided, in that it fixes x and allows for variations in y, denoted by y*. We place the following restrictions on y*:If the case arises where y* - y| ≤ gi) |y* < |S|ii) y* <y, then (y - y*) ≤ L AND (y - y*) <d. We enforce this constraint to avoid comparing subsequences at the same pair of positions in S more than once.iii) If y* > Ω, where Ω = highest index in S with matching character from the current seed extension – e.g. if last match was M[15], then Ω = 15 + L - 1; if last match was S[15], then Ω = 15. This rule prohibits matching redundancy.iv) y* such that M[x] = M[y*], XSTREAM records a match of min), increments x by L, sets y ← (y* + L), and if x ≤ p*, returns to standard SE (see above paragraph). Because y ← (y* + L), it is possible that y moves beyond q + d - 1, hence the need for ε. In addition, if a match is found when y* <y (prior to updating y), the mismatch record is adjusted to take into account any currently matching characters that were initially found to be non-matching. If M[x] ≠ M[∀y*], XSTREAM transitions to single character comparison using S, and then if space permits, returns to standard comparison using M. An example of seed extension with CW is shown in Figure If ∃Xi, XSTREAM implements two procedures, although the second one is used only if g > 0. First, x is reset to p. In this way the copy in Xi with the lowest index serves as the character comparison reference repeat Ri. The value given to q depends upon whether XSTREAM is attempting to extend Xi downstream or upstream of Xi's current sequence region. If downstream, q is incremented by d. If upstream, q is initially set to p - d, and decremented by d thereafter. The first method for domain expansion is exactly the same as seed extension except x = p, y = q, and the evaluated regions in S are S and S, where 0 ≤ q ≤ (|S| - d). If this procedure is successful, the new copy is added to Xi. If unsuccessful and if g > 0, XSTREAM invokes the second procedure, which uses GRDP (see Gap Restricted Dynamic Programming below) on the same regions in S. GRDP is better, albeit slower, than CW at identifying indel regions. Upon completion of GRDP, the number of matching characters in the alignment is determined and if that number is high enough, the new copy is added to Xi. Following success by either expansion method, q is updated and domain expansion is performed again. If i is not satisfied, domain expansion ceases, and the current candidate TR domain is sent to the maximality function.Seed extension operates on seed pairs, and therefore, if successful, only yields putative TRs of copy number 2. To further extend each potential TR Ri, with p remaining equal to the lowest index of Ri. This method finds the longest valid prefix and suffix of Ri by searching downstream and upstream of Xi respectively. A DP sequence alignment scoring scheme is used, with match = 2, mismatch = -4, and gaps = -4 (user modifiable). Let l = XiS, r = XiE, left = l - min, and right = r + min). Further, let Q1 = S, Q2 = S, RiQ1 = S, and RiQ2 = S. Since XSTREAM needs to find the character pair that corresponds to the highest score, it reverses the order of characters for both Q1 and RiQ1 prior to alignment. If g > 0, GRDP is used to align Q1 with RiQ1 and Q2 with RiQ2. If g = 0, the sequences are aligned so that the members of each sequence pair overlap 100%. XSTREAM uses the DP scoring scheme regardless of whether GRDP is used. The highest scoring indices in Q1, Q2 are denoted Q1* and Q2* respectively. If, at index Q1*, the score exceeds 0, Xi is extended upstream by (Q1* + 1) characters, and if the score for index Q2* is greater than 0, Xi is extended downstream by (Q2* + 1) characters.The maximality procedure makes use of Xi, using the indicator function I :For a given Ei in this way demands that Ei ≤ |Xi|. Both gap and masked  characters are not considered during copy number computation. Ei is updated whenever XSTREAM changes XiS, XiE, Pi, or Xi's multiple alignment.Computing After each successful seed extension, XSTREAM masks the sequence space corresponding to the newly detected TR domain in order to reduce both running time and repeat redundancy (see Redundancy Elimination I and Two-stage TR Detection below). Afterward, the next seed pair, if one exists, is extended.g > 0 and comparison wobble is successfully used, then the period Pi for a given TR Xi may need adjustment. To approximate a better period, Pi*, we turn to the offset y* - y for every CW success for a given Xi. Let So = Σ(y* - y), for all successful extensions, i.e. Xi[∀j] ≠ Ri. Then, Pi* = Pi + (So/Ei), and Pi ← Pi*. Therefore, Pi is updated using the average period offset. This function is important for TR domain parsing when g > 0, since Pi is used to derive a temporary Ci, which is needed for TR domain alignment.If Xi, its copies are aligned to one another and used to create a consensus sequence Ci. We describe our consensus derivation procedure shortly. To align Xi, it must be partitioned into its repetitive parts. For the case g = 0, starting from XiS, S is cut into as many tandem fragments of length Pi as possible. Because of maximality, Xi's last copy may have length less than Pi. Multiple alignment of Xi is achieved by simply stacking all copies in the order they occur in S. If g > 0, partitioning of Xi is much more complex. To preserve practical running time for the case g > 0, we use one of two segmentation tactics. Both methods require a putative consensus sequence Ci for a given Xi. XSTREAM therefore initially partitions Xi in the same way as when g = 0. Afterward, Xi is aligned using a multiple alignment algorithm that we describe shortly. Following alignment, a transient Ci is derived. We now compare/contrast XSTREAM's two partitioning procedures for the case g > 0.In order to best characterize any TR domain Xi in O(mn) time given a representative copy of length m (i.e. Ci), where m = Pi and n = |Xi| . Afterward, D is cut between every adjacent instance of Ci. HPS works by first building a concatamer of Ci comprised of n copies of Ci, where n = |Xi|/|Ci|. Because n may take a non-integer value, the consensus concatamer can have more or fewer copies than an optimal partitioning of Xi. After pairwise alignment to D using GRDP, |Xi| is segmented in the same way as described for WDP.As mentioned, both partitioning strategies require floor(Ei))2 (we use the floor function since Ei may be non-integer), in which case the last copy is excluded from being a center sequence. Because our version of STAR does not use standard DP, it will not always compute an optimal center sequence. Nevertheless, to maximize the practicality of XSTREAM for large dataset analyses, we decided that the order of magnitude performance gain provided by GRDP outweighs the possible decrease in multiple alignment quality. Since GRDP requires input sequences of the same length, we temporarily replicate Xi, denoted by Xi*, and add the dash character '-' to the rightmost end of all copies of Xi* where |Xi*[j]| <max(|Xi[∀j]|) until |Xi*[∀j]| = max(|Xi[∀j]|). We then find the center using Xi*. Following center sequence determination, the TR multiple alignment is constructed using the conventional STAR alignment strategy. Because practical running time is emphasized in our implementation, pairwise sequence comparisons during STAR Alignment may be computed in a non-optimal manner using GRDP.XSTREAM employs the STAR alignment algorithm for multiple sequence alignment. The center sequence is computed using GRDP exclusively. We elected to use GRDP over standard DP because the number of pairwise alignments that are needed increases as a function of  The non-gap counter, denoted mG, records the number of gaps in all columns where the majority character is a gap.ii) The majority gap counter, g* , specifies the maximum number of consecutive gaps in an alignment row that can be counted toward CEi. For each row of the alignment, we count the number of successive gaps that do not match the consensus until either that number equals g*, a non-gap character is reached, or the consensus contains a gap. We resume counting gaps the next time a gap is encountered in a column where the consensus character is a non-gap. Let cG equal the final count.iii) A user-modifiable constant, tot = total number of characters in the multiple alignment of Xi, including gaps.iv) Let CEi = (nG + cG)/(tot - mG). The quantity mG is subtracted from tot so that gaps in columns with a gap majority do not decrease CEi. Further, the addition of cG to the numerator functions to limit the extent to which gaps increase CEi. We dampen the role gaps play in CEi since they are artificial characters. In addition, we force Pi to equal the number of non-gap characters in Ci, and therefore, if necessary, Pi is updated.We set Xi, Edge Trimming (ET) moves downstream from XiS and upstream from XiE, deleting characters that mismatch with Ci until the first matching character pair is found from each direction. Xi is realigned if truncation is successful from the top-left, since otherwise we would start the alignment with one or more gaps. If ET is only successful from the bottom right, no realignment is necessary. In this case, XSTREAM removes both the flagged bottom right portion of the alignment as well as any columns that contain all gaps. If ET is a success from either direction, Ci is rebuilt. For each Xi, ET is iteratively invoked until either |Xi| = 2 or both edges of Xi agree with Ci.For each X} in order of increasing period. Given Pi, ∀i ∈ {X}, the following routine is executed:XSTREAM iterates through {Xtra as min·Pi), max(Pj) ∀j ∈ {X}), where by default, σ = 50. Xtra dictates the breadth of periods from which to draw TRs for merging. The conditions restricting Xtra were chosen to avoid messy and insensible TR domain characterizations as well as to maintain practical running time.(1) Define B} = Xj, ∀j ∈ {X}, where i ≠ j and Pi ≤ Pj ≤ Xtra. Set {X} ← ({X} - {B}). Note: from step (3) to step (10), we only refer to TRs from {B}.(2) Let TR set {B} in increasing order of XjS, ∀j ∈ {B}.(3) Sort {m = 0, we examine Xm and Xn, ∀m, n ∈ {B}, where n = m + 1(4) Starting with Q denote the maximum allowable sequence space between two combinable TRs, and set Q = min·Pm. By default, μ1 = 10 and μ2 = 0.25.(5) Let if |XmSE ∩ XnSE| ≠ Ø or 0 < (XnS - XmE) ≤ Q, compute similarity s of Cm and Cn using the consensus comparison function (refer to consensus comparison section).(6) else go to step (11).if s ≥ i, merge Xm and Xn.(7) else go to step (11).if |XmSE ∩ XnSE| ≠ Ø, perform the following procedure: From step (6) we obtained the index CnP (refer to consensus comparison section) corresponding to the best cyclical permutation of Cn when aligned to Cm. We repartition Xn by slicing its alignment vertically at CnP, thus ensuring Xn is in phase with Xm before consolidation. We then merge Xm and Xn, forming Xmn = (Xm ∪ Xn - Xm ∩ Xn). Go to step (10).(8) if |XmSE ∩ XnSE| = Ø, perform the same procedure as in step (8) with the exception that the sequence space between Xm and Xn must be incorporated into Xmn:(9) z equal the index in S that corresponds to the character in Xn[0] that is in the same alignment column as CnP. Let sequence k = S.i) Let Xm in its original form to Xmn.ii) Add k in accordance with Cm. To do this, cut k into as many consecutive fragments {f} of length Pm as possible. Start cutting k from the end with the lowest index.iii) Tile fi, ∀i ∈ {f} (tile fragments in order of increasing indices in k),iv) Given if |fi| = Pm, use the consensus comparison module to compute similarity s of fi and Cm.if s <η, where η <i and η = .5 by default, replace all characters in fi that do not match to Cm with 'x' and add fi to Xmn.else cut fi at the index corresponding to its best cyclical permutation, resulting in fi1 and fi2.if (|Xmn[max(j)]| + |fi1|) ≤ (g + Pm), append fi1 to Xmn's last row.else fi1 becomes a new row in Xmn.fi1, since fi2 is in phase with Cm, fi2 becomes a new row in Xmn.Regardless of what happens to else if |fi| <Pm, add fi to Xmn in the same manner as fi1 (above).k, add Xn to Xmn in the same way as in step (8).v) Following the incorporation of Xmn, perform multiple alignment on Xmn (without parsing) and derive consensus. We do not include the 'x' character (see (9 iv)) in the calculations of Emn, Cemn and Imn. if Xmn meets TR retention criteria, set Xm ← Xmn and {B} ← {B} - Xn.(10) Remove all gap characters from if m < |B| - 2, increment m by  and go to step (4).(11) else set {X} ← {X} ∪ {B}.The following TR domain refinement procedures are invoked in the order presented:Xi, but set Ri ← Ci. We invoke maximality again because using Ci as a reference copy may allow for additional expansion of Xi.(1) Maximality – Rerun the maximality function on each X}, make a copy of Xi, denoted Xi*, and perform multiple alignment on Xi* using Ci as the center sequence. Ci is not included in the final alignment of Xi*. If CEi* <CEi, we set Xi ← Xi*.(2) Realignment – For each TR in {X}.(3) Reducibility – Rerun redundancy elimination procedure II (see below) on every realigned TR in {X} to redundancy elimination algorithm III (see below).(4) Overlap Removal – If allowed by user, send {X} to nesting procedure (see below).(5) Nesting – By default, send {Xi can occur in Pi cyclical permutations, and if a given TR Xj has Ej ≥ 2 + (Pj - 1)/Pj, then Xj has Pj valid consensus sequence phases. Therefore, we must evaluate up to Pi consensus alignments for every pair of TRs with period Pi that also satisfies the same copy number condition as Xj. For simplification, we treat all TRs the same, regardless of copy number. Given a pair of TRs, Xi and Xj where Pi = Pj, XSTREAM fixes Ci and aligns as many phases of Cj to Ci as are needed to establish similarity. If Consensus Comparison is called from the merging procedure, all phases of Cj are aligned to Ci to locate the best-aligned cyclical permutation. The leftmost character in the highest scoring phase of Cj, denoted by CjP, is used during TR merging. Otherwise, only sufficient similarity is needed, and thus XSTREAM may align less than all phases of Cj. If g > 0, all gaps are removed from Ci, Cj prior to alignment. All alignments of Ci, Cj are computed using GRDP. For each alignment, XSTREAM counts the number of matching characters and stores the highest match count so far in N. If N/Pi ≤ i, XSTREAM groups Xi and Xj. The time complexity of comparing Ci and Cj is O(Pi2) because of Pi alignments and O(Pi) alignment time. For every newly established TR group, the consensus sequence with the lowest index in {X} becomes the group head or referential consensus, and is used for all subsequent comparisons. The time complexity for performing all consensus comparisons of the same period without considering alignment time is O(|X|2). Therefore, the total time complexity of Consensus Comparison is O(|X|2Pi2).For clustering different TRs, we compare their consensus sequences. In order to effectively compare consensus sequences we take into account TR phase variation – the same TR can have different starting points, leading to consensus sequences of different phases. More formally, every irreducible n2), where n = TR period. Because optimal alignment of TR copies may, in some cases, place a temporal burden on the user, we explored heuristic options. We decided to implement a non-optimal variant of pairwise global sequence alignment DP, which we call gap-restricted DP (GRDP). GRDP requires a user-modifiable parameter, g, which governs the maximum number of consecutive gaps that can be used during GRDP pairwise alignment. Because of g, the maximum traceable width of the DP matrix is held constant for all periods, is equal to 2g + 1, and is symmetrically distributed with respect to the main diagonal. As a result, GRDP has space complexity θ(n) and time complexity θ(n), enabling a 1:1 correspondence between increasing period and running time. The following recursion describes GRDP:A major obstacle to efficient alignment of gapped TRs is dynamic programming (DP), which, for global pairwise-sequence alignment, has time complexity O is left up to the user. By default, g = 3. In addition, our implementation of GRDP requires input sequences of equal length. In cases where input sequences have different lengths, both sequences are made the same length by appending gap characters to the shorter sequence. Any columns with two gaps in the resulting pairwise alignment are removed. Since standard DP is practical in many situations, several functions of XSTREAM toggle GRDP on and off depending on projections of time complexity. GRDP is used in four major functions: TR domain expansion, TR parsing, multiple alignment, and consensus comparison.Note that depending on XSTREAM implements three strategies to eliminate two types of TR redundancy – reducible TR periods and TR domain overlap.I) XSTREAM searches for TRs in order of increasing period. As TRs are found, their corresponding sequence space is flagged, preventing further searching in processed sequence regions. This tactic combats both kinds of redundancy and reduces running time.Ci of Xi contains a TR domain xi that spans Ci's entire length, XSTREAM repartitions Xi using the consensus of xi, resulting in Xi*, whose period is an even multiple of Xi's period. Xi* is retained and Xi erased (Xi*→Xi) if Xi* passes the user-adjustable TR filtration criteria.II) To combat reducible TR periods, XSTREAM is rerun on the consensus sequence of each TR domain from the input sequence.  must fail to move to rule set (ii) and so on. Let I = |XiSE ∩ XjSE| . By default, α = .9, β = .75, γ = .9, and δ = .6.III) The following redundancy elimination method, invoked by default, functions to remove TR domain overlap. The user can control the execution and parameters of this method because it may not always be desirable to remove TR domain overlap and because we are convinced that the amount of reasonable overlap among TR domains is an arbitrary matter. We now state the rules that determine whether for a given TR pair if (α·|Xi|) ≤ I ≤ |Xi| and |Xi| ≤ |Xj|i) if |Xi| < (β·|Xj|)   Xi      delete else if |Xi| < (γ·|Xj|) and (Ei <Ej or CEi > CEj)   Xi         delete else if |Xi| ≥ (γ·|Xj|) and Ei <Ej      Xi            delete else delete Xj         i and jii) Same as (i) but swap if I ≥ )iii) if CEi ≥ CEj and Ei ≤ Ej   Xi      delete else delete Xj   if I ≥ )iv) min   delete MinP <T and MaxP ≥ T, TR detection proceeds in two phases, where phase I examines periods = T, and phase II examines periods <T. By default, T = 10. This procedure reduces the frequency of inconsistent results. We now describe our reasoning.As shown in Table MinP can be altered, it is possible to differentially characterize the same TR domain Xi, or perhaps miss Xi altogether, for the case Pi ≥ max[all tested MinP values]. This problem can occur because as XSTREAM moves up the period ladder toward Pi, different stretches of sequence space may be removed in and around Xi for different values of Min. We determined empirically that by first scanning upward from a short period, such as 10, we could greatly mitigate this problem. To illustrate, see Figure As mentioned in Redundancy Elimination I, TRs are identified in order of increasing period and sequence space is masked for every successful seed extension. Because of these two facts and because the value of Following completion of phase I, all masked sequence space is reset to unused, thereby allowing shorter period TRs to be found independently of longer period TRs. Redundancy removal strategies II and III are invoked later and will remove any redundancy caused by XSTREAM's two-stage TR detection procedure.S| ≥ 2000, during seed detection, an additional hashcode array M* is kept, which stores hashcodes and sequence positions for seeds of maximum length L*, which by default is 7. Then, for every pair of seeds with distance ≥ 1000, XSTREAM initially invokes a filtration step, which jumps across M* a user-defined number of times t and looks for matching hashcodes. This method is identical to seed extension as described earlier, except that S is not used and x is incremented by floor(d/t) after each hashcode comparison. Thus, if g > 0, CW can be invoked. XSTREAM runs standard seed extension and TR domain expansion (using M* and L*) on periods ≥ 1000 if and only if t* matches are recorded during the filtering phase, where t* = t/3. Therefore, seed pairs with distances ≥ 1000 are subjected to a quick and preliminary filter, which although imperfect, drastically reduces running time for input sequences on the chromosome size scale. By default, t = 20.To ensure pragmatic running time for all possible periods, we implemented a heuristic that governs seed extension for periods greater than or equal to 1000 characters. If |Xi, we define a nested TR as a TR present in Ci that does not span Ci's entire length. Since TR degeneracy can complicate identifying nested structures, XSTREAM only looks for nested TRs in consensus sequences. Our procedure detects nested TRs of unlimited nesting depth, with no gaps and no mismatches. This algorithm employs a top-down approach to locating TRs, as opposed to the bottom-up method used by XSTREAM. A top-down approach is useful for nested TRs because it identifies the longest period TR first, then in a recursive manner, restarts the algorithm within that TR, and continually digs deeper until no more TRs can be found. By working off the greedy assumption that the longest period TRs are the best candidates for nesting, we avoid issues of TR overlap inherent in the bottom-up strategy. The main drawback to our nesting method is its time complexity, which is O(n3), where n = Pi. We therefore restrict this method to TRs from {X} with periods ≤ 1000 and only find nested TRs with periods ≤ 300. We set the minimum nested TR period at 1 for proteins and 2 for nucleotide sequences. The time complexity is O(n3) due to the worst-case scenario of comparing subsequences of all possible sizes in all possible sequence regions.Within each TR consensus sequence, XSTREAM searches for nested TRs – TRs that occur within TRs. This is a novel feature in the domain of protein analysis software and may provide important information about primary sequence architectures and peptide TR evolution. For a given l prior to TR detection. The last fragment of the input sequence may be of length <l. Overlapping regions have length l*, which is equivalent to the maximum detectable TR period. After all fragments are processed, the set of identified TRs are directed to the merging procedure, which functions to both extend TRs across fragment boundaries and consolidate overlapping regions. By default, l = 100,000 and l* = 10,000.XSTREAM implements a user-adjustable divide and conquer procedure to reduce memory consumption. If enabled, the input sequence is segmented into overlapping fragments of length


The computation of accurate alignments of cDNA sequences against a genome is at the foundation of modern genome annotation pipelines. Several factors such as presence of paralogs, small exons, non-consensus splice signals, sequencing errors and polymorphic sites pose recognized difficulties to existing spliced alignment algorithms.We describe a set of algorithms behind a tool called Splign for computing cDNA-to-Genome alignments. The algorithms include a high-performance preliminary alignment, a compartment identification based on a formally defined model of adjacent duplicated regions, and a refined sequence alignment. In a series of tests, Splign has produced more accurate results than other tools commonly used to compute spliced alignments, in a reasonable amount of time.Splign's ability to deal with various issues complicating the spliced alignment problem makes it a helpful tool in eukaryotic genome annotation processes and alternative splicing studies. Its performance is enough to align the largest currently available pools of cDNA data such as the human EST set on a moderate-sized computing cluster in a matter of hours. The duplications identification (compartmentization) algorithm can be used independently in other areas such as the study of pseudogenes.This article was reviewed by: Steven Salzberg, Arcady Mushegian and Andrey Mironov (nominated by Mikhail Gelfand). Accuracy of spliced alignments is crucial in such areas as studies of alternative splicing and regulatory elements.Spliced gene products available in the form of cDNA sequences provide an experimental level of support for gene models. It has been shown  that theOver the last decade, significant attention has been given to development of tools to assist the spliced alignment problem. A useful overview of such tools has been given in . DespiteWe developed a tool called Splign for accurate and fast alignment of spliced cDNA sequences against their genomic counterparts. The process Figure  starts wThis general scheme has been exemplified in virtually every spliced alignment method capable of aligning a cDNA against a whole genomic assembly. Our approach is different in that it uses a formally defined model of same-strand duplications, which are found as a solution of an optimization problem. Splign is very conservative in its use of local alignments to seed the core splice refinement algorithm, which tends not to bind the final alignment with preliminary alignments delivering non-unique mappings. This also makes the algorithm more capable of finding small exons which are often missed by other methods. Finally, we explicitly list several important alignment alternatives and assign the elementary scores of the optimal alignment algorithm via a system of inequalities assuring preferable alignment outcomes.To assess the quality of alignments reported by Splign, we compared it with five other spliced alignment programs: Sim4 , Spidey Overall identity is the number of matching residues, divided by length of the alignment excluding possible introns. For the purpose of this definition, cDNA bases that failed to align (except those of the poly(A) tail, if any) are counted as deletions. For example, if 62 out of the total of 100 bases of a cDNA aligned perfectly and the other 38 bases did not align, the overall identity is 62%.Full-length mRNA sequences are high-quality transcripts each representing a splicing variant of a gene. To assess the quality of alignment of a cDNA against a genomic locus, we introduced the following measures. In-frame identity is the number of matching nucleotide residues aligned without a frame shift, divided by the length of the coding region's alignment excluding possible introns.If information about the coding region is available, it is possible to introduce a measure accounting for frame shifts. Frame shifts in a coding region's alignment are caused by gaps whose length is not a multiple of three, and usually indicate either an error in a cDNA or genomic sequence, or incorrect alignment. span ratio, which is the span of the alignment on the genome divided by the length of the cDNA sequence.The presence of same-strand duplications often poses a problem for spliced alignment algorithms. With the possibility of a sequencing error or a polymorphic site on the genome, the alignment with the highest identity can stretch across multiple duplicated regions. Compactness of an alignment can be quantified with its Throughout our tests, the genome was represented as a collection of chromosomes and unplaced scaffolds. Four of the programs  are able to align a cDNA against the whole genome. Sim4 and Spidey require externally specified genomic sequence. We found that running these two programs on full-length human chromosomes will often cause them to crash. Assuming that in practice users would most likely run these two programs against genomic scaffolds, for every cDNA we supplied Sim4 and Spidey with scaffolds where Splign reported at least partial alignment.Our set of mRNA sequences consisted of 218 641 human mRNA sequences available at GenBank at the time of the testing, with 24 273 of them being RefSeq mRNA sequences.After having computed the alignments, we found that it was not uncommon for the programs to report 3' exons consisting mostly or entirely of 'A' residues, often connected to the rest of the gene by a non-consensus intron . We suspect that in many cases such alignment segments are in fact poly(A) tails that should not have been aligned. Table Tables Although the full set of mRNA sequences is the most representative, one may argue that the comparison based on it could be biased. A fraction of mRNA sequences are deposited to GenBank as complemented strand. Splign can report both sense and anti-sense alignments for a single mRNA which may give it an advantage over the tools that report alignments in one direction, because an incorrectly directed alignment can have an identity higher than the one in the correct direction. For queries aligning to more than one place on the genome, strategies vary among the tools, with some reporting all alignments above certain quality threshold and others attempting to rank the alignments and report a fixed number of the top-ranking alignments. To minimize these differences, we restricted the full set of mRNAs using the following conditions:• single alignment with 80% or higher overall identity• sense maximal ORF is 900 bases or longer• anti-sense maximal ORF is at least two times smallerThe conditions produced a subset consisting of 72 113 mRNA sequences and 13 883 RefSeq mRNA sequences ("Subset 1").Tables The data in Tables An acknowledged difficulty for a spliced alignment tool is to properly localize an alignment in presence of nearby same-strand duplications. In order to test how well each tool handles the task, we created a set of mRNA sequences with each sequence covered at least 1.5 times by same strand Megablast hits to the same subject (a chromosome or an unplaced scaffold), and the highest-identity alignment subject to the following conditions.• same exon count among the methods• sense direction• at most one non-consensus splice• the identity is 90% or higherThe conditions produced 9383 mRNA sequences ("Subset 2"). For every mRNA sequence in the set, its highest-identity alignment's span ratio has been compared among the methods. Table Alignment of EST sequences is often more difficult due to shorter sequence length and higher error rates. Yet for most organisms, the bulk of transcript evidence comes in the form of ESTs as they are less expensive to produce in a high-throughput manner than full-length mRNA sequences. Therefore, it is important for a spliced alignment program to be able to compute accurate alignments of cDNA sequences with higher sequencing error rates such as in ESTs. To measure how well different programs cope with the task, the following test has been conducted.We selected a subset of RefSeq mRNA sequences that align uniquely across the genome with an identity of 99% or higher, having at least two exons, and at least one co-aligning EST, which yielded 13975 sequences. For each sequence from this set, a list of EST sequences was compiled whose EST-to-mRNA alignment suggested the same splicing form. This selection was done by running Megablast  on queryThe results of this test are presented in Table Although each mRNA sequence in this initial test was required to have a high-identity alignment, for a number of sequences different methods produced different alignments. To reduce the possibility that the initial EST test might have been affected by the alignment errors introduced by the methods in their mRNA alignments and repeated in the EST alignments, we repeated the test with an extra requirement that the set of introns must be the same in the mRNA alignments produced by every method. This brought down the number of mRNA sequences to 7 923, and the number of EST sequences to 915 111. The results of the test are presented in the second line of Table We developed a tool that is robust enough to produce accurate cDNA-to-genomic alignments in a matter of hours on a moderate-sized computing cluster for the largest available cDNA data volumes such as the human or mouse EST libraries. Splign has a powerful compartmentization algorithm to identify and separate nearby same-strand duplications. The program is tolerant to sequencing errors and polymorphic sites due to its use of the true optimal alignment algorithm and a conservative application of the preliminary local alignments.There are three aspects that are novel in Splign compared to other methods. First, we introduce a high-performance method using index-to-index comparison for computing preliminary local alignments. Second, a formally defined model of compartments discriminating between gene and exon duplication events is used to localize candidate genomic regions for every input cDNA. Finally, the scores used in the splice-aware optimal alignment algorithm are obtained as a solution of a linear programming problem reflecting selected types of target alignments. Although the resulting affine gap scoring model employed in Splign is less generic than probability-based scoring models such as , it alloSplign has been evolving over the past five years. It is routinely used at NCBI to facilitate annotation of eukaryotic genomes.The Splign web site  providesIn this section we describe the algorithm for the computation of elementary alignments between a set of input cDNA sequences and a genome from the same species Figure . The goaHigh sensitivity of the algorithm is achieved by using a small word size and very light repeat filtering. During the compartmentization each alignment is evaluated in the context of compartments and kept only if found to be a member of the globally optimal chain of alignments. If some minimum level of query cDNA coverage by a compartment is employed, which is typical in practical applications, most spurious matches between a pair of sequences are discarded even before the compartmentization stage.On the performance side, the algorithm benefits from utilizing the information about the composition of the cDNA sequences at the indexing of the genome, reducing the size of the index. Indices produced by the algorithm are stored in disk files to free memory for accumulation and processing of matching words. The latter are found by a linear-time comparison of the cDNA and genomic indices, during which the indices are accessed sequentially. The algorithm performs ungapped extension of the alignments as it is sufficient for the compartmentization and gaps in the final alignments are discovered using the target function of the refinement stage.The algorithm starts with scanning the genomic sequence for repeats. Note that application of some form of repeat masking is necessary to keep a local alignment tool of choice from being overwhelmed with hits to repetitive genomic segments. On the other hand, accuracy of solutions produced by the compartmentization may suffer if the set of local alignment is incomplete. Since it is possible for a repeated sequence to be part of an exon, we apply a very light repeat filtering based on frequency counts of sparse words. We first collect the counts of 14-mers with relative positions 1, 2, 5 – 16 in 16-mers starting at every fourth position in the genome. Then we set elements of a repeat filtering bit vector (RFV) corresponding to 14-mers within the 99.5 percentile. For every 16-base word parsed during the cDNA indexing, the 14-base subsequence of the word is extracted and used to check the corresponding bit in the RFV to determine whether the word becomes a key in the index. The choice of 14 for the purpose of computing the number of word repetitions allows the entire repetition count vector to occupy only 256 megabytes. The repetition count vector is discarded as soon as the RFV is initialized, with the latter occupying even smaller space.The next step is the indexing of cDNA and genomic sequences. The sequences are concatenated and encoded using two bits per residue. The cDNA sequences are indexed first, with each word checked against RFV using the procedure described above. If the check is successful, the underlying 32-bit value (key) is written alongside its global coordinate. Such key/position pairs are accumulated unless indexing another sequence would top a pre-defined maximum index volume size. At that point the pairs are sorted by keys and the index volume is saved on the disk. The indexing continues until all sequences have been parsed.On the disk, the index is stored in two components. A position component lists global coordinates of the keys while the key component lists keys and offsets corresponding to them in the position component. Similar index representations have been used in a number of other applications ,10.Different filtering vectors are used during the indexing of the cDNA and the genomic sequences. RFV derived from the genome is applied at the cDNA indexing to filter out words that are over-represented in the genome. Similarly, a participation vector (PV), which is a bit vector with bits indicating presence of the keys in the cDNA index, is applied at the indexing of the genome. The vector occupies 512 megabytes in memory and is used to admit into the genomic index only those keys that are found in the cDNA index. Genomic words are extracted at every other position of the genome. Combined with the continuous sampling of cDNA sequences, this assures that every pair of perfectly matching sequence segments of length seventeen or longer will be found.As both indices have been created, word matching is done very quickly through comparison of the key components of the indices. Indeed, since the key components are ordered by keys, finding each matching pair of keys is achieved by synchronous scanning of the components. For the same reason, the number of words corresponding to a matching key on the cDNA and the genome is found immediately. Matching words are recorded as pairs of global coordinates for every pair of the cDNA and genomic index volumes. Because of the way the index volumes are constructed (above), matching words for every pair of cDNA and genomic sequences are guaranteed to be confined to a unique pair of index volumes. This is essential for the compartmentization which must have all alignments between a pair of sequences available by the time it starts processing the pair. The matching words are merged along common diagonals and extended using the drop-off approach .Compart matching, because the implementation of the algorithm is embedded in the same software tool that does the compartmentization. In the rest of this sub-section we evaluate the repeat filtering step, the effect of using the PV in Compart matching, and compare the results of the compartmentization based on local alignments computed with different methods.We refer below to our elementary matching algorithm as repeat filtering when describing the algorithm in Compart because, unlike RM or WM, it effectively tags whole words rather than individual positions on the genome.Filtering of repeated DNA sequences has been a subject of much previous research. The most widely used repeat masking tool, RepeatMasker , relies We evaluated the intensity of repeat filtering by comparing the number of genomic words kept out of the index. To do so, we disabled the PV and counted the number of words with their corresponding bit set in RVF. In sequences masked with RM or WM, only words with all residues masked were counted. According to our tests Table , the repFewer repeated words filtered out may result in explosive growth of alignments in a general-purpose local alignment algorithm. In Compart, however, only alignments composing compartments are kept beyond the compartmentization step which is a small fraction of the alignments generated internally.The RFV is used at the indexing of the cDNA sequences, which also initializes the PV. Table N1 and N2 in the table) is always smaller than the number of sequences with at least one compartment (N3).Table A shortcoming of Compart matching algorithm is its reliance on perfectly matching keys. As sequences get more diverged  the algorithm becomes less sensitive. In those cases, tools not relying on perfectly matching words, such as Megablast in discontiguous mode, will tend to provide better input for the compartmentization step.compartment to designate both the alignment subsets and the genomic locations. After a compartment is identified, a spliced alignment algorithm can step in to produce a more accurate alignment of the cDNA with the local genomic interval.For many cDNA sequences, their local alignments against the genome suggest more than one place from which these sequences  might have originated. The goal of the compartmentization step is to filter and partition the local alignments into subsets so that these subsets will pinpoint every candidate location on the genome. We use the term Compartments located on different chromosomes or different strands are trivially separated. For others, the task can be more complex because of possible sequencing errors, polymorphic sites and exon duplications. Various approaches have been employed in other tools to identify candidate genomic locations. In Spidey, a greedy algorithm is used in which high-stringency Blast hits are sorted by score and then iterated, possibly more than once. On every iteration, each hit is either skipped or assigned to its genomic window, based on whether the hit's coordinates are linearly consistent with those of the other hits already in the window. GMAP scans the ends of a cDNA in an attempt to find pairs of highly-specific oligomers matching into approximately the same location on the genome. The latter is defined taking into the account factors such as the allowed genomic expansion for a given length of the cDNA sequence, concentration of matches and collinearity of cDNA and genomic coordinates. SPA relies on BLAT to perform the compartmentization step, however the relevant algorithm is not described in the BLAT paper.query) sequence aligning in the sense direction with the plus strand of a genomic (subject) sequence. We call a high-scoring pair (HSP) a pair of intervals on the query and subject sequences revealing a certain level of similarity. Without a loss of generality, this exposition assumes that HSPs are ungapped and perfect.The compartmentization algorithm in Splign is based on a formally defined model of compartments. Consider a cDNA  (precedes hj) ((hi) (≺ hj) if the following conditions hold:Consider two HSPs, Imax is the upper limit on the length of introns andwhere hj) (may extend hi) ,...,hM), provided that each compartment maintains some minimal level of query coverage: Q(Ci) ≥ Qmin. Indeed, biologically compartments represent gene copies with every copy delivering its portion of the query coverage. While some exons may diverge significantly enough to escape being detected by a local alignment tool of choice, it may still be possible to identify a compartment accurately as long as its alignment delivers the query coverage above the threshold. In practice, we select Qmin as the minimum of some fraction of the query's length and a constant.The key to formalizing the compartmentization problem is an observation that a proper organization of HSPs into compartments {The following relation is introduced to reflect our model's assumption that no two (same-strand) compartments corresponding to a query can overlap on the genome:v = {h(1),...,hM) (≺ hj) (⊣ hj) (and hi) (such that hi) (≺ hj) (or hi) (⊣ hj), which is a combination of the global and local alignment algorithms. The use of the compartment's local alignments is two-fold. First, they define an interval on the genomic sequence on which to perform the alignment. Second, some of the local alignments can be used to accelerate the algorithm by dividing its dynamic programming space. Note that one should be very conservative in choosing the alignments to be used as pivots for the SAA, in order to avoid forcing the final alignment through one of alternatives that were equally favorable during the compartmentization. In Splign, only high-identity diagonal alignments that provide a one-to-one mapping between the sequences are selected. The last condition is verified by checking for possible overlaps among all local alignments between the two sequences. Each pivotal alignment is trimmed at the ends to allow enough slack space for the SAA to locate proper splice sites.In the areas between the pivotal alignments, the global alignment algorithm is applied. At the areas stretching to the borders of the compartment, we use a variant of the local alignment algorithm in which one of the alignment's ends is fixed at the pivot. In all cases, the following scoring scheme is used:Wdiag is the substitution score, Wg and Ws are the gap opening and extension scores, and Wintr is the score of the intron starting at genomic position j - I + 1 and ending at j. Assuming only two types of introns, consensus and non-consensus, we denote below their scores as Wc and Wnc.where Scoring schemes with affine gap penalties have been used in many tools e.g. ,14,15) a,15 a14,1mA and mB be the number of mismatches in alignments A and B, and Δ is a constant. Then for every mA and mB such that mA - mB < Δ (mA - mB ≥ Δ), A will score higher (lower) than B.A list of such alternatives and their respective scoring conditions is given in Table In addition to the conditions in Table Since the termini are not fixed in the alignment, the following condition is used to control the minimum length of perfectly matching terminal exons Finally, the following condition was applied to improve consistency between the intron and gap scores:This concludes the linear programming problem that we used to compute the scores. Since quality of EST sequences is generally lower than that of full-length mRNA sequences, Splign scores for EST alignments are computed using higher Δ constants. Using higher Δ constants means that the identity around splice sites must be higher for the algorithm to introduce less frequent alignment features such as non-consensus splices and micro-exons.Dr Steven Salzberg, University of Maryland, College Park, MD, United StatesThis paper describes the program splign, which aligns spliced transcripts (ESTs and cDNAs) to genomic DNA. The program is very accurate and relatively fast, though not the fastest available. The authors' experiments show that for several large data sets, its performance  is usually superior to several of the best alternative programs out there. Overall Splign appears to be a robust program with excellent accuracy, and a very useful "splice site aware" alignment algorithm. It is already widely used and will no doubt continue to be.All my comments and suggestions have been addressed satisfactorily.Dr Arcady Mushegian, Stowers Institute, Kansas City, KS, United States"A small fraction of mRNA sequences are deposited to GenBank as complemented strand." – what is the evidence that this fraction is small, is it higher for EST projects than for full-length cDNA projects, and can the proportion of the wrong strands be estimated? On the other hand, what if both strands are transcribed, as recent Affymetrix studies seem to suggest – any evidence of this in the data, especially perhaps evidence of splicing in the non-protein-coding strand?Indeed, we did not investigate the precise number of such mRNA sequences and therefore shall remove 'small' from the sentence. It was clear though that such sequences do exist. Some of incorrectly oriented sequences can be detected by looking for alignments in the original direction having multiple non-consensus splices, that become all-consensus, high-identity alignments when reversed and complemented. We found 240  sequences satisfying the above condition. The assertion that the presence of such sequences may bias the experiment is even more valid if their fraction is bigger.The suggestion that both strands of an mRNA can be transcribed is very interesting and deserves a separate study. In our full set, we did notice nine mRNAs with perfect, complete and all-consensus alignment in both directions."Compartment test" – Something is missing in the description of the assay: among 9383 mRNAs, how many corresponded to the known areas of segment duplications?It would have been possible to build a set of sequences for this test by collecting mRNAs aligning to known areas of segment duplications. In the test we chose a different approach, in which we collected all mRNAs that were likely to align  at more than one place per subject per strand, based on their blast hit coverage.The answer to the asked question will of course depend on a specific list of known segment duplications. For example, using a list of gene clusters available at NCBI, we extracted cluster gene-associated accessions and found that 3398 (36%) accessions from Subset 2 match the list. Using a list built with the compartmentization algorithm resulted in 8923 (95%) matching accessions. A third list, based on BLAT alignments, revealed 8215 (87%) accessions in common.Dr Andrey Mironov, Moscow State University, Moscow, Russian FederationThe paper addresses an important problem, spliced alignment of mRNAs and ESTs to genomic sequence. The problem is of special interest in context of splicing analysis. The existing algorithms of nucleotide spliced alignment are not fast and accurate enough. The authors present a new spliced alignment algorithm that involves indexing words in the genome and mRNAs, repeats filtering, comparison of the indexes and creating compartments, refinement using a dynamic programming procedure.The "Subset 1" was created using a rather weak filter. Nevertheless this subset is noticeably smaller than the full set. What is the reason for this? What part of the filter provides the strongest reduction?The ORF-related restrictions accounted for about one third of the reduction. For each of the other excluded sequences at least one method reported more than one alignment with identity at or above the threshold.The authors declare that they have no competing interests.DL conceived the project, YK, AS, TT and DL designed the algorithms and conceived the tests, YK implemented the algorithms and the complementary software, conducted the tests and wrote the paper. All authors have read and approved the final manuscript.