Alignment of amino acid sequences is the main sequence comparison method used in computational molecular biology. The selection of the amino acid substitution matrix best suitable for a given alignment problem is one of the most important decisions the user has to make. In a conventional amino acid substitution matrix all elements are fixed and their values cannot be easily adjusted. Moreover, most existing amino acid substitution matrices account for the average (dis)similarities between amino acid types and do not distinguish the contribution of a specific biochemical property to these (dis)similarities.PR2ALIGN is a stand-alone software program and a web-server that provide the functionality for implementing flexible user-specified alignment scoring functions and aligning pairs of amino acid sequences based on the comparison of the profiles of biochemical properties of these sequences. Unlike the conventional sequence alignment methods that use 20x20 fixed amino acid substitution matrices, PR2ALIGN uses a set of weighted biochemical properties of amino acids to measure the distance between pairs of aligned residues and to find an optimal minimal distance global alignment. The user can provide any number of amino acid properties and specify a weight for each property. The higher the weight for a given property, the more this property affects the final alignment. We show that in many cases the approach implemented in PR2ALIGN produces better quality pair-wise alignments than the conventional matrix-based approach.http://pr2align.rit.albany.edu.PR2ALIGN will be helpful for researchers who wish to align amino acid sequences by using flexible user-specified alignment scoring functions based on the biochemical properties of amino acids instead of the amino acid substitution matrix. To the best of the authors’ knowledge, there are no existing stand-alone software programs or web-servers analogous to PR2ALIGN. The software is freely available from The online version of this article (doi:10.1186/s13104-015-1152-6) contains supplementary material, which is available to authorized users. Alignment of amino acid sequences is the main sequence comparison method used in computational molecular biology. Dynamic programming provides a computationally efficient way of finding an optimal sequence alignment of two amino acid sequences, given an alignment scoring function ,2. This vice versa  according to the following equation:pi(xj) is the value of biochemical property i for amino acid xj; mini and maxi are the minimum and maximum values of the i-th biochemical property. The user may choose to disable normalization and use the raw biochemical properties (not recommended).Where n*N(k+2), where n is the number of sequence pairs in the benchmark dataset, N is the number of grid points, k is the number of amino acid properties, and the factor of 2 accounts for gap initiation and gap extension penalties. For instance, using 6,000 sequence pairs, a coarse 20-point grid, and 4 amino acid properties involves performing 6*103*204+2 ≈ 3.8*1011 pair-wise alignments. For more than 4 properties the procedure becomes computationally too expensive. Second, it was shown that the three main factors that explain a significant proportion of the total variability in amino acid properties are related to hydrophobicity, size, and structural propensity [By default, PR2ALIGN uses the following four amino acid properties: hydrophobicity , size 3, coil propensity . Coil propensity . The preopensity .The optimized property weights and gap penalties for the four default properties are listed in Table QAVER:These property weights and gap penalties have been optimized on the SABmark database of benchmark sequence alignments  using ouNpairs is the total number of SABmark sequence pairs in the benchmark dataset and Q is the accuracy of the test alignment between sequences i and j. Q is calculated by comparing the test alignment to the reference SABmark alignment for the same pair of sequences  [Where s  :8\documenI is the number of residue pairs aligned identically in the test and the reference alignments; lR is the length of the reference alignment; lT is the length of the test alignment.Where In order to minimize the effect of over-represented protein families and to reduce the computational time required for the grid search, if some SABmark super-family had more than 10 sequence pairs, only 10 pairs were randomly selected from this super-family. For property weights, a 20-point grid with 0.05 increments was used. For gap penalties, a 10-point grid with 0.1 increments was used.We compared the quality of sequence alignments produced by the PR2ALIGN algorithm to the quality of sequence alignments produced by the matrix-based global alignment algorithm  and the i,j) from the benchmark dataset and the first alignment accuracy score Q1 is calculated using Eq.8. Second, the matrix-based alignment with VTML200 is used to align the same sequence pair and the second alignment accuracy score Q2 is calculated. Then, the difference between these two scores is calculated, D = Q1 – Q2. If the difference is positive, it means that PR2ALIGN performed better than VTML200 on the pair . If the difference is zero, it means that PR2ALIGN and VTML200 showed identical performance. If the difference is negative, it means that VTML200 performed better than PR2ALIGN. All sequence pairs used for the comparison are listed in Additional files The comparison of the two alignment methods was performed using the following procedure. First, PR2ALIGN is used to align a sequence pair (http://www.gnu.org/licenses/) from http://pr2align.rit.albany.edu/download.html. The program reads amino acid sequences in the FASTA format (see “Example of FASTA file” below). The user has options to save the alignment as an HTML-formatted file or as a FASTA-formatted text file. The compilation instructions and command line options are described in the README file included in the distribution.The stand-alone alignment program is written in C++. The source code and pre-compiled Windows and Linux executables are freely available under a GNU General Public License . The web-server has a simple user interface . The us“Amino acid properties to use for the alignment” – the user can either use the four default amino acid properties and weights listed in Table The alignment program was also implemented as a freely available web-server : Platform independentProgramming language: C++ , JavaScript and Perl (web-server)Other requirements: NoneLicense: GNU GPLAny restrictions to use by non-academics: license needed


In this paper, we advocate high-level programming methodology for next generation sequencers (NGS) alignment tools for both productivity and absolute performance. We analyse the problem of parallel alignment and review the parallelisation strategies of the most popular alignment tools, which can all be abstracted to a single parallel paradigm. We compare these tools to their porting onto the FastFlow pattern-based programming framework, which provides programmers with high-level parallel patterns. By using a high-level approach, programmers are liberated from all complex aspects of parallel programming, such as synchronisation protocols, and task scheduling, gaining more possibility for seamless performance tuning. In this work, we show some use cases in which, by using a high-level approach for parallelising NGS tools, it is possible to obtain comparable or even better absolute performance for all used datasets. The alignment process maps reads onto a reference genome in order to study the structure and functionalities of sequenced data.Next generation sequencers (NGS) have increased the amount of data obtainable by genome sequencing; a NGS run produces millions of short sequences, calledThe rapid evolution of sequencing technologies, each one producing different datasets, is boosting the design of new alignment tools. Some of them target specific datasets  or even data from specific sequencing technologies. Since the alignment process is computationally intensive, many alignment tools are designed as parallel applications, typically targeting multicore platforms. Several of them are based on the well-known Smith-Waterman algorithm, which is known to be computationally expensive. For this reason, many of them are already parallel, typically leveraging on multithreading. Also in some cases, SIMD parallelism (via either SSE or GPGPU) is also exploited.Due to specialisation, some of these tools provide the users with superior alignment quality and/or performance. With the ever-growing number of sequencing technologies, it can be expected that the scenario of specialised alignment tools will widen yet more.Although the market of NGS alignment tools is growing, to date, the parallel programming methodologies used to design these tools do not embrace much more than low-level synchronisation primitives, such as mutual exclusion and atomic operations. In the hierarchy of abstractions, it is only slightly above toggling absolute binary into the front panel of the machine. In the NGS community, programming multicore for performance is still perceived according to “the closet to the metal the fastest”, thus exclusively focusing on extreme optimisation of the code for a single algorithm and a single platform. We believe that correctness, productivity, time-to-market, and porting of existing legacy codes are equally important targets. farm paradigm (a.k.a. master-worker or task-farm)  de novo assembly , authorsassembly , where tassembly , authors de-facto small-scale on-chip parallel computer. The only way to increase performance on a multicore is by exploiting thread-level parallelism. Parallel programs are inherently more difficult to write than sequential ones, because concurrency introduces several new problems that programmers should take into account carefully. Developers are then facing the challenge of achieving a trade-off between high-end performance and time to solution in developing applications on multicore platforms in which the number of cores per CPU is increasing.Multicore platforms areParallel software engineering addressed this challenge via high-level sequential language extensions, parallel coding patterns, and algorithmic skeletons aimed at simplifying the porting of sequential codes to parallel architecture while guaranteeing the efficient exploitation of concurrency , 31.Parallel design patterns have been recognised to have the potential to induce a radical change in the parallel programming scenario, such that new parallel program will be capable of exploiting the high parallelism provided by hardware vendors . ParalleIn this respect, the FastFlow parallel programming framework , offers FastFlow is a parallel framework targeting shared memory multi/many-core and heterogeneous distributed systems. It is implemented in C++ on top of the Posix Threads (Pthreads) library and provides developers with a number of efficient parallel patterns . As showFastFlow has been used to design a variety of parallel algorithms, including Smith-Waterman , C4.5 daAs discussed in related works , a plethThanks to specialisation, some of these tools might provide the users with superior alignment quality and/or performance. It is of particular interest to identify and engineer the building blocks needed to develop a parallel alignment tool that is at the same time efficient and portable. Ideally, such building blocks can provide any forthcoming alignment tool with absolute performance, performance portability, and reduced development time.There exists one  reference sequences . The single sequence is typically read-only data.There exists a set of reads to be aligned against the reference. It is also read-only data. The specific attributes of the reads  depend on the dataset. They can anyway be independently aligned against the reference(s). With the growing size of the dataset, they are likely to be available as a stream of data flowing from a permanent storage.The assembly of results from independent alignment frequently does not require a complex merging operation. In case a merging phase is required , it is expected to be an online process on the result stream flowing to a permanent storage.Indeed, the parallelisation of sequence alignment problem exhibits a number of distinguished features.gets a sequence to align from the shared input file;aligns the read against the genome loaded into the shared index file;populates shared data structures with results and statistics. During the first and last steps, shared data structures are accessed in a read/write mode. These accesses are regulated via mutual exclusion . Furthermore, during these steps, the memory space to accommodate reads is dynamically allocated and deallocated, which might induce further mutual exclusion operations within the memory allocator. Each worker thread iteratively gets a single read from the input dataset and maps it onto the reference genome. This behaviour, usually named on-demand scheduling, enforces load balancing among worker threads.These features fit into the master-worker parallel paradigm , or the more general composition of pipeline and farm paradigms in the case the process requires complex a merging operation . As a matter of fact, all the most popular parallel alignment tools, including Bowtie2, BWA, and BLASR, implement a master-worker paradigm, where each worker cycles over the following three steps:Interestingly enough, all of them are developed with extremely low-level programming tools, such as spin-lock and atomic operations. They might provide the applications with low-overhead synchronizations but certainly make them hardly portable across different platforms and operating systems. Furthermore, such low level optimizations require nontrivial debugging and a large performance-tuning effort.As shown in the next section, the adoption of an engineered master-worker pattern simplifies the work, guarantees the portability of the application, and provides the application with good performance. This adoption has been applied to two aligners, Bowtie2 and BWA-MEM. To definitely assert that the proposed pattern is the best for every aligner, we should test it on each tool. It is difficult because of their constant increasing number, but we can say that, for its nature, this pattern helps on simplifying both the parallelisation process and further optimisations.The Bowtie2 (a.k.a. Bowtie version 2) alignment tool can align reads of very different length. The human genome loading requires a fairly limited amount of memory (about 2.3 GB) and it makes the tool usable from both workstations and laptops. The original source code of Bowtie2 implements parallelism by using the Posix Threads library according to a master-worker pattern.Each worker iteratively cycles the three steps described in Bowtie2-FF) [ farm pattern , specialised in the variant master-worker. Overall, this required to alter less than two dozens of code lines out of about 40 K code lines (excluding comments) of the whole Bowtie2 source code.In order to asses expressiveness and efficiency of the pattern-based approach, Bowtie2 (version 2.0.6) has been ported on top of the FastFlow library (tie2-FF) , 37. TheThread creation and synchronisation are trasparently made available by the parallel pattern. This simplifies the coding and enhance portability on different platforms and threading libraries .Pattern run-time behaviour can be configured according to different scheduling policies  without changing the code.The lock-free run-time support minimises concurrency overhead due to coherency traffic, thus exhibiting a superior speedup on fine-grain and irregular workloads.The synchronisation schemas of both original Bowtie2 and Bowtie2-FF are shown in Bowtie2-FF (bt-FF): master-worker with workload dynamically partitioned among workers;Bowtie2-FF with thread pinning (bt-FF (pin)): master-worker with threads pinning on cores and memory affinity for private data;Bowtie2-FF with thread pinning and genome interleaving (bt-FF (pin + int)): master-worker with threads pinning on cores, memory affinity for private data, and interleaved allocation policy among memory nodes for shared data (genome). For further implementation details, please refer to [Also, the FastFlow framework offers the opportunity to easily couple thread pinning and memory affinity. As an example, in the Bowtie2-FF implementation, each worker private data structures have been allocated on the memory node connected to the core that is executing the worker pinned on it. This way it is possible to get the best memory access latency; that is, each worker thread needs less time to access to the memory and retrieve private data. In order to improve access to the genome, it has been allocated with an interleaved policy, that is, allocating memory pages into all memory nodes on the system (Round-Robin scheduling policy). This way it is possible to avoid memory hot spots on the access to the genome (concurrently accessed by many cores). To understand the gain breakdown of the different techniques, in refer to .Bowtie2-FF has been developed as a porting version 2.0.6 on the FastFlow library. In February 2014, the version 2.2.1 of Bowtie2 has been released. It has been improved in the index querying efficiency using “population count” instructions available since SSE4.2. In this set, the STTNI instructions (String and Text New Instructions) have been added, which contain several new operations for character searches and comparison on two 16 bytes operands. The two versions do not differ in the orchestration of threads.The BWA alignment suite includes three algorithms based on the suffix-array based representation of data (Burrows-Wheeler): BWA-backtrack, BWA-SW, and BWA-MEM , 38. As In all three variants, the BWA tool is designed according to a master-worker paradigm as described in As for Bowtie2, each worker of BWA iteratively cycles the three steps described in Theoretically, the FastFlow master-worker implementation has still performance edge against the described implementation since it also avoids all coherency traffic due to atomic operation (thanks to the memory fence-free/atomic-free design of FastFlow run-time). However, this edge becomes evident only for very fine grain tasks (hundreds of clock cycles), whereas typical task grain in BWA is orders or magnitudes larger. Still, master-worker pattern simplifies the design because it implements a transparent dynamic load-balancing strategy and does not require any ad hoc rebalancing strategy.In this section, datasets used to compare performances between Bowtie2 and Bowtie2-FF are firstly present . Then, rWithin this work, we aligned datasets obtained with three different sequencing technologies in order to show how they behave with various lengths. More precisely, for our analysis on Bowtie2, we selected 4 short reads  and 3 long reads experiments . The formers report genomic sequences from CTCF ChIP-Seq experiments performed on IMR90 cell line (SRR078586), Exome sequencing from phase 1 of 1000 Genomes Project (SRR502198), and a dataset from Hi-C assay on K562 cells . For long read datasets, we choose three whole human genome sequencing, one from phase 2 of 1000 genome project (SRR003161). We also selected a portion of two PacBio Bioscience PacBio RS II technologies . By comparing the length of mapped and unmapped reads, we observed that Bowtie2 was able to align reads longer than 10 Kbp (max length 35 Kbp). Despite expectations, majority of shorter reads (less than 3 Kbp) were not mapped by the algorithm . This isThe same analysis was done on BLASR and BWA-MEM alignment results. We verified this observation also using BLASR and BWA-MEM tools. All reads were aligned using the former algorithm (data not shown), while BWA-MEM produced similar results of Bowtie2 algorithm in terms of distribution of reads length . In factError Correction. In [ Drosophila melanogaster corrected dataset, generated by using the PacBio RS technology [tion. In , statistchnology , and cont test P value <2.2−16)  see . The aliIn this section, the original multithreaded implementation of Bowtie and BWA alignment tools are compared for performance to their porting onto the FastFlow pattern-based library on different datasets. A key of used tools with their version is reported in sse flag set to 4.2, while bt-2.0.6 and bt-FF have sse3 flag set. All were compiled with the g++ 4.7.2 compiler.Tests were executed on an Intel workstation with 4 eight-core E7-4820 Nehalem (64 HyperThreads) @2.0 GHz with 18 MB L3 cache and 64 GBytes of main memory with Linux x86_64. Each processor uses HyperThreading with 2 contexts per core. bt-2.2.1 was compiled with the As reported in Notice that the version with pinning and interleaving performs better in the most cases. This latter version is used for tests shown in the rest of the paper. Alignment tests with Roche 454 real and synthetic datasets can be found in , where BAs shown in Figures Performances of bt-2.2.1, bt-2.0.6, and bt-FF have been also compared on two Human uncorrected datasets, which exhibits long length reads. Notice that the aim of the test is to assess the performance gain due to the high-level programming approach, that is, to compare bt-FF against bt-2.06 and bt-2.2.1, and not to assess absolute performance of Bowtie2 on long reads. Drosophila melanogaster corrected dataset.To exclude the influence of sequencing errors content in sequences, we compared the speedup achieved by different tools  on the PacBioThe BLASR version, for which a FastFlow version has not been developed, is reported for the sake of completeness. BLASR exhibits the very same parallel structure of other two tools see  and its In all cases, the efficiency of parallelisation hardly reaches the 50% of efficiency, which cannot be considered to be fully satisfactory. A full explanation for this result requires further investigation; however, it is likely related to SIMD/SSE code used for the single read mapping. SSE instruction typically induce a strong pressure on memory subsystem due to wide operands, thus saturating memory/shared-cache bandwidth even using the half of the available cores. A partial evidence of this effect can be found in perf, a performance analyser tool in Linux. perf stat –d” command. All the three versions of the tool have been analysed, running with 32 threads. These ranges are chosen on the basis of lower alignment rate reported on Further information to explain performance differences of the different versions of Bowtie2 can be extracted via sse flag set to 4.2, while bt-2.0.6 and bt-FF have the sse3 flag set. All were compiled with g++ 4.4.7 compiler . Tests are executed by running tools with at most 16 threads in order to exploit only physical cores. These tests showed the same behaviour among the three versions, with two noteworthy differences: (1) all the Bowtie versions are significantly faster on the Sandy Bridge platform on subdatasets 1 Kbp, 2 Kbp, and 3 Kbp; (2) this is not true on subdataset 5 Kbp, for which the bt-2.2.1 version is also significantly slower with respect to the other software versions. Both differences are rooted in coupling of the software implementation choices with hardware platforms and can be appreciated by comparing Figures To assess results across different platforms, the tools were tested also on a different platform, an Intel Sandy Bridge with two 8-core sockets (2 HyperThreads) @2.2 GHz, 20 MB L3 cache with Linux x86_64 (only on a subdataset from Human-Ref19-1 from 1 Kbp up to 5 Kbp). As in the previous tests, bt-2.2.1 was compiled with the In general, the Sandy Bridge platform is (slightly) highly clocked and more importantly exploits SSE/AVX instructions whose length is twice the Nehalem's SSE ones. However, the quad-socket Nehalem platform exhibits an aggregate Level3 cache of 72 MB (18 MB x 4), whereas the Sandy Bridge dual-socket is only 40 MB (20 MB x 2). For this, the 5 Kbp experiment working set fits in the Nehalem cache and does not fit in the Sandy Bridge cache. Being Bowtie, a strongly memory-bound application, this impairs the performance to such large degree that cannot be balanced by the faster processors of the Sandy Bridge. In the same way, bt-2.2.1 is generally slower with respect to bt-2.0.6/bt-FF on the same experiment because it requires a larger working set.In this paper, we analysed the problem of sequence alignment from parallel computing perspective; we reviewed the design of three of the most popular alignment tools exhibiting parallel computing capabilities, among others, Bowtie2, BWA, and BLASR. All these tools exploit a master-worker parallel orchestration paradigm to process the set of reads in parallel. Some of them also exploit SIMD parallelism to further accelerate the computation of a single task  using SSE instructions. Each of the analysed tools implements its own version of the master-worker paradigm at a very low-level of abstraction, specifically using blocking locks of the Posix Threads library or processor-specific atomic instructions.We advocate high-level parallel programming as an alternative design strategy for next generation alignment tools. High-level parallel programming aims at reducing development and performance tuning effort and enhances code and performance portability across different platforms. We demonstrated on two tools (Bowtie2 and BWA-MEM) that the pattern-based design not only simplifies tool engineering but also boosts the speedup of the application beyond the hand-tuned low-level original code. As nowadays no developer expects to get any performance advantage coding an application in assembler, no developer should expect to get more speedup by the low-level coding of a parallel application.We ported Bowtie2 and BWA on top of the pattern-based FastFlow parallel programming framework for C++. The porting required altering few lines of code  with an estimated programming effort of few days. Also, the FastFlow-based version of the tools resulted easier to tune for maximum performance. In particular, scheduling policy, load-balancing strategies, and memory affinity are extrafunctional features of the master-worker FastFlow pattern. Leveraging on these features, it has been possible to optimise tools parallel behaviour beyond the hand-optimised code of their original versions. As an example, in the case of Bowtie2, which is a memory bound application; the key optimisation consists in improving locality of the memory accesses and utilisation of shared memory bandwidth. In terms of programming effort, this just consists in configuring the master-worker pattern to adopt a memory-affine task scheduling.High-level parallel programming is becoming the mainstream approach for a growing class of applications. Even though our results cannot be considered fully demonstrative of the correctness and efficiency of the parallel pattern applied, we can fairly state that the global structure of an aligner, from the parallelisation viewpoint, can be always mapped within a master-worker pattern with suggested optimisations. We do believe this can be an enabling feature for future generation sequence alignment and analysis approaches.


Homology modeling predicts the 3D structure of a query protein based on the sequence alignment with one or more template proteins of known structure. Its great importance for biological research is owed to its speed, simplicity, reliability and wide applicability, covering more than half of the residues in protein sequence space. Although multiple templates have been shown to generally increase model quality over single templates, the information from multiple templates has so far been combined using empirically motivated, heuristic approaches.We present here a rigorous statistical framework for multi-template homology modeling. First, we find that the query proteins’ atomic distance restraints can be accurately described by two-component Gaussian mixtures. This insight allowed us to apply the standard laws of probability theory to combine restraints from multiple templates. Second, we derive theoretically optimal weights to correct for the redundancy among related templates. Third, a heuristic template selection strategy is proposed.ha model quality score by 11% over single template modeling and by 6.5% over a conventional multi-template approach on a set of 1000 query proteins. Robustness with respect to wrong constraints is likewise improved. We have integrated our multi-template modeling approach with the popular MODELLER homology modeling software in our free HHpred server http://toolkit.tuebingen.mpg.de/hhpred and also offer open source software for running MODELLER with the new restraints at https://bitbucket.org/soedinglab/hh-suite.We improve the average GDT- Since a protein’s function is largely determined by its structure, predicting a protein’s structure from its amino acid sequence can be very useful to understand its molecular functions and its role in biological pathways. By far the most widely used computational approach for protein structure prediction relies on detecting a homologous relationship with a protein of known structure and using this protein as a template to model the structure of the query protein on it. The basic concepts of this homology modelling approach have not changed during the last 20 years. In this study we extend the probabilistic formulation of homology modelling to the consistent treatment of multiple templates. Our new theoretical approach allowed us to improve the quality of homology models by 11% over a baseline single-template approach and by 6.5% over a multi-template approach. PLOS Computational Biology Methods paper.This is a Homology modeling is by far the most widely used computational approach to predict the 3D structures of proteins, and almost all protein structure prediction servers rely chiefly on homology modeling, as seen in the community-wide blind benchmark “Critical Assessment of Techniques for Protein Structure Prediction” (CASP) –3.Homology modeling consists of four steps: (1) Finding homologous template proteins of known structure, (2) Selecting the best template or set of templates, (3) Optimizing the multiple sequence alignment (MSA) between query and template protein sequences, and (4) Building the homology model for the query sequence that resembles as closely as possible the structures of the templates, accommodating for deletions and insertions of query residues with respect to the template structures.mms) with each other . This method is analogous to weighting sequences according to their similarity with other sequences in a multiple sequence alignment in order to compute a sequence profile [wk in the following subsection. The previous formula can then be generalised to K templates, givingp(d) is the probability independent of any template, i.e., the background distribution θ and θ′)In practice, the query and templates are related to each other through evolution along phylogenetic trees, and conditional independence cannot be assumed. We therefore approximate the dependence among the templates by weighting their odds ratios, with weights  profile  or some  profile . We willd again yields a quadratic function. Note that the ratio of the two Gaussians is again a Gaussian, because subtracting two quadratic functions of P(d∣dk) are multiplied. Second, the negative logarithm of Modeller’s distance restraint is quadratic in d, and hence unsatisfiable restraints can lead to extreme values during optimization. Dividing by the background avoids this quadratic increase because P(d∣dk)/P(d) has flat tails where it approaches a constant (1 − w). In cases of incorrect alignments with a wrong distance dt in the template, the restraint will not disrupt the query’s model structure as d will be pulled away from dt into the flat region of the restraint. Combining two component distance restraints as shown in Dividing by the background has two effects: first, it prevents the background to become dominant when the individual background components of all odeller (version 9.10) automodel.homcsr(0) command that generates a file with the list of restraints from the query-template alignment. We parse the list of restraints and replace each template-dependent distance constraint (which is either a Gaussian function for a single-template restraint or a Gaussian mixture for a multi-template restraint) with a set of our own distance restraints, one for each template. For this purpose, we added a restraint function that computes the logarithm of odeller. All template-independent restraints such as main chain and side chain dihedral angle restraints, bond lengths etc. are left unchanged. We run Modeller with the modified restraints list to generate a 3D model.After having picked a set of templates, we run the Mt3 should get a weight of 1, since conditioned on q it is independent of the other two templates. But templates t1 and t2 should get weights clearly smaller than 1, since they do not contribute independent information to d. On the other hand, they are not identical and hence should receive a weight clearly larger than 0.5. But how do we compute the exact optimum weights wk for templates 1, …, K given a phylogenetic tree with known edge lengths?As a motivation for the template weighting scheme, consider the case shown in wk for the star-like tree. In the star-like tree which we finally obtain, all template distances dk are conditionally independent, and hence we obtain for the odds ratio the result in wk from this iterative process.We begin by rooting the phylogenetic tree at the query, and giving its leaf nodes initial weights of 1. By iteratively applying the elementary step in d0 as the transformed, star-topology tree wk with a proportionality factor approaching 1 for τ0 ≪ τk. The sum of weights over all K templates is τ0 ≫ max{τk}, signifying that in this case the information in the templates is completely redundant.For the elementary step, we will show that the upper (sub)tree dh,To show that the odds ratio in dl after an evolutionary time τkl, when in the ancestor the distance was dk, is given byγ. Note that at time τkl = 0 the standard deviation vanishes and the right hand-side becomes equal to the delta functional, as it should. Substituting the conditional probabilities in the integral with these expressions, we see that the integral is over a product of Gaussians and can be solved analytically by the method of completing the square . This results in a Gaussian distribution which is shown in the Supporting Information to be equivalent to the tree We now make the very reasonable assumption that the evolution of the distance between pairs of atoms manifests diffusive behaviour. This behaviour results if the change in distance can be modelled by many small, independent changes, each change being the consequence of a sequence mutation that will slightly change the protein structure. Concretely, this means the probability of observing a distance tk, tl) = −log), where TMscorepred is the TMscore [q is at its root.For simplicity, we use the UPGMA algorithm  to const TMscore  predictetk from the mixture density network depends on the similarity between q and tk. In order for the new star-like tree to be equivalent to the real one, it has to represent the same pairwise q − tk similarities as the real tree.Note that by its construction the final tree with star-like topology has the same edge lengths between the query and any template as the real tree. This is important, since the restraint function for template search ranks templates by the probability Phom for the template to be homologous to the query protein. To pick the template best-suited for homology modeling, we trained a simple neural network with three hidden nodes  on the training set  they are structurally similar to the first template  and 3) all selected templates are structurally similar to each other .As a simple baseline approach to multiple template selection, we employ the network of the previous section to select the first template. Further templates are added if 1) their predicted TMNext, we propose here a heuristic method which aims to optimise the trade-off between increasing the query sequence coverage and decreasing the restraint quality of already covered residues due to adding more diverged templates with less reliable alignments.search in the following way  in (see t4 in We select the set of templates from among the top 100 found by HHwing way . The fir) in see  is (re)cS(t)  that residue i from q is homologous  to residue i′ in t. The latter probability is estimated by HHalign and HHsearch by a Forward-Backward algorithm. The local improvement (or impairment) of s with respect to the best local score s among already selected templates s, subtract a per-residue threshold β and sum over all aligned residue pairs  in the alignment A between q and t:α and β influence the degree of non-linearity and greediness of the selection, respectively. They were optimised with a simple grid search on the optimisation set as explained in the Results section.To calculate the score S(t) see  below, wpdb2fasta.pl and pdbfilter.pl in the HHsuite package v2.0.16). For all sequences in the resulting pdb20 and pdb70 databases, we built multiple sequence alignments (MSAs) with our sensitive, iterative sequence search tool HHblits (v2.0.16) that is based on the pairwise alignment of profile hidden Markov models (Hmms) [blits parameters with three search iterations against the uniprot20 database to get sufficiently diverse MSAs that are well suited to detect even remotely homologous proteins. The query sequences were picked from among the pdb20, and the template database was obtained from the pdb70 as explained below.We filtered the sequences from the PDB database of protein structures (May 2010) down to 20% and 70% maximum pairwise sequence identity and a minimal pairwise E-Value of 0.1 (using scripts s (Hmms) . We usedq according to TMalign (excluding the query itself) and recorded the sequence identity given by TMalign. q was then put into one of the three sets if the sequence identity bin for that set was not yet filled up. Otherwise, q was rejected. Finally, for each of the three query sets we constructed a template set by removing the sequences in the query set from the pdb70.We extracted three disjoint query sets from the pdb20, a test, a training and an optimization set, with 1000, 1000, and 500 proteins, respectively. To achieve a good balance of easier and more challenging queries for modeling, we aimed to obtain the same distribution of query-template sequence identities as for the 108 queries in the CASP7 experiment shown in Supplemental Fig. S2 . We computed the total amount of queries needed in each sequence identity bin . We then randomly picked query sequences from the pdb20 without replacement. For each picked query, we searched for possible templates in the pdb70 database and found the template most structurally similar to q in one of the three sets through the corresponding template database using HHsearch, a slower and slightly more sensitive version of HHblits, resulting in a list tlist(q) of potential templates.We then searched with each query sequence search results. We fitted distributions of log(d) with the mixture of two Gaussians. Modeller includes four different classes of distances depending on the atom types involved: between two Cα atoms (Cα–Cα), N-O atoms, side chain—main chain and side chain—side chain. We generated four sets of training data with 3 million training cases for Cα–Cα and N–O pairs, 1 million for SC–MC and 300k for SC–SC. Optimizing the log-likelihood of the mixture density network was done by conjugate gradient ascent until convergence was reached. Bad local optima were avoided by picking the run with maximum likelihood from among 50 random initializations.As training data for the mixture density networks for two-component distance restraints, we used the 3D models generated with single templates picked by the neural network. The alignment features for the network were again parsed from the HHodeller’s template based distance restraints with our new two-component Gaussian mixture restraints. The optimization schedule was kept unchanged. The new restraints improved single-template modeling by 0.8% from a GDT-ha model quality score .We replaced all of M-ts, see ) of 0.44to 0.492 , which isearch using the neural network with three hidden nodes shown in Fig. S1 (see odeller (version 9.10) for each query in the training set and each of the maximal 10 best-ranked HHsearch hits in tlist(q) as templates. This yielded 9212 models (since some queries had less than 10 database matches), whose model quality we evaluated using TMscore. To learn the network parameters we ran a standard back-propagation procedure. In order to avoid local optima, training was started from several random initializations, which all turned out to optimise to a similar likelihood on the training-set. The correlation between the network predictions and the true TMscore values was 0.89. Compared to selecting the first hit in the HHsearch results list for single template modeling, the neural network-based template selection led to a 0.9% increase of the average GDT-ha from 0.443 to 0.447  ∈ {0.9, 0.95, 1, 1.05, 1.1} ⊗ {0.8, 0.9, 1, 1.1, 1.2} using all sequences in the optimization set as queries. For each parameter combination, templates were selected according to the score in odeller and 3D structures were generated. We found α = 0.95 and β = 1 to maximize the cumulative TMscore of all models.Choosing multiple templates increases both the coverage and the probability to detect a correct template. However, a higher number of templates leads to accumulation of noise and wrong templates which decreases the model quality. As described in the Methods section, our template selection heuristic has two parameters, ha score of 0.462 to 0.480 , which resulted in a mean coverage of 94% of the query residues . The new selection strategy leads to an improvement of 3.9% from an average GDT-to 0.480  comparedirst one .odeller restraints) was 4.3%, from average GDT-ha 0.443 to 0.462 .ha, do not penalize incorrect regions and thus reward adding more templates to increase the fraction of the query structure for which restraints can be derived. [odeller. In that way, distance constraints can only be generated on cores. Then we evaluate the resulting models on core residues only and we compare the GDT-has with the general case.Most model quality assessment scores, such as the GDT-derived.  assessedodeller restraints of being more robust towards wrong restraints, because the new distance restraints become flat when log d deviates strongly from log dt, i.e., when the restraint cannot be satisfied at all. Therefore, completely wrong restraints practically get ignored in the new approach. Note that this was not a design target of our method but it is simply a consequence of a correct statistical treatment. To test our hypothesis on the robustness of the new restraints, we modified the template selection as follows.Our probabilistic multi-template modeling approach should have the advantage over the Mscores predicted by the neural network in Fig. S1 that also attained a true TMscore of > 0.5. The bad templates were the lowest ranked templates with a true TMscore < 0.3. The average model quality obtained with these three selections are shown in odeller pipeline.For each query in the test set, we constructed three different template sets . The thrpred regularly participates in the server based structure prediction category competing with 70–80 other servers. For CASP9 and CASP10, we integrated all methods described above into the HHpred pipeline.CASP  is a community wide, double-blind experiment that takes place every second year to objectively test the performance of various predictors. HHpred is among the most accurate servers . For detailed results, see Supporting Information. When replacing the new restraints with Modeller’s default restraints for the CASP10 set on the same selection of templates, the gdtts-score decreased by 3%.Depending on whether there existed a suitable template in the databases, all queries are subdivided into two categories: template based (TBM) and free (FM). Due to the ever increasing database sizes, most of the queries are TBM (121 vs. 26 in CASP9 and 111 vs. 15 in CASP10). As ils, see , 32). AtWhen considering HHpred’s performance in CASP9 and CASP10, note that assessors filtered out targets that will be too simple to predict by eliminating targets for which a high-confidence homologous template could be found using HHsearch. This procedure thus selectively biases the targets at the detriment of HHpred by eliminating targets that would be easy for HHpred to predict.odeller to build their 3D homology models, a software whose core has changed very little since its publication 22 years ago. This speaks to the enormous success of Modeller’s statistical approach to homology modeling. In this study we have shown how to generalize the statistical approach by taking account of alignment errors and treating restraints from multiple templates in a probabilistically satisfactory way.Protein structure prediction is a mature field, in which the best methods differ only by a few percent in performance according to recent CASP benchmarks. Even so, great progress has been made in the last 10 to 15 years in template-based protein structure prediction, fuelled by advances in techniques for remote homology detection and alignment  and techodeller’s heuristic to derive multi-template restraints works surprisingly well. Also, since Modeller’s internal workings (e.g. the stochastic optimization) are optimized together with its own restraints, it might well be possible to improve on the presented results by specifically optimizing Modeller’s model building procedure with our new restraints. We note, however, that an average model score improvement of 4.4%  that are somewhat smaller than what we expected initially. In hindsight, M% that arn CASP10 .ha, as compared to the less strict GDT-ts or TMscore  and try to find the 3D model that is best compatible with the alignment. To allow information from the 3D modelling to be fed back to the alignment stage and vice versa, it seems promising to explore the joint posterior probability distribution of alignment and 3D structure. One way to do this would be by Markov Chain Monte Carlo Gibbs sampling of the alignment and the model structure from appropriate conditional distributions.We are convinced of the power of probability theory in describing quantitative phenomena under uncertainty. MS1 Text(PDF)Click here for additional data file.S1 FastaThese correspond to the supplemental files S2_training_set, S2_test_set.fasta and S2_optimization_set.fasta, respectively.(ZIP)Click here for additional data file.


Citizen science games such as Galaxy Zoo, Foldit, and Phylo aim to harness the intelligence and processing power generated by crowds of online gamers to solve scientific problems. However, the selection of the data to be analyzed through these games is under the exclusive control of the game designers, and so are the results produced by gamers. Here, we introduce Open-Phylo, a freely accessible crowd-computing platform that enables any scientist to enter our system and use crowds of gamers to assist computer programs in solving one of the most fundamental problems in genomics: the multiple sequence alignment problem. Multiple sequence alignment (MSA) algorithms are among the most powerful tools available today to study the evolution and function of DNA, RNA and protein sequences . Key to Recently, we introduced Phylo ,6, a casAs with many other crowdsourcing platforms, such as Galaxy Zoo , Foldit In this paper we introduce Open-Phylo , an openWe used Open-Phylo to align sequences from the promoter regions of three key cancer genes , and retinoblastoma protein (RB1)). We show that crowds of gamers, managed through Open-Phylo, consistently improved the alignments computed using any state-of-the-art methods such as Multiz , MUSCLE crowd manager: a private interface that implements the tools to manage and monitor the data. In particular, the workspace lets users identify, either automatically or manually, portions of the alignment on which the crowd-based improvements should be focused, that is, those for which puzzles, either short 'casual’ 20-column subalignments or longer 'expert’ 300-column subalignments, should be generated. The submitter can track in real time the number of times each puzzle has been played and the magnitude of the improvement to the alignment score achieved by the crowd. At any time, the user can remove from the pool puzzles that he/she feels have been played sufficiently often, or to add new ones. This functionality allows the submitter to manage the work of the crowd. Crowd-improved MSAs can be downloaded at any time.Open-Phylo is the first crowd-computing system that is open for the benefit of the whole scientific community. It uses the processing power generated by video gamers Figure . At the Although Open-Phylo is based on a player interface similar to Phylo’s, it features several key innovations that significantly broaden its player base, including support for mobile devices such as most popular tablets and browsers, and social-login and social-share capabilities allowing easier logging in and improving the sustainability of the crowd. More importantly, the new crowd-computing system also features a new expert gaming interface Figure , which aThe Open-Phylo submission interface has several key functions. First, users can select the objective function for identifying the best alignments. In addition to classical scoring functions such as Ancestor , MUSCLE Task routing is important for ensuring the efficiency of human-computing systems . In the To illustrate and evaluate the alignment capabilities of Open-Phylo, we used it to align sets of orthologous promoter sequences  of three key cancer genes from 12 different species of mammals. Each set of orthologous promoter sequences was initially aligned using one of four state-of-the-art algorithms: Multiz , MUSCLE Between 3 December 2012 and 3 April 2013, 12,961 unique visitors proposed solutions for 1,352 puzzles, including 338 expert-level and 1,014 casual-level puzzles. We assessed the extent to which the quality of an MSA could be improved through Open-Phylo. There is no single well-accepted scoring scheme for MSAs and each of the four aligners considered uses a different objective function. We thus evaluated each of the MSAs obtained using each of the following four scoring functions: Ancestor  , MUSCLE,Open-Phylo appears to have the potential to improve a significant fraction of alignments calculated by any method for any scoring function. We obtained the largest improvements with the Ancestor and GUIDANCE scoring functions. Interestingly, these functions are precisely those that use the same user-defined phylogenic tree to score an alignment as the game. In both cases, and also for the MUSCLE objective function, we observed that for up to 62% of the cases, the solutions calculated from casual puzzles outperform those submitted by experts. This suggests that the work of many casual gamers can in some cases compensate for the lack of experts. Casual gamers are an important processing resource, who should not be neglected. However, this might not be the case for alignments calculated with T-Coffee, as the 44% improvement (using the T-Coffee objective function) was obtained almost exclusively from expert submissions. This discrepancy could be explained by the differences between the scoring scheme used in T-Coffee and the one used by our game. Nonetheless, since the latter achieved satisfactory performance with all other programs as well as with the T-Coffee objective function using the expert submission, we consider that the scoring scheme used in the game provides reasonable performance.P53 gene originally produced by MUSCLE was improved by an expert player, resulting in an increase in the alignment score from 3,533 to 3,906, and clearly improving the conservation of several alignment columns.Overall, the magnitude of the improvement of the score is modest  game to the results from the advanced player (expert) version. In particular, we investigated whether the classic or the expert version of the game provided the best improvement. We show these data in Figure All solutions generated by gamers for casual puzzles with a score (using the scoring scheme of the game) higher than or equal to the score of the initial level are stored in our system. We have to find those that provide the best improvement (if any) from the initial levels. Since the scoring function used in the game is not identical to the objective function we wish to use to select the best alignment , we inserted all of the proposed solutions into their original location in the full MSA and evaluated the global improvement using the desired objective function.The performance of the human-computing system was thus determined by the agreement between the scoring scheme used in the game and the values returned by the objective function used to identify the best alignments. To evaluate this correlation, we plotted Figure  the distBetween 3 December 2012 and 3 April 2013, 12,961 unique visitors  submitted 49,875 solutions for classic and expert puzzles, comprising 2,005 solutions for expert-level and 47,870 solutions for casual-level puzzles. During this period, in addition to the expert and casual puzzles  used for the benchmark, our database also included 56 other expert puzzles and 1,066 casual puzzles unrelated to our cancer gene test set, built from UCSC genome browser reference alignments.We collected at least three solutions for each large MSA played in the expert version of Phylo. Of the puzzles, 7% to 27%  were played more than five times. Thus, if we expect enhanced performance from the expert version, we must also expect a lower coverage (or lower submission rate) than with the casual version.Figure Figure Figure Figure Our results suggest that humans can provide insights that cannot be entirely replicated by heuristics-based algorithms. This performance is most likely due to the capacity of humans to use their  intuition to explore promising but abstruse configurations neglected by the heuristics implemented in alignment software.Interestingly, we also observed that the scores of the best solutions from the four different initial alignments rarely converged to the same (or even similar) scoring alignments, suggesting that the players’ solution remained in the vicinity of the initial MSA. Indeed, even if two different scoring functions agree on the global features of the “best” MSAs, it is very unlikely that they will have the same global optima for all MSAs. Therefore, the performance of the system seems to be significantly influenced by the choice of the initial configuration, thus by the alignment program chosen by the submitter. Nonetheless, our results also suggest that Phylo is able to improve alignments for the most popular objective functions.Open-Phylo is the first open-science platform that enables any scientist in the world to benefit from crowdsourcing and human-computing technologies to help in solving one of the most fundamental and widely used problems in bioinformatics. We believe that Open-Phylo is a pioneer for the next generation of crowdsourcing frameworks in biology: human-computing tools will be run by the people for the people.Once uploaded in our system, levels  are extracted from the MSAs submitted by Open-Phylo users. The protocol used to determine the levels  is:1. Pan a reading frame of ten to twenty nucleotides across the sequences.2. Calculate the number of nucleotides (without gaps) for each species. Then, compute the average and standard deviation.3. Calculate the number of pairwise matches between nucleotides in columns (ignoring the tree structure). From this number, derive the ratio of matches vs all possible pairwise comparisons within columns.4. The level is accepted if the standard deviation in Step 2 is greater than 1, and the level match ratio/fraction in Step 3 is between 0.32 and 0.38.5. If accepted, the reading frame jumps past the current nucleotides (to prevent an overlap). Otherwise, it shifts by one position to the right.In addition, users can also create their own levels through the Open-Phylo web interface. To do so, a user selects a region (using the shift key) of the MSA with a size of between ten and twenty columns. All non-empty rows (that is with at least one nucleotide) are included in the new level.We developed a version of Phylo for advanced players . This in• The game can display sequences with up to 300 nucleotides on a grid with 400 columns. As in the classic/casual version, the game can display 12 sequences instead of the 8 in the 2010 version of the casual game Phylo.• By default, all sequences are displayed initially in their original configuration. Therefore the user does not have to go through all stages and can work on improving the initial MSA immediately.• Users can also choose to start from the best solution from those submitted by the other advanced players. This enables players to work collaboratively to improve difficult MSAs.• Users can modify the ancestor sequences reconstructed with our variant of the Fitch algorithm . This al• Several levels of zoom of the MSA board are available, to give a global or local view of the game.• A user can save their current configuration at any time and revert to it on demand (and not only the best one as in the classic version).• A user can also submit their solution to our system at any time and still continue to play the same puzzle.The advanced player (expert) version of Phylo is restricted to registered players who have completed at least 20 puzzles, and thus gained experience, with the classic version. As in most crowdsourcing applications, the number of advanced players is one to several orders of magnitude lower than the basic version. The reasons are that some players only play a few games before leaving, other players never register and finally some players prefer to play casual games rather than working on more sophisticated problems.We evaluated Open-Phylo on MSAs of promoters regions of tumor suppressor genes: the P53 tumor suppressor protein, breast cancer type 1 susceptibility protein (BRCA1) and retinoblastoma protein (RB1). The sequences and initial Multiz alignments were downloaded from the UCSC Genome Browser .These initial alignments were divided into smaller MSAs of 300 columns. Each of these MSAs was realigned with one of the four alignments programs used in this study .We made minor modifications to the scoring scheme to improve on that used in the first version of the casual game . The PhyBecause it infers ancestral nucleotides independently at each position, the original Fitch algorithm is not designed to accommodate an affine gap penalty model and may result in sub-optimal ancestral sequences, which would yield a pessimistic alignment evaluation. However, exact algorithms or better approximations are computationally more expensive ,26, and Finally, our new version of Phylo also ignores gaps at the beginning and the end of each pairwise alignment. This modification enabled us to counter a basic strategy used in the first version of the casual Phylo game , which cIn this study, we used version 3.8.31 of MUSCLE and version 9.03 of T-Coffee to calculate and score alignments. The alignments calculated with version 100303 of PRANK were scored with version 1.3.1 of GUIDANCE. The latter samples bootstrap neighbor joining trees to evaluate alignments. We chose to generate 50 bootstrapping trees, which seems to offer the best trade-off between the accuracy of the confidence score and running time.bp: Base pair; MSA: Multiple sequence alignment.The authors declare that they have no competing interests.DK designed and implemented the Open-Phylo interface and server. AK designed and implemented the Phylo casual video game. DB analyzed the data. QZ designed and implemented the Phylo expert interface. AH prepared the data. EZ participated in the design and implementation of the Open-Phylo interface, Arthur K participated in the implementation of the Phylo casual video game (in part while he was affiliated with the Nokia Research Center). LS contributed to the design of the Phylo casual video game. MB designed the research and wrote the manuscript. JW designed the research, implemented the server, analyzed the data and wrote the manuscript. All authors read and approved the final manuscript.Scores for the alignments of the 338 blocks used in the benchmark. Each row is for an expert block aligned using one of the four programs . Each column shows the scores obtained using one of the four scoring functions  for the three types of alignment . Highlighted cells show scores that improve the initial score.Click here for file


Since there is no best way to compare structures and evaluate the alignment, a wide variety of techniques and different similarity scoring schemes have been proposed. Existing algorithms usually compute the best superposition of two structures or attempt to solve it as an optimization problem in a simpler setting . Here, we present PROPOSAL , a stochastic algorithm based on iterative sampling for multiple local alignment of protein structures. Our method can efficiently find conserved motifs across a set of protein structures. Only the distances between all pairs of residues in the structures are computed. To show the accuracy and the effectiveness of PROPOSAL we tested it on a few families of protein structures. We also compared PROPOSAL with two state-of-the-art tools for pairwise local alignment on a dataset of manually annotated motifs. PROPOSAL is available as a Java 2D standalone application or a command line program at  Protein function is commonly deduced by sequence analysis. On the other hand, most protein interactions, such as catalytic activity or gene regulation , depend on sub-regions of their 3D structures, called structural or binding motifs. Havranek and Baker  show thaSince the structure of many proteins is still unknown and proteins with similar structural motifs often exhibit similar biological properties even when they are distantly related, 3D structure comparison can help characterize the role of many proteins. As stated in Eidhammer et al. , there iMolLoc  of the optimal rigid-body superposition Kabsch, , the disIn this paper, we present PROPOSAL , a stochastic algorithm for local alignment of 3D protein structures. PROPOSAL relies on Markov Chain Monte Carlo in connection to a Gibbs Sampling strategy which has been applied to solve the multiple local sequence alignment problem  in connection to Gibbs sampling , called fingerprint. Since the fingerprint changes at every iteration and there are 20 amino acids, the maximum number of iterations performed by PROPOSAL has been set to 203 = 8000.PROPOSAL is an iterative method. In each iteration it tries to find an optimal local alignment of size bootstrap phase, Gibbs sampling is used to find a local alignment of N substructures (one for each protein), composed by 3 residues each. These substructures, called seeds of the alignment, represent small potential conserved motifs shared by the N 3D protein structures.A single iteration consists of three phases. In the first one, called The quality of the seeds alignment is quantified according to a proper scoring scheme based on the average Root Mean Square Deviation (RMSD) between the aligned substructures, considering all possible pairs of proteins. The best alignments will have the lowest average RMSD.C = {C1, C2,…, kC} and D = {D1, D2,…, kD} be two sets of residues. The RMSD between C and D is given by the root mean-square deviation of the Cα atomic coordinates of residues, after performing an optimal rigid body superposition. The RMSD is defined as follows:ixC, iyC, izC and ixD, iyD, izD are the 3D coordinates of residues iC and iD, respectively, after the superposition.Let We computed RMSDs using QCP .The goal of the bootstrap phase is to find an optimal alignment of small substructures of 3 nodes, called seeds. A seed is represented by a triple of residues The set of possible candidates for the initial alignment consists of all seeds satisfying the following conditions:All residues within the seed are at distance less than 10 Å;The residue symbols in the triple must match the fingerprint of the corresponding iteration of PROPOSAL.Feasible candidates are seeds satisfying both (a) and (b). If one or more proteins contain no feasible candidates, the search stops and a new iteration of PROPOSAL begins.N seeds, one from each protein structure.Once a set of suitable candidates is generated, PROPOSAL tries to construct an optimal initial alignment through Gibbs Sampling on top of a Monte Carlo Markov Chain (MCMC). In the MCMC each state represents an alignment of Starting from a random initial state , the sampling method iteratively performs a transition from a state of the chain to another, by replacing a randomly chosen seed of the current alignment with a feasible candidate of the same protein, according to a properly defined transition probability distribution. When Gibbs sampling stops, the last current alignment is returned. If the sampling procedure is iterated a sufficient number of times, it converges to a local optimum solution.i consecutive iterations of Gibbs sampling. The number of iterations of Gibbs sampling is determined by the following parameter k:k consecutive iterations, the Gibbs sampling is stopped. The lower is α, the more precise and slower will be the sampling procedure. Therefore, α represents a trade-off between accuracy and speed of PROPOSAL.A critical task is to establish when Gibbs sampling can be stopped. The procedure ends when the alignment of seeds does not change. Let Dist be the euclidean distance between the two residues R1 and R2 of a 3D structure. Given two seeds A =  and B = , we define the pairwise distance between A and B as:The transition probability is defined on top of a similarity score, based on the distances between the residues of the seeds. Let S = {S1, S2, …, NS} be the alignment of seeds at the i-th iteration of Gibbs sampling and suppose we have to replace jS by a feasible candidate X of the same protein. The similarity score of X is defined as the inverse of the product of all pair distances between X and the seeds of the current alignment (except jS):Now, let The transition probability is then computed by normalizing such similarity scores in .w by iteratively adding N residues to the current alignment, one from each protein.In the extension phase, the alignment of residues is extended up to size w′<w. The goal is to find an optimal alignment of N residues R1, R2,…, NR, one for each protein, and add such residues to the substructure alignment. iR must be at distance at most equal to 10 Å from residues in the corresponding current aligned substructure. At the end of this process, the alignment size will be w′+1.Suppose that we start from a substructure alignment of size Each extension step is performed through a Gibbs sampling strategy similar to the one used during the bootstrap phase. In the extension phase the similarity score takes into account:The symbol of a candidate residue;The distances between the candidate residue and the aligned residues of the same structure.SA = {SA1, SA2, …, NSA} be the current alignment of size w′, where each iSA = {Ri,1, Ri,2,…, Ri,w′} is a set of residues, and let mA = {mA1, mA2,…, mNA} be the alignment of candidate residues at the generic m-th iteration of Gibbs sampling.Let mjA with a candidate residue X. First, we define a similarity score, SimSymb(X) which evaluates the similarity between the symbol of X and the symbols of residues in mA (except mjA):imMatrix is a BLOSUM similarity score between X and mkA.Suppose we replace SimDist(X):PairDist(X) is defined as follow:Then, we define another similarity function, X, Sim(X), is the product of SimSymb(X) and SimDist(X). Again, the transition probability of X is the normalization of Sim(X) in .Finally, the similarity score of IterRefine. According to our experimental results (Section 3.2), a good accuracy can be achieved with relatively small values of such parameter .The goal of the refinement phase is to increase the quality of the discovered alignment. An alignment of residues is iteratively removed from the current alignment of substructures and replaced with a new one. The number of iterations is bounded by a user-defined parameter called Badness function defined below.The replaced alignment is chosen according to a SA = {SA1, SA2, …, NSA} be the final alignment of size w, where each iSA = {Ri,1, Ri,2,…, i,wR} is a set of residues. We can view the alignment SA as a matrix R, where each column represents an alignment of residues and R is the j-th aligned residue of the i-th substructure. Our final goal is to compute a Badness score for each column of SA and remove the column that maximizes the Badness score function from SA.Let R and R, we define the function PairDistAligned as follows:First, given two aligned residues Badness of a generic column k is:The Badness score is removed, a new single extension step is performed through the Gibbs sampling procedure described in Section 2.2.Once the column with the highest iSA = {iSA1, iSA2,…, iNSA} be the local alignment of rank i in the sorted list. We define ik)PercPercPercPerc are considered. As expected, when N and w grow and alpha decreases, the running time goes up. Such a trend is even more evident in the TIM Barrel family which has the highest average protein sequence length and similarity.Next, we investigated the effects of varying PROPOSAL parameters. The default values are IterRefine on the global accuracy of PROPOSAL. We measured the average RMSD over all the computed alignments. In Figure alpha varies from 0.01 to 0.30 and IterRefine is set to 10, while in Figure iterRefine varies from 1 to 30 and α is set to 0.05. Default values (w = 15 and N = 6) were assigned. As expected, the best performance of our method are obtained with low values of α and high values of IterRefine. However, if we also consider the influence of such parameters on running time (in particular the IterRefine parameter), the best trade-off between speed and accuracy can be achieved with 0.01 ≤ α ≤ 0.1 and IterRefine = 10.Figure As far as we are concerned, PROPOSAL is the first algorithm proposed for multiple local alignments of protein structures. On the other hand a few existing tools can solve the pairwise local structure alignment problem , taken from CSA   have PPos < 5% and 6173 (≃ 97%) have PPos < 15%.The dataset has many highly dissimilar pairs of proteins. In order to analyse the sequence similarity between the 6380 couples of proteins with the lowest RMSD alignments, we run BLAST and considered the percentage of residues with positive matches in the shortest sequence. We call AvgOverlap = 100%) and w equals to the number of residues of the query motif. We ran SMAP and ProBiS with default parameter values.For each couple, we run PROPOSAL with no overlapping filter : the highest percentage of residues of the query motif which are present in an alignment returned by each algorithm;RMSD of the alignment with highest QMC;Running time;PPos similarities. All results are plotted in Figure We analyzed the average values of these parameters by considering different ranges of PPos similarities ProBiS is the best method . It is worth noting that our method has been designed for solving the multiple alignment problem, while ProBiS and SMAP have been efficiently implemented for comparing pairs of protein structures. Moreover, PROPOSAL and SMAP have been implemented in Java, while ProBiS has been written in C++. Interestingly, our method is faster when PPos ranges from 10 to 30%. However, when proteins are very dissimilar, the convergence of Gibbs sampling in the bootstrap phase may be slower. On the other hand, when proteins are very similar PROPOSAL performs more extension and refinement phases, producing more feasible alignments. A similar trend holds for ProBiS, where the best performance is obtained when PPos ranges from 15 to 60%.Finally, ProBiS is by far the fastest algorithm for all possible ranges of s Figure , while PIn the last case study, we run PROPOSAL on a different set of 172 motifs taken from CSA to test the capability of our method to detect known conserved binding sites in the multiple case . The remaining parameters were set up to the default values.For each EC family, we run PROPOSAL on the set of protein structures belonging to that family. We fixed We filtered out all alignments with average RMSD above 1 Å, taking for each query motif the local alignment with maximum QMC. In case of ties on QMC, the alignment with minimum average RMSD was chosen. PROPOSAL successfully completed all the alignments in about 29 h, with an average QMC of 50.08% and average running time of 10 min. In Table In Torrance et al. ; Moll etIterRefine, because these influence both speed and accuracy. The best trade-off is achieved with α ranging from 0.01 to 0.1 and IterRefine set to 10. Therefore, default values for the algorithm are set to α = 0.05 and IterRefine = 10. The running time of PROPOSAL on Skolnick's dataset resulted sublinear  for family of proteins with low and medium similarity  and linear for highly similar and long proteins (TIM Barrel).PROPOSAL is a stochastic algorithm for local alignment of 3D protein structures relying on Markov Chain Monte Carlo in connection to a Gibbs Sampling strategy. PROPOSAL is a parameter-based algorithm. In our experimental analysis on the Skolnick's dataset (see Section 3.1) we showed that the most critical ones are α and Since PROPOSAL is the first multiple structure local alignment method, we compared it with two pairwise local alignment algorithms (ProBiS and SMAP) on a dataset of couples of query motifs and target proteins (see Section 3.2). The accuracy of PROPOSAL is defined by the highest percentage of residues of the query motif which are present in an alignment returned by each algorithm (query motif coverage), together with the quality of the alignment (RMSD score).PROPOSAL strongly outperforms the other methods on the quality of the alignments, independently of proteins' similarity. Concerning the coverage, it is constant on proteins' similarity, whereas SMAP and ProBiS have low coverage for dissimilar proteins. However, ProBiS is 5 times faster than PROPOSAL and SMAP.Finally, we run PROPOSAL as a multiple aligner on a subset of the above query motifs (see Section 3.3). Once again, PROPOSAL yields high quality alignments with coverage scores comparable to those obtained in the pairwise local case. Experiments also show that PROPOSAL is a valuable alternative algorithm to both identify new motifs and refine existing ones.The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.


A standard procedure in many areas of bioinformatics is to use a single multiple sequence alignment (MSA) as the basis for various types of analysis. However, downstream results may be highly sensitive to the alignment used, and neglecting the uncertainty in the alignment can lead to significant bias in the resulting inference. In recent years, a number of approaches have been developed for probabilistic sampling of alignments, rather than simply generating a single optimum. However, this type of probabilistic information is currently not widely used in the context of downstream inference, since most existing algorithms are set up to make use of a single alignment.In this work we present a framework for representing a set of sampled alignments as a directed acyclic graph (DAG) whose nodes are alignment columns; each path through this DAG then represents a valid alignment. Since the probabilities of individual columns can be estimated from empirical frequencies, this approach enables sample-based estimation of posterior alignment probabilities. Moreover, due to conditional independencies between columns, the graph structure encodes a much larger set of alignments than the original set of sampled MSAs, such that the effective sample size is greatly increased.The alignment DAG provides a natural way to represent a distribution in the space of MSAs, and allows for existing algorithms to be efficiently scaled up to operate on large sets of alignments. As an example, we show how this can be used to compute marginal probabilities for tree topologies, averaging over a very large number of MSAs. This framework can also be used to generate a statistically meaningful summary alignment; example applications show that this summary alignment is consistently more accurate than the majority of the alignment samples, leading to improvements in downstream tree inference.http://statalign.github.io/WeaveAlign.Implementations of the methods described in this article are available at The online version of this article (doi:10.1186/s12859-015-0516-1) contains supplementary material, which is available to authorized users. Sequence alignment is one of the most intensely studied problems in bioinformatics, and is an important step in a wide range of different analyses, including identification of conserved motifs , analysiMany of the most popular alignment methods seek to compute a single optimal alignment, using dynamic programming algorithms ,9 as welIt has become increasingly clear in recent years that downstream analyses are often highly sensitive to the specific choice of alignment. There may be many plausible but suboptimal alignments within the vicinity of the optimum, containing additional—often complementary—information regarding the evolutionary relationships between the sequences ; selectiA number of studies have highlighted the impact of the choice of alignment on subsequent phylogenetic inference -31; in mA common approach to tackling the issue of alignment uncertainty has been to attempt to annotate particular regions of the alignment as unreliable, and to remove these before carrying out subsequent analysis. Filtering methods have in some cases been observed to yield improved inference for phylogenies -48 and pHowever, the specific choice of filtering method may have a strong influence on the results , and uncposterior distribution. In this framework, regions of high alignment variability then correspond to regions of high variance in the posterior. The last decade has seen the development of several fully Bayesian approaches for performing joint inference on alignments along with other objects of interest, such as mutation rates  can be e et al. , and an  [et al. , althougg parameter as described above, such that the use of modeller variant loss functions is unnecessary.The same approach cannot be applied to minimise the risk under modeller variants, however, since the contribution of each column to the partial sum at each step in the dynamic programming algorithm depends on the unknown final alignment length. Collingridge and Kelly recently presented an algorithm, entitled MergeAlign, that proposed to optimise a score of this type, but as shown in Additional file Ξ| is the number of observed columns and In representing the alignment DAG, it is essential to ensure that the space complexity of the data structure is less than the total number of paths through the graph, which increases very rapidly with the number of columns. The obvious way to represent a graph is via a list of neighbours for each node, which requires N−1, where N is the number of sequences, since each row can take one of two possible values (gap/character) in each equivalence class, with the restriction that the column cannot be all gaps. In general, the number of equivalence classes is therefore somewhat less than the number of columns, with However, within the mean-field setting, we can use the predecessor and successor equivalence classes to significantly increase the space efficiency, since each column need only record its predecessor and successor equivalence class. Given the definitions of the predecessor and successor equivalence classes, we can see that each equivalence class is of size at most 2fP-equivalence class will have the same set of possible predecessors, and similarly for successors, the partial sums required in dynamic programming algorithms can be stored per equivalence class rather than per node, which results in algorithms of see Algorithms 1 and 2 for examples). In the limit of a large number of short sequences with high uncertainty, this results in going from approximately quadratic time, to time linear in the number of columns.Similar gains can be made in time complexity. Since any column in a particular see Additional file : Section S7 for further details); 50 datasets were generated for each regime, yielding 150 datasets overall, each containing 10 sequences, with average sequence length equal to 905 nucleotides.In order to illustrate the utility of the aforementioned procedure, we first simulated sequence data using the program DAWG , yieldin%) , and medium sequence identity  . The simulated and BAliBASE datasets can be found in Additional file As a biologically relevant example, we also considered a set of 78 alignments taken from the BAliBASE database, comprising the full-length alignments from the Reference 1 set . This seC- and C+-based loss functions.For each of these datasets, we ran the statistical alignment software StatAlign , which jsee Additional file : Section S7 for further details).It is also of interest to consider how the minimum-risk summary approach scales to alignments containing larger numbers of sequences. As a test dataset containing larger alignments, we selected one of the largest alignments from the OXBench suite , consistFor comparison, we also generated summary alignments for each dataset using the MergeAlign method of Collingridge and Kelly , and a cC+-based loss function incurs an additional overhead due to the time needed to compute the weighted marginal probabilities, As shown in Table C+-score, measuring the proportion of correct columns). In addition, we use the measures shown in Table To assess the performance of each approach, we make use of several measures of alignment accuracy, including the AMA metric of Schwartz ,121 Given that the absolute value of the accuracy varies substantially over the different datasets, we measure the performance of each method by computing a rank score, which indicates the rank of the accuracy of an alignment, α than each of the individual samples, whereas a rank of 0 indicates an accuracy lower than any of the individual samples.A rank of 1 therefore indicates an alignment that is more accurate under measure C-based loss function results in the highest accuracy under metric αC, and similarly minimising the risk under C+ method also results in the highest accuracy under the AMA sum-of-pairs metric. In all cases setting g=0 results in the best performance, since these accuracy metrics do not penalise false positives, although setting g=0.5 does not result in a large loss of performance.As shown in Table αC measure. The progressive heuristic S-Coffee algorithm performs consistently badly in all cases, yielding summary alignments that are typically worse than the majority of the samples used to build the library, suggesting a conflict between the information contained in the samples, and the heuristics used to construct the alignment.In contrast, on these datasets MergeAlign typically yields a summary alignment whose accuracy is close to the median, with a rank score close to 0.5, although performance is more reasonable under the g parameter, since the modeller scores penalise longer alignments. For alignments with more gaps (higher indel rate), the value of g yielding the highest accuracy under the modeller scores tends to decrease  while maintaining computational tractability, and a meaningful statistical interpretation.As might be expected, the performance of MergeAlign improves when the accuracy is measured using the modeller scores. However, better performance can still be obtained under the modeller variants by using the MinRisk method and a non-zero Given the heterogeneity of the different datasets, it is also useful to visualise the results for the individual datasets. As shown in Figure see Tables  and For the BAliBASE datasets, the MinRisk method also consistently yields summaries that are better than the majority of samples, and outperforms the other methods examined here in all cases . As discussed earlier, the minimum-risk algorithm scales linearly with the number of columns in the DAG, but this step contributes a very small proportion of the total runtime in the examples shown in Table see Table see Additional file : Figure S9). Memory usage is also generally low, requiring less than 2Gb in all the cases we have tested, even for 500,000 alignments.While the runtime does increase with the number of sequences, a breakdown of the contributions to these timings shows that the majority of the time is spent reading in the alignments, which scales linearly with the number of alignments multiplied by the number of sequences , where n is the number of leaves in the tree [For each of the simulated datasets discussed earlier, we performed tree inference using the program DNAML from version 3.69 of the PHYLIP package , using athe tree .C+ version of the minimum-risk algorithm, applied to alignments generated by StatAlign, yields the highest tree accuracy. This example illustrates the types improvements that can be obtained by using more robust methods to generate alignments before carrying out tree inference.As shown in Table see Table C+-weighted marginals  are less accurate in predicting the presence/absence of a column under the C+ definition, which may be due to the fact that the estimates of As well as providing a way to approximate full alignment probabilities, posterior column marginal probabilities can also be good predictors of the presence or absence of a column in the true alignment . In all Comparison to results generated by the widely-used program GUIDANCE  indicateSo far we have examined how the DAG facilitates the efficient generation of accurate summary alignments, which can then be used for subsequent analyses. However, for many types of analyses it may be advantageous to jointly sample alignments and other parameters of interest, such as trees ,57, or ssequential approach has been used to assess the sensitivity of phylogenetic inference to the starting alignment [One way of accomplishing this is to carry out the downstream analyses separately on each of the sampled alignments, averaging or summarising the results as appropriate. This type of lignment ,29,33, alignment  and RNA lignment .cf. Additional file : Figure S3). Hence, the uncertainty quantified in the individual samples will be a significant underestimate of the true alignment uncertainty.However, as discussed earlier, a set of alignment samples will typically contain only a small portion of the total probability mass, even for pairwise alignments with relatively low uncertainty , myoglobin (Mb), and cytoglobin (Cygb), as well as a plant leghaemoglobin (LegHb) , and the marginal likelihood for each tree in the set was then computed as a sum over all the alignments by evaluating the quantity Θ, were set using the Dayhoff substitution matrix [τ, was then computed by averaging the marginal likelihoods for all trees in  conforming to the particular topology:For these sequences, a set of alignment samples, n matrix , with ga indicates that tree Υ conforms to topology τ. These marginal posteriors can then be compared to the topology posterior computed on each alignment individually, replacing A in Equation . As such, the runtime scales linearly with the number of columns in the DAG, as expected .Since the same DAG is used to compute the likelihood for all trees in the set The approaches illustrated here provide a general framework for dealing with alignment uncertainty in a statistically meaningful fashion. Encoding a set of sampled alignments in a DAG structure allows for more accurate estimation of posterior probabilities based on column or pair marginals. Due to interchanges and crossovers in the DAG, the number of alignments encoded in the graph is typically many orders of magnitude greater than the number of samples used to generate the DAG, such that the effective sample size is greatly increased by this representation.Since the graph is acyclic, efficient algorithms can be developed for summation over this very large number of alignments, each weighted according to its probability. As a specific example, we have considered algorithms for generating summary alignments that minimise the expected value of various types of loss functions, observing that this type of algorithm is generally very successful at minimising the loss on a set of test cases.This approach provides a way to conduct many types of sequence analysis on the very large set of alignments encoded in the DAG structure, allowing for alignment uncertainty to be propagated into downstream inference in cases where computationally expensive joint sampling procedures are infeasible. In addition to the tree inference example illustrated here, we are currently working on adapting several other common algorithms to the alignment DAG structure.The approaches detailed here are in theory applicable to a set of alignments generated by any type of method, although the quality of the probability estimates generated by the DAG will depend on the quality of the underlying model used to generate the alignments. Although this type of method can be used to combine the output of several different alignment programs, in a similar fashion to the M-Coffee procedure , such anWe have observed that this type of procedure usually yields summary alignments that are similar in accuracy to the program that typically generates the most accurate alignments (data not shown); however, since the most accurate alignment method is usually known from the outset, based on benchmarking results, there is not much to be gained by employing such a procedure. Moreover, the reliability of such an approach as a heuristic will depend strongly on the degree of similarity between the different alignment programs, hence we would recommend against using alignment DAGs as a way of combining the output of non-probabilistic alignment programs.cf. Additional file : Section S6).One other obvious application of the alignment DAG is as a way of generating additional alignment samples, which can be sampled by using a DAG-based version of the traditional stochastic traceback algorithm (One potential use for these alignment samples could be as a source of proposals within an MCMC alignment sampler, allowing for a new state to be efficiently generated, along with a known proposal probability for use in a Metropolis-Hastings accept/reject step. Although this type of approach does not allow for the exploration of previously unobserved columns, it could be useful as way to improve mixing, particularly once the key regions of the space have already been explored.http://statalign.github.io/WeaveAlign. A platform-independent jar archive containing version 1.2.1 of WeaveAlign is included in Additional file Java software implementing the minimum-risk alignment summary algorithm and computation of marginal topology probabilities is available for download at