Next generation sequencing platforms have greatly reduced sequencing costs, leading to the production of unprecedented amounts of sequence data. BWA is one of the most popular alignment tools due to its relatively high accuracy. However, mapping reads using BWA is still the most time consuming step in sequence analysis. Increasing mapping efficiency would allow the community to better cope with ever expanding volumes of sequence data.We designed a new program, CGAP-align, that achieves a performance improvement over BWA without sacrificing recall or precision. This is accomplished through the use of Suffix Tarray, a novel data structure combining elements of Suffix Array and Suffix Tree. We also utilize a tighter lower bound estimation for the number of mismatches in a read, allowing for more effective pruning during inexact mapping. Evaluation of both simulated and real data suggests that CGAP-align consistently outperforms the current version of BWA and can achieve over twice its speed under certain conditions, all while obtaining nearly identical results.http://sourceforge.net/p/cgap-align under the GNU General Public License (GPL).CGAP-align is a new time efficient read alignment tool that extends and improves BWA. The increase in alignment speed will be of critical assistance to all sequence-based research and medicine. CGAP-align is freely available to the academic community at  In recent years, advances in sequencing have led to the production of unprecedented amount of sequence data. Alignment, which maps reads to the reference sequence, is one of the most computationally demanding tasks performed in typical sequence data processing. Accurate sequence alignment is critical for SNP calling http://www.vmatch.de). Unfortunately, these programs have poor performance on large-scale references including the human genome due to memory constraints. The FM-index is a type of substring index based on the Burrows-Wheeler transform, with some similarities to suffix array. Owing to its small memory requirement, it is utilized by numerous state of the art programs including SOAPv2 In order to efficiently and accurately map large numbers of short reads many new alignment programs have been developed. The algorithms underlying most of these tools can be classified into two major categories BWA has become one of the most widely used alignment tools owing to its efficiency and accuracy. BWA possesses higher recall and precision than SOAPv2 or Bowtie. However, both Bowtie and SOAP2 are significantly faster than BWA. Therefore, it is highly desirable to improve the speed of BWA while maintaining its alignment quality. In this paper, we describe a new efficient alignment tool, CGAP-align, following the framework of BWA. As part of short read mapping in BWA, possible mismatches and gaps are enumerated during the traversal of the FM-index of the reference sequence. The time efficiency of BWA is mainly impacted by two factors. The first is the efficiency of locating a substring in the reference. The second is the ability of the program to bypass segments of the reference where the read would contain a large number of mismatches, avoiding the need to enumerate all possible sets of mismatches and gaps, through a process called pruning. Improvements to these strategies have been implemented in CGAP-align to optimize the efficiency of both the reference querying and the pruning steps.In this report, we first introduce a novel data structure, Suffix Tarray, which speeds up the process of locating a read on the reference. Second, we present an effective pruning strategy that more accurately predicts the number of mismatches in a read prior to alignment. Pruning is significantly improved by using a set of training reads in advance to identify and study frequent patterns of nucleotides. The performance of CGAP-align was evaluated on both simulated data and several sets of real paired-end sequence data. Our results indicate that by implementing both of these improvements alignment speed is significantly increased without sacrificing recall or precision.To improve the alignment speed, we utilized a data structure, Suffix Tarray (STA), to index reference sequences in CGAP-align. STA uses a new index structure that is a hybrid of trie (inspired by suffix tree) and suffix array data structures. Before we present the concept of STA, we first briefly review the two most widely-used data structures for sequence indexing: suffix array (SA) and suffix tree (ST).W|+N) time, where |W| is the length of the substring and N is the number of occurrences of that substring. More specifically, ST for a string X is a tree whose edges are labeled with strings, such that each suffix of X corresponds to exactly one path from the tree's root to a leaf. In the case of sequence data, a suffix tree for string X of n characters is queried and constructed in linear time n) memory with a large constants leading to a large memory requirement. State-of-art ST methods like TDD Suffix tree is a data structure that encodes all of the suffixes of a given string in the form of tree, allowing quick location of substrings in O space with a small constant and can be constructed in linear time C and Occ values based on Burrows-Wheeler transform (BWT) W and a character c, Ferragina and Manzini k(cW)≤l(cW) iff cW is a substring of X, where  and  are the SA intervals of the substrings W and cW respectively. During each query, a backward search is performed on FM-index so that the substring W is scanned from the end to the beginning. FM-index is constructed in O(n) time from the reference X (as it can be constructed in linear time from a SA) and used to query a substringfig of length m in O(m) time. Due to its space efficiency, FM-index has recently been adopted by many widely-used mapping tools, including SOAPv2 Suffix array (SA) is an array of integers each of which gives the start positions of suffixes of a string c, Occ is a function of the SA position y, which counts the number of the occurrences of c within the suffix interval  of the SA. To accelerate the calculation of Occ values, the SA is divided into buckets with a fixed size. For the SA positions y that define the left bucket boundaries, the corresponding Occ values are pre-computed and stored in a table. This allows all other Occ values to be efficiently calculated by counting the occurrences of the character c from the start of their corresponding buckets instead of from the beginning of the SA.In an FM-index, for a character Occ value is still much faster than retrieving an Occ value in the middle of a bucket. This observation implies that pre-computing frequent Occ values has the potential to speed up the mapping process. The basic idea of Suffix Tarray (STA) is to first find those most frequently visited Occ values  and then organize them in a ST so that they can be efficiently accessed during alignment. With this novel approach, we can take the advantage of both the time efficiency of the ST and the space efficiency of FM-index. At a high-level, STA can be viewed as a truncated suffix tree (TST) encoding corresponding SA intervals of a FM-index at each leaf  takes substring W and maximal edit distance z as input, and returns the SA intervals of substrings that match W with no more than z differences. The algorithm framework is similar to that used in BWA, but with a different index structure. The l and k values are re-calculated based on STA. For a given node of ST, we denote node.child as its child-list, while node.k and node.l define its SA interval values. The lines with an asterisk mark the D-array pruning strategy used in BWA, which will be discussed in section 1.2.The procedure to query a substring from STA is given in Algorithm 1. Procedure InexactSearch. This helps to detect relatively long gaps. However, it also causes a potential issue resulting in false negative alignments in both BWA and CGAP-align. This problem is addressed in section 2.2.W (i.e. the i-length prefix of the read W) and any substrings of the reference sequence and stored as the ith element of array D, all prior to mapping. Reads with D[i] greater than the maximum tolerated number of mismatches defined by the user are excluded from further alignment. If calculating D-array is faster than the time it would take to map the pruned part of the search trees, pruning improves mapping efficiency. The degree of improvement depends on both the speed at which the D-array can be calculated and the accuracy of the estimation of D-array. A more accurate estimation of D results in a smaller search space and more efficient mapping. To improve the efficiency of mapping, a pruning step is implemented in BWA. A lower bound is calculated for the number of differences between W) be the minimal number of the edit operations required to make W exactly align onto the reference X. BWA divides W into segments w1w2…wt, where e(pw) = 1 for 1≤p<t and e(pw)≤1 for p = t. Then D[i] is approximated as p-1 for 1≤i<|W|, where pw contains the (i+1)th element of W, or t for i = |W|. For example, given a reference X = “AACGTATCGACG” and a read W = “AACTGA”, BWA segments the W as “(AACT)(GA)” and thus produces the D-array “000111”. The time to calculate the D-array for read W is in O(|W|) when the FM-index of the reverse of X is used. In CGAP-align, the calculation of D-array is further accelerated by using STA.BWA proposes a method to estimate the D-array by splitting W into several small strings. Let e(pw with e(pw)>1 when splitting W generates a D-array with a tighter lower bound. In the example described above, if we consider segments with an e(pw) equal to 2, then we derive the segmentation “(AACTG)(A)” with the corresponding D-array “000122”. By allowing segments with more mismatches we derive a tighter bound for D.Identifying a W) = k is exponential to the value of k. Therefore, it is too expensive to calculate each e(wi) value on the fly unless e(iw) is strictly restricted to be 1  is O(|w|)). To address this issue, we add a pre-processing step, in which we identify the frequent substrings from the training read set with a e(w) = 2. This approach is feasible as genomic sequences from the same species are similar among individuals. Thus, by providing a training read set from each species, it is possible to generate a list of species specific frequently occurred substrings (w) with e(w) = 2.However, the above tighter bound comes at the cost of longer computations. The time cost of verifying e that match to any of the indexed patterns (denote as f) in linear time. A description of AC automaton is given in section 1.2.3. For the sake of the efficiency, we only index patterns with e(f) = 2 into AC automatons.In a pre-processing phase, an appropriate number of patterns with the greatest frequency values are identified by a depth-first visit on an FM-index built upon the training reads and then organized into an Aho-Corasick (AC) automaton f) = 2 are found in the pre-processing phase. We use a AC automaton GT to organize these FPs so that when given a read W, we are able to quickly query all of the FPs that are contained in W in a single scan. This allows for efficient segmentation of W according to the FPs it contains. We adopt the AC algorithm f within a main text string W, AC automaton supports searching for occurrences of a set of strings F within W. An AC automaton makes use of the information embodied by the string set F itself to determine where to begin then next matching attempt if a mismatch happens, thus bypassing re-examination of previously matched characters in W. There is a particular type of state called a “leaf state”, each of which corresponds to a string f. The transition to a leaf state Lf indicates an occurrence of f in W. When a match is detected, we reset the automaton to its initial state and continue the scanning on W. These steps are iteratively performed until we meet the end of W. A simple example is shown in In general, millions of frequent patterns (FP) with e = 1 instead (the first “if” condition). As described above, when we find a match in GT at position i, we reset the automaton, scanning matches within W in the following comparison.Algorithm 2 shows the detailed procedure to estimate a tighter D-array in CGAP-align. We use a greedy strategy to iteratively find the first matched pattern string f of As described above, two major changes have been added to the current version of BWA. First, instead of FM-index we utilize STA, a novel data structure that speeds up string matching by constructing a trie on top of an FM-index. Second, we implement a new pruning method DCDC. As mapping time increases exponentially with the number of mismatches, it is highly desirable to prune reads with large numbers of mismatches. To achieve this goal, a data training process has been implemented to identify a set of frequent substrings with two mismatches from the genome. This pre-processed data allows for accurate calculation of the minimal number of mismatches between a prefix and the genome, resulting in further reduction of the search space.Both functionalities have been implemented in C. To facilitate the usage of CGAP-align, it offers a command line interface that is almost identical to BWA and outputs SAM files (Sequence Alignment/Map format). CGAP-align is distributed under the GNU General Public License (GPL) with detailed documentation and source code freely available through Fudan University, BCM-HGSC and the Sourceforge web site. The pre-built indices for some public references (eg. Hg19) are also provided.*), were evaluated. STA was built based on the human reference genome hg19 with 600 MB size. All of the experiments utilized the same AC automaton with a size of 1000 MB trained from independent WGS data for DCDC.To evaluate the performance of CGAP-align, we have benchmarked it against BWA (version 0.5.9), SOAPv2 (version 2.20) and Bowtie2 (version 2.0.6), three of the most commonly used alignment programs. Other tools like Bowtie are not included because gapped alignments are currently not supported. All tools run on 4 threads. Both BWA and CGAP-align were evaluated on their ability to map 100 base pair long reads using either default settings or relatively loose settings that allow up to 5 edits and a gap extension of 3 base pairs (-n 5 -e 3 -l 25). The same data set is used for SOAPv2, allowing up to 5 mismatches and a gap size of 4 (-v 5 -g 4). This setting is looser than SOAPv2's default setting, which enables it to find more alignments. For bowtie2, default parameters are used (–sensitive) since no gap settings can be adjusted. In addition, two modes of CGAP-align, the first with STA alone  and the second with both DCDC and STA  contained multiple hits, and only 607 of them were correct.Slightly different mapping results were obtained for CGAP-alignWhen mapping to the human genome, SOAPv2 uses 5.4 GB of memory while BWA only uses about 3 GB. In our experiment, CGAP-align without DCDC consumed 3.6 GB of memory, and used 4.6 GB when DCDC was integrated. However, the memory consumption can be controlled by adjusting the index sizes for both STA and DCDC.The relationship between the sequence error rate and the performance of STA and DCDC is shown in *, while achieving a small speed up with default settings, shortened the running time by more than 50% with loose settings, due to the high error rates of the reads in real data. While SOAPv2 was faster than all other candidates including CGAP-align*, it found less confidently mapped reads than BWA, especially for the WGS cases. On the WGS1 data, where a significant number of mismatches between the reads and reference were observed, CGAP-align and BWA confidently mapped almost 10% more reads than SOAPv2 did. In comparison to SOAPv2, CGAP-align* further shortens the performance gap while maintaining a relatively high mapping rate. Overall, it possesses impressive mapping rates in WES while the performances when mapping WGS data still need to be improved.We tested CGAP-align using whole exome sequence (WES) data from two individuals  and whole genome sequence (WGS) data from a separate pair of individuals (107.8 million read pairs for WGS1 and 86.3 million read pairs for WGS2). All read pairs were produced by Illumina HiSeq with a 100 bp read length. Both the consumed time (Hours) and the frequency with which reads were confidently mapped (Conf) are reported in Due to the enormous number of reads generated by the next generation sequencing technologies, the efficiency of read alignment has become a critical problem. In this article, we present CGAP-align, a variant of BWA, which doubles the speed of the alignment process. While SOAPv2 is also very fast, it is unable to map as many reads as CGAP-align. CGAP-align retains its high recall and precision even when the error rate of the reads is high. CGAP-align also outputs SAM files, allowing easy use of various downstream analysis tools.CGAP-align requires a tunable amount of memory beyond that required by BWA, which equals to the size of the additional indices for STA and DCDC. To make DCDC work, a set of training reads are needed for CGAP-align to build the DCDC index. In practice, any FASTA file containing reads that are supposed to be mapped to the reference is qualified to be the training dataset for that reference. However, we recommend not using FASTA files larger than 2 GB to reduce memory cost and time of DCDC index construction.It is very easy to migrate from using BWA to CGAP-align. For each reference sequence, only a single command line is needed to build the additional indices used by CGAP-align. After that, CGAP-align has an identical interface to that of BWA. In addition, CGAP-align is backwards compatible with BWA, so BWA can do read alignment using the FM-index produced by CGAP-align.* is that it occasionally misses alignments called by BWA. * mapping during the alignment depicted in W to X according to DCDC's D-array. As a result, this alignment is pruned by CGAP-align*. However, at the same position in BWA's case, the D-array value is 2 (telling us that at least 5 edit costs are needed), which does not trigger the pruning, leading to the discrepancy between the alignments. From the mechanism behind this example, we can see that such discrepancies are quite random and partially depend on the gap positions in the alignment. As previously noted, only a very small fraction of reads encounter this problem and the pruned alignments are typically quite marginal.The main concern with using CGAP-align


The increasing ease and accuracy of protein-protein interaction detection has resulted in the ability to map the interactomes of multiple species. We now have an opportunity to compare species to better understand how interactomes evolve. As DNA and protein sequence alignment algorithms were required for comparative genomics, network alignment algorithms are required for comparative interactomics. A number of network alignment methods have been developed for protein-protein interaction networks, where proteins are represented as vertices linked by edges if they interact. Recently, protein interactions have been mapped at the level of amino acid positions, which can be represented as an interface-interaction network (IIN), where vertices represent binding sites, such as protein domains and short sequence motifs. However, current algorithms are not designed to align these networks and generally fail to do so in practice. We present a greedy algorithm, GreedyPlus, for IIN alignment, combining data from diverse sources, including network, protein and binding site properties, to identify putative orthologous relationships between interfaces in available worm and yeast data. GreedyPlus is fast and simple, allowing for easy customization of behaviour, yet still capable of generating biologically meaningful network alignments. A major objective of biology is to understand how complex biological systems are assembled from their components into functional units and how they evolve. In molecular biology, efforts have increasingly focused on how proteins and other molecules interact, and determining how their interplay affects biological phenotypes, including disease. This has driven work in interactomics, as better, cheaper high-throughput methodologies allow us to systematically map the dynamic molecular interactions in a cellRecently, protein interactions have been mapped at the level of amino acid positions, which can be represented as an interface-interaction network (IIN), where vertices represent binding sites, such as protein domains and short sequence motifs3456In the trivial case of finding the ideal alignment of a network to itself, the network alignment problem is equivalent to the classic graph isomorphism problem, which is of unknown complexity10Interface-interaction networks (IINs) are a refinement of PPINs wherein proteins are subdivided into their separate interaction interfacesThe higher resolution of IINs allows for new biological insights that cannot be derived from standard PPINs. For example, IINs can distinguish between “date hubs” – proteins that interact with many partners, but at different times or in different locations - and “party hubs” – proteins that interact with many partners simultaneously513Topological differences between IINs and PPINs, however, mean that algorithms designed to operate on PPINs may not function properly with IINs. While PPINs are often sparse, IINs are much more so, with each PPIN vertex (protein) split into multiple vertices that represent the different binding sites on that protein. Similarly, while PPINs exhibit a hub and spoke topology, with many low-degree and fewer high-degree vertices, this characteristic is exaggerated in IINs. For example, protein-recognition modules, such as protein kinases or SH3 domains, are often capable of binding many different proteins, leading to relatively few high-degree vertices connected to many low degree vertices. Additionally, due to binding specificity similarities, different domains will often recognize the same ligands, forming a multi-fan topology. Methods that depend on the neighbourhoods of vertices being topologically distinct to generate their alignments get confused by these repeated patterns and thus perform inconsistently (see below for examples).Saccharomyces cerevisiae (budding yeast)Caenorhabditis elegans (worm)15Experimentally mapped interface-interaction data across species have recently become available, such as a set of interactions mediated by SH3 domains in To address the IIN alignment problem, we developed a new algorithm called GreedyPlus, which considers bipartite IINs by design.Even though we argue that IIN alignment represents a different problem to PPIN alignment, the problems are related in their approach and we review PPIN alignment work here. Previous network alignment research has focused on protein-protein interaction networks, although other network types have been studiedPathBLASTGenerally, the local network alignment strategy is similar to that for local sequence alignment, beginning with a seed that can be aligned with high confidence, which is often based on BLAST scores. A scoring scheme is defined, often based on an explicit evolutionary model, and then the alignment is extended outwards from the seed along network edges, incorporating as many other protein pairs as possible and optimizing on the score. NetAlignerOtherwise, the local network alignment problem is well defined. The objective is to identify small, well-defined interactomic units – such as protein complexes or pathways – that are analogs within the input networks. However, by focusing on local regions, they may miss global aspects of network evolution. Additionally, as certain topological patterns appear frequently in PPINs, such as cliques and hubs, local network alignments can improperly align subnetworks corresponding to these patterns. This is typically prevented using minimum sequence similarity thresholds, explicitly or implicitly, to block the alignment of proteins with dissimilar sequences.Global network alignment methods attempt to align all or most of the proteins in two or more PPINs. These methods typically build interactome-wide alignments either by seeding an initial alignment and then extending it or by seeking a global optimum according to some scoring mechanism using methods such as the HungarianThe IsoRank algorithms – IsoRankGRAALAlternatively, network alignment algorithms can use evolutionary models to score possible alignments in terms of likelihood, as BLAST does with sequence alignments. Unlike the IsoRank and GRAAL algorithms, GraemlinMost PPIN alignment methods have attempted to align pairs of related proteins, analogously to pairs of similar amino acids in protein sequence alignment. However, many proteins are part of orthologous and paralogous groups. This has been only recently treated in network alignment, due to the significant complications it creates in both the design of an algorithm and in the subsequent assessment of the algorithm’s effectiveness. Despite this, a few attempts have been made to create alignment methods that produce many-to-many alignments between proteins; these are exclusively extensions of previous one-to-one alignment methods, such as IsoRankNTo assess the GreedyPlus algorithm, we tested it, along with several algorithms for PPIN alignment, by aligning available worm and yeast SH3 domain IINs4We compare these algorithms’ performance based on three metrics. The first two – represented protein orthologies (RPO) and orthologous vertex pairs (OVP) are measures of how well the algorithms reproduce known orthologous relationships see . An RPO As IsoRank and Natalie 2.0 use BLAST protein similarity as their only similarity feature, our first comparison uses only BLAST protein similarity. C-GRAAL uses BLAST score among others, so we include it in these tests. The Edge Alignment Weight parameter for GreedyPlus was set to 0.5 after testing with several values (see Discussion). The Greedy, GreedyPlus, and IsoRank algorithms all align similar numbers of orthologous vertices  number of edges aligned implies that it is a poor network alignment strategy. This may be expected, as the algorithm does not consider edges. The IsoRank algorithm also aligns edges poorly , as it primarily focuses on the alignment of similar nodes. The bipartite nature of the networks also causes unusual behaviour: the R similarity score in IsoRank fails to properly distribute itself throughout the networks, instead oscillating between domains and ligand sites rather than converging to a stable state. An examination of the resulting IsoRank alignment see  reveals Similar to IsoRank, the C-GRAAL algorithm also struggles with the topology of the network. The seeds it finds are invariably ligand sites adjacent to multiple domains, as domains have much higher degrees. However, domains share few common neighbours due to their binding specificity, and ligand sites have generally few neighbours. This limits the alignment expansion, based on its core common-neighbours concept, to less than half of the final alignment.The seed & extend and Natalie 2.0 algorithms captured very few orthologies  as they are primarily focused on edge alignment. Seed & Extend makes an early unrecoverable error, beginning alignment at the periphery of the worm network and then rapidly dead-ending, aligning only a total of ten vertices see . NatalieFinally, GreedyPlus performs best on RPO and second-best on both OVP and EA . It is also the only algorithm that performs evenly across the three metrics, with performance each at >60% of max, and thus generally performs the best in this comparison see .The GRAAL and H-GRAAL algorithms rely on a single vertex similarity feature, known as the graphlet degree signatureH-GRAAL, which focuses on aligning vertices, also fails due to the loss of resolution, while the C-GRAAL algorithm suffers from the same issues as in the earlier tests. Thus, for graphlet degree, different network types require different topological considerations to be aligned properly.As seen in our comparisons above, the choice of similarity feature can dramatically affect algorithmic performance across a range of algorithms for a given network. In particular, the simple Greedy algorithm, using a highly informative similarity feature (BLAST), was more successful at recovering orthologous protein relationships than the more advanced GRAAL algorithm using a poor similarity feature (graphlet degree) for our IIN . To investigate the information content of diverse similarity features and their impact on network alignment, we gathered 29 vertex similarity features, based on sequence, functional annotation, and topological characteristics see , MethodsIn this comparison, with 29 equally weighted similarity measures, the H-GRAAL algorithm performs best in aligning orthologous vertices, with 11 RPOs and 15 OVPs, but it aligns only 10% (47) of the edges . This peHaving established GreedyPlus’ performance using naïve parameterizations on the weights of each of the 29 similarity measures, we investigated how improved parameterizations would affect alignment quality. We used a random-restart hill-climbing strategy to search the high-dimensional parameter space for local maxima in orthology recovery (see Methods). This strategy was applied to all 29 similarity features plus the edge alignment weight together , as shown in Sequence similarity features account for ~64% of the overall parameter weighting. Topological considerations, including the closeness similarity features and the edge alignment weight – which is not a similarity feature and can be applied multiple times to the same pair of potentially aligned vertices – account for ~30%.Including closeness and the edge alignment weight in addition to the sequence similarity features improved orthology recovery. When closeness was removed, the resulting alignment produces only 13 RPO, 17 OVP, and 231 EA. Similarly, setting the edge alignment weight to zero results in a poorer alignment, in particular with edges: 13 RPO, 19 OVP, 34 EA. The small weight assigned to the functional similarity feature Topological Clustering Semantic Similarity (TCSS)th and 11th among our dataset; however, the other similarity features and the Edge Alignment Weight drive up their priority in alignment.As a snapshot of how GreedyPlus works in practice, we zoom in on the yeast protein BZZ1 see , which hInterestingly, the EPHX-1 – BZZ1 alignment was performed first, as the neighbouring aligned pairs F22E12.1,377,394 - YTA12,151,171 and UNC-26,1085,1112 - INP53,960,975 boost its score, via the EAW, by ~36%, illustrating the additive effect of the EAW. Subsequently, the vertices LST-1,181,200 and STP22,187,204 are aligned, partially on the strength of the EAW from EPHX-1 – BZZ1, which then promotes the alignment of SDPN-1 to BZZ1. A number of other orthologous node alignments occur in the immediate neighbourhood, but do not contribute any EAW to the BZZ1 domain alignments because they are not adjacent in either the worm or yeast networks. For example, WSP-1 and LAS17 are orthologs, but while LAS-17 interacts with BZZ1 in yeast, its worm ortholog WSP-1 does not interact with either SDPN-1 or EPHX-1 in our SH3 dataset, nor is such an interaction found in the interaction data iRefIndexWe also observe that while BNI1 is an interaction partner with BZZ1, with two sites targeted by the two BZZ1 SH3 domains, its worm ortholog CYK-1 does not interact with either EPHX-1 or SDPN-1. This non-interaction is also supported by iRefIndex. In our worm network, the respective CYK-1 sites are targeted only by Y106G6H.14 and TOCA-1, neither of which have functional annotations in GO, though TOCA-1 is indicated to be involved in endocytosis as well36C. elegans to S. cerevisiae IIN alignment, we tested GreedyPlus on published predicted SH3 IINs from 18 different yeast speciesS. cerevisiae. The feature weighting identified in the above described optimization for GreedyPlus on C. elegans and S. cerevisiae was used.In addition to the C. elegans and S. cerevisiae, we found, as expected, that GreedyPlus is able to recover more orthologous pairs in these pairwise alignments. When using a minimal set of similarity features with optimized weights , allowing us to specifically query how changes in parameterization and input data may lead to differences in the resulting alignment. Further, a key research question for network alignment is how to balance vertex-specific information versus topological information. The critical characteristic of network alignment is that edges must be aligned in addition to vertices; an alignment that has no aligned edges is, fundamentally, not a network alignmentG, consisting of a vertex set V and an edge set E, where each edge is a tuple of two vertices . An alignment of two PPINs G1 and G2 is thus a set of 2-tuples A = {, , …, }, where ui ϵ V1 ϵ G1 and vi ϵ V2 ϵ G2, if the alignment is one-to-one. In this context, the goal of GreedyPlus, like most other biological network alignment algorithms, is primarily to align vertices  such that biological inferences can be drawn about one vertex from the other based on their alignment. If these vertices represent interfaces, such an inference might be that they are orthologous, or that they mediate functionally similar interactions, or that they evolved to occupy similar positions in their respective networks under similar selective pressures.An interface interaction network can be modelled as an undirected graph G, with a vertex set V = {D, L}, where D and L are the sets of vertices representing peptide recognition domains (e.g. SH3) and ligands respectively, and ∀ v ϵ G, v ϵ D or v ϵ L. An alignment A of such networks is then restricted such that for each tuple  ϵ A, either (u ϵ D Λ v ϵ D) or (u ϵ L Λ v ϵ L).Though generalizable to other networks, GreedyPlus’ current implementation is tailored specifically to accommodate bipartite peptide-recognition module-mediated IINs, reflecting the current availability of IIN data. These networks, being bipartite, can be modelled in a similar manner as general IINs, as an undirected graph u1, u2) ϵ G1 and  ϵ G2, and it is known that u2 and v2 are orthologous, then we can infer that u1 and v1 are more likely to also be orthologous. Furthermore, if there also exist  ϵ G1 and  ϵ G2, this would provide even stronger evidence; thus the more edges that would be aligned by aligning vertices u1 and v1, the more likely that this is a good alignment of vertices.The key intuition behind the GreedyPlus algorithm is that the presence of interaction is itself a biological evidence source pointing towards an orthologous relationship between a pair of proteins. That is, if there exists , providing flexibility and enabling investigation of the relative importance of aligning vertices versus edges.The GreedyPlus algorithm is essentially a greedy algorithm that iteratively aligns pairs of vertices in descending order of similarity, defined by a given similarity score. However, when aligning two vertices, GreedyPlus also considers the number of edges that would be aligned if the vertices were aligned, strengthening the respective vertex pair similarity score with more edges aligned see . Thus, GThe edge alignment weight (EAW) determines how strongly GreedyPlus prioritizes the alignment of edges compared to vertices. When the EAW is set to zero, GreedyPlus behaves identically to the greedy alignment algorithm, as it will ignore the alignment of edges. When the EAW is set to ∞, GreedyPlus behaves similarly to a seed-and-extend algorithm (see below), always choosing to align two edges whenever possible as the EAW will overwhelm any preference in aligning vertices, with the exception that it can resume alignment even if edge extension possibilities are exhausted. By tuning the EAW parameter to intermediate values, the preference between vertex or edge alignment can be balanced.D|3|E| + |L|3|E|) time, though given the nature of domains and ligands, |L| >> |D|. In practice, GreedyPlus takes approximately two seconds to align two networks with |L| = 500 and |E| = 600, implemented in Java on a 3.4 GHz processor.A naïve implementation of GreedyPlus runs in worst-case O – (scorei – scorej) ∀ x ϵ D1, ∀ y ϵ D2, and then normalized logarithmically to the interval  using the formula: ∀ x ϵ D1, ∀ y ϵ D2, adji,j = log/log). Similarity scores between ligand vertices were calculated similarly.Functional similarity was calculated between proteins using TCSSThe parameter training procedure used was a random hill-climbing heuristic, designed to find parameter sets that maximized the orthologies found (RPOs). For each set of similarity features trained, we randomly generated a weight parameter in the interval , and generated a corresponding alignment. We then randomly incremented or decremented the first parameter by a step value if the new value would remain within the interval  and generated a new alignment. If the first alignment had more RPOs, then the parameter change was reversed and another parameter chosen to be incremented or decremented. Otherwise, the new parameterization was kept, and the parameter stepping repeated until no further improvement could be achieved. Then every other parameter would be retested for possible improvement via incrementation or decrementation.4√0.01 ≈ 0.32, 0.1, 0.03, and 0.01, until convergence was achieved, resulting in a parameterisation at a presumed local maximum for orthology recovery.This process was continued until no parameter could be either incremented or decremented to improve the orthology reproduction of the alignment produced. This procedure was iterated four times, using increasingly precise step sizes: For each set of similarity features used, the training procedure was iterated at least 5,000 times, producing at least 5,000 locally optimal parameter sets.To reduce the full set of similarity features to a smaller set, redundant similarity features were identified by calculating Euclidean distances between each similarity feature matrix and performing principal component analysis. Similarity features that were highly similar to another feature (Euclidean distance with another similarity feature < = 0.10) were then removed, with preference given to removing the feature most similar to the other remaining features. The following features were removed: BLAST coverage, TCSS cellular component, and TCSS biological process for proteins, betweenness, BLAST coverage, eccentricity, and radiality for domains, average shortest length path, betweenness, eccentricity, degree, radiality, and stress for binding site.To further reduce the similarity feature set, GreedyPlus was re-optimized with the remaining 18 similarity features to identify features that could be removed without negatively impacting algorithmic performance. The similarity feature given the lowest weight in parameter sets associated with the top 50 results from the training procedure was identified as the most uninformative feature and removed. This process was repeated until an effective minimal set of similarity features was identified, whereby the removal of any additional feature resulted in loss of orthology recovery.How to cite this article: Law, B. and Bader, G. D. GreedyPlus: An Algorithm for the Alignment of Interface Interaction Networks. Sci. Rep.5, 12074; doi: 10.1038/srep12074 (2015).


Multiple sequence alignment (MSA) is a crucial step in many molecular analyses and many MSA tools have been developed. Most of them use a greedy approach to construct a first alignment that is then refined by optimizing the sum of pair score (SP-score). The SP-score estimation is thus a bottleneck for most MSA tools since it is repeatedly required and is time consuming.O(nL) time complexity for affine gap cost, instead of O(n2L), which are easy to implement.Given an alignment of n sequences and L sites, I introduce here optimized solutions reaching  A wide range of molecular analyses rely on multiple sequence alignments (MSA), e.g., prediction of tridimensional structures , phylogeO(n2L) for an alignment of n sequences and L sites. The practical importance of having an efficient solution to compute SP-score lies within the following ‘Muscle software paper’ [O(nL) expression for [SP-score estimation…], but to the best of our knowledge no solution is known.”Most MSA software use a greedy approach to construct a first alignment that is then refined by optimizing the sum of pair score (SP-score) ,7 using e paper’  quotatioO(nL). I also introduce a more versatile solution able to handle more general gap cost penalty functions in O(nL + n2Gmax), with Gmax ≤ L being the maximum number of gap intervals within one aligned sequence.The main result of this paper is an optimized algorithmic solution to estimate SP-score for affine gap costs in s1…sn}, defined with alphabet Σ, is a set of n sequences {S1…Sn} which are defined on an enriched alphabet Σ ∪{‘-’} so that all Si have the same length L and, ∀i, removing ‘-’ from Si leads to si. The aim of MSA tools is to position gaps (stretches of ‘-’) so that characters at the same position (constituting a site) are (most likely) homologous. This is usually achieved through a heuristic optimization of the sum of pair score (SP-score). The SP-score of an MSA is obtained by considering all pairwise alignments it induced. Given two sequences Si and Sj of MSA Si,Sj}) is the alignment made up of two sequences Si (resp. Sj) whenever Sj (resp. Si) also has a gap at this position/site. The score of this pairwise alignment is the sum of the substitution/match scores induced by sites without gaps, plus the sum of scores associated to the gap intervals  observed in A multiple sequence alignment (MSA) for a set of sequences {O(n2L) by summing up the score of its The SP-score of an alignment is classically obtained in L|Σ|2 and n|Σ|2, compared to nL, can safely be ignored in asymptotic complexity analysis. Under this assumption, all solutions described here have an O(nL) space complexity.In molecular biology |Σ| is a constant so typically small (4 for nucleotides and 20 for amino acids) that Algorithm. 1. Basic O(n2L) computation of the SP-score of an alignment n sites and L sequences given subst and g_cost(.) functions. The subst function provides, in O(1), the elementary score for two non gap characters on the same site, e.g. using BLOSUM matrix  == ‘–’ and Sj[k] == ‘–’))            if(not (                                Si[k] ≠ ′–′ and Sj[k] ≠ ′–′)            if // e.g., g_cost(IG’) = {return gapO + IG’[length]*gapext}            SPs + SPgReturn SPAlgorithm. 2. An O(L) algorithm to compute the list of gap intervals, ordered by their gap start position, of a sequence S of length L. Note that, thought IG[length] is not explicitly set, it is assumed it can be access since IG[length] is simply IG[end]-IG[start]+1.Algorithm 2: compute_gap_intervalsInput: An aligned sequences Si of length LOutput: The list of gap intervals of Si, ordered by gap start positionLG = {}; // the list of gap intervals of Si found so farIG = NULL; // the current gap intervalk in 1…Lfor Si[k] == ′–′ and IG = = NULL) // start a new gap interval    if        Si[k] ≠ ′–′ and IG ≠ NULL) // the current gap interval finish at previous position    if // handle terminal gap if anyif  by using a table of size L|Σ| containing for each site the number of each (non gap) symbol  using Algorithm 2. The compute_gap_intervals ∪ compute_gap_intervals(Sj) according to order of opening  while maintaining the number of gaps facing gaps encountered so far (i.e. the shift between S and S’ site coordinate systems for current position). The resulting SP-score algorithm (Algorithm 3) has a complexity of O(nL + n2Gmax), with Gmax ≤ ⌈L/2⌉ the maximum number of gap intervals within one aligned sequence, instead of O(n2L). Note that the difference with the naïve algorithm is especially important when sequences contain few long gap stretches but that in the worst case, where most sequences have a number of gap intervals close to L, this algorithm has the same O(n2L) complexity as the naïve solution.The SPs part of the SP-score can be computed in O(ol (e.g. ). This sO + IG’[length].gapext) are frequently used. For such gap penalties, the total of gap extension penalties (SPge) can also be efficiently computed in O(nL), by counting the number of gaps per site. However, gap opening cannot be counted exactly based on local site information (e.g  and i for all IGi ending at i—hence updates for all sites overall require O(nL). External and internal gaps are often penalized with different affine functions. The proposed O(nL) solution can handle this refinement by: firstly, using different characters (e.g. ‘-’ and ‘_’) to represent the two different gap types while computing SPge; and secondly, testing each gap interval type in Algorithm 3  to select the adequate gap opening cost.The key idea is to note that a gap Algorithm. 3. Given the gap interval lists LGi, LGj of sequences O(|LGi| + |LGj|) the restricted gap interval lists Si,Sj} without actually building this restricted alignment.Algorithm 3: compute_pairwise_restricted_gap_intervalsInput:—LGi, LGj the ordered lists of gap intervals for Output:—Si,Sj}IGi = first(LGi); IGj = first(LGj)shift = 0;IGi≠NULL and IGj≠NULL)while(IGi[start] == IGj[start])    if(IGi == IGj) // both intervals disappear when Si,Sj}            if(IGi = next(LGi);                 IGj = next(LGj);                 IGj ⊂ IGi)//IGj disappear during restriction            elif(IGj = next(LGj);                                 if(IGi[start]-shift                    IGi⊂ IGj) // IGi disappear during restriction            else // (i and j                ……. // similar to previous case swapping IGi ∩ IGj|            shift = shift+|IGi[start]<IGj[start])    elif(IGj ⊂ IGi) // IGj disappear during restriction, shift increase        if(            if(IGi[start]-shift                IGi ∩ IGj|        shift = shift+|IGj = next(LGj);         IGj start after IGi and is not included in IGi    else //         if(IGi[start]-shift            IGi ∩ IGj≠⊘) //        if(IGj[start]-shift            IGi ∩ IGj|            shift = shift + |IGi[end]-shift                append IGi = next(LGi);         IGj[start]<IGi[start])    else // (i and j        ……. // similar to previous case swapping IGi≠NULL) // handle last gaps in LGiif(IGi[start]-shift}    if(IGi[end]-shift        append IGi = next(LGi) ≠ NULL)    whileto         append new Interval(start = IGj≠NULL)if(i with j        …… //similar to previous block replacing return O(nL) and a more versatile solution able to handle more gap cost penalty functions in O(nL + n2Gmax), with Gmax ≤ ⌈L/2⌉ being the maximum number of gap intervals per sequence. These optimizations will obviously be part of the next release of MACSE …IGi[end]        for             nbOpenGap[k]++IGi to gapClosing[IGi[end]]    append go = 0; // part of the SP score related to gap opening costsSPi in 1 … Lfor IGi in gapClosing[i]    foreach i == L OR IGi[start] = = 1)        if(go = SPgo+(n-nbOpenGap[IGi[start]])* gapO_ext            SP        elsego = SPgo+(n-nbOpenGap[IGi[start]])* gapO            SPIGi in gapClosing[i]    foreach k in IGi[start] … IGi[end]        for k] = nbOpenGap[k]-1;            nbOpenGap[goreturn SP


Functional Inference using Rates of Evolution) algorithm with an amino acid substitution matrix in a dynamic scoring function. The enigmatic hepatitis B virus X protein was used as a test case for BLOSUM-FIRE and its associated database EvoDB.Selective pressures at the DNA level shape genes into profiles consisting of patterns of rapidly evolving sites and sites withstanding change. These profiles remain detectable even when protein sequences become extensively diverged. A common task in molecular biology is to infer functional, structural or evolutionary relationships by querying a database using an algorithm. However, problems arise when sequence similarity is low. This study presents an algorithm that uses the evolutionary rate at codon sites, the dN/dS (ω) parameter, coupled to a substitution matrix as an alignment metric for detecting distantly related proteins. The algorithm, called BLOSUM-FIRE couples a newer and improved version of the original FIRE  revealed that the BLOSUM-FIRE algorithm performs as well as conventional algorithms. Its main strength lies in that it provides greater potential for aligning divergent sequences and addresses the problem of low specificity inherent in the original FIRE algorithm. The utility of this algorithm is demonstrated using the Hepatitis B virus X (HBx) protein, a protein of unknown function, as a test case.This study describes the utility of an evolutionary rate based approach coupled to the BLOSUM62 amino acid substitution matrix in inferring protein domain function. We demonstrate that such an approach is robust and performs as well as an array of conventional algorithms. The initial steps when investigating phylogenetic relationships or protein functions usually relies on performing accurate sequence alignments. Typically, tools such as BLAST  are emplFunctional Inference using Rates of Evolution (FIRE) was developed to address the low similarity challenge . The selective pressure (selab) provides information that is untapped by conventional alignment algorithms. Such an approximation given by Equation  of amino acidi and b the ω value of amino acidj, where i and j are indexes in amino acid sequences, then the similarity simab of the evolutionary rates can be calculated such that:The premise of the FIRE principle is that amino acid sequences under similar selective pressures share similar functions. Several studies have demonstrated that highly conserved sites can be used as a proxy for functionality, for example, ConSurf  and Rateorsimab to the absolute difference normalised in the range . Therefore, simab, maximises the absolute normalised differences at codon sites.Either Equation  or EquatK) was proposed for the FIRE approach score or simab to be comparable to BLOSUM scores. Let simab from Equation , , K) was F is a BLOSUM comparable score, K is the proportionality constant obtained from the substitution matrix and simab is described in Equations  is the mean amino acid identical match scores determined from the BLOSUM62 matrix and it was found that K = 5.64. Using this proportionality framework we adopt the BLOSUM approach and weigh ambiguity characters in the same manner as regular amino acids.where quations  and 4)..F is a BThe strength of the FIRE approach is its ability to detect shared functions using ω values at low sequence similarity without using the amino acid identity. The BLOSUM approach is effective for aligning sequences using amino acid identity. The FIRE algorithm produced false positives when sequence conservation was high. This is because at high conservation the high similarity of the ω values creates “noise” for the scoring function resulting in poor alignments. Under such conditions the power of aligning sequences based on dN/dS values at amino acid sites becomes weak. Therefore, at high conservation the BLOSUM score is more acceptable than a FIRE score.To allow the algorithm to be dynamic between the two approaches: BLOSUM to FIRE depending on the selective pressure on the amino acids the equations were combined, resulting in a dynamic scoring scheme such that:Conversely, the approach recognises that when conservation is low the BLOSUM score may not be strong evidence. It has not left our attention that determining evolutionary rates requires nucleotide MSAs, which can be challenging to obtain. Therefore, to mitigate this challenge the database EvoDB is provided (described above) and BLOSUM-FIRE allows for the comparison of protein sequences with evolutionary rate profiles in a one sided comparison. However, this comparison may not be as robust as a pairwise evolutionary rates comparison. To allow for this one-sided comparison, the algorithm assumes that all the protein residue sites for the protein sequence without ω MLEs are highly conserved such that ω = 0.The affine gap penalty scheme used in the FIRE algorithm proposed by  and 35]35] was mP is the total gap open penalty g, is the initial gap open penalty t, is the initial gap extension penalty l, is the length of the gap, ea−  is the approximated selective pressure at the codon site, a is the ω value where the gap is opened and similarly, ex−  is the approximated selection pressure where x is the ω value for the site where the gap is extended. Therefore, gaps are extended based on the level of conservation at each site where the gap open penalty and its extension thereof varies as a function of the evolutionary rate at each site. According to this penalty scheme, variable sites are more likely to be gap insertion or extension sites than conserved sites.where Theoretical guidelines for the determination of gap penalties are scarce. In this study an empirical approach similar to the investigation by  was adopWe evaluated the effect of sequence number and MSA accuracy on the final alignment. To evaluate the effect of number of sequences on the final alignment, 10 Pfam families were randomly selected and using between 3 and 20 taxa we investigated how shuffling the order of sequences in the MSA affected the BLOSUM-FIRE score. The domains with the varied number of sequence were aligned with the same domain with 20 sequences. The effect of MSA accuracy on the final alignment was investigated using the heat shock hsp70 (PF00012) domain using nucleotide sequence data corresponding to the manually curated Pfam alignments from EvoDB. Using the MAFFT algorithm and by iteratively increasing the gap open penalty from 0 to 3 in increments of 0.1, we were able to obtain alignments of varying quality and accuracy using the comparison against the alignment generated using default parameters as a performance measure. These alignments were then aligned to the reference alignment to evaluate the effect on the final alignment. Phylogenetic trees for the above experiments were determined using the CLUSTALO program and ω profiles were determined under the M2a model using CODEML.time command. Execution times were measured for the generation of alignments and calculating the phylogenetic tree and determining the ω MLEs. Furthermore, the time taken to generate the final alignment using BLOSUM-FIRE was also measured. Resources were measured on one of the nodes on our cluster (WITS-CORE). This is an Intel (R) Xeon (R) machine with 15 E5630 processors at 2.53GHz running the Scientific Linux operating system. The machine has a cache size of 12M and 23GB RAM. All experiments were carried out on a single core using default algorithm parameters.The resource requirement of an algorithm is an important consideration as some algorithms may require prohibitive resources or running times. While BLOSUM-FIRE has not been optimised for performance, we assessed the time and resource requirements for generating alignments from the MSAs to the final pairwise alignment. For this analysis, the heat shock hsp70 domain was used; we trimmed the sequence to 900 nucleotides to approximate the average length of a protein. Alignments were then de-aligned and iteratively added from 3 sequences to 30. Resources were measured using the Unix bali_score tool provided with the BAliBASE benchmark database [The conventional approach when evaluating the performance of a sequence alignment algorithm is to make use of a sequence alignment benchmark. However, the reliance on pre-processed data makes it a challenge to evaluate the BLOSUM-FIRE approach. The MAFFT algorithm is well known for its accuracy and speed, for example,  and moredatabase . The SPSp-value framework was implemented to assess the statistical significance of the alignments in EvoDB. The HBx ω MLEs were shuffled and used to query the EvoDB database. The scores of the alignments were tested for statistical significance using a p-value statistical framework. In this framework, the fraction of shuffled alignments scoring higher than the actual alignment was determined and this provided the p-value for that alignment. The functions of those proteins that were statistically significant were assessed by analysing the alignments produced. The BLAST algorithm finds statistically significant regions of local similarity between two sequences. The most statistically significant results found by BLOSUM-FIRE were then assessed using the BLAST algorithm to determine their statistical significance using a local alignment approach.To evaluate the significance of the results, a statistical framework was required. The inference of homology requires assessment of the statistical significance of an alignment to identify those real alignments from those due to chance. A To demonstrate false positive results, 100 random alignments of varying sequence lengths were aligned using FIRE. The quality of alignments was inferred from identity scores. Alignments were then performed using the CLUSTAL Omega and MAFFT algorithms  to positive selection (ω >1). A three dimensional heat map providing the correlation between ω values: a and b and the approximated selective pressure selab is provided in Fig. We compared the quality performance of the evolutionary rate based approach (FIRE) with the conventional BLOSUM substitution matrix based algorithm. The results of the comparisons provided the theoretical framework required to conceptualise an approach to couple the evolutionary rate based approach with a conventional BLOSUM matrix. Equation  was usedEquation . TherefoTo determine optimal gap penalty parameters for BLOSUM-FIRE, alignment scores were obtained from iterations of the gap open penalty from 0 to -11 and gap extension penalties from 0 to -6 were used to generate Fig. We compared the resource requirements of our algorithm with other widely used algorithms. The relatively high executive times and resident memory requirements Fig.  for BLOSThe evaluation of the effect of MSA accuracy (results not shown) on the final alignment revealed that there is a correlation between the accuracy measured through the SPS and TC scores and the BLOSUM-FIRE algorithms score for alignments. Therefore, the choice of alignment must be made appropriately. The evaluation of number of sequences on the final alignment Fig.  revealedWe evaluated the performance of BLOSUM-FIRE by comparison with conventional, widely used algorithms CLUSTAL Omega, MUSCLE and T-COFFEE, using MAFFT reference alignments to obtain the SPS. Additionally, alignments produced by a plain BLOSUM62 based algorithm are provided for comparison to demonstrate the difference between the new algorithm and a standard BLOSUM matrix based algorithm. Figure Modifications and improvements to the algorithm were evaluated by comparing the quality performance measured through residue identity scores using datasets of low sequence similarity. The quality performance results Fig.  of BLOSUsim score.To demonstrate the utility of the BLOSUM-FIRE algorithm, the enigmatic HBx was aligned against all the evolutionary rate profiles on EvoDB (a database of evolutionary profiles for the Pfam-A entries). The evolutionary rate profile of the HBx and EvoDB were determined using the CODEML program see . The top−4 is used for inferring homologous relationships). The biological relevance of these results has not be established although the two proteins have vital roles in viral replication.Since the association with the trans-activation X family is well known, we became interested in the similarity with the Rubella endopeptidase family as these domains have been found to play vital roles in viral replication. The BLOSUM-FIRE alignment for the HBx and rubella endopeptidase family is shown in Fig. Some of inherent limitations of BLOSUM-FIRE approach to sequence alignment are the assumptions made when measuring positive selection under the M2a model using the CODEML program in the PAML suite. One of these assumptions is that for those sites under positive selection there have been numerous substitutions at that site across the phylogeny ; howeverhttp://www.bioinf.wits.ac.za/software/fire.This work provides evidence for the efficacy of an evolutionary rate based approach to sequence alignment; we also address the challenge of low specificity. We show that coupling evolutionary rates with conventional amino acid substitution matrices produces robust algorithms comparable in performance to conventional approaches to sequence alignment. We note that the approach has inherent limitations as methods and models of measuring the site by site evolutionary rate accurately still remain a challenging field. This work supports the hypothesis that proteins under similar selective pressures share similar functions. We provide a proof of concept that evolutionary rate profiles can be used as an alignment metric and that in certain cases at least the similarity of these evolutionary rate profiles can be used to infer domain functions. Additionally, we show that aligning sequences based on their evolutionary rate profiles could be used to extend the traditional alignment techniques in testing hypothesis in homology inference. The BLOSUM-FIRE software, user information and sample data files are freely available for download at


Progressive alignment is the standard approach used to align large numbers of sequences. As with all heuristics, this involves a tradeoff between alignment accuracy and computation time.We examine this tradeoff and find that, because of a loss of information in the early steps of the approach, the alignments generated by the most common multiple sequence alignment programs are inherently unstable, and simply reversing the order of the sequences in the input file will cause a different alignment to be generated. Although this effect is more obvious with larger numbers of sequences, it can also be seen with data sets in the order of one hundred sequences. We also outline the means to determine the number of sequences in a data set beyond which the probability of instability will become more pronounced.This has major ramifications for both the designers of large-scale multiple sequence alignment algorithms, and for the users of these alignments. The creation of a multiple sequence alignment is a routine step in the analysis of homologous genes or proteins. For aligning more than a few hundred sequences, most methods use a heuristic approach termed “progressive alignment” by Feng and Doolittle . This isN sequences. Most alignment programs use k-tuple scores [The guide tree determines the order in which the sequences are aligned. All sequences are compared to each other to generate a matrix of distance measures between each pair of sequences. By necessity, the calculation of these distance measures must be fast as it will clearly require e scores , 5 to mee scores  matricesThis paper examines the impact of the tradeoff of accuracy for speed in the construction of the guide trees in protein progressive multiple sequence alignment. We find that, because of a loss of information when calculating the distance measures, the alignments generated are inherently unstable. This instability is easily seen by changing the order of the protein sequences in the input file. This will cause a different alignment to be generated. We also show that, while this instability is more apparent with larger alignments and with some alignment programs, it is also found in small alignments of less than 100 sequences.This instability is due to huge numbers of tied scores in the distance matrices used to make the guide trees. With word-based distances, there is a relatively small number of possible distance scores that can be found between two sequences. This number will depend on the length of the sequences and on the metric used. The effect is that once you get to even moderately large numbers of sequences, the distance matrix will have many tied scores which would ideally be represented in the guide tree as multifurcations. Progressive alignment is a strictly pairwise algorithm and the branching order within these tied groups will be completely arbitrary and determined purely by how the clustering code was written. If you change the sequence order, you will change the cluster order and hence the order of progressive alignment. This means that the supposed power of the guide tree to sensibly align the sequences in the correct order is lost and the considerable computation effort required to calculate them may be completely wasted.The analysis presented here uses the HomFam alignment benchmark system . This coOn examining the HomFam sequences, it was noticed that a number of proteins had the same amino acid sequence even though they were (correctly) labelled differently in Pfam. As an example, in the zinc finger family (Pfam accession number PF00096), the sequence information for: >D2I3U5_AILME/95-116ACADCGKTFSQSSHLVQHRRIHand>ZN787_HUMAN/95-116ACADCGKTFSQSSHLVQHRRIHk-tuple scores.are identical. Table One side effect of the removal process is that the remaining sequences are sorted in ascending alphabethical order of the sequences (not the sequence names) within each of the HomFam families. As each dataset is later randomly shuffled before being aligned, this will not have an effect on any of the alignments produced.This article examines the instability of the alignments produced by the progressive multiple sequence alignment programs Clustal Omega , Kalign Each of the alignment programs generates a distance matrix containing the similarity or distance measures between all pairwise combinations of input sequences. Kalign does not output this distance matrix by default, but on examining kalign2_main.c line 135, the code to output the distance matrix has been commented out. This code was uncommented and modified to output the distance matrix to a specific text file. In addition, the distance measures were output to 25 decimal places to ensure that any duplicates were not as a result of rounding when formatting the output.The other three alignment programs were also modified to output distance measures to 25 decimal places: Clustal Omega: line 327 of clustal/symmatrix.c; Mafft: line 2643 of io.c; Muscle: line 59 of fastclust.cpp.For all four alignment programs, the runtime parameters were limited to those required to generate a distance matrix. By default, Clustal Omega uses the mBed algorithm  to clustk-tuples.For Mafft, the FFT-NS-1, FFT-NS-2 and G-INS-1 algorithms were used. With FFT-NS-1, a distance matrix is first generated using the 6-tuple score between each pair of sequences—both sequences are scanned from the start for matching 6-tuples, and when a match is found the score is incremented and scanning continues from the next residue . A guideWith Muscle, the number of iterations was limited to 2 rather than the default of 16. This is the number of iterations recommended by the authors for large datasets.The program versions and runtime parameters used are as follows:Clustal Omega (v1.2.0-r289): --full --distmat-out=...Kalign (v2.04): -qMafft (v7.029b) FFT-NS-1: --retree 1 --anysymbol --distoutMafft (v7.029b) FFT-NS-2: --anysymbol --distoutMafft (v7.029b) G-INS-1: --anysymbol --globalpairMuscle (v3.8.31): -maxiters 2 -DistMx1 ...http://www.bioinf.ucd.ie/download/2015instability.tar.gz.A package of utility programs, data files and scripts is available for download from In the following sections, we refer to distance matrices and the calculation of distances between sequences. In most of the cases we discuss here, we actually use similarity scores. Nonetheless these can be easily converted to distances and we retain the use of the words distance and distances out of convenience.For each of the 94 HomFam families we selected the HOMSTRAD reference sequences and a random selection of sequences to make up 1000 sequences in total. Families with an insufficient number of sequences were excluded, leaving a total of 68 families.The 1000 sequences were randomly shuffled, a default alignment was generated , and the alignment quality measured using its BAliSCORE TC score. The order of the sequences in the input file was then reversed, the alignment repeated with the same parameters and the quality of this alignment measured. The difference between the two quality scores was then calculated. This process was repeated 10 times for each of the 68 HomFam families, and the results are presented in Fig. In the first four panels, and for virtually all of the represented HomFam families, reversing the order in which the sequences are listed in the input file has an impact on the quality of the alignments produced. For some protein families and alignment programs this impact is considerable, with the alignment of up to 50 % of columns in the reference sequences changing by reversing the order of the input sequences. In the fifth panel, Mafft G-INS-1 uses Needleman-Wunsch  to calcuIt should be noted that Mafft’s G-INS-1 is considerably slower than FFT-NS-2 for the given number of sequences, taking approximately two orders of magnitude longer to run. It also requires over ten times more memory, and both memory and time requirements scale quadradically. As a result it is not recommended for aligning more than a few hundred sequences, but was included in the figure for reference purposes. In the remainder of this paper, we will only examine the distance measure calculations used when aligning larger numbers of sequences.Clustal Omega uses 1-tuple scores to determine the distance measures between proteins, where the scores are calculated in the same was as Mafft’s 6-tuple score except for the different lengths of matching string. Muscle uses 6-tuple scores calculated in the same way as Mafft, and Kalign uses the Muth Manber  approximIn order to further investigate the frequency of such tied distances, the number of unique distance values in a distance matrix computed for a dataset was determined. The four alignment programs, Clustal Omega, Kalign, Mafft and Muscle were run with the parameters listed previously on random samples of sequences drawn from each of the HomFam protein families. Sample sizes ranged from 50 to 10,000 sequences (or as many unique sequences as were in the HomFam family), and each sampling was repeated 100 times. The number of unique distances were counted in the distance matrices produced from each alignment, and the mean number of unique distances for each family and number of sequences are presented in Fig. N sequences, for the larger data sets the vast majority of distance measures are duplicated in each alignment program.The number of unique distances generated by Mafft is considerably higher than for the other alignment programs. However, for all alignment programs, the numbers of unique distances show clear trends of levelling off as the number of sequences increases. In addition, as the total number of distances calculated is given by To determine why the number of unique distances reaches a plateau while the total number of pairwise distances increases quadratically, we need to examine how the distances between sequences are calculated. To simplify the analysis, we will first look at sequences of the same length.L is the length of the sequences. These correspond to sequences with no matches, 1 match, 2 matches, etc. up to identical sequences. Mafft and Muscle use 6-tuple scores, so the maximum number of unique distances between sequences of length L is Clustal Omega uses 1-tuple scores for comparing sequences. With sequences of the same length it can therefore only generate a maximum of Depending on the actual amino acids, Kalign calculates the distance measure as zero between pairs of protein sequences of up to 32 amino acids each.i and j, and x and y are the lengths of the longer and shorter sequences respectively. The additional scaling is deemed necessary as Clustal Omega scales the 1-tuple scores by the length of the shorter of the two sequences. Similarly Muscle scales its 6-tuple scores by the number of 6-tuples in the shorter sequence, and Kalign scales based on the length of the longer sequence. In Mafft, the distance measure is calculated as:Based on this analysis, the two factors that determine the number of different possible distance measures are the lengths of the sequences and the number of different sequence lengths. For simplicity, we will ignore the minor adjustments to the sequence lengths due to using 1-tuples or 6-tuples. Hence, for Clustal Omega, Kalign and Muscle, the theoretical maximum number of unique distances is given as the product of the longest sequence length and the number of different sequence lengths in the dataset. For Mafft, as both sequence lengths are included in the additional scaling factor, the theoretical maximum is the longest sequence length times the square of the number of different sequence lengths. These theoretical maxima are conservative as all sequences may not be as long as the longest sequence, and all possible matches for all sequence lengths may not be found.MaxUniqueDists is the theoretical maximum number of unique distances, MaxSeqLength is the length of the longest sequence in the dataset, and Count(SeqLengths) is the number of different sequence lengths.So, for Clustal Omega, Kalign and Muscle:MaxSeqs is the maximum number of sequences that can be aligned before duplicate distance measures are generated.In additionFigure The lower plots in Fig. It should be noted, however, that duplicate distance measures do not necessarily lead to instability in the alignment generated. It will depend on whether the duplicate measures are the lowest values in the distance matrix at that step in the clustering process, which will in turn depend on what has happened in the previous clustering steps. Hence, we cannot say for definite that duplicate measures will lead to alignment instability. However, as the number of duplicate measures increases, so too does the likelihood of alignment instability. As the alignment instability is determined by the characteristics of the input sequences, we recommend that alignment programs be modified to issue a warning of potential instability when the clustering algorithm encounters tied distance measures.While the instability demonstrated earlier is more apparent in larger alignments, it can also be present when smaller numbers of sequences are aligned. This can be shown by randomly selecting 50, 100 and 250 sequences (including each family’s reference sequences) from each HomFam family and calculating the TC scores for the forward and reversed datasets, as was done in Fig. As can be seen, the instability in sequence alignments occurs even with small alignments. Also, as the number of sequences increases so too does the number of differences in TC scores. While there is no clear trend between the number of unique distances and the number of TC score differences for a particular alignment program, this trend can be seen across the different programs—Mafft shows the fewest number of differences in TC scores and Kalign the most.It should also be pointed out that another reason for the difference in TC scores reported above may be due to the asymmetry of the different implementations of distance measure calculations. Different distance measures could then cause a different clustering order and give a different tree topology, causing sequences to be aligned in a different order.To illustrate, we randomly select two Retroviral aspartyl protease (Pfam accession number PF00077) sequences, run the four alignment programs and extract the distance measures between the two sequences. The order of the two sequences is then reveresed, the alignment programs run again, and the distance measure from this second run is compared with the original. Out of 10,000 samples, for Clustal Omega there were 9 different distances identified. With Mafft and Muscle, no different distance measures were found. However, with Kalign 6516 differences were found.In this paper we have demonstrated a very strong dependence on the order of the input sequences in a data file when we measure multiple alignment accuracy. This effect is disconcerting as merely changing the order of the sequences can change the alignment. The scale of this effect is somewhat surprising and mainly shows up when the numbers of sequences grows large. It can, nonetheless, be seen in data sets of the order of a hundred sequences or so.k-tuple scores for computing these distances. For sequences of a given length, there is a finite and relatively small number of possible scores that can be generated. For shorter length sequences, the number of possible distances is also reduced. If you use real alignment scores using an amino acid weight matrix such as BLOSUM [k-tuple distances. Given enough sequences though, you will inevitably get many tied values in a distance matrix. The use of such alignment scores is limited however, to relatively small datasets as they are expensive to compute, as was seen with Mafft G-INS-1 in Fig. k-tuple or word based scores at some stage of the progressive alignment procedure. Iteration, as carried out by Clustal Omega, Mafft and Muscle can help as the later alignments can use real alignment scores but these are very expensive computationally and do not eliminate tied scores. It is also possible to mitigate the alignment instability by, say, ordering the input sequences lexicographically before calculating the k-tuple scores. However, while this will result in a consistent alignment being produced, it is difficult to justify from a biological point of view why one particular alignment out of numerous alternatives should be chosen. The solution to this issue is not clear-cut. We have previously shown [We have also noticed that when we examine distance matrices generated by some widely used MSA packages that these become increasing dominated by tied values. The more sequences you have, the greater the percentage of the scores in a distance matrix that are duplicates of other scores. We can trace this effect to the use of s BLOSUM , the numly shown  that thely shown  can help