However, accurate large-scale multiple sequence alignment is very difficult, especially when the dataset contains fragmentary sequences. We present UPP, a multiple sequence alignment method that uses a new machine learning technique, the ensemble of hidden Markov models, which we propose here. UPP produces highly accurate alignments for both nucleotide and amino acid sequences, even on ultra-large datasets or datasets containing fragmentary sequences. UPP is available at The online version of this article (doi:10.1186/s13059-015-0688-z) contains supplementary material, which is available to authorized users. Multiple sequence alignments (MSAs) of large datasets, containing several thousand to many tens of thousands of sequences, are used for estimating the gene family tree for multi-copy genes , estimating viral evolution, detecting remote homology, predicting the contact map between proteins ; howeverThe difficulty in accurately estimating large MSAs is a major limiting factor in phylogenetic analyses of datasets containing several hundred sequences or more. Phylogeny estimation methods that do not require a MSA  – to address these limitations. Each ensemble of HMMs is best seen as a collection of profile HMMs for representing a MSA, constructed in a phylogeny-aware manner; hence, we refer to this method as UPP uses the HMMER  suite ofPhase 1 begins with unaligned sequences and selects a subset  of the sequences; the remaining sequences are the “query sequences”. Phase 2 uses PASTA , 17 to cde novo alignment method.This part of UPP’s algorithmic design is similar to alignment methods that are based on seed alignments , but th5 is not based upona clade).Phase 3 creates a collection of HMMs  using the backbone alignment and backbone tree. The process begins by including the HMM computed on the entire backbone alignment. Next, the backbone tree is decomposed by removing a centroid edge . For each of these two unrooted subtrees, we use hmmbuild (a command within HMMER) to compute an HMM on the backbone alignment restricted to the sequences in the leaf set of the subtree, and then add the resulting HMM to the ensemble. We repeat this decomposition process until each subtree contains at most ten sequences. Thus, this process results in an ensemble of HMMs, each computed on an alignment induced by the backbone alignment on one of the subtrees. Note also that while the subtrees are local regions within the backbone tree, they may not be clades within the tree ; this returns a bit score, which is a measure of the quality of the match between the query sequence and the HMM. The subset HMM with the best bit score is selected, and the sequence is inserted into the subset alignment using hmmalign (a command within HMMER). We treat each site within an alignment as a statement of positional homology, so that all letters within the site are considered to be positionally homologous . Since pOnce all the query sequences have been added into the backbone alignment, the transitivity defines the final output MSA. This approach will tend to have potentially many insertion sites; to save space, we combine adjacent insertion sites into a single column. These introduced columns therefore contain nucleotides or amino acids that are not homologous to each other, and so the columns are indicated as insertion sites and masked before running a phylogenetic analysis. We also do not consider the homologies within these columns when evaluating the accuracy of computed alignments.As we will show, UPP provides very good accuracy on both phylogenetic and structural benchmarks, and is fast enough to produce highly accurate alignments for 10,000 sequences in under an hour, and for one million sequences in 12 days, using only 12 cores. Furthermore, UPP has excellent accuracy even when the sequence dataset contains a large number of highly fragmentary sequences. In comparison, most other MSA methods either cannot analyze datasets of this size due to computational limitations, or do not exhibit the same accuracy as UPP under the most challenging conditions (large datasets with fragmentary sequences).We used a variety of simulated and biological datasets from prior publications to compare UPP to existing MSA methods  error, which is the average of the sum-of-pairs false negative (SPFN) and false positive (SPFP) rates [We computed ML trees on the estimated alignments, and report tree error using the false negative (FN) rate , and the P) rates . We alsoWe explored modifications of the UPP design in which we varied the backbone size, used a single HMM instead of an ensemble, built ensembles based on clades within the backbone tree, built ensembles based on disjoint subsets of ten sequences each, used different MSA methods to compute the backbone alignment, used MAFFT instead of hmmalign to add sequences to the backbone alignment, and ran hmmbuild using different options to compute HMMs on each subset alignment. These preliminary studies revealed the following trends:1) Using small backbones (100 sequences) rather than large backbones (1000 sequences) typically produced higher alignment SP-error rates and tree error rates for both the ensemble of HMMs approach and the single HMM approach  Using an ensemble of HMMs rather than a single HMM with 1000-sequence backbones had varying impact. As shown in Table Finally, using an ensemble of HMMs instead of a single HMM generally reduced tree error Table . For exa(3) Using ensembles of HMMs computed for clades within the backbone tree produced alignments and trees that were generally as accurate (according to the SP-error and tree error rates) and had variable impact on TC scores  as those produced using ensembles based on the centroid-edge decompositions  Using ensembles of HMMs based on disjoint subsets (each with at most ten sequences) had variable impact. For many datasets , the impact of using disjoint subsets was very small, and in some cases even slightly favorable  The technique used to estimate the backbone alignment had a large impact on the final alignment and tree  Using MAFFT to add sequences to the backbone alignment instead of UPP’s default technique  reduced accuracy  Using different hmmbuild options (such as turning off the entropy-weighting flag) did not improve accuracy , using an ensemble of HMMs, computing the backbone using PASTA, and using hmmalign to add sequences into the backbone alignment. These settings were used for the default version of UPP. However, for running-time purposes , we explore UPP (Fast), a variant of UPP that uses backbones of 100 sequences but otherwise uses all the default settings .We used Clustal-Omega , MAFFT , Muscle We rank methods by tiers, where the first tier contains the method that had the best performance as well as any other method that was within 1 % of the best result for the dataset. Similarly, the second tier contains the method not in the first tier that had the best performance, and all methods within 1 % of that method (and so forth for the remaining tiers). The method that had the best performance overall within a collection is also identified. We describe the general performance of each method on the full-length datasets Table  and fragThe majority of experiments were run on the homogeneous Lonestar cluster at the Texas Advanced Computing Center (TACC). Because of limitations imposed by Lonestar, these analyses are limited to 24 hours, using 12 cores with 24 GB of memory; methods that failed to complete within 24 hours or terminated with an insufficient memory error message were marked as failures. For experiments on the million-sequence RNASim dataset, we ran the methods on a dedicated machine with 256 GB of main memory and 12 cores until an alignment was generated or the method failed. We also performed a limited number of experiments on TACC with UPP’s internal checkpointing mechanism, to explore performance when time is not limited. All methods other than Muscle had parallel implementations and were able to take advantage of the 12 available cores.On full-length datasets Table  where neThus, for full-length sequences, whether with respect to alignment SP-error, tree error, or TC scores, on average PASTA came in first place, UPP in second, and MAFFT in third, while Muscle and Clustal-Omega were behind these methods.We next investigated performance for datasets with fragmentary sequences. As shown in Table Figure UPP’s alignment SP-error increased only slightly with increases in fragmentation, even up to the highest degree of fragmentation (50 %). All other methods exhibited greater increases in alignment SP-error or tree error than UPP, as the amount of fragmentation increased.To understand better why UPP is robust to fragmentation, we explored UPP variants  in which we did not constrain the backbone to be only full-length sequences. We also looked at whether using the ensemble of HMMs instead of a single HMM contributes to robustness to fragmentation. These comparisons Fig.  revealedSecond, the comparison between UPP-random (Default) and UPP (Default)) favored UPP (Default), so that while there were negligible to small differences in some cases, UPP (Default) was dramatically more accurate than UPP-random (Default) for the ROSE NT datasets for both alignment SP-error and tree error Fig. . Thus, rHowever, restricting the backbone to full-length sequences and using only a single HMM produced much higher tree error than using an ensemble of HMMs Fig. , showingWe evaluated the ability of different methods to analyze very large datasets (up to one million sequences), using subsets of the million-sequence RNASim dataset; this comparison also reveals the impact of taxon sampling on the alignment methods. We examined performance for UPP (Fast), the fast version of UPP that differs from the default setting of UPP only in that it uses smaller backbones (100 sequences instead of 1000). Figure ΔFN), and the UPP trees were close behind  had stable alignment SP-error across all the datasets, varying between 12.5 % and 13.3 %. The trees for both UPP and PASTA improved with increased taxon sampling, with PASTA trees approaching the accuracy of ML for the true alignment (0.1 % to 0.2 % ΔFN). PASTA completed in 15 days, and produced a much worse alignment but better tree errors . Because we used a different machine with a different architecture, the running times for the million-sequence RNASim dataset cannot be directly compared to the running times for the other RNASim datasets, which were run on TACC.We then compared UPP (Fast) to PASTA for the full million-sequence RNASim dataset. We ran UPP (Fast) and PASTA on a dedicated machine with 12 cores and 256 GB of memory so that the analyses could exceed the 24 hour time limit in TACC. UPP (Fast) completed in 12 days, with alignment and tree errors similar to previous results . However, for the CRW datasets, which could be quite large (nearly 28K sequences), the differences in average running time were large: UPP (Default) used 11.6 hours, Muscle used 5.9 hours, PASTA used 3.2 hours, Clustal-Omega used 2.8 hours, and MAFFT used only 0.4 hours. Overall, for these datasets, MAFFT was generally the fastest (or nearly so), and UPP (Default) generally the slowest.We compared the wall-clock running time for each stage of the UPP algorithm for UPP (Default) and UPP (Fast) for two large nucleotide datasets: the RNASim 10K dataset with 10,000 sequences and the CRW 16S.B.ALL dataset with 27,643 sequences Table . Only twWe then explored how UPP’s running time  scaled with the size of the dataset by exploring subsets of the RNASim dataset with 10,000 to 200,000 sequences, using 12 cores. Running times for UPP (Fast) for the RNASim datasets showed a close to linear trend, so that UPP (Fast) completed for 10K sequences in 55 minutes, 50K sequences in 4.2 hours, 100K sequences in about 8.5 hours, and 200K sequences in about 17.8 hours Fig. .Fig. 6RΔFN tree error rates do not tend to increase that much with fragmentation although they do for PASTA. Thus, UPP is highly robust to fragmentary data whereas PASTA is not. Hence, while PASTA has an advantage over UPP for datasets without fragments, UPP presents advantages relative to PASTA for datasets with fragments.Although the relative performance of MSA methods depended on the dataset, in most cases, UPP produced alignments with lower SP-error rates and higher TC scores than MAFFT, Muscle, and Clustal-Omega. ML trees computed with UPP alignments were also more accurate than ML trees for the other alignments. However, the comparison between UPP and PASTA is more interesting. Because UPP uses PASTA to compute its backbone alignment and tree, by design, UPP is identical to PASTA for fragment-free datasets containing at most 1000 sequences. The comparison between UPP and PASTA with respect to alignment accuracy is interesting: UPP alignments tend to have lower SP-error rates than PASTA alignments but also lower TC scores, indicating that these two criteria are not that well correlated. However, ML trees based on PASTA alignments (for fragment-free datasets) are typically more accurate than ML trees based on UPP alignments. For datasets with fragmentary sequences, UPP has nearly the same SP-error rates that it achieves with the full-length sequences, while PASTA’s SP-error rates increase substantially with fragmentation; consequently, UPP’s To understand UPP’s performance, it is useful to consider the alignment strategy it uses. First, it computes a backbone alignment using PASTA for a relatively small (at most 1000-sequence) dataset; this allows it to begin with a highly accurate alignment. Then, instead of using a single profile HMM to represent its backbone alignment, UPP uses a collection of profile HMMs, each on a subset of the sequences. The subsets are obtained from local regions of the backbone tree, which is an ML tree estimated for the backbone sequences. Hence, the sequences in these subsets tend to be closely related. The induced subset alignments for these smaller localized regions are thus better suited for HMMs, especially when the full dataset displays overall substantial heterogeneity.These observations help explain why using multiple HMMs, each for a region within the backbone tree, provides improved alignments compared to using a single HMM. However, UPP also restricts the backbone to the full-length sequences, and this algorithmic step is critical to improving robustness to fragmentary sequences. Hence, these aspects of UPP’s algorithmic design – restricting the backbone to full-length sequences and using an ensemble of HMMs instead of a single HMM –increase sensitivity to remote homology  and reduces alignment SP-error and tree error, but each targets a different aspect of algorithmic performance.UPP exhibits great scalability with respect to running time , parallelism, and alignment accuracy. For example, our study showed the alignment SP-error for the backbone alignment is quite close to the alignment SP-error for the alignment returned by UPP. Thus, UPP enables large datasets to be aligned nearly as accurately as smaller datasets.Overall, UPP is a MSA method that can provide very high accuracy for sequence datasets that have been considered too difficult to align, including datasets with high rates of evolution, fragmentary sequences, or many thousands of sequences – even up to one million sequences. UPP performs well for both phylogenetic and structural benchmarks . We generated fragmentary datasets by selecting a random subset of sequences and a random substring (of the given length) for each selectedsequence.Each dataset was aligned (when possible) using Clustal-Omega  version Because the algorithmic design parameters for running PASTA on amino acid datasets has not been studied before, we examined different options for running PASTA on amino acid datasets and used those settings in our studies , we used FastTree  version We compare estimated alignments and their ML trees to reference alignments and trees. We use FastSP  to compuΔFN, the difference between the FN rate of the estimated tree and the FN rate of the tree estimated on the true alignment, to evaluate the impact of alignment estimation on phylogenetic analysis. Most typically, ΔFN>0, indicating that the estimated tree has higher error than the ML tree for the true alignment, but it is possible for ΔFN<0, which happens when the estimated ML tree is more accurate than ML for the true alignment.We report tree error using the FN rate , which is the percentage of internal edges in the reference tree that are missing in the estimated tree. We also report Additional file 1Supplementary materials discussed in the main paper. This file is available at [lable at . It cont


It gains accuracy by not masking repeats, and by using a statistical model to quantify the (un)ambiguity of each alignment part. Compared to previous animal genome alignments, it aligns thousands of locations differently and with much higher similarity, strongly suggesting that the previous alignments are non-orthologous. The previous methods suffer from an overly-strong assumption of long un-rearranged blocks. The new alignments should help find interesting and unusual features, such as fast-evolving elements and micro-rearrangements, which are confounded by alignment errors.We present a new pair-wise genome alignment method, based on a simple concept of finding an optimal  If we compare two genome sequences, such as those of human and chimp, to see how they differ, then intuitively we wish to align the “equivalent” regions of the genomes. More precisely, we wish to align orthologs, which are descended from the same sequence in the last common ancestor of the genomes. The white boxes in Fig. before the speciation event. The black and white boxes in Fig. We can recognize orthologs by sequence similarity, but we need to distinguish them from two other types of similar sequence. The first is paralogs, which are descended from a common ancestral sequence by intra-genome duplication Genome comparison would be simpler if the equivalencies were always one-to-one, but unfortunately orthology is not always one-to-one. If orthologs are duplicated after the speciation event, it can be many-to-many. In Fig. There is a large body of ongoing research on discriminating orthologous from paralogous proteins –6. A simThere is a widespread desire to refine the concept of orthology, perhaps in order to avoid many-to-many equivalencies, and so people speak of “main ortholog”, “positional ortholog”, “syntenic regions”, etc . These tThis has been made more precise under the term “toporthology”  or “topb, becausIt was suggested that symmetric duplications are those where deletion of either duplicate would restore the genome to its original state . HoweverDrosophila melanogaster and Drosophila pseudoobscura genomes shows striking synteny conservation: although these genomes are highly shuffled relative to each other, the shuffling is mostly within and not between chromosomes  are more conserved than others, structural RNA genes conserve complementarity rather than primary sequence, etc. There have been proposals to model some of these features e.g. –15), but, but15])Maximal-score alignment has an under-appreciated flaw: it can spuriously align dissimilar and unrelated sequences, if they are flanked by similar sequences . Althougd; 3) if so check whether there is a gapped alignment with score ≥e.Maximal-score alignments can be found by the Smith-Waterman-Gotoh algorithm , 18, butx-drop algorithm” [x below the maximum seen so far. It can be argued that x should be just less than e: lower values of x can hide alignment flanks with positive score, but higher values cause trouble by merging alignments with score s≥e across drops with score ≤−s [Step 3 is often done with a “gapped gorithm” , 20. Thicore ≤−s .12 alignments.Repeats (interspersed repeats and simple sequences) are typically masked before alignment. Specifically, they are marked using lowercase letters, seeds are forbidden from overlapping them, but the final alignments are allowed to extend into them. A major reason for masking is to make the computation tolerable: without it, e.g. each of the 1 million human Alu repeats would hit each of the 1 million chimp Alus, producing 10It is based on finding an optimal set of alignments, instead of optimal individual alignments.It aligns without masking, which turns out to be important for orthology search.It uses a statistical model to estimate the reliability (unambiguity) of each alignment part, enabling the user to disregard less-reliable parts.In a major departure, it does not consider conserved order and orientation. Although considering this is sensible, the ways that other aligners do so are problematic.This study presents a new genome alignment method, with several interesting features: Compared to previous aligners, this method aligns thousands of loci differently and with much higher similarity, strongly suggesting that the previous alignments are not orthologous.The idea is to seek a set of one-to-one alignments between two genomes that maximizes: f is an “alignment existence cost”, which is necessary to avoid trivial solutions with lots of length-1 alignments. It is similar to Mauve’s breakpoint penalty [Here,  penalty .The one-to-one requirement means that each basepair in either genome must match at most one basepair in the other genome. This is crude but tractable, and the hope is it will mostly find one-to-one orthologs. It is akin to the reciprocal best match approach to protein orthology.f, because in that case the score could be increased by splitting the alignment into two parts either side of the segment. So it solves the aforementioned problem of arbitrarily bad segments in individual alignments. The constant f reflects uniform probabilities, in a statistical model, of starting and ending a new item (see the Appendix).This simple scoring system is a natural way to find a set of items. One property is that no alignment can contain any segment with score <−f, with a classic aligner like BLAST or WU-BLAST [Note this is not equivalent to finding non-overlapping alignments with score >WU-BLAST , 24. OurFind local alignments between the two genomes, by seed-and-extend (many-to-many).Apply the repeated matches algorithm, constrained to the candidate alignments found in step 1. We refer to this constrained version of the repeated matches algorithm as “split-alignment”.f), where each alignment in the set is part  of a candidate alignment. In other words, given a set of alignments that overlap in the query, it finds an optimal set of nonoverlapping alignment parts. One aspect of this is finding optimal breakpoints for jumping between overlapping alignments. The output may include multiple parts of one candidate alignment.Split-alignment guarantees to find a set of many-to-one alignments that maximizes the sum of , and for brevity let us refer to the whole new method as LAST . We shalMany of the following results use the 1-split alignments, because they are easier to evaluate: if we find many-to-one alignments between genomes Q (query) and R (reference), we can assess whether each alignment could be improved by aligning the same segment of Q to a different region of R. They are also more comparable to the UCSC genome alignments, which are many-to-one , 27.By using a probabilistic version of split-alignment , not all matches. Ultimately we just want one strongest match, but the second-strongest helps us to calculate model probabilities. A similar culling procedure is present in BLAST [To mitigate this problem, a “gapless alignment culling” step was added. This step discards any gapless alignment whose query segment lies in those of two or more other alignments with greater score-per-length.in BLAST .Post-masking  was tested on five pairs of genomes Fig. . In each5-fold difference in model probability.As above, we can compare scores for “different” LAST alignments whose human segment is covered by one UCSC alignment Fig. , row 2. The human-dog and human-mouse results are not quite as good: the LAST scores are lower in about 2 % of cases. This is at least partly because these genomes are more diverged, so LAST’s seeds miss some orthologs.It may be more intuitive to compare the LAST and UCSC alignments by %-identity Fig. , row 3. Large and complex duplications: these create ambiguity about how to construct chains.Rearrangement (e.g. inversion) of the ortholog but not the paralog.Genome misassembly: most of these assemblies are unfinished drafts. Misassembly is especially likely in regions with complex duplications, repeats, and rearrangements.Gene conversion: this can convert an ortholog to a paralog.Contaminating human sequence in e.g. the chimp assembly.Accelerated evolution: this can decrease the similarity of an ortholog.In summary, there are thousands of loci that LAST aligns completely differently from UCSC, with significantly higher score and %-identity. Some overlap protein-coding exons Table . It is px-drop heuristic , the left and right flanks of that region will usually be found as separate alignments. Unfortunately, it is sometimes possible to find an alternative, wrong alignment of the whole region without a score drop >x, but with lower score overall. If orthologs are wrongly aligned in this way, the alignment score may be lower than that of paralogs, causing LAST to prefer a paralogous alignment.LAST’s ape comparisons still have a tiny fraction of alignments with lower score than UCSC. These are mostly caused by a pathology of the gapped tic Fig. . If an ax so that the correct alignment is found, or decreasing x so that the incorrect alignment is not found and the correct alignment is found in two parts. Unfortunately, different values of x fix different cases, and there is no reasonable value that fixes all cases.This problem can be fixed by either increasing The LAST alignments include many cases where the human segment is completely unaligned by UCSC Table . These aNevertheless, orthology search is likely harder for repeats than non-repeats. The human-chimp 1-split alignments mostly have around 98 % identity, but many of the repeat alignments have lower %-identity Fig. , panel 2This problem mostly vanishes in the final 2-split alignments Fig. , panel 3Surprisingly, the human-dog 1-split repetitive alignments do not have reduced %-identity Fig. , panel 5D. melanogaster and D. pseudoobscura genomes worked less well: the LAST scores were lower than the UCSC scores in 13 % of cases  than UCSC :(mismatch cost) ratio of 1:1 is appropriate for ∼75 % identity, 1:2 for ∼95 % identity, and 1:3 for ∼99 % identity . To inveFinally, we tested our method on the “Alignathon” simulated genomes . SimulatThere are two simulations: one of four ape-like genomes, and one of five mammal-like genomes. The “truths” are multiple (not pair-wise) alignments, and, in our understanding, they align all homologs  that have duplicated since the most recent common ancestor of the genomes. This unfortunately does not match our approach of finding one-to-one orthologs. In any case, for each simulation we made pair-wise alignments with LAST, then joined them into multiple alignments with mafTransitiveClosure , which jFor the ape simulation, LAST achieved a precision of 0.998 and a recall of 0.978. All other aligners had lower precision (Table S13 in ). For thTo understand why Cactus has higher precision, let us focus on pair-wise alignments between simHuman and simMouse. LAST aligns 124 million pairs of bases, of which 25 million are wrong, and 464 thousand lie in completely-wrong alignments . Cactus aligns 131 million pairs of bases, of which 18 million are wrong, and 6 million lie in completely-wrong alignments. So LAST is much better at avoiding completely-wrong alignments, whereas Cactus excels at accuracy of partly-right alignments. The latter is not surprising, because Cactus is a true multiple aligner: it takes pair-wise alignments from an external source , and combines and refines them by integrating the information from all the sequences .sets have been surprisingly neglected, although they are often what is really wanted, e.g. for multi-domain proteins.The new genome alignment method is conceptually extremely simple, it just seeks an optimal set of one-to-one alignments. Despite decades of extensive research on alignment, alignment The new method is obviously crude, because it ignores phylogeny and many-to-many orthology. It will fail in cases of reciprocal gene loss, where one copy of a paralog is absent in one genome and the other copy is missing from the other genome. Such hidden paralogy is a major problem in understanding evolution .Nevertheless, the new method seems to fix thousands of non-orthologous parts in previous genome alignments. The previous errors were caused by an over-aggressive assumption of conserved order and orientation. For example, in many cases in Table The use of a probabilistic model is a key advantage, since it quantifies the ambiguity of each aligned base. Similar probabilistic methods have been applied before to individual alignments , 14, 21,We found that pre-masking is dangerous for orthology search, which is probably not widely recognized since it is not dangerous for typical BLAST homology searches. Unfortunately, genome alignment without masking is much more compute-intensive, even with adaptive seeds and gapless alignment culling. Probably, better heuristics could be developed to tackle this.x-drop heuristic can sometimes produce bad alignments , the bad alignments are not immediately obvious , and this problem does not seem to have been described before. Unfortunately, it is unclear how to fix it, save by applying the repeated matches algorithm directly to the genomes (which seems feasible on a large supercomputer).We also found that the gapped nts Fig. . This isSplit-alignment has applications beyond whole genome comparison. It can be used to map DNA or RNA reads to a genome. “Mapping” is orthology search , and reads are genome fragments (possibly rearranged), so it is all the same thing. Since different reads may redundantly cover the same query bases, we would seek many-to-one alignments, i.e. stop at the 1-split stage. Our method incorporates fastq quality data into the model and scoring . The staThe new method aligns the majority of genomic bases identically to previous methods, as expected. Nevertheless, around 100 million human bases, which overlap a number of protein-coding regions, are in completely different alignments. The new alignments should be especially beneficial when searching for interesting and unusual features in genome evolution, because these are particularly confounded by alignment errors. One example is accelerated evolution, which is mimicked by paralogy. Another is micro-rearrangements, which are systematically missed in standard genome alignments based on colinearity , 39. IndAij is defined to be the score at query letter j in alignment i, for match, mismatch, or insertion of this letter. Dij is defined to be the score between query letters j−1 and j in alignment i, for deletions. The optimal split-alignment score is calculated by dynamic programming, using these recurrence relations: The input is a set of local alignments between one query sequence and one genome.  An example is shown in Fig. The recurrence is initialized like this: i) is the coordinate of the first query letter in alignment i, and beg= min(beg(i)). The optimal split-alignment score is Wend, where end= max(end(i)), and end(i) is one-past the last query letter in alignment i. This only calculates the score, but an optimal split-alignment can then be found by a standard traceback procedure [where beg, and hg19 .The UCSC genome alignments were taken from the axtNet subdirectories of these directories: hg19/vsPanTro4, hg19/vsPonAbe2, hg19/vsCanFam3, hg19/vsMm10, dm3/vsDp4.The VISTA alignment was taken from: .Lowercase-masked genomes were obtained from the UCSC database. Tandem repeats found by tantan version 13 were additionally masked, in order to prevent non-homologous alignments more reliably [e it was discarded.The genomes were lowercase-masked by tantan only, then aligned case-insensitively, and at the very end each alignment was rescored with gentle masking of lowercase letters : if it lThe sensitive transition seed set MAM8 was used by default . For them was empirically set to 50 for the ape alignments and 100 for the others. The score threshold e was set to values with borderline statistical significance, using ALP [f and the maximum gapped score drop x were both set to e−1.LAST’s seed rareness limit sing ALP : 5000 foTo illustrate, the Drosophila HoxD70 alignments can be constructed with LAST v535 as follows. First, run tantan on both genomes, with default settings. Then, make the 1-split alignments like this:lastdb¡-uMAM8¡x¡dp4.fa lastal¡-pHOXD70¡-e4000¡-C2¡-m100¡x¡dm3.fa¡| last-split¡-m1¡>¡1.maf Next, make the 2-split alignments like this:maf-swap¡1.maf¡|¡last-split¡-m1¡>¡2.maf Finally, run last-postmask on 1.maf and 2.maf.These query-reference pairs were aligned: simChimp-simHuman, simGorilla-simHuman, simOrang-simHuman. The alignment procedure was the same as for the real ape genomes . Alignments with error probability ≤ 0.00001 were retained, and joined by mafTransitiveClosure.These query-reference pairs were aligned: simDog-simHuman, simMouse-simHuman, simRat-simMouse, simCow-simDog. Since the simulated genomes are smaller than the real ones, we used MAM8 instead of MAM4 . Alignments with error probability ≤ 0.00001 were retained, and joined by mafTransitiveClosure.The data set supporting the results of this article is available in the Zenodo repository .a Score-per-length is computed for whole alignments, not overlapping parts.f parameter . It is instructive to first consider models of segments, such as hydrophobic segments in protein sequences. Segments are a simpler  analog of alignments.The aim here is to explain and motivate the statistical model of alignments, and the πx, while background (non-segment) regions have letter frequencies θx. Given a sequence, we can then seek maximal-likelihood segments.A simple model is for segments to have independent letters with frequencies ω and γ, in a standard circle-and-arrow notation [Q of length n. Let us calculate the likelihood of the path through the model whereby Qc+1…Qd is a foreground segment: Figure notation . Supposeμ, defined as: This can be simplified by factoring out a constant μ does not depend on the path, we can find a most-probable path by maximizing: Because Next, because maximizing a value is equivalent to maximizing its logarithm, we can maximize: x receives a score: We can now define a scoring scheme, where each letter-type t is an arbitrary scale factor. Maximal-likelihood segments are runs of letters with maximal total score. Scores are related to model probabilities like this: Here, one segment, and we can instead model multiple segments using Fig. ω, γ, and α. It can be shown that a maximal-likelihood segment set is one that maximizes: Figure S(x), and f is: Here, the segment score is the sum of the letter scores f arises naturally from model probabilities of starting and ending a segment.Thus, a segment existence cost Figure γ≈ω2, and t was calculated from each score matrix . We can define the probability of any alignment set A as follows: Unfortunately, it is unclear how to make a simple model like those in Fig. where t are the same as in the single-alignment model, so the only new parameter is f.The score parameters and The probabilistic version of the split-alignment algorithm is described here. These exponentiated scores are used: The Forward algorithm is: The Backward algorithm is: i with query letter j is: These algorithms enable us to calculate the model probability of each column in each alignment. The probability for a column in alignment z=Gend=Cbeg. The probability for a column in alignment i between query letters j−1 and j is: where Each column’s error probability is one minus its model probability.The practical implementation of this Forward-Backward algorithm uses scaling to avoid numerical instability .The substitution and gap frequencies in each genome alignment are shown in Table


The webserver is freely available and easy to use for non-specialists. Upon submission, LYRA automatically generates alignments using ad hoc profiles, predicts the structural class of each hypervariable loop, selects the best templates in an automatic fashion, and provides within minutes a complete 3D model that can be downloaded or inspected online. Experienced users can manually select or exclude template structures according to case specific information. LYRA is based on the canonical structure method, that in the last 30 years has been successfully used to generate antibody models of high accuracy, and in our benchmarks this approach proves to achieve similarly good results on TCR modeling, with a benchmarked average RMSD accuracy of 1.29 and 1.48 Å for B- and T-cell receptors, respectively. To the best of our knowledge, LYRA is the first automated server for the prediction of TCR structure.The accurate structural modeling of B- and T-cell receptors is fundamental to gain a detailed insight in the mechanisms underlying immunity and in developing new drugs and therapies. The LYRA (LYmphocyte Receptor Automated modeling) web server ( The immune system has the ability to target and fight with extreme efficacy and specificity dangerous molecules of either exogenous  or self-origin . Two key molecules in this extraordinary defence mechanism are T-cell (TCRs) and B-cell receptors  that with their interplay ensure a precise yet controlled immune response. In order to do so, the lymphocyte cells specific for their production have the capacity, unique among all the cell types in higher organisms, to control their genomic sequence by means of genomic recombination, to be subjected to positive or negative selection according to their ability to recognize self and non-self molecules, and in the case of B-cells, to further change their genomic content in a process called ‘affinity maturation’. All these events eventually allow the organism to generate a huge yet highly controlled repertoire of different lymphocyte receptors .canonical structures that can usually be identified by specific sequence features. The canonical structure model has been proven valid for both T- and B-cell receptors, but it has until now been developed and implemented into automated modeling tools only for B cell receptor (BCR) molecules. The reasons for this bias reside in the larger number of antibodies with an available solved structure and in the large use of antibodies in pharmaceutical and industrial applications. In the last few years however, the T cell receptors (TCR) have gained increased attention for the development of vaccines and therapies to treat cancers  present in the blood or in mucosal tissue and represent one of the first barriers against infection. The ability to study and predict their structure has been of fundamental importance to our understanding of the immune system, of pathogenic and autoimmune diseases –4 and fo cancers ,13, alle cancers ,15, and Here, we present LYRA (LYmphocyte Receptor Automated modeling), a web server for automated modeling of both B- and T-cell receptors. It is based on the canonical structure method and can produce, easily and within minutes, extremely reliable models of lymphocyte receptors.The input sequences are scanned with sequence profiles generated in-house. For each input sequence, the best-scoring profile is used to infer the receptor and chain type and the correct alignment. If LYRA can identify and properly align both chains of a given lymphocyte receptor, the pipeline continues with an automatic selection, from a database of curated templates, of the best framework template and eventually of the CDR templates that need to be grafted. The templates are then merged and the side chains are repacked to generate the final model. The overall modeling procedure takes on average less than a minute . A more detailed description of each modeling step follows below.http://www.rcsb.org/pdb/) are checked and the ones that are non-redundant with any molecule in the current version of the database are added to it .PDB codes of all BCR and TCR structures present in the IMGT/3Dstructure-DB  were retLYRA uses sequence profiles for BCR heavy, lambda and kappa chains and TCR α and β chains to identify and align the lymphocyte receptor sequences. The BCR HMMs were generated according to a protocol previously developed by the authors . The fin−50 (501 α chain and 599 β chain sequences) were added to the corresponding MSA. Consistently with what we observe in the Kabat-Chothia alignment  using the 3DCoffee/TMalign mode of the t-coffee software version 11.0010 . The mulD = 2(1 − cos(θ1 − θ2)). The CSs were obtained by applying the affinity propagation clustering algorithm from the Python package scikit-learn  and corresponding rules for BCR models were previously defined by others and us ,11,23–28it-learn  to the d  in each query chain is scanned. If the canonical structure of the loop in the selected framework template matches the calculated canonical structure for the query sequence, the loop is left untouched, otherwise a loop with the same canonical structure and the highest CDR-specific score is selected as template. In the cases  where no such loop can be found in the database the template loop with the same length of the template loop and the highest CDR score is selected. This selection method is always used for the β CDR3 loops, for which no clear CS could be identified.The final model assembly consists of three stages: packing of the two chains, loop grafting and side chain modeling. If the selected framework templates for both chains originate from different crystal structures, a set of interface packing residues is used to construct a ‘pseudo-sequence’ based on positions that determine the interface packing. The pair of templates from the same crystal structure and with the highest BLOSUM62 similarity based on the pseudo-sequence is chosen and the two template chains are modeled superimposing the target and template residues of all residues belonging to the interface ,23. Temphttp://www.cbs.dtu.dk/services/LYRA/) provides an easy-to-use interface to input the amino acid sequence data, a result page containing graphical and downloadable output of the model and an advanced modeling options for experienced users, and a detailed help page including sample sequences and output. In the following, we will describe the main elements of the LYRA web server in more detail. Further information and a more detailed guide can be found on the LYRA help page.The LYRA . The ‘PDB Blacklist’ input area  allows the user to enter a comma-separated list of any PDB structure that should not be used as template and therefore discarded in the modeling pipeline. The two buttons labeled ‘TCR’ and ‘BCR’ will load the text areas with sample BCR or TCR sequences respectively, overwriting any sequence already copied in the input areas. Upon pressing the ‘submit’ the user will be redirected to a queue page that will reload until job completion. The user can optionally submit his/her email address in this page and receive a mail with a link to the job. This field is not compulsory and it is sufficient to bookmark the page to access the results at a later time.The LYRA output page contains a header bar linking to several tabs. The ‘Summary’ tab shows detailed information on the modeling process: the templates used to model the framework and the CDR loops of each chain are reported for both chains. For each CDR loop, the CS of the target and of the corresponding template is shown. A complete list of the CS can be displayed by clicking on the button with a question mark button near the corresponding chain type. The user can visualize the model either interactively via the JSMol application in the ‘View Structure’ tab or with the high-resolution renderings generated using the PyMOL software in the ‘Structure Images’ tab. In both cases, the CDR loops are highlighted using different colors. The PDB file with the complete energy-minimized model can be inspected online in the ‘PDB File’ tab or downloaded by clicking on the ‘Download PDB File’ button. It is worth noticing that the header section of the pdb file generated by LYRA contains most of the modeling details found on the output page. The ‘Log’ tab displays technical information on the job inputs, outputs and possible errors.In the ‘Manual Template Selection’ the user can override the automatic selection of framework templates by clicking on any of the templates listed in the page. For each template all the relevant information are listed, such as the canonical structure of their CDR loops, the sequence identity and Blosum score with respect to the target sequence. An alignment of the target sequences with the templates currently selected is visible in the bottom part of the page. By clicking the ‘Submit’ button in this tab a new job will be launched, using the framework templates just selected and the automatically selected templates for the CDR loops. Additional files can be downloaded by clicking on the rightmost button in the header bar labeled ‘More’. These files include a complete summary of the input molecules and of the modeling parameters in JSON and csv format, a PyMOL script containing the model colored similarly to the pictures displayed in the ‘Structure Images’ tab, a ‘Pre-SCWRL’ pdb in which only backbone atoms and side-chains conserved from the templates are present and a non-minimized complete model, to be used as input for sidechain modeling and energy minimization software of the user's choice.The LYRA server provides a comprehensive help page that can be accessed from the header bars in the input and output pages. The help page contains a short description of the LYRA server and its usage, an outline of the modeling pipeline, a detailed definition of framework and CDR regions in each lymphocyte receptor chain, links to the tables with the CS definition in each chain type, and a description of the server outputs.In order to test the accuracy of LYRA, we applied a leave-one-out procedure to all the paired TCR and BCR molecules in our template database. In each round, we removed from the database the molecule being modeled together with any template having a sequence similarity of 90% or higher with the molecule itself. The overall results of the assessment are shown in Figure While several other antibody automated modeling tools are present ,34–39, LTo demonstrate the functionality of the LYRA web server also for TCR modeling, we show the modeling of 4×6B , a TCR mWe present the LYRA webserver, a completely automated method for the prediction of BCR and TCR structures. LYRA is, to the best of our knowledge, the first automated modeling tool for TCRs. Given its extremely simple interface, we believe LYRA will help researchers with limited knowledge of bioinformatics and computational tools, to easily build reliable models of lymphocyte receptors. The quality of the models generated by LYRA is at par with other methods and sufficient to make them useful in a vast number of biotechnological, pharmaceutical and computational tasks. As expected ,26,36, tSupplementary Data are available at NAR Online.


Mapping of short sequencing reads is a crucial step in the analysis of RNA sequencing (RNA-seq) data. ContextMap is an RNA-seq mapping algorithm that uses a context-based approach to identify the best alignment for each read and allows parallel mapping against several reference genomes.In this article, we present ContextMap 2, a new and improved version of ContextMap. Its key novel features are: (i) a plug-in structure that allows easily integrating novel short read alignment programs with improved accuracy and runtime; (ii) context-based identification of insertions and deletions (indels); (iii) mapping of reads spanning an arbitrary number of exons and indels. ContextMap 2 using Bowtie, Bowtie 2 or BWA was evaluated on both simulated and real-life data from the recently published RGASP study.We show that ContextMap 2 generally combines similar or higher recall compared to other state-of-the-art approaches with significantly higher precision in read placement and junction and indel prediction. Furthermore, runtime was significantly lower than for the best competing approaches. ContextMap 2 is freely available at http://www.bio.ifi.lmu.de/ContextMap.The online version of this article (doi:10.1186/s12859-015-0557-5) contains supplementary material, which is available to authorized users. Sequencing of RNA using next generation sequencing technology (RNA-seq) has become the standard approach for analyzing the transcriptomic landscape of a cell ,2. The fCurrently, many different RNA-seq mapping algorithms are available, such as TopHat , TopHat2Independent of the strategy for identifying spliced reads, existing RNA-seq mapping approaches were implemented to use only specific short read alignment programs, in most cases Bowtie. Thus, they cannot be easily extended to make use of novel developments in short read alignment, e.g. Bowtie 2  or BWA , which iIn this article, we present ContextMap 2, an extension of the ContextMap strategy, which among other improvements addresses the problem of integrating different short read alignment programs. The key novel features of ContextMap 2 are:(i) It provides an easy-to-use plug-in interface for integrating different short read alignment programs into the mapping workflow. This flexibility guarantees that ContextMap can be quickly adapted to newly developed read alignment algorithms.(ii) It extensively uses local read alignment options of novel short read alignment programs such as Bowtie 2 or BWA to accurately detect spliced reads.(iii) It precisely predicts the exact position of deletions or insertions (indels) by using the information provided by all reads in the same context.We evaluated the performance of ContextMap 2 using Bowtie, Bowtie 2 and BWA as integrated alignment programs on both simulated and real-life RNA-seq data used by the RGASP consortium in a recent evaluation of RNA-seq mapping programs . The comContextMap 2 is based on the ContextMap approach for RNA-seq read mapping . Here, tSimilar to other mapping approaches, this first ContextMap implementation used a modified version of Bowtie for alignment. Thus, it suffered from the same problem as most state-of-the-art mapping approaches that newly developed short read alignment programs could not be easily integrated to replace the used Bowtie version. Furthermore, variable read lengths were not supported and reads crossing multiple exon-exon junctions or containing indels were not mapped. All of these problems are addressed by ContextMap 2.In the following, an overview of the five steps of the ContextMap 2 workflow is presented .Candidate single-split alignment: if the seed could be aligned at the start or end of the read, the end-to-end alignment of the read contains more than the allowed number of mismatches and the last allowed mismatch is at least a predefined distance from the end of the alignment. If the integrated short read alignment program also produces local alignments, unaligned read positions are counted as mismatches for this classification.Partial alignment: if the same criteria apply as in (2) but the last allowed mismatch is less than the predefined distance from the alignment end.Candidate multi-split alignment: if only a local alignment could be determined with both a prefix and suffix of the read unaligned.Parameters of the underlying alignment program are set such that all alignments for which the seed can be aligned are retained, allowing for multiple alignments of each read. The resulting alignments are then classified into four categories:Following this classification, candidate single-split and multi-split alignments are extended to complete split alignments as described further below.The alignments identified in the previous step are used to define contexts. For this purpose, read alignments are clustered into a context if their start or end positions on the genome are at most a maximum distance apart Figure B. ContexOnce contexts have been defined, additional alignments are determined for each read based on the alignments found in the first step Figure C. This aFor this purpose, full and partial read alignments are checked for an overlap with split alignments of other reads. If overlaps are found, additional split alignments are created for the corresponding reads using the splice junctions indicated by the overlapping split alignments. Furthermore, all possible split alignments are generated for each read for which at least one split alignment was identified in step 1  with i mismatches supporting the splice site, m the maximum number of mismatches allowed and w a value <1 (default w=0.3)  downstream of the window if a candidate split alignment with the seed at the read start ends too close to the window end (i.e. the distance is less than the average intron size x). This allows finding split alignments that start within the window but end downstream of the window end. Similarly, an upstream sequence is added to the index if a candidate split alignment with the seed at the read end begins too close to the window start.To determine the complete split alignments within each window, an index is built for the used short read alignment program covering the part of the reference sequence within the current window. This sequence is extended by Using this dynamically built index and the corresponding short read alignment program, completing alignments of the unaligned read part are determined for each candidate split alignment within the sliding window Figure A. This rThe detection of multi-split alignments, i.e. alignments crossing more than one exon-exon junction, is a novel feature of ContextMap 2. It is based on local alignment options of recently developed alignment programs such as Bowtie 2 or BWA. Essentially, the local alignments are used to fragment the reads into smaller segments for which single-split alignments are then determined  to the same genomic region are collected using the same sliding window approach used for the single-split alignment detection. In fact, ContextMap uses a single run of the sliding window approach to process single- as well as multi-split alignments.r=r1…rl (l= read length) has been aligned at positions ri…rj, the first fragment consists of the subsequence f1=ri−e…ri−1ri…rj, where e is the predefined minimum exon size (default 20 nt). If the unaligned prefix (r1…ri−1) of the read is smaller than the minimum exon size e, f1=r1…rj. Similarly, the second fragment is defined as f2=ri…rjrj+1…rj+e. If the unaligned suffix of the read (rj+1…rl) is shorter than e, f2=ri…rl.For each candidate multi-split alignment in the current sliding window, two fragments of the read sequence are generated. If read f1 and f2. The completing alignments to these candidate split alignments are found within the sliding window as described in the previous section. This results in single-split alignments for the fragments, which are added to the list of initial alignments determined in step 1 of ContextMap 2 and extended to all valid single-split alignments of the fragments in step 3.The original local alignment then provides candidate split alignments for The complete multi-split alignment of the whole read is determined in step 4 by merging overlaps of the single-split alignments for fragments of the same read after the resolution of pairwise overlapping splice sites. Thus, the precise location of the splice sites is first determined for the single-split alignments of the fragments before combining them to the complete multi-split alignments.Essentially, the prediction of reads containing a deletion to the reference is the same as detecting spliced reads with a very small intron size , this split position is classified as an insertion. If the gap size is between 1 and a user defined maximum deletion size (default = 10 nt), it is classified as a deletion. If the gap size is between a user defined minimum intron size (default = 50 nt) and a user defined maximum intron size , the split is classified as an intron. Split alignments with gap sizes that do not fall into these ranges are not determined when detecting single- and multi-split alignments.The distinction between indels and splice sites is only applied when preparing the output at the very end of the ContextMap 2 run. At this point, the gap size is determined for each split position in a single- or multi-split alignment . For all programs, we evaluated the performance without and with an annotation (indicated by “ann”). For STAR, we evaluated both the 1- and 2-pass version. In the 2-pass version of STAR, splice junctions detected in the first run (1-pass) are taken as an input for a second run to improve mapping.We compared ContextMap 2 against the best performing RNA-seq mapping approaches identified in the RGASP study. These included MapSplice , STAR 11, and GSWe applied the same evaluation scripts to evaluate ContextMap 2 mapping runs using Bowtie (version 0.12.7), Bowtie 2 (version 2.1.0), or BWA (version 0.7.8) as internal short read alignment programs. Additionally, we evaluated the performance of ContextMap 2 using BWA and an annotation. Here, the annotation is only used for scoring splice junctions when resolving overlapping splice sites . It was not the published MapSplice 1.x version as options were used (e.g. detection of indels with length >3) that this version does not support. We thus included an evaluation of MapSplice 2 in this article by applying it to all data sets using default parameters. Since MapSplice 2 uses the annotation only to detect fusion junctions between different genes, which was not simulated in the RGASP data sets, MapSplice 2 was only applied without annotation.As a first metric, we evaluated the fraction of mapped reads for both simulated data sets  is set to even moderately high values. Thus, per default we used a relatively low value of Consistent with evaluation results on simulated data, alignment yield of ContextMap 2 was lower on all samples for the K562 cell line than for MapSplice 2, STAR or GSNAP, but similar or slightly higher than for TopHat1/2  was compared to the fraction of reads mapping to a novel splice junction (=: frequency of novel splices).Consistent with the evaluation of alignment yield, this analysis showed that ContextMap 2 combined low FDR with high recall. Again the combination with BWA performed best. Although some of the other mapping programs showed higher recall, this was always accompanied by significantly higher FDR. Generally, the increase in recall compared to ContextMap 2 was only modest with the exception of annotation-based GSNAP on simulation 2.The analysis of known and novel splices identified in the real data set showed that ContextMap 2 mapped reads to novel splices with similar frequency as most other programs except STAR 2-pass  outperformed all other programs on reads containing only one junction except STAR 2-pass and annotation-based GSNAP. This includes the vast majority of all spliced reads. Here, only annotation-based GSNAP performed significantly better, at least on simulation 2. In general, F-measure decreased with increasing number of junctions for all programs, mostly due to lower recall values. Precision generally remained above 90%. For reads with two junctions, ContextMap 2 with BWA was still only outperformed by STAR 2-pass, annotation-based GSNAP and now also annotation-based Tophat2, but the difference in recall to these programs increased.For three junctions, however, recall and thus F-measure of ContextMap 2 using BWA or Bowtie 2 dropped dramatically, such that only MapSplice 2, STAR 1-pass and GSNAP (both without annotation) performed worse. Since Bowtie does not perform local alignment, ContextMap using Bowtie cannot identify multi-split alignments and therefore had zero recall on three-junction reads. A small number of two-junction reads were mapped as single-split alignments are extended to multi-split alignments in step 3 of ContextMap 2 if they overlap an additional splice site.e), we repeated the analysis only for multi-junction reads fulfilling this condition. The results of this analysis are shown in the last two columns of Table Since ContextMap 2 by default only determines multi-split alignments for which internal exons are at least 20 nt long : Platform independent Programming language: Java Other requirements: Java 7 or higher; one of the following: Bowtie version 0.12.7 or higher, Bowtie 2 version 2.1.0 or higher, BWA version 0.7.8 or higher License: Artistic License Any restrictions to use by non-academics: noneAdditional file 1Supplementary material. Supplementary material contains Supplementary methods, Figures and Tables.


In template-based modeling when using a single template, inter-atomic distances of an unknown protein structure are assumed to be distributed by Gaussian probability density functions, whose center peaks are located at the distances between corresponding atoms in the template structure. The width of the Gaussian distribution, the variability of a spatial restraint, is closely related to the reliability of the restraint information extracted from a template, and it should be accurately estimated for successful template-based protein structure modeling.To predict the variability of the spatial restraints in template-based modeling, we have devised a prediction model, Sigma-RF, by using the random forest (RF) algorithm. The benchmark results on 22 CASP9 targets show that the variability values from Sigma-RF are of higher correlations with the true distance deviation than those from Modeller. We assessed the effect of new sigma values by performing the single-domain homology modeling of 22 CASP9 targets and 24 CASP10 targets. For most of the targets tested, we could obtain more accurate 3D models from the identical alignments by using the Sigma-RF results than by using Modeller ones.We find that the average alignment quality of residues located between and at two aligned residues, quasi-local information, is the most contributing factor, by investigating the importance of input features used in the RF machine learning. This average alignment quality is shown to be more important than the previously identified quantity of a local information: the product of alignment qualities at two aligned residues.The online version of this article (doi:10.1186/s12859-015-0526-z) contains supplementary material, which is available to authorized users. Due to the rapid increase of the size of the protein structure database, the template-based modeling has become a major tool for studying the structural aspect of proteins whose structures are not yet determined. Typical template-based modeling consists of three steps: 1) fold recognition, 2) sequence-template alignment and 3) chain building by optimizing spatial restraints. For the last decade, there have been significant improvements in the first two steps. A number of new methods have been proposed for improved fold recognition  and multσ, between two corresponding inter-atomic distances (Δd=|dn−dt| where dn is from the native structure and dt from the template structure) is assumed to follow the Gaussian probability distribution function (PDF), which is defined asGenerally, the chain building is carried out by optimizing a number of spatial restraints, which are extracted from a given sequence-template alignment. When a pair of residues in a target sequence are aligned with a corresponding pair in a template structure, the inter-atomic distance of the residue pair of the target sequence is assumed to take that of the template structure. The variability, denoted as σ, is estimated by fitting the Gaussian function against the histogram of data considering four features related to the quality of the alignment. For the chain building, the PDFs are converted into harmonic restraints by taking the negative logarithm and the model is constructed by minimizing the sum of the restraints. If a restraint is assumed to be more accurate than others, its corresponding σ value will be set to be relatively small and the restraint will be reinforced accordingly. Therefore, even with an identical alignment, the accuracy of a generated model would depend on the accuracy of σ values for the spatial restraints.In Modeller  and RoseΔd〉, by using the random forest (RF) method [σRF, has the following simple linear relationship with the standard deviation of Gaussian PDF used in Modeller, σModeller,In this work, we have constructed a statistical prediction model, Sigma-RF, to predict the variability of the spatial restraint, 〈) method . RF is a) method -27. It h) method . The varσ value either from Sigma-RF or Modeller is possible. When we benchmark the accuracy of σ prediction by Sigma-RF against that by Modeller, we find that the correlation between σ and Δd by Sigma-RF outperforms that by Modeller when tested on 22 CASP9 targets, To identify the effect of the improvement of σ values, we performed template-based modeling of single-domain targets of recent CASP experiments: 22 from CASP9 and 24 from CASP10, by using the σ values from Sigma-RF (σRF) and those from Modeller (σModeller) separately. The quality of model structures are compared in terms of the maximum TMscore [Therefore, the direct comparison of the correlation coefficients between the true variation of the distance restraint and the  TMscore  and lDDT TMscore  and the To train Sigma-RF, a set of known sequence-structure alignments is necessary. To prepare a training set for Sigma-RF, a set of 1181 non-redundant protein sequences were selected from the PISCES server . The criα-C α (CACA), N-O (NO), Main chain-Side chain (MS), Side chain-Side chain (SS). The distance cutoff values of the four categories are 14.5, 10.0, 8.0 and 5.0Å, respectively. For a given pair of atoms, i and j, the variability of their spatial inter-atomic distance, the objective quantity for training, is defined as the difference between the distance from the native structure and the one from the template structure, Following the Modeller procedure ,17, for I and J, in the target sequence. The third feature is the inter-atomic distance between atom i and atom j from two aligned positions in the template, di,j. The fourth feature is the product of match scores of two aligned positions of target-template residues, mI,K and mJ,L, given by FoldFinder, which is equivalent to the local alignment quality in Rosetta [We considered 20 input features to train four random forest machines separately and they are described in Table  Rosetta . The fifThe next four features represent the consistency between the predicted secondary structure/solvent accessibility of the target and those of the template. In addition, we introduced three heuristic features, F18, F19 and F20, to consider correlations between features more explicitly. For example, F18 is defined as the product of match scores and consistency scores of two aligned positions since we observed that these features have positive correlations with the accuracy of the spatial restraint.https://www.stat.berkeley.edu/~breiman/RandomForests/reg_examples/RFR.f.The random forest algorithm is a machine learning algorithm using the ensemble of decision trees. Each tree is optimized by using a random subset of input features instead of deterministic optimization . More deFrom all sequence-template alignments in the training set, we could identify over 10 million pairs of aligned atoms whose inter-atomic distances were shorter than the corresponding cutoff value for each distance type. Among these, we selected 1 million cases randomly and used them to train a random forest machine. We trained 4 random forest machines considering 4 distance types separately: CACA, NO, MS, and SS. Each random forest consists of 200 decision trees. For each tree, 2/3 of the initial training set is randomly sampled with replacement to train the tree. The unused training set is called out of the bag (OOB) data and it is used to measure feature importance. At each split, 6 out of 20 features were randomly selected to find the best split that maximizes information gain . The treσ values of instances included in the end node where the test case ends. The ensemble average of outputs from all 200 trees is considered as the final estimate of σ value.For prediction, a test case runs down all trees from the root to an end node based on the pre-determined splits. The output of each tree is defined as the average of The importance of each feature is measured by the increase of error in out of the bag (OOB) data after the value of the test feature among OOB data is permuted in a random fashion. When a tree is trained, the error of tree is estimated using the original OOB data. Next, the test feature is randomly permuted among the OOB data and the error of the tree is re-estimated by using the permuted data. The average difference between two error estimates over all trees in the forest is the raw importance score for the test feature.σModeller) of the Gaussian model of the distance restraint from Modeller [σRF), the predicted variability can be utilized as the parameter of the harmonic spatial restraint to build a model structure, which is defined asBased on the linear relationship between the standard deviation  is also prepared as the reference, which corresponds to the ideal prediction based on a given alignment.For a given alignment, a set of distance restraints was obtained by Modeller, and a new restraint file was generated by replacing http://lee.kias.re.kr/~protein/wiki/doku.php?id=modellercsa:download. It should be noted that, in this work, we excluded multiple binormal restraints of the Modeller energy function that affect the backbone and side-chain dihedral angles [For each target, 100 models were generated by executing restraint optimization with ModellerCSA  and origl angles . The qual angles  and lDDTl angles . The maxΔd=|dn−dt| and the predicted variability values σ were calculated for 22 single-domain template-based modeling targets from CASP9. The results of four distance types, C α-C α (CACA), N-O (NO), main chain-side chain atoms (MS), and side chain-side chain atoms (SS), obtained by Sigma-RF and Modeller are shown in Table The correlation coefficients between the actual σ values of CACA restraints of T0552 and T0598 are shown in Figure σModeller (red) tend to have rather smaller values and they are more narrowly distributed than σRF (green). We note that many highly inaccurate spatial restraints, |dn−dt|>10.0Å, are assigned to have rather small σ values by Modeller, σ<2. These small σ values can significantly lower the accuracy of thus-generated 3D protein models since the corresponding harmonic restraints will cause large penalty scores for the native structure, which would prevent the sampling of more native-like conformations. On the other hand, Sigma-RF provides relatively larger σ values for highly inaccurate distance restraints than Modeller does. For T0552 and T0598, all highly inaccurate restraints are predicted with larger σ values by Sigma-RF. This will lower the penalty from inaccurate distance restraints and will potentially allow one to sample more native-like conformations, which are inaccessible with small σ values from Modeller.To illustrate details on the difference of results between Sigma-RF and Modeller, One of the advantages of using RF is that we can estimate the importance of each input feature with little additional computational cost. We performed the importance test for 20 input features by using CACA restraints and the results are shown in Table In this work, we used three heuristic features, F18, F19 and F20, to take into account the relationship between features more explicitly. F18 is the product of match scores of two target positions successively multiplied by consistency scores considering the predicted secondary structure and solvent accessibility between the target and the actual value from a template. All features used to generate F18 are expected to be positively correlated with the local similarities at target positions. Therefore, as the characteristics of target positions are consistent between predicted values and actual values, this feature’s relevance will increase. F19 is defined as the division of F18 by (1+F6+F10), where F6 and F10 is the number of gaps between two target positions of the target and the template, respectively. The number of gaps in the alignment is expected to correlate negatively with the accuracy of the alignment, and therefore the smaller value of F19 would indicate that the local alignment between two target positions is less reliable. Similarly, F20 is defined as the division of F19 by (1+F8+F9+F12+F13).For F8, F9, F12 and F13, the reciprocal to the closest gap is defined as zero if there are no neighboring gaps, i.e., these features become zero. The distance from an aligned position to its closest gap is also closely related to the accuracy of alignment. This was identified as the most  or the sσ values of the CACA restraints are shown in Table Next, we tested the performance of the machine trained by using only the 10 most importance features to validate the importance estimates. The correlation coefficient between the true and predicted σRF, σModeller and σnative are summarized in Table TMmax,TMEmin and TMavg values obtained with σRF are consistently higher than those with σModeller.The average model quality measures of homology modeling results of 46 benchmark targets obtained by ModellerCSA using σ predictions of SS atom-pairs than those of main-chain related atom-pairs  it is one of the most accurate learning algorithms available, 2) it can handle large datasets efficiently, 3) it can handle a large number of input features without modification or deletion and 4) it provides an estimate of importance for each input feature . In prevσ values using the histogram-based approach, one should be careful in selecting only a small number of relevant input features, the identities of which are generally unknown in advance. By using the random forest method, however, we were able to use as many as 20 input features readily.One shortcoming of the histogram approach is that the number of input features and the number of bins are limited by the size of the database. If there are 5 input features each of which is divided into 10 bins, a total of 100,000 bins should be considered, which would require at least 10 million data points to obtain a reasonable estimate of the quantity of interests. The size of database can increase even further by including an additional feature. In addition, a considerably large size of the database does not always guarantee that all bins are properly filled. Therefore, to obtain an accurate estimation of The random forest method can measure the importance of each feature during the training with a fraction of additional computational cost. The importance estimation of an input feature can uncover hidden relationships between local properties of protein attributes. We found that the average match score of all aligned residue pairs located between and at two target positions is the most relevant information to predict the accuracy of the distance restraint extracted from the template. This suggests that the alignment quality of two target positions depends on their neighboring residues as well as the aligned pair themselves. This feature has not been considered in existing homology modeling studies ,22.Therefore, incorporating the equivalent information may help to improve the accuracy of Modeller  and/or Rσ values on the 3D chain building. However, in general, it is well known that the multiple alignment can help to generate more accurate protein 3D models. By using the multiple alignment and Sigma-RF, the modeling quality of such residues, which are aligned in terms of multiple templates, are likely to improve the model quality even further if accurate σ values are assigned to competing distance restraints originating from separate templates. Obviously, accurate assignment of σ values will allow thus-generate model to adopt the more accurate part selectively out of multiple template structures.Additional improvement in the model quality can be achieved by using a multiple sequence alignment. In this work, the single template alignment of each target was used to measure the sole effect of new In this work, we have trained a statistical model, Sigma-RF, to predict the intrinsic variability of the distance restraint between a residue pair using the random forest algorithm. Benchmark results show that Sigma-RF predictions are more highly correlated with the true variability than Modeller results. The homology modeling of 46 CASP9 and CASP10 targets shows that the utilization of the variability predicted by Sigma-RF consistently leads to more accurate three-dimensional protein models than using Modeller predictions with the identical alignment. The importance test of input features shows that the average alignment quality of residues located between and at two aligned residues, quasi-local information, is the most important feature in determining the variability of the distance restraint. This average alignment quality is shown to be more important than the previously identified quantity of local information: the product of alignment qualities at two aligned residues.


Non-coding sequences such as microRNAs have important roles in disease processes. Computational microRNA target identification (CMTI) is becoming increasingly important since traditional experimental methods for target identification pose many difficulties. These methods are time-consuming, costly, and often need guidance from computational methods to narrow down candidate genes anyway. However, most CMTI methods are computationally demanding, since they need to handle not only several million query microRNA and reference RNA pairs, but also several million nucleotide comparisons within each given pair. Thus, the need to perform microRNA identification at such large scale has increased the demand for parallel computing.Although most CMTI programs  are based on a modified Smith-Waterman (SW) algorithm, the existing parallel SW implementations  are unable to meet this demand in CMTI tasks. We present CUDA-miRanda, a fast microRNA target identification algorithm that takes advantage of massively parallel computing on Graphics Processing Units (GPU) using NVIDIA's Compute Unified Device Architecture (CUDA). CUDA-miRanda specifically focuses on the local alignment of short  sequences against longer reference sequences . Moreover, the proposed algorithm is able to report multiple alignments (up to 191 top scores) and the corresponding traceback sequences for any given  pair.Speeds over 5.36 Giga Cell Updates Per Second (GCUPs) are achieved on a server with 4 NVIDIA Tesla M2090 GPUs. Compared to the original miRanda algorithm, which is evaluated on an Intel Xeon E5620@2.4 GHz CPU, the experimental results show up to 166 times performance gains in terms of execution time. In addition, we have verified that the exact same targets were predicted in both CUDA-miRanda and the original miRanda implementations through multiple test datasets.https://sourceforge.net/projects/cudamiranda/.We offer a GPU-based alternative to high performance compute (HPC) that can be developed locally at a relatively small cost. The community of GPU developers in the biomedical research community, particularly for genome analysis, is still growing. With increasing shared resources, this community will be able to advance CMTI in a very significant manner. Our source code is available at  MicroRNAs (miRNAs) are single-stranded, small non-coding RNAs that control the expression of gene . Target The miRanda algorithm detects potential microRNA target sites from genomic sequences in two steps. Firstly, miRanda carries out sequence alignment of query (miRNA) and reference (3UTR) sequences through dynamic programming local- alignment based on sequence complementarity. Then the minimum free energy (MFE) score is calculated for each selected high alignment miRNA-mRNA pairs. Lastly, targets exceeding predetermined threshold MFE scores are selected as potential targets. Although miRanda is accurate, it is slow. For example, it takes more than three hours to run 2,000 queries against 30,000 references on an Intel Xeon 2.4 GHz CPU and 96 GB memory. Due to the quadratic run time complexity of the underlying sequence alignment algorithm used in miRanda, there is a long computation time when comparing query sequences against a large amount of reference sequences. This is challenging to the investigator who wants to analyze multiple samples of microRNA sequence data. The researcher typically has to run a sequence of pre-target-prediction steps, including short-read alignment to both genome and other small RNAs, novel miRNA prediction, and statistical test for differential expression . Each ofO(n2) due to the underlying dynamic programming, it has been modified through the addition of heuristic techniques to accelerate run time, as in BLAST [Sequence alignment requires scoring of the similarity between a short query sequence against a set of reference sequences. While the global alignment performs end-to-end matching of two sequences, the local alignment aims to find the highest scoring alignment of sub-sequences of the query and the reference sequences . Thanks in BLAST  and FASTin BLAST  algorithin BLAST , SIMD  and lr(j) at the position i of k qand the position jof lr, respectively, where • i,j Ais a partial alignment score for diagonal continuation.• i,j Bis a partial alignment score for horizontal gap extension.• i,j Cis a partial alignment score for vertical gap extension.• d(kq(i), lr(j), i) is the scoring function for match or mismatch, where i indicates whether the location is within the seed region or not.• i Ois the cost for opening a gap, where its value depends on whether i is within the seed region or not.• i eis the cost for extending a gap, where its value depends on whether i is within the seed region or not.• i < 8 by default.where the seed region is defined as 2 <Dl 0,= Dk,0 Al 0,= Ak,0 = Bl 0,= Bk,0 = Cl 0,= Ck,0 = 0. Given the boundary conditions, the alignment scores can be updated asThen, the boundary conditions for alignment scores are defined as i is in the seed region , Ci,j = -1, otherwiseIf Specific scoring matrix: The scoring function d(kq(i), lr(j),i) in miRanda algorithm is defined by two specific scoring matrices with following heuristic rules. Since target recognition between microRNA and mRNA is the end-goal, the complementary matching is imposed in miRanda, where the default value for A-U or G-C pairs is +5. Moreover, for G:U wobble pairs, a positive score is set to +1. All other nucleotide pairs have a default score of −3  in the alignment score matrix D until reaching the termination criteria ) or a left move ) corresponds to a gap insertion in the query or reference, respectively. Besides, a diagonal move ) indicates a match between reference and query at corresponding locations. The implementation of backtracking routine will be illustrated in details in the GPU implementation section.Free energy calculation: For the identified target sites, the minimum free energy of the micro RNA-mRNA duplex is calculated using folding routines from the Vienna RNA secondary structure programming library (RNAlib) [(RNAlib) . An enerEvolutionary conservation: miRanda applies predefined thresholds to select miRNA-target pairs having high alignment score and low minimum free energy of the duplex structure. Among these, miRanda keeps the miRNA-target pairs that are also found in other species. More specifically, the hits found in D. melanogaster are considered conserved if they are also found in D. pseudoobscura and A. gambiae. However, it has been reported that about half of the predicted miRNA target sites in human are not conserved in other organisms based on the experimentally validated data [melanogaster, has reported that its conservation rate with A. gambiae is only 60%. This version of CUDA-miRanda did not include the scoring of conservation.ted data . Also, tIn GPU computing, CPU and GPU are used together in a heterogeneous co-processing computing model. Computationally intensive parts can often be accelerated by parallelization. This part of code is applied to the GPU while the sequential part of the application runs on the CPU. With the availability of the Compute Unified Device Architecture (CUDA) by NVIDIA, developers can now write code for both a CPU and a GPU in a similar way by using the instruction set of CUDA . With CUIn CUDA, the thread hierarchy within a kernel is organized by the thread, the block of threads and the grid of blocks as shown in Figure cha 4 type, which results in a bandwidth of 128 bytes per transaction. Such procedure can significantly increase the memory throughput and reduce the number of accesses to the global memory.First, all the query and reference sequences are loaded from the input files in fasta format. In the preprocessing step, the queries and references are sorted by the length, so that tasks within a block have roughly equal complexity. Moreover, the original row-wise sequences are also stored into an optimized column-wise data structure in texture memory, by which sequence data can be cached and sequentially read by 32 threads in a warp within a single memory transaction. Moreover, instead of only reading a single nucleotide , each thread reads a group of four nucleotides stored in a i-th row is shifted to the left by i cells. Then, by observing the dependencies, for the calculation of alignment score D in the current column ) is the most memory consuming part in CUDA-miRanda, where q, Nr, Lq* Nand Lr* are the number of queries and references, and the maximum length of queries and references, respectively. Moreover, sizeo (track) is the number of bits that are required to represent the backtracking path in each cell. It turns out that a large number of q Nand N - r is desired for maximizing the parallelization, and Lq* and Lr* are data dependent. Therefore, to minimize the memory usage, we need to optimize the number of bits used for representing the track information. In our implementation, each track information is represented by 4 bits as follows:To enable traceback, it is necessary to store the whole path  from which the alignment scores are calculated. Thus, the backtracking matrix with size  &mask2' and 'T4 = (track >> 3) &mask2' extract the third and forth bits from track variable, where mask2 = 1 and '>>' is a left bit-shift operation.Here, we introduce notations to be used in later formula. 'The rules for filling the backtracking array are as follows:size of (track) is equal to 0.5 byte  and the backtracking matrix with 128 queries of length 32 and 100 references of length 30K only requires 128 × 100 × 32 × 30,000 × 0.5 bytes , which can be easily fitted into a Tesla GPU with 6GB memory. For a dataset with a large number of queries and references, we can split the dataset into multiple batches, where each batch can be executed sequentially on GPU. We use an unsigned short type with 16 bits to store the track information of a group of four cells, so that we can improve the memory throughput when reading and writing the backtracking matrix. Moreover, as illustrated in the Alignment Score Thresholding section, there are multiple candidate alignments for each query and reference pair. The starting positions for both query and reference, the alignment score, and the index of each candidate are stored in an ushort4 type array in the global memory.Therefore, in the proposed representation, the * function takes the largest integer that is smaller than *, and q Nand r Nare the number of queries and references that can be fitted in the device memory, respectively. Moreover, the organization of threads in each block is shown in Figure x direction in parallel. As the query length is limited up to 32 nucleotides, 32 independent cells can be calculated at a time using 8-thread parallel update of groups of 4 nucleotides in the y direction. The above thread organization scheme makes sure that all 32 threads within the same warp can operate on the same nucleotide location, which enables minimization of the intra-warp branch and bank conflict in shared memory. The pseudocode of the modified SW alignment kernel is shown in Figure the miRanda Algorithm section, the gap opening and extension costs, scoring matrices and alignment score update are different for the inside and outside seed regions. Moreover, the miRanda algorithm is based on the reversed order of each query. Therefore, the start and end positions for query sequences with different lengths are not the same. In our implementation, we pre- calculate the seed region for each query and store such information in a 32 bit int type array in the constant memory, as the length of the microRNA is bounded by 32 in our problem. Additionally, a value of 1 at a given bit indicates that the position is in the seed region. Moreover, the function isValidCell in the kernel function is used to check the boundary condition in the row shifting representation. Finally, the if conditions in equation 5 are replaced through carefully designed bit and shift operations to avoid the branch within a warp as shown in Figure The organization of blocks in the modified SW alignment kernel is shown in Figure ushort4 with 8 bytes is used to store score, index, and the alignment positions for query and reference sequences. As the shared memory size is 48 KB and we have reserved 128 bytes  for the counts of a candidate, the maximum number of candidates per query-reference pair is bounded to 191 and can be calculated as follows:The second stage of the CUDA-miRanda algorithm is to filter out the invalid alignment candidates as shown in Figure Subsequently, the parallelism is limited by the number of query and reference sequences, where the dimensions of a block and a grid are 32 × 1 × 1 and et. al. [Blazewicz et. al.  were theHardware: All tests were performed on a 64-bit Linux workstation having two Intel Xeon E5620@2.4 GHz, 96GB RAM and four NVIDIA Tesla M2090 GPUs with 6 GB RAM each without ECC configuration.Test data: To test the performance with as most application-related data as possible, real data sources for both queries (microRNA) and reference (3' UTRs) were used. MicroRNAs were downloaded from miRBase (databased release 18). FASTA files containing different numbers of known human microRNA sequences were created. These references comprise a set of 3' UTR sequence from http://www.targetscan.org (TargetScanHuman Release 6.1: March 2012). Only human transcripts were considered and brought into the FASTA file format so that they could be used as a reference input for miRanda. The raw reference dataset had 17,720 unique sequences and an average length of 1,167, ranging from 1 to 22,502. To test the performance in different conditions, we sampled multiple reference datasets with different average lengths from the Target Scan database.Parameter selections: All test runs were performed using the default alignment parameters and the options -quiet, -outfile, -keyval, -noenergy unless specifically mentioned. This means that the output was configured to write only aligned query- reference pairs into a file in key-value format, where the I/O cost for outputting the results was not considered. All the results were obtained over an average of ten trials, and we have verified that the exact same targets were predicted in both CUDA- miRanda and the original miRanda implementations through multiple testing datasets. Finally, the energy calculation was deactivated for these tests, as the focus was on the most time consuming part, the alignment.In order to show the performance of CUDA-miRanda, the total execution time of the single and multi-GPU setups were compared to the original CPU-only version miRanda 3.3a on different datasets. CUDA-miRanda emerged from a specific use case where targets with hundred putative novel microRNA sequences should be predicted. Due to the parallel grouping of microRNA sequences in warps, the best alignment performance can be achieved for multiples of 32 queries. Table The impact of different average reference lengths on GPU performance was also investigated and the results are shown in Table Although there are many existing GPU-based implementations of the SW algorithm -28, mostCMTI, Computational microRNA target identification; SW, Smith-Waterman; GPU, Graphics Processing Units; CUDA, Compute Unified Device Architecture; GCUPs, Giga Cell Updates Per Second; HPC, high performance compute; MFE, minimum free energy; FPGA, Field Programmable Gate Array; SIMD, Single Instruction Multiple Data; GPL, General Public License; GPGPU, General-Purpose computing on Graphics Processing Units; RBS, reference batch size.The authors have received a gift from NVIDIA in the form of hardware: two NVIDIA Tesla C2070 GPUs and one Tesla K20c GPU.SW carried out the design and implementation of GPU-accelerated algorithm, conducted most of the analysis and drafted the manuscript. JK participated in the design and coordination, as well as contributed to draft the manuscript. XJ participated in the design of the study and helped to draft the manuscript. SFB prepared the data, performed preliminary studies and wrote portions of this manuscript. LOM provided oversight for this study and helped to edit the manuscript. All authors read and approved the final manuscript.