Most phylogenetic studies using molecular data treat gaps in multiple sequence alignments as missing data or even completely exclude alignment columns that contain gaps.splids) that define an approximate bipartition of the taxon set. We show both in simulated data and in case studies on real-life data that splids can be efficiently extracted from phylogenomic data sets.Here we show that gap patterns in large-scale, genome-wide alignments are themselves phylogenetically informative and can be used to infer reliable phylogenies provided the gap data are properly filtered to reduce noise introduced by the alignment method. We introduce here the notion of split-inducing indels  contains supplementary material, which is available to authorized users. Gaps in multiple sequence alignments are usually seen as a nuisance in molecular phylogenetics. In most studies, gaps are treated as missing data or alignment columns with gaps are even removed completely. Indeed, stochastic models of sequence evolution that deal explicitly with insertions and deletions (indels) have been investigated only recently , 2. DetaBetween these few recent rigorous approaches to include gaps and the dismissal of gaps as missing data, indels have been incorporated in several ways into sequence-based phylogenetic analyses. The simplest one is the coding of gaps as fifth character state. Other authors have suggested the replacement of the gapped regions by a binary matrix that codes presence and/or absence of the respective indel . This biGaps in alignments are, of course, not features identifiable from the individual sequences. Instead, they appear as derived patterns inferred from sequence comparison only. Nevertheless, they convey a surprising amount of phylogenetic information. Shared multi-residue deletions, for instance, have been used to support hypothesis derived from molecular data in single gene analyses, see e.g. . Multi-rThe few studies of the phylogenetic information content of gap patterns were mostly conducted on limited sets of protein data. Gap patterns are, however, very different between coding and non-coding regions . With thThe encoding of characters from gap patterns is not entirely trivial as soon as indels rather than individual gap characters are to be assessed.We formally define an indel to be a contiguous stretch of gap characters in one or more rows of the alignment. Each indel therefore has a well-defined start and stop column. Its size is defined as the number of consecutive gap characters. Two indels overlap if there is an alignment column that is common to both of them . Applying this “strict mode” removes indel (11), while it is retained in “fuzzy mode”. These alternative treatments of single-position gaps is motivated by the observation that they occur more randomly than multi-residue gaps, while still containing some phylogenetic information [splids could increase the number of available characters, although this increases the possibility of conflicting signal.We call an indel a ormation . Thus, isplids. By default, the output is a FASTA file, containing the binary coded splid presence/absence information, and a summary statistic with details about the identified splids. Output is also available in PHYLIP and NEXUS format.The algorithm for the conversion of alignments to a binary character matrix is implemented in the C++ program gappy. It reads multiple sequence alignments in MAF and FASTA format. The user can select a minimum and maximum indel size for determining Indel rates and indel-size distributions are usually estimated based on pairwise alignments  but 81 model , two indata sets . All datata sets . The guiata sets  obtainedIn order to address the problem of how our method behaves under real-life data and genome-scale alignment lengths we created two data sets from the ENCODE  project A genome-wide alignment is the result of an extensive similarity search between at least two species. Due to evolutionary changes in genome organization, such as inversions and duplications, two genomes are virtually never completely co-linear, resulting in a decomposition of alignments into syntenic blocks. Practical procedures such as TBA/Multiz also use other features, such as large insertions, missing data in individual species, or low complexity regions, as additional breakpoints, so that relative small alignment blocks are produced. Not all of these blocks contain sequence information from all taxa, both due to missing data in the sequence assemblies and because highly diverged regions of some taxa cannot be reliably recognized as homologous.The first data set contains only those alignments with sequence information for all 36 organisms. Alignment blocks of two ENCODE regions fulfilled this criteria: ENm001  and ENm013 . To investigate how the method behaves under a considerable amount of missing data, as it is usually the case for genome wide alignments, we created a second data set, based on all ENCODE alignment regions with sequence information for at least three species.The use of a predefined guide tree for the genome alignments could conceivably create a bias in indel positioning. We therefore checked whether such a bias exists and how other commonly used alignment programs perform. To this end we removed all gaps from the ENCODE alignment blocks. The genome-wide alignments thus are used only as a convenient means of extracting orthologous regions.We applied a similar procedure to the ’true’ alignments of the simulated data set. To mimic the properties of the ENCODE alignments, we first split all simulated alignments in blocks with an average size of 140 bp. After removing all gaps, each block was then re-aligned with a variety of commonly used multiple sequence alignment programs using default settings: ClustalW version 2.0.12 , Muscle Approximately 2% of the ENCODE regions contain coding exons while the majority covers non-coding sequences, such as introns, UTRs, and intergenic regions. It has been pointed out that, while performing fairly good on these sequences, TBA/Multiz’s results on regions containing non-coding RNAs is not optimal . We thersplidsstrict mode.Following realignment, gaps introduced at the 5′ and 3′ ends of the sequence blocks were considered as artifacts and hence coded as missing data . As indBinary model selection was performed using PartitionFinder version 2.1.1  and compn-taxa trees can be compared using a variety of different distance measures. The most sensitive one is the unweighted Robinson–Foulds (RF) distance (Two phylogenetic ent}dRF) , defineddistance . We therment}dQ) , definedon 3.6.1  and tqDion 3.6.1  to compasplids we first used simulated sequence data generated with INDELible along a known reference tree. Alignments were computed using nine different methods. PartitionFinder identified the GAMMA model of rate heterogeneity including ascertainment bias correction as the most suitable model for all splid alignments. In total 3000 trees were calculated from these alignments and the simulated INDELible reference alignments. On these artificial data set we observe nearly correct trees derived from splids  or inside Euarchontoglires (Muscle). The original TBA/Multiz alignments did not contain enough supporting splids to position Afrotheria outside of Boreoeutheria, however.The monophyly of Afrotheria and the positioning of tenrec basal to elephant and rock hyrax , 50 was f debate –54. Howef debate . Only spSplid data mostly supports the basal-Xenarthra hypothesis. Prank positioned armadillo basal to Afrotheria, whereas ProbConsRNA and T-Coffee placed armadillo basal to Laurasiatheria and therefore inside Boreoeutheria. Interestingly, none of the calculated trees supports the ENCODE guide tree that follows the basal-Afrotheria hypothesis.Three hypotheses concerning the positioning of Xenarthra are discussed in the literature: (1) basal-Afrotheria ; Exafroplacentalia), e.g. , 54, (2)splid data about the relationship within Laurasiatheria, which resembles the conclusions obtained elsewhere [Splid data derived from most of the alignment methods support this and place Rhinolophus ferrumequinum as sister taxon to Pteropus vampyrus, while Myotis lucifugus was found as sister taxon to both of them. Only ProbConsRNA follows the traditional view of a monophyly of megabats and microbats and is therefore similar to the results obtained from the TBA/Multiz alignments.Monophyly of Laurasiatheria was recovered in all cases. Monophyly was also recovered for its major orders Insectivora (Eulipotyphla), Chiroptera, and Carnivora. There was no clear result from lsewhere , 52, 55,lsewhere , while olsewhere , 60. Splsplid data obtained from Muscle and T-Coffee, because of the wrongly positioned Muroidea (Muscle and T-Coffee) and the wrong position of tree shrew, guinea pig, and squirrel (T-Coffee). However, all other alignment methods clearly support the monophyly of the superorder Euarchontoglires.The monophyly of Euarchontoglires (Euarchonta and Glires) could not be recovered from Splid data also do not yield an unambiguous conclusion. They often place the tree shrew within  or in a sister group relationship to Glires (TBA/Multiz). Only splid data derived from ProbConsRNA alignments places the tree shrew  within Primata. Interestingly, splid data obtained from the alignments of Prank recovered the tree shrew as the most basal taxon in Euarchontoglires . Splid data from Dialign-TX, Mafft default, Muscle, and T-Coffee alignments recover Glires as polyphyletic with varying positions of the tree shrew.Among all analyzed groups, Glires are the most problematic one. Incongruent results were reported in the literature in particular concerning the position of the tree shrew. While some studies place tree shrews as sister group to Glires, others recover them as sister group to Primata . In addition, we included in our analysis the splid set derived from the original TBA/Multiz alignments. We removed four invariant splid sites extracted from the TBA/Multiz alignments, because invariant sites are not allowed when ascertainment bias correction is used.splid data sets derived from the large ENCODE data set , which likely contributes to its unstable position.Indels are not features of individual sequences. Instead they are inferred by comparative analysis and, in practice, appear as gaps in multiple sequence alignments. In some alignment methods they are explicitly modelled and contribute to the score, e.g. by means of affine gap costs. In other approaches they are modelled only implicitly. It is not unexpected, therefore, that the number and position of gaps depends quite strongly on the alignment algorithm. The fact that the choice of the alignment algorithm has an impact on the reconstructed phylogenies is well documented in the literature, see e.g. –67. Nevesplids) is based on two basic principles that are largely accepted in the literature. First, indels at the same position, i.e. sharing the same end points in two sequences, are likely homologous. Second, independent single-residue insertions and deletions tend to occur more frequently than multi-residue indels. Hence they are expected to contribute a more noisy signal and hence are disregarded in our analysis.We have focused here on a subclass of indels, namely those which can be found in more than one sequence and therefore define a split in the taxon set. Our definition and inference of such split-inducing indels  is embedded in a larger set of more distantly ones. While splid information, does not necessarily lead to better resolved trees. This effect is likely related to the observation that alignments computed for large data sets have relatively large error rates, especially when sequence coverage is low. This in turn introduces considerable conflicting signal in tree inference [3Increasing sequence length, and therefore nference . In the Additional file 1: Figure S1. Normalized quartet distances for the simulated data sets.


Pairwise sequence alignment is widely used in many biological tools and applications. Existing GPU accelerated implementations mainly focus on calculating optimal alignment score and omit identifying the optimal alignment itself. In GATK HaplotypeCaller (HC), the semi-global pairwise sequence alignment with traceback has so far been difficult to accelerate effectively on GPUs.We first analyze the characteristics of the semi-global alignment with traceback in GATK HC and then propose a new algorithm that allows for retrieving the optimal alignment efficiently on GPUs. For the first stage, we choose intra-task parallelization model to calculate the position of the optimal alignment score and the backtracking matrix. Moreover, in the first stage, our GPU implementation also records the length of consecutive matches/mismatches in addition to lengths of consecutive insertions and deletions as in the CPU-based implementation. This helps efficiently retrieve the backtracking matrix to obtain the optimal alignment in the second stage.Experimental results show that our alignment kernel with traceback is up to 80x and 14.14x faster than its CPU counterpart with synthetic datasets and real datasets, respectively. When integrated into GATK HC , the overall acceleration is 2.3x faster than the baseline GATK HC implementation, and 1.34x faster than the GATK HC implementation with the integrated GPU-based pair-HMMs forward algorithm. Although the methods proposed in this paper is to improve the performance of GATK HC, they can also be used in other pairwise alignments and applications. NGS (Next Generation Sequencing) platforms offer the capacity to generate large amounts of DNA sequencing data in a short time and at a low cost. However, the analysis of the dramatic amounts of DNA sequencing data is still a computational challenge. Researchers have proposed many methods to improve the performance of the DNA sequencing data analysis tools and applications. One method is to execute these tools and applications on high performance computing architectures, such as supercomputers, clusters and even cloud environments. Another method is to use accelerators, such as GPUs and FPGAs, to accelerate the time-consuming kernels of these tools and applications to improve their performance.GATK HaplotypeCaller (HC) is a popular variant caller, which is used to find the differences (or variants) between the sample DNA sequence compared with the reference sequence. Although GATK HC has higher accuracy of identifying variants compared with many other variant callers, its feasibility is limited by the long execution time needed for the analysis, which has proven to be difficult to optimize. This has driven researchers to improve its performance. Intel and IBM researchers both employ vector instructions to optimize the pair-HMMs forward algorithm , 2, whicPairwise sequence alignment, which includes global alignment, semi-global alignment and local alignment, is one of the commonly used techniques in many biological tools and applications. The global alignment and the semi-global alignment are calculated by the Needleman-Wunsch algorithm and the modified Needleman-Wunsch algorithm, respectively, while the local alignment is calculated by the Smith-Waterman algorithm. Although there are some differences existing in the three algorithms, the main framework of these algorithms is similar, which includes two stages: (1) a dynamic programming kernel to calculate the score matrices and find the optimal alignment score; (2) a traceback (or backtracking) kernel to find the optimal alignment.Since three kinds of pairwise sequence alignment  have the same framework and differ only in details, techniques of speeding up one can be applied to the other two with tiny modifications. Different kinds of high-performance platforms, especially accelerators, such as FPGAs , 6 and GThere has been much research done to reduce the execution time of the three kinds of pairwise alignment on GPUs. There are two approaches to implement the first stage of the pairwise sequence alignment on GPUs : inter-task parallelization model and intra-task parallelization model. The former is that each thread performs one alignment independently, such as  and 8]..8]. The However, very few researchers implement the second stage on GPUs. The existing implementations can be classified into two groups. The implementations of the first group are based on backtracking matrices. Liu et al.  proposedWe first analyze the characteristics of the semi-global alignment in GATK HC and then propose a GPU-based implementation of the semi-global alignment with traceback based on the analysis.During the first stage, we propose to record the length of consecutive match(es)/mismatch(es) and store the alignment moves in a special backtracking matrix.We also propose a new algorithm that allows for retrieving the optimal alignment efficiently on GPUs.We benchmark the results and show an overall speedup of GATK HC of about 2.3x over the non-accelerated version.In this paper, we provide an accelerated solution tailored to GATK HC which implements the semi-global pairwise sequence alignment with traceback on GPUs to further improve the performance. The contributions of this paper are as follows: Although this paper proposes to improve the performance of GATK HC, the GPU-based implementation of the semi-global alignment with traceback can be used in other applications and tools. Moreover, since there are only small differences among the global alignment, semi-global alignment and local alignment, the methods proposed in this paper can also be applied to the global alignment and local alignment.Semi-global alignment finds the overlap between two sequences. Insertion and deletions introduce gaps in the alignment. Gaps at the start or end of the sequences may be neglected. Hence, different types of semi-global alignments are possible between two sequences. Figure The pairwise sequence alignment is to find the optimal alignment between two sequences, which has the optimal alignment score. The modified Needleman-Wunsch algorithm with affine gap penalties to calculate the optimal alignment score of the semi-global alignment in GATK HC is defined asInitialization: Recurrence: Termination: Mi,j represents the optimal alignment score of two subsequences R1[1]...R1[i] and R2[1]...R2[j], while Ii,j and Di,j represent the optimal alignment score of two subsequences R1[1]...R1[i] and R2[1]...R2[j] with R2[j] aligned to a gap and R1[i] aligned to a gap, respectively. Here, the semi-global alignment uses an affine gap penalty model to calculate gap penalties, in which α and β are the gap open penalty and the gap extension penalty, respectively. sbt is the score of a match or mismatch. As shown by Eq. where m and n are the length of R1 and R2, respectively. In these equations, O(mn), which makes the execution time increase quadratically with the sequence length. Usually, the algorithm is implemented using dynamic programming which solves three two dimensional matrices. According to the equations, Mi,j, Ii,j and Di,j only depend on the up-left, up and left neighbor elements, which implies that the elements on the same anti-diagonal can be computed in parallel. Thus, a method employed by many researchers to reduce the execution time is to exploit this inherent parallelism in the algorithm.These equations indicate that the computation complexity of the modified Needleman-Wunsch algorithm is If the alignment only needs to find the optimal alignment score of two sequences, the dynamic programming kernel can be calculated in linear space. Otherwise, the alignment with affine gap penalties generally uses three backtracking matrices to store the scores or alignment moves calculated by the dynamic programming kernel. The optimal alignment traceback starts from the position of the element with the optimal alignment score until reaching any element in the first row or the first column of the backtracking matrices, which is calculated in linear time. Figure In GATK HC, the goal is to get the optimal semi-global alignments, which are represented in the CIGAR format , and POSTake the alignment in Fig. blocks and these blocks are grouped into grids. Furthermore, consecutive threads in the same block are grouped into warps. The size of a warp is usually 32. The memory hierarchy includes registers, shared memory, global memory, cache and so on. Each thread is assigned a set of registers. The shared memory is accessed by all threads in a block. Using the shared memory, the threads in a block can exchange data at a very fast rate. The global memory is accessed by all the threads on the GPU. The latency of the global memory access is high since it resides on the device DRAM. If the data accessed by each thread in the same warp are stored at consecutive addresses, the global memory accesses of these threads can be coalesced. Usually, the width of one global memory access is 128 bytes. If the global memory accesses of threads in a warp are coalesced, there will be only one global memory access when the data accessed by each thread is not more than 4 bytes. Otherwise, there would be 32 sequential global memory accesses in the worst-case situation.Modern GPUs are widely used to accelerate computationally intensive algorithms. A GPU consists of thousands of small cores capable of executing one thread at a time. On NVIDIA GPUs, threads are grouped into In GATK HC, the semi-global pairwise alignment is performed in two stages.O(mn) computational complexity. The results of the first stage are two matrices: the score matrix sw, which stores matrix M, and the backtracking matrix btrack. In btrack, the value of each element can be classified into three kinds, which is defined as follows: >0 - indicates a deletion and the length of the consecutive deletion(s) is the value of the element=0 - indicates a match or mismatch and the length of the consecutive match(es)/mismatch(es) is increased by 1<0 - indicates an insertion and the length of the consecutive insertion(s) is the absolute value of the elementThe implementation of the first stage is realized with a two-layer loop, which results in the The absolute values of the elements in the backtracking matrix are calculated by recording the length of the consecutive deletion(s) and consecutive insertion(s) when calculating the score matrix.btrack is then used to obtain the optimal alignment and POS. The optimal alignment is calculated in linear time. The backtracking matrix in GATK HC is helpful during backtracking. It is much easier to identify the next move compared with other methods since it does not need to jump among several backtracking matrices /mismatch(es) is not given, which is increased by one instead.The implementation of the second stage is to calculate the optimal alignment in CIGAR format and POS. The score matrix sw is first used to find the optimal alignment score and the backtracking matrix Align the reference path with the dangling path to recover dangling branches for the local assembly.Align the read with the assembled haplotype.Align the assembled haplotype with the reference to decide whether the assembled haplotype satisfied the defined requirements.In GATK HC, the semi-global alignment is performed in three situations: We profiled GPU-based GATK HC  with a tO(mn), the execution time of each semi-global alignment in situation 3 is bigger than that in situation 2. This explains why the total execution time of situation 3 is bigger than that of situation 2, which is shown in Table We then analyzed the lengths of the sequence pairs in situation 2 and 3. In situation 2, let R1 be the assembled haplotype and R2 be the read. In situation 3, let R1 be the assembled haplotype and R2 be the reference. Figure M operations is the largest. Especially in situation 2, the number of M operations accounts for 99.65% of the total operations. Moreover, we found that most of M operations are consecutive in each optimal alignment. However, the length of the consecutive match(es)/mismatch(es) is increased by one during the optimal alignment retrieval.In addition, we investigated the optimal alignments achieved in situation 2 and 3 and added up the number of M/I/D/S operations in each optimal alignment. Figure Hence, although the computation complexity of the optimal alignment is linear, most of its execution time is used to calculate the length of the consecutive match(es)/mismatch(es).We last studied the source code of GATK HC version 3.7 and found that the semi-global alignments in situation 2 and 3 can be grouped into many batches without big modifications of the source code. Each batch consists of many semi-global alignments of sequence pairs. The numbers of batches in situation 2 and 3 are 13,142 and 13,977, respectively. Figure The implementation of the semi-global pairwise alignment for GATK HC on GPUs is performed in two stages. In the first stage, it performs the modified Needleman-Wunsch algorithm in order to obtain the backtracking matrix and the position of the optimal alignment score. In the second stage, it retrieves the backtracking matrix in order to obtain the optimal alignment in CIGAR format and POS.O(m+n). Figure M as an example to explain the implementation. Let R1 and R2 be the two sequences. There are in total 6 threads in the block and the size of matrix M is 6×6. At each step, the elements on an anti-diagonal are calculated in parallel and every element is calculated by one thread. For example, at step 5 (S5), M5,1, M4,2, M3,3, M2,4 and M1,5, which are on the same anti-diagonal, are calculated by thread 0 (T0), thread 1 (T1), thread 2 (T2), thread 3 (T3) and thread 4 (T4), respectively. These elements are then used in the next step to calculate the elements on the next anti-diagonal. Moreover, each thread is responsible to calculate the elements in one column of matrix M. For example, the elements in the second column are calculated by thread 1 (T1). The goal of the first stage is to obtain the backtracking matrix and the position of the optimal alignment score. Therefore, elements of the score matrix M, I and D are not stored. Instead, two vectors in the shared memory and three registers of each thread are used to store the intermediate results of the three score matrices. During the calculation of elements of the last column and the last row of matrix M, the optimal alignment score and its position are obtained. However, the drawback of the implementation is that some threads remain idle at the beginning or at the end of the calculation procedure, resulting in low thread utilization. If the length of R2 is smaller than the number of threads in a block, the execution is similar to Fig. As mentioned in “short2 matrix. Each element of the matrix has two values, which are x and y. The value of x and y are defined as follows: x>0 - indicates a deletion and the length of the consecutive deletion(s) is the value of the elementx=0 - indicates a match or mismatch and the length of the consecutive match(es)/mismatch(es) is y.x<0 - indicates an insertion and the length of the consecutive insertion(s) is the absolute value of the elementBesides recording the length of the consecutive deletion(es)/insertion(es), we also record the length of the consecutive match(es)/mismatch(es) in the first stage. The backtracking matrix on GPUs is stored in a short, of which the minimum value and maximum value are −32768 and 32767, respectively. The absolute values of the minimum value and maximum value are bigger than the theoretical maximum length of the consecutive operations, which is the length of R1 or R2. In order to calculate the backtracking matrix, a short2 vector in the shared memory and two registers of each thread are used.The data type of x and y is M shown in Fig. Moreover, Since the backtracking matrix will be used in the next stage and the shared memory is not big enough to store it, the backtracking matrix is stored in the global memory. Similar to calculation of the matrix btrack to obtain the optimal alignment and POS. Algorithm 1 presents the pseudo code of the optimal alignment retrieval on GPUs. P1 and P2 describe the position of the optimal alignment score. Algorithm 1 first checks whether there are soft clippings at the end of R2, and then computes the optimal alignment in a while loop. At the end, it checks whether there are soft clippings at the beginning of R2. The backtracking starts from  and finishes when i≤0 or j≤0, which is calculated in linear time. POS is the value of (i−1) at the end of the while loop. In addition, the position of each element in the backtracking matrix is calculated by i, j and max_col, as shown in the 9th line in Algorithm 1. max_col is the column size of the maximum backtracking matrix of all sequence pairs.In the second stage, we use the backtracking matrix The length of the deletion, insertion and match/mismatch is given by the value of an element of the backtracking matrix, as shown in the 13th, 18th and 23rd line, respectively. This reduces the global memory accesses used to calculate the length of the operations.All the experiments are performed on IBM Power System S823L (82478-42L), which has 2 IBM Power8 processors (10 cores each) running at 3.6 GHz, 256 GB of DDR3 memory, and an NVIDIA Tesla K40 card. The NVIDIA Tesla K40 card has 2880 cores that run at up to 745 MHz and has a CUDA compute capability of 3.5.We first compare the performance of the GPU-based semi-global alignment implementation with different techniques using the synthetic datasets. The synthetic datasets are created based on the output of Wgsim  with defThroughput is used as a performance metric of the first stage of the GPU-based implementation, which is measured by giga cell updates per second (GCUPS). Note that it is not fair to compare the throughput of the first stage of the semi-global alignment with traceback with that of the score-only alignments since the former needs to store backtracking matrices in the global memory.There are two solutions to implement the first stage of the semi-global alignment on GPUs if the length of R2 is bigger than the number of threads in a block. We realized these two solutions and used different synthetic datasets to compare the performance of the two solutions.Figure For the first solution, which is to increase the block size, there are in total 9 implementations for 9 datasets. The differences of these implementations are the block size and the sizes of vectors in the shared memory which store the intermediate results. For the second solution, which employs multi-pass, there is 1 implementation with block size of 128.As shown by Fig. i, j) of M are decreased by 1. The backtracking matrices are produced by 9 implementations for the first solution using 9 synthetic datasets. Here, the synthetic datasets are not based on the output of Wgsim since we consider the best case, in which only many M operations exist in the optimal alignment. The lengths of R1/R2 in the 9 synthetic datasets are 64, 128, 192, 256, 320, 384, 448, 512 and 576. The number of sequence pairs in the 9 datasets is 100.In this section, we analyze the impact of recording the length of consecutive matches/mismatches on the performance of the second stage of the alignment on GPUs. We realized two implementations. The first implementation is our approach shown in Algorithm 1 in which the length of consecutive matches/mismatches is recorded in the backtrack matrix. The second implementation is similar to Algorithm 1 except that the length of M is increased by one and the coordinates  In the first stage, our implementation employs the intra-task parallelization model, while the gpu-pairAlign implementation employs the inter-task parallelization model; (2) The backtracking matrix of our implementation is a short2 matrix, elements of which are the length of consecutive deletion(es), insertion(es) and match(es)/mismatch(es), while the backtracking matrices of the gpu-pairAlign implementation are four Boolean matrices, elements of which indicate the proper direction of backtracking moves.We modified the gpu-pairAlign implementation to make it to deal with the data produced by GATK HC: (1) Since the input data of our implementation is a set of sequence pairs instead of a set of sequences, the way in which the gpu-pairAlign implementation handles input data is modified; (2) Integer arrays are used to store the intermediate results instead of short arrays since the intermediate results are bigger than the maximum value of the short data type; (3) The alignments are modified to be represented using the CIGAR format and POS.We first used the synthetic datasets described in “We then compared the performance of the second stage of the two implementations using the synthetic datasets described in “In this section, we compare the performance of our GPU-based semi-global alignment with traceback implementation with the CPU-based implementation using synthetic and real datasets. We used the first solution which increases the block size when the length of R2 is bigger than the block size and records the length of consecutive matches/mismatches. The CPU-based implementation is written in the C++ programming language and compiled with gcc O3 optimization, running on one Power8 core. The real datasets are produced by using a typical workload (Chromosome 10 of the whole human genome dataset G15512.HCC1954.1).Figure Table The two GPU-based implementations with block size of 128 and 576 are integrated into GATK 3.7 to accelerate the semi-global alignment with traceback of situation 2 and situation 3, respectively. The GATK HC implementation with both GPU-based pair-HMMs forward algorithm and GPU-based semi-global alignment with traceback is compared with other two GATK HC implementations: GATK HC (referred to as baseline), which is downloaded from the GATK website, and GATK HC with only GPU-based pair-HMMs forward algorithm. The dataset is Chromosome 10 of the whole human genome dataset (G15512.HCC1954.1). All the GATK HC implementations are performed in single thread mode.Table Note that the number of sequence pairs of each batch produced by GATK HC is small, leading to under utilization of the GPU resources. It is better to launch multiple GATK HC processes at the same time to fully utilize the GPU resources.This paper presents an implementation of the semi-global alignment with traceback on GPUs to improve the performance of GATK HC. Semi-global alignment with traceback has two stages: in the first stage, a backtracking matrix is computed; in the second stage, the optimal alignment is calculated using the backtracking matrix. Based on the characteristics of the semi-global alignment with traceback in GATK HC, the intra-task parallelization model is chosen. The first stage of our GPU implementation is up to 18.94x faster than CPU. Moreover, our GPU implementation also records the length of consecutive matches/mismatches in addition to lengths of consecutive insertions and deletions as in the CPU implementation. This helps to reduce global memory accesses and provides a speedup of up to 4.43x in the second stage. Experimental results show that our alignment kernel with traceback is up to 80x and 14.14x faster than its CPU counterpart with synthetic datasets and real datasets, respectively. The GATK HC implementation with both GPU-based pair-HMMs forward algorithm and GPU-based semi-global alignment with traceback is 2.30x faster than the baseline GATK HC. It is 1.34x faster than the GATK HC implementation with only GPU-based pair-HMMs forward algorithm.


Template-based modeling (TBM), which aims to construct structural models by copying and refining the structural frameworks of other known proteins, remains the most accurate method for protein structure prediction. Due to the difficulty in recognizing distant-homology templates, however, the accuracy of TBM decreases rapidly when the evolutionary relationship between the query and template vanishes. In this study, we propose a new method, CEthreader, which first predicts residue-residue contacts by coupling evolutionary precision matrices with deep residual convolutional neural-networks. The predicted contact maps are then integrated with sequence profile alignments to recognize structural templates from the PDB. The method was tested on two independent benchmark sets consisting collectively of 1,153 non-homologous protein targets, where CEthreader detected 176% or 36% more correct templates with a TM-score >0.5 than the best state-of-the-art profile- or contact-based threading methods, respectively, for the Hard targets that lacked homologous templates. Moreover, CEthreader was able to identify 114% or 20% more correct templates with the same Fold as the query, after excluding structures from the same SCOPe Superfamily, than the best profile- or contact-based threading methods. Detailed analyses show that the major advantage of CEthreader lies in the efficient coupling of contact maps with profile alignments, which helps recognize global fold of protein structures when the homologous relationship between the query and template is weak. These results demonstrate an efficient new strategy to combine  Despite decades of effort in computational method development, template-based modeling (TBM) still remains the most reliable approach to high-resolution protein structure prediction. Previous studies have shown that the PDB library is complete for single-domain proteins and TBM is in principle sufficient to solve the structure prediction problem if the most similar structure in the PDB could be reliably identified and used as template for model reconstruction. But in reality, the success of TBM depends on the availability of closely-homologous templates, where its accuracy and reliability decrease sharply when the evolutionary relationship between query and template becomes more distant. We developed a new threading approach, CEthreader, which allows for dynamic programing alignments of predicted contact-maps through eigen-decomposition. The large-scale benchmark tests show that the coupling of contact map with profile and secondary structure alignments through the proposed protocol can significantly improve the accuracy of template recognition for distantly-homologous protein targets. PLoS Computational Biology Methods paper.This is a Given the rapidly increasing gap between the number of known protein sequences and the number of known structures, the demand for high-resolution, computer-based protein structure prediction has risen dramatically ,2. WhileRecently, sequence-based contact prediction between residue pairs using co-evolution –20 and mSeveral efforts have been previously made to incorporate pair-wise contacts into dynamic programming and subsequent threading alignments ,13,26,27Since direct alignment of contact maps is challenging, several other attempts –33 have Recently, some methodologies have been extended specifically for threading. For instance, SABERTOOTH  was exteFig 1). Multiple large-scale benchmark tests were conducted to carefully examine the strengths, weaknesses and potential of the new contact-based threading approach. Comparison of CEthreader to start-of-the-art contact- and profile-based threading algorithms and pure contact- or template-guided folding approaches demonstrated the significant advantages associated with using our composite contact and profile-guided threading approach for distant-homology fold-recognition and modeling. The CEthreader online server and standalone package are freely available at https://zhanglab.ccmb.med.umich.edu/CEthreader.In this study, we propose a new contact-based threading method, called CEthreader (Contact Eigenvector-based threader), which first creates contact map predictions using deep residual neural-network training. The contact map matrix is then represented by the cross product of single-body eigenvectors through the eigen-decomposition technique, following the idea of Al-Eigen . Finallyhttps://zhanglab.ccmb.med.umich.edu/library/). The second library was collected from SCOPe [Two libraries of non-redundant protein structure templates were collected to test CEthreader. The first was taken from the I-TASSER threading template library , which com SCOPe , which ci) pair-wise sequence identity is <30% to any other selected protein in Set-I; (ii) each protein had at least one template with a TM-score >0.5 as identified by TM-align [The threading methods were examined using two benchmark protein sets. The first (Set-I) consisted of 614 non-redundant protein domains taken from the PDB that satisfied the following criteria:  pair-wise sequence identity is <95% to any other selected protein in Set-II; (ii) structure came from a Fold group that contained at least two Superfamilies. Next, we randomly selected one representative target from each Superfamily, which resulted in 539 targets from 116 Fold groups. Based on LOMETS, this set contained 379 Easy and 160 Hard targets.The second benchmark set (Set-II) was taken from the SCOPe database and constructed in two steps. First, we retrieved 5,497 structures from the SCOPe that satisfied the following requirements:  to enhance the ability to recognize distant-homology templates. To examine the impact of the different components of the CEthreader scoring function on the accuracy of template identification, we list in Fig 2A the average TM-scores of the first templates identified by using Scm (contact map information only), Sss+prof (profile and secondary structure information), or Scm+ss+prof as the scoring function. First, the data show that contact-based threading using Scm alone can identify better quality templates for Hard targets than traditional profile and secondary structure-based alignments, where the average first template TM-score for Scm was 0.439 and 71 out of the 211 Hard targets had templates with TM-scores >0.5, as compared to an average first template TM-score of 0.284 and 19 targets with correctly identified templates for Sss+prof (see more TM-score and RMSD comparisons in S1 Table). The poor performance by the latter method can be attributed to the fact that profile-profile alignments rely on the evolutionary relationship between the query and templates, which is much less accurate here as homologous templates have been excluded; meanwhile, the number of homologous sequences is low for the Hard targets  which further reduces the reliability of the profile-based alignments. On the other hand, ResPRE [METHODS), can generate contact predictions with reasonable accuracy even for targets with few homologous sequences, thus helping capture the global structural similarity between the query and templates in the absence of a reliable profile match.While sequence profile information derived from multiple sequence alignments (MSAs) for query and template proteins has been effectively used to detect homologous templates in many threading methods ,14, it iScm+ss+prof score was used, the average TM-score of the first identified templates increased to 0.453, which was 3.2% (or 59.5%) higher than that obtained by contact-based threading using Scm (or profile and secondary structure-based threading using Sss+prof), with a p-value of 2.3E-03 (or 7.8E-30) calculated using the Wilcoxon signed-rank test. Accordingly, the number of targets whose templates were correctly identified (TM-score >0.5) using Scm+ss+prof was 80, which was higher than the number identified by either individual scoring function Scm (71) or Sss+prof (19). The data suggest that the combined scoring function helps to accurately align the query proteins to their templates and to identify correct templates more effectively than the scoring functions that were solely based on contact or profile and secondary structure information alone.When the Fig 2B, we also list the threading results for the 403 Easy targets that had homologous templates in the PDB. Although profile alignments have been proven to be highly efficient at detecting closely-homologous templates, the results show that contact map information can still help enhance the alignment accuracy for the selected Easy targets. This is demonstrated by the fact that the average TM-score of the first templates identified by CEthreader using Scm+ss+prof (0.687) was about 4.7% higher than the corresponding templates detected using Sss+prof (0.656) with a p-value of 1.1E-15, where the number of targets whose templates were correctly identified by the former (365) was also higher than the latter (347). When considering each of the 614 test targets together, the average TM-score of the first templates detected by Scm+ss+prof (0.607) was 15% higher than the average TM-score of the first templates identified by Sss+prof (0.528), which corresponds to a p-value of 2.1E-45; these data suggest that CEthreader can significantly improve the alignment accuracy and the number of correctly identified templates for both Hard and Easy targets.In Sss+prof score was slightly worse than that of the state-of-the-art secondary structure and profile-based method, HHsearch [S2 Table, which will be discussed later, where our Sss+prof score is called PPA). Even though the non-contact-based components (secondary structure and profile matching) do not produce as accurate results as HHsearch, the performance of the full CEthreader algorithm, which couples the non-contact-based components (secondary structure and profile matching) with the contact-based component (contact eigenvector matching), is significantly better than all other methods, underscoring the importance of contact information to the CEthreader method (S2 Table).Here, it is worthy of noting that the performance of our HHsearch , for botFig 2C, we further examined the effective number of homologous sequences, Neff (defined in Eq. S1 in S1 Text), which is required for each scoring function to identify good templates with TM-scores >0.5. The figure lists the TM-scores of the first templates identified by CEthreader using different scoring functions  versus the logarithm of the MSA Neff values. Despite the large variations, we use linear regression to fit the correlation relationship between the template TM-score and the logarithm of the Neff value for the three scoring functions. The intersection points between the fitted lines and the TM-score = 0.5 horizontal line can be considered as an approximate cutoff to determine what Neff values are required for each scoring function to identify good templates. It was found that threading with the Sss+prof scoring function has the highest dependency on the MSA Neff value with a cutoff of 26.14 (≈64), which means that on average the Sss+prof scoring function may detect good templates only when the Neff is >64. On the other hand, the Scm scoring function, which only uses contact information to guide the threading alignments, has a relaxed Neff cutoff of 24.69. The combination of both scores, Scm+ss+prof, has the widest applicability since it can identify good templates for targets with the lowest Neff values (only >23.86). These data suggest that CEthreader has the ability to identify good templates for targets whose MSAs have relatively few effective sequences, thereby extending the applicability and usefulness of CEthreader, especially for Hard targets.In Fig 3A a Venn diagram of fold-recognition results using the three scoring functions, Scm, Sss+prof and Scm+ss+prof, on the selected Hard targets. We found that the 80 targets whose templates were correctly detected by Scm+ss+prof with a TM-score >0.5 were not a simple overlap of the 71 targets found using Scm and the 19 targets found using Sss+prof. Instead, the composite scoring function helped detect correct templates for 21 new targets that were not identified using either contact or profile and secondary structure-based threading search alone.To examine the effectiveness and rational of the combined scoring function for fold-recognition, we present in Fig 3B (Left panel), we present a representative example from the RuvB Holliday junction branch migration motor (PDB ID: 1in4A1), for which the templates identified using Sss+prof and Scm+ss+prof are superimposed onto the native structure separately. The match based on profile and secondary structure resulted in an incorrect alignment shift starting from the third helix region (H3), where the resulting alignment gap is shown in Fig 3C and highlighted with a circle in Fig 3B. Under the pressure of enforcing contact map matching between the query and template, however, the correct alignment was restored when using Scm+ss+prof, where each of the four helix regions of the template was correctly aligned to the query. This improvement can be clearly seen in Fig 3D, where the gap region corresponds to the mis-match between the query and template contact maps (Left panel), which is removed after considering the contact match score (Scm) (Right panel). As a result, the TM-score of the template identified using Sss+prof was 0.46, which was considerably lower than that by Scm+ss+prof (0.61). This example highlights the usefulness of coupling contact maps with profile and secondary structure information to improve the alignment accuracy even when the same template is identified. The Right panel of Fig 3B displays the superposition of the native structure with the full-length models constructed by MODELLER [Sss+prof template alignment (with a model TM-score = 0.53) contains a long loop between two strands (E1 and E2) due to the alignment shift at H3. On the other hand, the use of Scm+ss+prof leads to a better full-length model along each of the secondary structure regions with an improved TM-score (= 0.68).In Fig 3E, we quantitatively analyze the contribution of profile and contact information to the query-template alignment for 1in4A1. We observed that the profile score was positive in the H1 and H2 regions for both the query and template due to the conservation of amino-acid composition, as evident from their profiles . As a result, the profile match is dominant when aligning the H1 and H2 regions of the query and template, and hence contact information does not have a significant effect on the alignment of these regions. However, the profile score is highly negative when the H3 region of the query is aligned to that of the template due to their different amino acid compositions in this region . Hence, the dynamic programming algorithm tends to add gaps in this region to maximize the final score of the profile-guided alignment. On the other hand, the contact information is highly conserved in the H3 region , and thus the net score in this region has a positive contribution to the final score. Nevertheless, it is noteworthy that the overall profile information is reliable for this example, since approximately 1,000 homologous sequences were obtained for both the query and template sequences using PSI-BLAST [E-value cutoff of 0.01. This particular example highlights the importance of profile information when aligning regions where the amino acid composition is conserved, while also showing how contact map prediction can help fix the alignment errors along the regions where the profiles for the query and template do not match.In SI-BLAST  with an S1 Fig, we found that as the TM-score between the target and the best template increased, the performance of CEthreader-detected templates  generally increases, meaning that the performance of CEthreader does have a weak but positive correlation with the similarity between the target and templates. Nevertheless, the TM-scores of CEthreader-identified templates were uniformly around 0.14 units lower than those of the best possible templates for the 211 Hard targets. When comparing the alignment results on the same template, the alignment quality of CEthreader, in terms of TM-score, was around 0.06 units lower than that produced by the structure alignment program, TM-align. These data show that there are considerable room for CEthreader improvement in both template detection and alignment construction.Furthermore, we conducted an analysis to examine whether and how the performance of CEthreader varies based on the relative difficulty of identifying templates for the Hard targets, where the latter is quantitatively assessed by the structural similarity between the target and the best possible template identified by TM-align  from theMETHODS). However, the time cost also increases rapidly when more eigenvectors are taken into account when aligning the query-template contacts, because a total of 2K possible alignments must be enumerated when considering K eigenvectors so that the sign of every involved eigenvector can be decided. This is particularly an issue when threading through a large size database. For example, when we set K = 7, the average time required to thread a query sequence of 200 residues through our database of 51,376 templates is ~130 hours. In order to reduce the time cost while maintaining the alignment accuracy, we implement a hybrid threading approach that combines both greedy and enumerative searching strategies.We use eigen-decomposition to convert the two-body contact map potential into a single-body potential, where the accuracy of the contact matrix representation increases with an increased number of eigenvectors (see K (= 2) and rank all the templates based on CMOq = O/N(CMQ), where N(CMQ) is the number of contacts used by CEthreader and O is the number of overlapped contacts between the aligned regions of the query and template proteins. For each query-template pair, this greedy strategy attempts to invert the signs of each eigenvector in turn, starting with the eigenvector associated with the largest eigenvalue. Once a sign inversion is set, this process is performed for the rest of the eigenvectors until all K signs are set. This greedy algorithm performs only 2K alignments, which significantly reduces the time complexity when compared to the enumerative searching strategy where all 2K alignments must be performed. Next, based on the ranking results in the first step, we select the top 1,000 templates for the query sequence and re-rank these templates using an enumerative searching strategy with a cumulative total of 7 eigenvectors. Although 254 (21+22+23+24+25+26+27 = 254) alignments are performed for each template, the number of templates is significantly reduced, which means all of the query-template alignments can be conducted with a reasonable cost and an average CPU time of ~2 hours.First, we use a greedy searching strategy to scan the whole database with a small S2 Fig in the SI shows the performance of CEthreader on the 211 Hard targets using different searching strategies and different numbers of eigenvectors. When only one eigenvector was used in the first step, the greedy searching strategy could detect correct templates for 57 targets, and the average time cost was ~1.4 hours. After further optimization based on the enumerative searching of the top 1,000 templates, the number of correct templates increased to 77. When two eigenvectors were used in the first step, correct templates for 68 targets could be identified by the greedy searching algorithm with an average time cost of ~2.4 hours, and correct templates were recognized for 79 targets in the second step of searching. Although the performance based on greedy searching increased with an increase in the number of eigenvectors, the final performance based on the hybrid searching strategy did not change much. In fact, the number of correct templates identified after implementing our greedy heuristic was very close to the number found after ~130 hours of enumerative searching through the whole template library of 51,376 proteins based on a cumulative total of 7 eigenvectors. Therefore, the hybrid searching strategy with only 2 eigenvectors used during the greedy searching step achieves reliable performance but with significantly reduced time complexity.To further examine the impact of contact map information on threading, we compare the performance of CEthreader to other state-of-the-art profile- and contact-based threading programs. The comparisons were made on our two benchmark sets (Set-I and Set-II), where each target from Set-I and Set-II were searched through either the I-TASSER template database or the SCOPe database, respectively.Table 1shows the CEthreader threading results in comparison to eight state-of-the-art threading programs. The results were obtained by threading the 211 Hard targets in Set-I through the I-TASSER template library, where all templates that had a sequence identity >30% to the query sequence were excluded. The data show that the average TM-score of the identified templates by CEthreader was 0.453, which was at least 9% or 45% higher than the average TM-scores by other contact-based methods or profile-based methods, respectively. The contact-based methods included: map_align (0.414) and EigenThreader (0.413), while the profile-based methods included: HHsearch (0.313) and MUSTER (0.304) [p-values <4.4E-06 for all of the comparisons. The table also shows that CEthreader could identify correct templates for 80 out of the 211 Hard targets, which was 1.35 times higher than the next best contact-based methods and 2.76 times higher than the next best profile-based method. The average RMSD by CEthreader was also lower than that of other programs, including the ones  and profile information, while other excellent profile-based programs, such as HHsearch and MUSTER, use profile and single-body local structural information (such as secondary structure), which are not sufficient to detect correct templates for many Hard targets. More importantly, by carefully coupling the profile information, CEthreader performs significantly better than other contact-based methods, such as map_align and EigenThreader, which rely solely on contact information to guide threading.p-value <2.2E-03 relative to the best of the profile-based programs and <3.2E-23 to the best of the contact-based programs (see S2 Table). Note that without the use of profile information, other contact-based methods, such as map_align and EigenThreader, perform worse than profile-based methods  on the Easy targets. The head-to-head comparisons between CEthreader and EigenThreader or map_align can be found in S3 Fig.Furthermore, although CEthreader was primarily developed for threading Hard targets, the alignments compare favorably with other profile-based threading programs for the 403 Easy targets, with a S3 Table shows that CEthreader is still the best performing threading method compared to other profile- and contact-based methods for both of the subsets, which is consistent with the results for the entire Benchmark Set-I as shown in Tables 1and S2, even though the results for the subset with sequence identities ≥30% are slightly better than those for the subset with sequence identities <30%.As discussed above, we have used a sequence identity cutoff 40% (instead of the <30% cutoff enforced between Set-I and the CEthreader training set) to filter proteins in Benchmark Set-I homologous to the ResPRE training dataset. In order to justify the reasonability of selecting the 40% sequence identity cutoff, we divided Benchmark Set-I with its 614 targets into two subsets: the first subset includes 239 targets with sequence identities <30% to the ResPRE training set, and the second contains 375 targets with sequence identities between 30% and 40% to the ResPRE training set. Despite filtering out templates with high sequence identities to the target proteins (>30%), templates identified in Benchmark Set-I may still have evolutionary relationships to the target proteins. Meanwhile, the distribution of the evolutionary distances between the query sequences and templates is highly uneven and varies from case-to-case. To conduct a more rigorous quantitative assessment of the ability of each threading program to recognize different levels of distantly-homologous templates, we performed a second test using Benchmark Set-II, which was collected from the SCOPe database. SCOPe is organized using a stringent hierarchy of protein structures, ranging from Class, Fold, Superfamily to Family, with members in a lower level of hierarchy having a closer evolutionary and structural similarity.Table 2summarizes the results for five state-of-the-art threading programs for which all templates within the same Superfamily as the query were excluded. The average TM-score of the first templates identified by CEthreader from the SCOPe database was 0.483, which was significantly higher than that by the next best contact-based method, i.e., map_align (0.464), or profile-based method, i.e., HHsearch (0.301), with Wilcoxon signed-rank p-values <5.0E-05. Out of the 539 targets, CEthreader detected templates with the same Fold as the query in 323 cases, resulting in a SCOPe Fold-recognition success rate of 59.9%; this is much higher than the success rate of EigenThreader (50.3%) or HHsearch (28%). These data show that CEthreader has a stronger ability to detect templates with similar Folds even in the absence of a Superfamily-level homologous relationship to the query. In the lower panel of Table 2, the query proteins are categorized as Easy (379 targets) or Hard (160 targets) based on their LOMETS classification, where similar trends in TM-score and success rate are observed for both Easy and Hard targets.Fig 4shows a more detailed illustration of the ability of CEthreader and HHsearch to detect non-homologous templates from Fold groups of different sizes. In the outer circle of Fig 4A, there are 39 Fold groups with each containing at least 4 Superfamilies, where 29 groups were threadable by both CEthreader and HHsearch, 8 other groups were threadable only by CEthreader, and none of the groups were threadable by HHsearch but not by CEthreader. Here, "threadable" refers to cases for which the identified template and query proteins share the same Fold. For the 29 cases, both CEthreader and HHsearch demonstrated good performance at recognizing Folds with a high number of Superfamilies. On the other hand, recognition of Folds became more challenging when the number of Superfamilies in a Fold group was smaller, as statistically there was a lower chance of recognizing the correct template. In Fig 4B, we list 77 Fold groups in the SCOPe set that had ≤ 3 Superfamilies, where 39 of them could not be detected by either CEthreader or HHsearch. There were, however, 26 Fold groups where CEthreader identified a higher number of correct templates (with the same Fold) than HHsearch, while HHsearch did so only in 5 Fold groups. Overall, as shown in S4 Table CEthreader detected correct templates in the same Fold group as the query in 72 cases, while HHsearch did so in 44 cases out of the 116 Fold groups, which were selected after excluding the Superfamily-level homologs.Fig 4A, we further analyze the evolutionary connection between different Folds in the SCOPe database in order to investigate what types of Folds are recognizable by CEthreader. For this purpose, a dotted edge is drawn between two Folds if the average TM-score between the Folds was >0.4, where Folds were clustered based on the edges using Walktrap [S5 Table). Here, the TM-score cutoff of 0.4 was chosen as multiple Fold groups could be formed with no singleton cluster at this cutoff. For the 39 Folds with ≥4 Superfamilies, the four clusters approximately corresponded to the four Classes of Folds, i.e., α-, β-, α+β, and α/β proteins. The figure shows that CEthreader tends to have better performance for Folds of smaller degree (less edges) and/or larger size (more Superfamilies), especially for those in large clusters. For example, in the blue region of the inner disc that corresponds to the α-protein Class, CEthreader failed to detect Folds a.2 and a.8 that had both large degree and small size, while it showed excellent performance in identifying Folds a.24 and a.118, both of which were of small degree and large size, and Fold a.102, which was of small degree. Since Folds with larger sizes comprise more Superfamilies, it is easier for CEtheader to detect a correct Fold. Additionally, Folds with smaller degree have fewer neighbors that are structurally similar to the Fold, thus there is a lower chance of mis-identifying the templates from other Folds by CEthreader, which utilizes structural information to identify templates.In the inner disc of Walktrap  . When all templates with the same SCOPe Family to the query were excluded, both CEthreader and HHsearch could detect templates from the correct Fold group as highlighted by the yellow (for HHsearch) and green (for both CEthreader and HHsearch) circles in Fig 4B. When the templates with the same Superfamily to the query were excluded, however, CEthreader could still detect the top-ranked template (SCOPe ID: d2rdea2) with the same Fold (b.45) and a TM-score of 0.57 to the query, but HHsearch’s top-ranked template (SCOPe ID: d3d2la_) was from a different Fold (c.66) that had a TM-score of 0.14 to the query. This example illustrates the enhanced ability of CEthreader to detect distantly-homologous templates.In order to better illustrate the enhanced ability of CEthreader compared to HHsearch to recognize correct Folds, we present in the inner disc of Fig 4C a Venn diagram for the number of cases for which the correct Fold was detected by CEthreader, HHsearch and MUSTER for all 539 targets in Set-II. It shows that the overlap between HHsearch and MUSTER was high, where 88% of targets whose Fold were correctly identified by MUSTER were also detected by HHsearch, probably due to the fact that both methods are built on the same principle of profile-profile alignment. On the other hand, due to the utilization of contact maps, CEthreader had a relatively lower overlap with HHsearch and MUSTER, where there were 185 cases (57%) whose Folds were correctly identified by CEthreader but not by HHsearch or MUSTER. Since CEthreader also adopts profile alignment information, most of the Folds successfully recognized by MUSTER and HHsearch were also recognized by CEthreader, which again demonstrates the advantages of using the composite profile- and contact map-based scoring function for threading alignment.As a summary, we present in Fig 4D shows the difference in average TM-scores between CEthreader and HHsearch query-template alignments (ΔTM-score) for the 102 proteins, as a function of contact prediction accuracy, CMOacc = O/N(CMnative), where N(CMnative) is the number of contacts in the native structure and O is the number of overlapped contacts between the native and the top N(CMnative) predicted contacts.To specifically examine the potential of contact-based threading, we collected a subset of 102 modelable proteins from the 160 Hard targets in Benchmark Set-II, each of which had at least one template with TM-score >0.5 as identified by searching the SCOPe library using TM-align. In total, TM-align identified 15,440 templates with TM-scores >0.5 for the 102 selected proteins, with around 150 templates for each query protein. CMOacc values. For example, the average ΔTM-score = 0.087 for the targets with CMOacc >0.5, while ΔTM-score = 0.073 for the targets with CMOacc below 0.5. There was also a correlation between ΔTM-score and the effective number of homologous sequences, Neff, where ΔTM-score = 0.092 (or 0.081) for targets with Neff > 128 (or < 128). This is understandable because the contact prediction in ResPRE was based on training using multiple sequence alignments [Neff corresponds to a more complete sequence profile and therefore can result in, on average, better contact map prediction accuracy. Overall, ΔTM-score was >0 for 98 and <0 for 4 out of the 102 Hard targets. In 83 cases, the TM-score by CEthreader was significantly higher  than that by HHsearch, while HHsearch only had a significantly higher TM-score in 3 cases . Here, the p-values were calculated using Wilcoxon signed-rank tests for all of the ~150 templates for each target.The data show a modest but obvious correlation between the improvement of CEthreader over HHsearch and the ignments , where aFig 4E and 4F, we present an example from the hypothetical protein MS0332 (SCOPe ID: d2db7b_) to illustrate the impact of contact map prediction on threading results. For this target, both CEthreader and HHsearch identified the Cyanobacterial Photosystem I protein (SCOPe ID: d1jb0l_) as the top template. The query had a four-helix bundle fold, but HHsearch could only align the C-terminal helix of the query (helix H2) to the C-terminal helix of the template (helix H3) based on profile and secondary structure information, which resulted in a low TM-score (= 0.3) compared to the native. On the other hand, utilizing the contacts predicted by ResPRE between the residues in helices H1 and H2, CEthreader correctly aligned all four helices between the query and template by maximizing the overlap between the contact maps of the query and template structures, which resulted in a query-template alignment with a TM-score of 0.615. This example again demonstrates how the predicted contact map information helps correctly align two proteins that do not share any homologous relationship.In S6 Table listed a summary of the TM-score and RMSD of the full-length models constructed by MODELLER based on the template alignments generated by CEthreader and other profile- and contact-based threading algorithms for the proteins in Benchmark Set-I. It was observed that the TM-scores of the first models generated by CEthreader/MODELLER are 0.708 and 0.476 for Easy and Hard targets, respectively, which were significantly higher than the corresponding average TM-scores for models built by EigenThreader/MODELLER (0.656 and 0.449) or HHsearch/MODELLER (0.698 and 0.330), with p-values <4.42E-05 for all cases. These data suggest that CEthreader helps improve the template alignments and full-length model construction for both Easy and Hard targets.The core of the CEthreader development involves the integration of contact maps with profile and secondary structure information to improve the threading alignment accuracy. Based on our former benchmark tests, the combination of contact maps with the profile and secondary structure features can help CEthreader to generate significantly better template alignments than the methods built on either profile or contact map alignment. To further examine their impact on the full-length homologous model constructions, METHODS). The CEthreader/C-I-TASSER folding engine was modified here to use the top five ranked CEthreader templates and the ResPRE contacts as restraints. In  we presented a comparison between the full-length models constructed by the C-I-TASSER and the models generated by the pure template-based modeling tool, I-TASSER, starting from the same top five CEthreader templates for all 614 targets in Benchmark Set-I. As a control, we also listed the results from the models built by the Crystallography & NMR System (CNS) program [To further improve the modeling quality, we coupled the CEthreader threading alignments with the predicted contact map information using a recently developed contact-guided structural assembly pipeline, C-I-TASSER , to buil program , utiliziFig 5, we presented the modeling results for the ARF guanine-nucleotide exchange factor 1 (PDB ID: 1re0B), which is an α-protein consisting of 10 helices. For this target, ResPRE accurately predicted the contact map with a CMOacc of 0.915 . Using the predicted contacts, CEthreader identified a template, 1xszA3 , that fully covered the C-terminus of the target with a local TM-score of 0.808  and a CMOq of 0.335, but had the N-terminal region completed missed. Despite the fact that the local alignment quality of the template was good, due to the low alignment coverage (59%), the full-length model generated by CEthreader/I-TASSER had a near random coil conformation in the N-terminus region, resulting in a relatively low overall TM-score of 0.578 . These data show that template-based modeling approaches lose much of their accuracy in gap regions where the aligned template information is absent. On the other hand, since the predicted contact map overlapped well with the native contact map for the entire protein , ResPRE/CNS constructed a full-length model with a slightly improved TM-score of 0.637 . However, ResPRE/CNS utilized restraints from all of the predicted contacts , where the false positive contact between residue 85 and 124  drew helix H6 close to helix H8 in the C-terminus  during the CNS simulation. This caused the position to shift away from that found in the experimental structure and produced even more false positive contacts in the C-terminus of the final CNS model. Therefore, when only considering the C-terminus region, the TM-score of the ResPRE/CNS model was much lower than that of the CEthreader/I-TASSER model (0.477 vs 0.833). This analysis shows that pure contact-based modeling is still not as accurate as template-based modeling when high quality templates can be identified. In the CEthreader/C-I-TASSER pipeline, since both contact-map and threading template were considered in the structural assembly simulations, the final model had a reasonable accuracy on both N- and C-terminal regions , which resulted in a full-length model with a much higher TM-score (0.792) than that by either CEthreader/I-TASSER (0.578) or ResPRE/CNS pipelines (0.637). This example highlights again the advantage of contact-map and threading template combinations in structural assembly simulations, in particular for the cases when low-coverage templates are identified, where contact map predictions can be used to help model the threading-unaligned regions.In Fig 6A and 6B, we examined the correlations of the TM-score of the first C-I-TASSER model with two metrics of the C-I-TASSER C-score (defined in Eq 8in METHODS) and the threading Z-score (Eq 7). It was shown that the Pearson correlation coefficient (PCC) between TM-score and C-score (0.800) was much higher than that between TM-score and Z-score (0.579). If we selected a C-score cutoff of -0.18 to estimate the fold of final models, it would result in a maximum Matthews correlation coefficient (MCC) of 0.600, which was also much higher than the maximum MCC achieved by the threading Z-score (0.463). Here, it is noted that Fig 6B presented the TM-score of the C-I-TASSER models which might have only indirection relation with the threading Z-scores. To avoid the bias, we presented in Fig 6C the correlation data between the TM-score of the first threading template and the Z-score, where the PCC and the maximum MCC for the threading templates were 0.647 and 0.558, which were still lower than that from C-score/TM-score correlations (0.800 and 0.600). These results suggest that the C-score values by combining contact map, threading and MC simulation information should provide more accurate estimation on the final model quality compared to the widely threading Z-score.After predicting the final structure models of a target, it is important to estimate the accuracy of the models, e.g., determining whether a target was correctly folded (TM-score of the model ≥0.5) or not (TM-score <0.5). In In this study, we developed a new contact-guided threading approach, CEthreader, with the aim of significantly improving template-based structure modeling and fold-recognition for distant-homology proteins. The method first deduces residue-residue contact maps from multiple sequence alignments by integrating precision matrices with deep residual convolutional neural-network training. The predicted contact maps are then converted into single-body eigenvector products through eigen-decomposition, which enables the utilization of two-body contacts to guide the alignment construction and template selection using the Needleman-Wunch dynamic programming algorithm .CEthreader was tested on two large-scale benchmark sets containing 614 non-redundant protein structures collected from the PDB and 539 domains selected from different families in the SCOPe database . For theCEthreader was also compared to other profile- and contact-based threading methods for full-length 3D model constructions. Using the CEthreader alignments, MODELLER constructed full-length models with TM-scores >0.5 for 476 out of the 614 Benchmark Set-I proteins, which was 14% or 18% higher than the number of correct models built using either EigenThreader or HHsearch alignments, respectively. The performance of CEthreader-based template modeling can be further improved by coupling the template information with the predicted contact maps in the structural assembly simulations, for which the models constructed by CEthreader/C-I-TASSER demonstrated significantly higher TM-scores and folding success rates than those produced by CEthreader/I-TASSER or ResPRE/CNS. The data suggests that the interplay of contact-guided threading with predicted contact maps can further improve protein structure modeling and makes the CEthreader/C-I-TASSER approach go far beyond model reconstruction strategies built purely on contact map prediction or template recognition.Despite the ability of CEthreader to recognize distant-homology templates, there is still room for further improvement. Currently, only positive eigenvalues have been considered in the eigen-decomposition process, which may result in a loss of information for some targets due to the omission of negative eigenvalues that are often important for precisely recovering the contact map matrix. Based on the statistics of the results of the Benchmark Set-I, for a typical protein, 47% of the eigenvalues are positive and 53% are negative  when performing eigen-decomposition utilizing native contact maps. Therefore, the inclusion of both positive and negative eigenvalues, which although may increase the implementation time of the program, should help further improve the contact-guided threading accuracy.Fig 1.CEthreader is a fold-recognition algorithm to identify similar-fold structures from the PDB under the guidance of predicted contact maps. The core part of the algorithm consists of contact map prediction, eigen-decomposition of the contact matrix, and contact-guided template search and selection, where the flowchart of the pipeline is depicted in β-Cβ distances <8 Å) is predicted using the ResPRE method, which couples evolutionary precision matrices with deep residual neural networks [L×L×21×21 array of evolutionary couplings for a protein with L residues and L×L residue pairs. For each residue pair, the 21×21 coupling matrix is fed directly to the deep residual network (ResNet) [The contact map for a query sequence (with Cnetworks . Precisi(ResNet) , which i(ResNet)  under th(ResNet) .N predicted residue pairs, which are ranked by their confidence scores of prediction, are selected to form the final contact map, where cr refers to the long-, medium- and short-range contacts with sequence separation |i−j| ≥ 24, 23 ≥ |i−j| ≥ 12, and |i−j| ≤ 11, respectively. The parameters σcr were determined by maximizing the TM-score of CEthreader on a set of 905 training protein-pairs; these pairs were selected from the all-to-all alignments by TM-align [S4A Fig, the average TM-score of the CEthreader alignments is sensitive to σcr, where the maximum value occurs near σsum = 2.51 (= ∑crσcr = 1.79+0.41+0.31), although the fraction of aligned contacts, CMOq, decreases monotonously with σsum . In S4C Fig, we present the correlation data between the number of short, medium and long-range contacts and protein length calculated from 9,896 non-redundant SCOPe domains, where the linear regression with the fitted parameters coincides well with the experimental structure data.The ResPRE predicted contacts with sequence separation ≥5 are selected and used by CEthreader, where residue pairs located at the same helix with a separation of 4 are also considered in order to enhance helix alignment. The top TM-align  from a sS8 Table, we list the performance of CEthreader on 905 training protein-pairs using contact maps from 18 different predictors. Although CEthreader was trained on the ResPRE contact maps, the data shows a strong correlation between the alignment performance and the accuracy of the contact map prediction from all different predictors. On average, ResPRE has the highest accuracy (84.6%) which also results in the highest TM-score (0.633) and CMOq (0.480) values used by CEthreader for the 905 training proteins.In L×L symmetric binary matrix, M, in which residue pairs in contacts are designated as 1 and non-contacting pairs are set to 0. Based on the eigen-decomposition theory [λk represents the k-th eigenvalue of M, and Eq (1), we reorder the eigenvalues in descending order , any pair of contacts between residues i and j can be written asBased on i- and j-th residues are described by the vectors ofIn this way, the contact profiles of the S2 Text and S5 Figin the SI for more details). In CEthreader, we set K = 7 as a trade-off between accuracy and speed for the alignment procedure .This representation of contact maps using single-body profiles allows the integration of contact map information into a dynamic program alignment algorithm for fold-recognition :i-th residue of the query and the j-th residue of the template as defined by Eq (4). This term helps to align the residues pairs from the query and template that have similar contact eigenvectors, and therefore enhances the match between the global contact maps of the two proteins . There are several previous studies trying to use a cosine function or a standard inner dot product function [S4 Text). Indeed, based on our tests on the 905 query-template pairs (S8 Table), the scoring function defined by Eq (6) performs significantly better than the inner dot product-based scoring function in terms of query-template alignment TM-scores and CMOq values.Here, the first term accounts for the contact map match between the query and template by  and Sss, in Eq (5), which are explained in  take into account the sequence profile-to-profile and secondary structure alignment scores between the i-th residue of the query and the j-th residue of the template. The weighting parameters are w1 = 0.5, w2 = 0.4, w3 = 0.1, and w4 = 0.1, which were determined by maximizing the alignment TM-score for the 905 training protein-pairs described above.The second and third terms, l residue gap the gap penalty, G is determined by G = go + gel, where go,e = w1go,e(cm)+w2go,e(prof)+w3go,e(ss) with go(cm) = go(prof) = go(ss) = −1.0, ge(cm) = ge(prof) = ge(ss) = −0.1 and ge(ss) = −0.077. These parameters were determined by optimizing the alignment performance on the 905 training protein pairs (see S5 Text). The gap penalty is used only for residues in the middle of the query and template sequences, and no penalty is applied to the terminal ends. Since changing the sign of νi,k and νj,k simultaneously gives the same Mi,j in Eq (3), for a given eigen solution, there are 2K different vectors all satisfying the eigen-decomposition equation. Thus, CEthreader needs to calculate The Needleman-Wunsch (NW) dynamic programming algorithm  is used CMOq is used to rank all the templates. Additionally, we can compute the Z-score based on CMOq to assess the quality of the template alignments with respect to the average, and further distinguish between good and bad templates. The Z-score is calculated byCMOq(i) is the CMOq of the i-th template, and 〈CMOq〉 and σ(CMOq) are the average CMOq and standard deviation, respectively, across all templates for CEthreader.In order to select the best alignment, th community-wide Critical Assessment of Structure Prediction (CASP13) experiment. It is built on the I-TASSER [i and j) that is predicted to be in contact, the restraint is added to the inherent I-TASSER potential byUij is the contact probability between residue pair i and j predicted by ResPRE, dij is the Cβ-Cβ distance between residue i and j in the simulation decoys, and D = 16 Å.C-I-TASSER   is the highest Z-score of the templates identified by CEthreader and Z0 = 6.8 is the corresponding Z-score cutoff for distinguishing between good and bad templates, which was determined based on the training dataset; N(CMQ) is the number of contacts used by CEthreader and O is the sum of probabilities provided by ResPRE for the overlapped contacts between the query and structure models.Following the simulations, the decoys from the simulation trajectories are clustered by SPICKER , where tS1 Text(PDF)Click here for additional data file.S2 Text(PDF)Click here for additional data file.S3 Text(PDF)Click here for additional data file.S4 Text(PDF)Click here for additional data file.S5 Text(PDF)Click here for additional data file.S1 Table(PDF)Click here for additional data file.S2 Table(PDF)Click here for additional data file.S3 Table(PDF)Click here for additional data file.S4 Table(PDF)Click here for additional data file.S5 Table(PDF)Click here for additional data file.S6 Table(PDF)Click here for additional data file.S7 Table(PDF)Click here for additional data file.S8 Table(PDF)Click here for additional data file.S1 Fig(PDF)Click here for additional data file.S2 Fig(PDF)Click here for additional data file.S3 Fig(PDF)Click here for additional data file.S4 Fig(PDF)Click here for additional data file.S5 Fig(PDF)Click here for additional data file.S6 Fig(PDF)Click here for additional data file.S7 Fig(PDF)Click here for additional data file.S8 Fig(PDF)Click here for additional data file.