Enterococcus hirae V-ATPase complex.Application of cryo-electron microscopy (cryo-EM) is crucially important for ascertaining the atomic structure of large biomolecules such as ribosomes and protein complexes in membranes. Advances in cryo-EM technology and software have made it possible to obtain data with near-atomic resolution, but the method is still often capable of producing only a density map with up to medium resolution, either partially or entirely. Therefore, bridging the gap separating the density map and the atomic model is necessary. Herein, we propose a methodology for constructing atomic structure models based on cryo-EM maps with low-to-medium resolution. The method is a combination of sensitive and accurate homology modeling using our profile–profile alignment method with a flexible-fitting method using molecular dynamics simulation. As described herein, this study used benchmark applications to evaluate the model constructions of human two-pore channel 2 (one target protein in CASP13 with its structure determined using cryo-EM data) and the overall structure of  The application of cryo-electron microscopy (cryo-EM) has become an important tool for ascertaining the structures of large biomolecules such as ribosomes and membrane protein complexes ,5,6,7,8.For the determination of atomic structures, various methods have been proposed based on density maps derived from cryo-EM experiments. Two important categories are template-free, i.e., de novo modeling methods ,12,13,14justment ,11. The justment ,22, molejustment ,19,20,21justment . Initialjustment  or are bjustment . MDFF, wjustment ,24. Othejustment , and MDfjustment ,26 betweRegarding recent progress in the modeling of protein structures, AlphaFold2 (AF2)  achievedAs an application of our developed homology modeling method , we propEnterococcus hirae V-ATPase (Eh V-ATPase). Human TPC2 is a target in CASP13 for which structures have been ascertained using the cryo-EM technique [Thermus thermophilus V-ATPase, with a structure that was determined using cryo-EM techniques. For comparison of the performance of our homology modeling method with those of other methods as the generator of a starting point for flexible fitting, flexible-fitting simulations were undertaken for all predicted models of the target, generated without information from the cryo-EM map. Then, the entire structure of Eh V-ATPase, for which the atomic structure remains unclear, is presented as a demonstration that our method is applicable for a huge and complex target. Until recently, cryo-EM map single-particle analysis with the Zernike phase plate provided the entire structure of Eh V-ATPase only at 17.3 Å resolution [Eh V-ATPase based on the density map from a further improved cryo-EM map at subnanometer resolution using the Volta phase plate. Our method generated a reasonable model of the entire structure of Eh V-ATPase that agrees well with the EM map.To demonstrate the performance and applicability of our method, we present results obtained for two applications intended for modeling of a protein complex for which structures are already known and for one application of modeling the protein complex for which the structure has not yet been determined: human two-pore channel (TPC) 2 and the whole structure of echnique ,45. Furtsolution . In thisOur proposed method includes two parts: generating a set of models using our homology modeling method for a target sequence or sequences, and flexible fitting of the generated models via an MD simulation biased to an EM map. First, we generate a set of three-dimensional (3D) models through our template-based modeling pipeline. These models are evaluated both by the score based on fitting with the EM map and the scores of model quality. Then, models with higher scores are subjected to flexible-fitting simulations to improve the fit to the EM map. Finally, scores that evaluate the quality of the 3D models and the fitting with the EM map are used as criteria for selecting models. For protein-complex modeling, the EM map is divided into fragments corresponding to each subunit. Then, 3D models generated by the homology modeling pipeline for each chain (subunit) are evaluated based on fitting with the EM map fragments. Models with higher scores for each subunit are used for flexible fitting of the whole model.The homology modeling method is based on the latest version of our pipeline . The whoFirst, the step for the construction of profiles is explained. Technical details are presented in the FORTE, our profile–profile alignment algorithm, was used to calculate an alignment and a score between a target and template profiles. The FORTE scoring scheme is based on the correlation coefficient found between the two profile columns to be compared. The Z-scores of the alignments are calculated using alignment scores and log-length correction. If no good template is found for the entire length of the target sequence in this step, then the target sequence is split into multiple fragments, where possible, in order to find a good template.Based on the obtained alignments of the target sequence with the template sequence and their Z-scores, the 3D models of the target protein (or protein complex) were constructed using MODELLER . We consEh V-ATPase, flexible-fitting simulations were performed using cryo-fit with the MD engine, a modified version of GROMACS [Flexible fitting is aimed at fitting an atomic model to the density map derived from a cryo-EM experiment. In our scheme, we adopted the cryo-fit  or cryo- GROMACS .Hereinafter, we briefly summarize the method we adopted. The flexible-fitting protocol is fundamentally CCC-based fitting using MD simulation. This fitting was performed to try to maximize CCC without loss of structural features of the models such as secondary structure or residue–residue contacts. A benefit of CCC is that it is a measure of how the model fits a cryo-EM density map ,26. The n-th atom of the model and In addition, the Gaussian function of k is a parameter for the strength of the biased term along with the force field term and N stands for the number of heavy atoms. Furthermore, an additional term to maintain the residue–residue contact of the initial structure is used.The objective function of the flexible-fitting simulation includes the biased term For evaluation of the model in the terms of the goodness-of-fit to the EM map, cross-correlation-related (CC-related) values implemented in the map_model_cc module in PHENIX such as CCCCvolume  were usest peaks . PHENIX’C) score  implemenC) score  were useC) score .https://www.predictioncenter.org/casp13/multimer_results.cgi?target=T0984o, accessed on 10 January 2022). Our five submitted models were generated using the homology modeling pipeline explained herein. The PDB ID codes of the template used were 6C96 and 6C9A (both are homodimer structures) [For demonstration and comparison of the performance of our method with others, T0984o from CASP13 was selected . In CASPuctures) . First, uctures)  was usedEh V-ATPase was used. V-ATPase is a rotary molecular motor that actively transports ions coupled with ATP hydrolysis. It comprises 24 chains with 9 types of subunits , as shown in Eh VEh V-ATPase , DF-comde: 2BL2 ), A3B3-cde: 2BL2 ), and A3de: 2BL2 ). The fiEMD-9661 ). Here, Eh V-ATPase was used. First, the EM map was split into subunits with appropriate size using UCSF Chimera [The following strategy for modeling of  Chimera ,75. For  Chimera . Other s Chimera  score anThe superimposed structures between the PDB structure and our model with the highest CCC and TM-score (before and after fitting) are portrayed in The SMOC of each chain was also calculated for both the reference structure and for our model , indicatEh V-ATPase using our homology modeling pipeline and flexible fitting are examined. The structures of the complex of A- and B-subunits (A3B3-complex), complex of A-, B-, D-, and F-subunits (A3B3DF-complex or VThe results for the modeling of each subunit and the whole structure of We first examine how existing structures fit to the EM map (fragments). des 3VR4  (2.2 Å),des 3VR4  (3.9 Å),des 3VR4  (2.7 Å),des 3VR4  (3.0 Å),des 3VR4  (2.9 Å).Next we examine the results of homology modeling for E-, G-, a- and d-subunits, for which structures are unknown  [Finally, the most probable model for each subunit was selected based on the CCC and model quality scores. tructure . We comprom 5GAR  to 5Y5X.ynthase) , 3DHR (pynthase) , and 2XNOur developed homology modeling method is combined with cross-correlation-based flexible fitting to establish a method of constructing an atomic model based on an EM density map. Our homology modeling method is characterized by the adoption of enhanced profile–profile alignment in which our developed aligner, FORTE, is applied for alignment and comparison between profiles of templates and target proteins calculated in multiple ways. Due to FORTE-based alignment features, our homology modeling is expected to provide better initial structures for flexible-fitting simulation.Thermus thermophilus V/A-ATPase (T. thermophilus V-ATPase). This target was also elucidated structurally using cryo-EM techniques with multiple resolutions [Two examples of application of our modeling method using the cryo-EM data were presented herein. In the first example, the dimer structure of human TPC2, one target of CASP13, was modeled. The structure of this target had already been determined using an EM map with 3.5 Å resolution . This caolutions ,80,83. OEh V-ATPase was shown. In fact, Eh V-ATPase consists of 24 chains with 9 types of subunits. We constructed a reasonable model both in terms of fitting with the EM map and of model quality scores. It is noteworthy that the step of splitting the EM map into fragments was important for these models. Suitable fragments are useful for distinguishing between good and poor homology models. They often require manual tuning and repeated trials to partition the map properly. As already described in As a second example in this paper and as a practical demonstration, construction of the entire structure of The novelty and strength of our method lies in a combination of enhanced profile–profile analyses and a filtering/fitting method using cryo-EM data. Profile–profile alignment enables us to create a group of accurate alignments based on the sensitive search for the template library including distantly related alignments. Filtering with the correlation with the cryo-EM map enables us to select the appropriate alignment (model) among them. Flexible-fitting simulation biased to the EM map used was sufficiently powerful to raise a low CC-related value to a high CC-related value for models generated by our homology modeling. We expect that if homology modeling is self-sufficient based on scores within the method , then the final modeling is likely to be successful. Although few examples are presented herein, diversity does exist, as represented by homodimers and heterooligomers, and by those using multiple templates. It was possible to present some useful features and results of this method. In fact, this method is expected to play a valuable role in determining heterooligomer structures when the target EM data resolution is medium to low, and when the structures are outside the scope of ordinary de novo modeling methods.Finally, we described the effects of recent progress that has been made in AI-based modeling of protein structures: as described in the Introduction, AF2, today’s state-of-the-art AI-based structure prediction method, achieved a breakthrough for the modeling of a monomer structure. However, multimer predictions based on AF2 ,34,35 do


O(n2) instead of the O(n6) time complexity of the naive implementation of Sankoff-style algorithm for input RNA sequence of length n.Effective embedding is actively conducted by applying deep learning to biomolecular information. Obtaining better embeddings enhances the quality of downstream analyses, such as DNA sequence motif detection and protein function prediction. In this study, we adopt a pre-training algorithm for the effective embedding of RNA bases to acquire semantically rich representations and apply this algorithm to two fundamental RNA sequence problems: structural alignment and clustering. By using the pre-training algorithm to embed the four bases of RNA in a position-dependent manner using a large number of RNA sequences from various RNA families, a context-sensitive embedding representation is obtained. As a result, not only base information but also secondary structure and context information of RNA sequences are embedded for each base. We call this ‘informative base embedding’ and use it to achieve accuracies superior to those of existing state-of-the-art methods on RNA structural alignment and RNA family clustering tasks. Furthermore, upon performing RNA sequence alignment by combining this informative base embedding with a simple Needleman–Wunsch alignment algorithm, we succeed in calculating structural alignments with a time complexity of  Unstructured data, such as biological sequences and networks, require an embedding operation that encodes the unstructured data into a high-dimensional numerical vector space. This is a necessary step for processing unstructured data in downstream analysis using computational models such as neural networks. In the deep learning field, embedding using the pre-training framework with a large set of unlabelled data has been shown to be effective for the downstream supervised learning task even when smaller size of labelled data is available. When embedding an RNA sequence, each nucleotide  is usually encoded to a numerical representation so that the RNA sequence is embedded into a numerical vector. An effective embedding method further attempts to encode contextual information into the numerical vector representation . Word2vec, an effective word embedding technique  are not large enough to obtain an effective embedding when dna2vec is applied to base-by-base DNA sequence embedding.Recently, DNA, RNA and amino acid sequences have been attempted to be effectively embedded using deep representation learning, especially techniques developed in the field of natural language processing . These sechnique  that vecTwo recently developed state-of-the-art embedding methods, namely, embeddings from language models (ELMo) and bidirectional encoder representations from transformers (BERT), are used to generate context-sensitive distributed word representations ,7. In thIn this study, we propose RNABERT for the effective embedding of RNA bases by adopting the pre-training BERT algorithm to non-coding RNA (ncRNA). We apply informative base embedding to encode the characteristics of each RNA family and structure. To see whether this informative base embedding technique successfully captures these characteristics, we apply RNABERT to two basic RNA sequence analysis tasks: structural alignment and clustering. Then, we evaluate the quality of the informative base embedding results by structural alignment of RNA sequences and by RNA family clustering.O(n6) for the length n of input RNA sequences, and accelerating the Sankoff algorithm is an unsolved hard problem (O(n2) using the dynamic programming technique. Hence, we aim to apply the informative base embedding to determine the position-dependent and secondary structure-dependent score matrix in calculating alignments so that the structural alignment is obtained using a simple Needleman–Wunsch algorithm instead of the computationally expensive Sankoff-style algorithm.The first important problem in RNA sequence analysis is the structural alignment of RNA sequences, which calculates the alignment of not only RNA sequences but also their secondary structures. The most influential method for the structural alignment of RNA sequences is the Sankoff algorithm, which simultaneously performs secondary structure prediction and alignment . However problem . While S problem  and Dyna problem  calculat problem  determinBuilding an appropriate clustering algorithm for ncRNAs is an effective step towards unsupervised analysis of ncRNA sequences without their family labels ,16, as hFor our goals of RNA structural alignment of lower computational complexity and accurate RNA family clustering, we construct an informative base embedding method, RNABERT, for RNA sequences that takes into account the context and secondary structure of RNA sequences through two training tasks: MLM and structural alignment learning (SAL). In RNABERT, pre-training is performed using a large number of unlabelled ncRNA sequences. RNABERT introduces a novel pre-training task, SAL, in addition to the usual MLM task to more explicitly incorporate RNA secondary structure information into the base embedding for structural alignments. The SAL task employs pre-training using seed alignments obtained from the Rfam database  so that The architecture of the RNABERT model consists of three components: token and position embedding, a transformer layer and pre-training tasks. The input to RNABERT is an RNA sequence. First, the token embedding randomly generates a 120-dimensional numerical vector that encodes four RNA bases  and assigns the same vector to each base in the input RNA sequence. Second, the position embedding generates a 120-dimensional vector that encodes the position information of each base in the input RNA sequence. Third, the element-wise sum of token embedding and position embedding for each base in the input RNA sequence is fed to the transformer layer. The transformer layer component consists of a stack of six transformer layers, each of which is composed of a multi-head self-attention mechanism followed by a feedforward neural network. The final output from the transformer layer is an informative base embedding, denoted The self-attention mechanism  is a cenThe self-attention mechanism is described as mapping a query and a set of key-value pairs to an output sequence, where the query, key, and value are all matrices: query MLM is a task that masks a part of the input RNA sequence and predicts the masked part using the surrounding bases. The MLM task performs a base embedding so that the masked part can be restored, which enables context-sensitive embedding. First, 15% of the bases are randomly selected in a given RNA sequence for training. Next, one of the following three actions is performed on the selected base in the input: 80% of the selected bases are replaced with a token indicating an unspecified base  for the input RNA sequence of length n.A pairwise RNA sequence alignment based on the base embedding is calculated using the Needleman–Wunsch algorithm using the n and m. The similarity RNA family clustering is performed as the second evaluation test to confirm the quality of the informative base embedding. A similarity measure between two RNA sequences with respect to soft symmetric alignment  is definThe similarity O(n6) for RNA sequences of length n. PMcomp takes base-pairing probability matrices generated using McCaskill’s algorithm as the input and incorporates the energy information of each sequence into these matrices to quickly find common secondary structures and alignments (O(n4) is achieved by simplifying the dynamic programming method utilizing the fact that the base-pairing probability matrix is actually sparse. SPARSE (O(n3). R-Coffee is a multiple RNA alignment package that takes a similar strategy with our study by utilizing an alignment-scoring scheme that incorporates secondary structure information (O(n2). As R-Coffee makes use of the base-pairing probability calculated with McCaskill’s algorithm, it is considered as a type of structural alignment algorithm. TOPAS is a network-based scheme for pairwise structural alignment of RNAs that can handle pseudoknots (O(n4) in the worst case. TOPAS employs graph data structures to represent the RNA secondary structure including pseudoknots and designs an efficient algorithm to calculate an alignment of two graph structures by matching two nodes in two different graphs. Finally, MAFFT v7  and F1 score, which are calculated as follows. The number of true positives (TP)  is the number of positions Clustering accuracy was measured with the Rfam family as the true reference class. Three indices, namely, the adjusted Rand index (ARI), homogeneity, and completeness, were used to evaluate the clustering performance. The ARI is a measure of how well two types of clustering results match. ARI takes a real number from -1 to 1: if the value of ARI is -1, the two clustering results do not match at all, while a value of 1 indicates that they completely match. In this study, the ARI reflects how close the predicted clustering result is to the true reference class composed of the Rfam family.The ARI is derived from the Rand index (RI), defined as follows:For the pre-training of the MLM task, 76 237 human-derived small ncRNAs with lengths ranging from 20 to 440 bases from RNAcentral  were utiIn the training of the SAL task, two types of datasets, named TrainSet-A and TrainSet-B, were devised. In both datasets, the pairwise structural alignment extracted from Rfam alignment  was usedFor the structural alignment benchmark, we utilized the BRAliBase2.1 k2 database  used in To evaluate the clustering accuracy of RNABERT, the test dataset was collected from the BRAliBase2.1 database. The multiple alignment of each ncRNA family provided by the database was treated as a true reference cluster, and each ncRNA sequence in the multiple alignment was treated as a member sequence. All reference clusters with a sequence identity of <40% were selected. The dataset contained 37 RNA sequences and 12 RNA families. The RNA sequences used in the RNA family clustering test did not overlap with those used for the pre-training of the SAL task.The RNABERT model was implemented using PyTorch for deep learning. All experiments were run on Linux Red Hat 4.8.5–2  Xeon(R) Gold 6148). Optuna  was usedt-distributed stochastic neighbour embedding (t-SNE)  , which i (t-SNE) , left an (t-SNE) , right. Table O(n2) for two sequences of length n. We achieved high-speed computation by implementing the deep learning algorithm using Python and PyTorch while implementing the Needleman–Wunsch algorithm in C++. Note that the loading time of the transformer model into the GPU was excluded from the time measurement of pairwise alignment by RNABERT. The typical amount of time needed to load the transformer model onto GPU was around 4.376 s. In addition, the maximum memory consumption for the RNA structural alignment was around 35.2G bytes in RNABERT.In terms of computation time, RNABERT was faster than the existing state-of-the-art algorithms and even faster than the sequence-based  alignment algorithm MAFFT. The alignment computation of RNABERT consists of three sub-procedures: the first procedure (transformer) obtains the embedding of each base, the second procedure calculates the match score between the two input sequences, and the third procedure calculates the alignment by the Needleman–Wunsch algorithm. The first two procedures can be accelerated by GPU computation, and the Needleman–Wunsch algorithm is a simple algorithm that requires a computation time of Figure Table Several well-known sequence motifs in the snoRNA and tRNA families were identified by observing the attention maps. Attention maps, which indicate the ratios of contribution to the MLM task, were extracted from the final transformer layer of RNABERT, and sequence motifs were detected from the attention maps. The ‘UUCGA’ sequence motif shown in Figure In this study, we performed two tasks to obtain informative base embeddings. The MLM task is a fundamental step in the original BERT algorithm, whereas SAL is a novel RNA sequence-specific task introduced in this study. To determine whether these tasks effectively incorporate RNA secondary structure information into base embeddings, we performed two tests, RNA clustering and sequence alignment.O(n2) for two sequences of length n.Sankoff-style algorithm provides high structural alignment accuracy, but these algorithms are usually very complex in both time and space. Unlike the many structural alignment algorithms based on the Sankoff algorithm, RNABERT does not explicitly consider RNA folding and boasts a high structural alignment accuracy. This is considered to be evidence that the base embedding encodes the secondary structure information specific to RNAs. Furthermore, while RNABERT achieves the same accuracy as Sankoff-style algorithms, it is much faster because it uses a simple sequence-based alignment algorithm. In fact, the time complexity of the RNABERT algorithm is only SPARSE  achievesPerformance evaluation was done for two types of training datasets, TrainSet-A and TrainSet-B. TrainSet-A contains the same RNA families as the benchmark test dataset while TrainSet-B has no RNA family overlap with the test dataset. When TrainSet-A was used, RNABERT exhibited a superior accuracy than state-of-the-art existing structural alignment methods. When TrainSet-B was used, the performance of RNABERT was still sufficiently high and comparable to the one using TrainSet-A. This result shows that RNABERT has succeeded in proposing a new scoring scheme for sequence-based alignment algorithms to accomplish RNA structural alignment and has sufficient generalization ability. It has to be noted that with the development of high-throughput sequencing, hundreds of thousands of ncRNAs have been detected, but many have not been annotated yet. In fact, 86% (24 972 896) of the 28 895 596 ncRNAs present in RNAcentral do not have gene ontology (GO) annotations. Therefore, fast and accurate structural alignment of unknown sequences of existing RNA families is still practically valuable and RNABERT could contribute to the annotation of such novel transcripts.The base embeddings obtained by RNABERT are applicable to various fields in RNA informatics. One immediate problem is the multiple structural alignment of RNA sequences. RNABERT can be expected to accomplish this task by combining existing sequence-based multiple alignment algorithms such as MUSCLE  and MAFFructures ,41,42. Shttps://github.com/mana438/RNABERT.git.The codes, pre-trained RNABERT model, and all datasets used in this study are available at lqac012_Supplemental_FileClick here for additional data file.


Goal: Over the decades, there have been improvements in the sequence alignment algorithm, with significant advances in various aspects such as complexity and accuracy. However, human-defined algorithms have an explicit limitation in view of developmental completeness. This paper introduces a novel local alignment method to obtain optimal sequence alignment based on reinforcement learning. Methods: There is a DQNalign algorithm that learns and performs sequence alignment through deep reinforcement learning. This paper proposes a DQN x-drop algorithm that performs local alignment without human intervention by combining the x-drop algorithm with this DQNalign algorithm. The proposed algorithm performs local alignment by repeatedly observing the subsequences and selecting the next alignment direction until the x-drop algorithm terminates the DQNalign algorithm. This proposed algorithm has an advantage in view of linear computational complexity compared to conventional local alignment algorithms. Results: This paper compares alignment performance (coverage and identity) and complexity for a fair comparison between the proposed DQN x-drop algorithm and the conventional greedy x-drop algorithm. Firstly, we prove the proposed algorithm's superiority by comparing the two algorithms’ computational complexity through numerical analysis. After that, we tested the alignment performance actual HEV and E.coli sequence datasets. The proposed method shows the comparable identity and coverage performance to the conventional alignment method while having linear complexity for the Conclusions: Through this study, it was possible to confirm the possibility of a new local alignment algorithm that minimizes computational complexity without human intervention. I.Sequence alignment is one of the popular methods for analyzing the relationship between biological information by finding similarities between various biological sequence data such as DNA, RNA, and protein. In the early stage of sequencing technology, the dynamic programming-based conventional alignment method was sufficient to analyze the sequences with few nucleotides There are many types of the sequence alignment methods depending on the application, such as sequencing sequences with semi-global alignments in NGS, as well as comparing sequences with global, local, and multiple sequence alignments. In the development of methodologies such as global alignment, semi-global alignment, local alignment, and multiple sequence alignment, various heuristic sequence alignment methods were studied to improve the sequence alignment's performance Recently, there have been several efforts to solve the problems of conventional alignment methods. The greedy x-drop algorithm is one of the famous algorithms among the local alignment methods. The greedy x-drop algorithm is an alignment method that terminates the expansion process if the difference between current alignment score and the best alignment score is larger than X. Since conventional algorithm has a complexity linearly proportional to the alignment's length, the complexity problem seems to be solved. However, this greedy x-drop algorithm also has a complexity proportional to a square of the given Up to now, many attempts have recently been made to apply deep learning into sequence comparison researches. At first, there were methods to analyze the result of sequence alignment to classify the sequences or to predict protein structure or analyze the characteristics of sequences with alignment-free features In the previous paper, the authors proposed a method called DQNalign that repeats selecting the next alignment direction while sliding a window using a deep reinforcement learning method. Here, the deep reinforcement learning method is one of the deep learning methods that the deep neural network-based agent select optimal actions to get the maximal total reward in a given environment In this paper, we tried to examine the adaptability of this alignment method called DQNalign to various sequence alignments. The DQNalign algorithm, which performs alignment through window sliding, is similar to the gapped extension algorithm in the conventional local alignment method. Therefore, we tried to combine DQNalign with the local alignment method to compare two long complete genomes. So, we developed a novel local alignment algorithm by combining the x-drop algorithm with the DQNalign algorithm. The proposed DQN x-drop algorithm has the advantage of an utterly linear alignment method. Based on this advantage, the proposed algorithm can perform a broader search with low complexity than the conventional greedy x-drop algorithm.This paper deals with a new local alignment method based on deep reinforcement learning: In II.https://github.com/syjqkrtk/DQNalign.In this paper, we will propose a novel type of the local alignment by combining DQNalign with x-drop algorithm. The detailed explanation and the code implementation of the proposed DQN x-drop algorithm are available at A.We will briefly introduce the conventional greedy x-drop algorithm. A greedy x-drop algorithm is a method used in various sequence alignment methods and is a method used to extend the gapped alignment. First, the x-drop algorithm is a method of terminating the alignment when the alignment score falls below the highest score observed so far In particular, the greedy x-drop algorithm is a method that combines dynamic programming-based optimal alignment and x-drop algorithm. Alignment scores are calculated based on the Smith-Waterman algorithm, and the alignment ends when the score falls by more than In this paper, BLAST is used as a representative tool of the greedy x-drop algorithm. BLAST is an algorithm that is considered one of the state-of-the-art tools for searching local alignments B.1)Before explaining the proposed DQN x-drop algorithm, we will briefly describe the DQNalign algorithm. DQNalign is an algorithm for aligning sequence pairs using a deep reinforcement learning algorithm To enable reinforcement learning in sequence alignment system, we defined state, action, and reward as follows: sub-sequence pair, alignment direction , and alignment scoring system . First, we defined a sub-sequence pair of window sizes as a state in two sequence pairs. And the alignment directions are treated as actions. Then, we can get the changed sequence alignment score as a reward which is decided by selecting alignment directions in the current sub-sequence pair. By defining state, action, and reward, we tried to predict the sum of future rewards for the next alignment direction in a given sub-sequence pair and to advance in the optimal direction through this reinforcement learning system. In this reinforcement learning system, we used the Dueling Double DQN which is one of representative methods of deep reinforcement learning. In detail, Dueling Double DQN uses two different techniques: Dueling DQN and Double DQN. Dueling DQN separates the Q-value into two values . Each value represents the expected sum of future rewards of state and actions. Dueling DQN prevents instability in the learning process. Besides, Double DQN method uses two similar network named main network and target network. The target network slowly approaches to the main network. And, in the training procedure, the action is determined by the Q-values calculated by the target network. Double DQN enables stable selection in the training procedure.Moreover, we used the Here, we introduce two network structures optimized in the sequence alignment system: DDDQN and faster DDDQN. The detailed DQN structure is depicted in Fig. S1 and Fig. S2. Each network is focused on performance and speed, and in this paper, we used a faster DDDQN structure considering speed to focus the advantage of our algorithm. In detail, DDDQN structure only used the existing methods described above. But,in the case of faster DDDQN, the separable convolutional layer is used which has same the perspective field compared to conventional convolutional layer, but the complexity is greatly reduced. With faster DDDQN structure, we were able to reduce the operations about 1/9 to 1/26 times compared to the DDDQN structure.2)In the early DQNalign, the alignment agent was trained in the environment of virtual sequence sets created by the JC69 model We set the environment distribution with various SNP, indel probability, and maximum indel length with uniform distribution within the range shown in Table S4. In each step of the outer loop, one environment is determined from this environment distribution. In the inner loop, two sequences are generated from the environment. Then, the agent is trained by a general DQN process, and the trained network is tested against other sequences created in the same environment. All the state, action and reward are recorded in the episode buffer. Finally, the initial network in Algorithm 1:1:Inputs:2:Initialize:Initialize a network Initialize a replay memory in outer loop 3:fordo4:Pick 5:Set 6:Generate two random sequence 7:Mutate 8:Initialize a replay memory in inner loop 9:Copy 10:11:fordo12:13:14:15:16:Move position 17:Get a reward 18:Append 19:Update network 20:end for21:Test network 22:Append new trajectories to 23:Update network 24:end for25:return3)In order to perform local alignment using DQNalign, the x-drop algorithm was applied to the DQNalign algorithm. In Algorithm Algorithm 2:1:Inputs:2:Initialize:3:whiledo4:5:6:7:8:Move position 9:Append 10:Get a reward 11:12:ifthen13:14:15:end if16:end while17:returnIII.To show the feasibility and performance of the proposed DQN x-drop algorithm, we designed the following three comparisons: 1. Complexity analysis, 2. Performance comparison according to various window sizes, 3. Alignment time comparison according to x-drop parameter and alignment length. Based on these metrics, we will show how the DQNalign method can improve the conventional greedy x-drop algorithm. Also, all of these alignment results are included in Supplementary material S2.A.For complexity analysis of the proposed method, first of all, we tried to derive the relationship between the window size and the x-drop parameter. Then, we used reference papers Here, Secondly, we intend to get the expected value of In the x-drop algorithm of the proposed scheme, since the alignment is unconditionally terminated when there are Here, Thirdly, using this function Here, we express the terms except the window size as constants A and B for the convenience of expression. In case of any Fourthly, we will derive the relationship between window size and X parameter. According to the Lopital's theorem, if the denominator in From Fifthly, using the relationship between the window size and B.To show the performance difference according to various window sizes, we used the HEV sequence set in Table S5. We grouped HEV sequences as Intra-genotype and Inter-genotype to distinguish the performance of same genotypes from that of different genotypes, respectively. In detail, the total number of sequence pairs for all 47 sequences is 1081. Then, Intra-genotype consists of 332 sequence pairs and Inter-genotype consists of 749 sequence pairs. Also, we compared the coverage and identity performance of the conventional local alignment algorithms with those of the proposed DQN x-drop algorithm, as shown in As shown in C.E.coli sequences (Escherichia coli O157 and Escherichia coli K-12) Furthermore, we tried to compare the execution time of the conventional greedy x-drop algorithm with that of the proposed DQN x-drop algorithm for two As can be seen from the results, an increase in the window size generally leads to a longer operation time. In a faster DDDQN structure, we replace the convolutional layer with a separable convolutional layer. Thus, we can reduce the convolutional layer's computational complexity, which is proportional to window size. However, the fully connected layer, which has constant complexity, becomes more extensive than the convolutional layer's operation time in the small window sizes.In addition, we compared the execution time of the proposed algorithm with that of the conventional algorithm, as shown in E.coli cases, which shows high accuracy and low complexity results as shown in In detail, when the window size is 10, the number of exact matches is decreased because the alignment performance is insufficient, which brings the increase of the total number of the network calculation. Also, the alignment execution time results are similar in case of W=10 and W=100. On the other hand, when the window size is 1000, we can confirm that the complexity increases and the computation time increase rapidly. For these reasons, we consider that 100 was the best window size for IV.We analyzed the computational complexity of proposed and conventional algorithms theoretically, and we verified through simulation for real E.coli genomes. Further, we confirmed that the alignment time increases linearly in proportion to the X and the alignment length.Moreover, we showed that the proposed algorithm could obtain similar alignment performance to the conventional algorithm with less complexity. That is verified by the alignment performance of the proposed algorithm for the real HEV genomes. As the window size increased, our method showed high accuracy. Despite the significant improvement in complexity, the proposed DQN x-drop method showed the same level of accuracy as the conventional method.In addition, we compared the total execution time according to the change of X. Then, we could see that the proposed algorithm has a significant advantage in terms of complexity in the case of large X, even in the actual alignment.A. At present, we used four small separable convolutional layers because of the complexity limitation of the current deep learning technology. But we expected that the improvement of the network operation speed, layer structure, optimizer and learning strategies can improve both the performance and complexity of the DQNalign methodology.On the ohter hand, various MSA methodologies have been developed using dynamic programming whose complexity is proportional to the power of the number of sequences and progressive methods whose complexity is proportional to the square of the number of sequences. However, an MSA method with linear complexity has not yet been proposed. In future, we intend to develop a multiple sequence alignment methods using DQNalign. To perform neural network computation for an unspecified number of input sequences, we are willing to use recurrent neural networks used in time series data, and will show a different innovative improvement to solve the multiple sequence alignment problem.V.The two supplementary materials are included in this submission. The detailed figures, simulation parameters, and the HEV sequences list are included in the Supplementary material S1. Moreover, the alignment results of the simulations are included in the Supplementary material S2.


Levenshtein edit distance has played a central role—both past and present—in sequence alignment in particular and biological database similarity search in general. We start our review with a history of dynamic programming algorithms for computing Levenshtein distance and sequence alignments. Following, we describe how those algorithms led to heuristics employed in the most widely used software in bioinformatics, BLAST, a program to search DNA and protein databases for evolutionarily relevant similarities. More recently, the advent of modern genomic sequencing and the volume of data it generates has resulted in a return to the problem of local alignment. We conclude with how the mathematical formulation of Levenshtein distance as a metric made possible additional optimizations to similarity search in biological contexts. These modern optimizations are built around the low metric entropy and fractional dimensionality of biological databases, enabling orders of magnitude acceleration of biological similarity search. I.n points in {0, 1}n space. He introduced a distance or metric on this space by setting D equal to the number of coordinates where xi ≠ yi. This metric counts the number of substitutions needed to change x into y  and is now called Hamming distance. Leven-shtein’s main interest is extending Hamming’s error correction results to include the case of allowing single letters to be inserted or deleted. His metric is the count of the minimum number of substitutions and single letter insertions or deletions to change x into y. This metric is known as Levenshtein distance, and it is clear that computing Levenshtein distance is more challenging than computing Hamming distance. Levenshtein also discusses counting reversals by which he means interchanging the order of two adjacent symbols in one sequence. In this paper, we will follow the developments of sequence distance metrics and sequence comparison in the biological sciences where it has proved to be crucially important. We will indicate the relevance of the methods of comparison to biology, including the complexity of computing the comparison statistics. Coding and information theory is not our focus here but it plays an important role in recent developments.In 1965 V. I. Levenshtein published “Binary codes capable of correcting deletions, insertions, and reversals,” a landmark paper  and is hr-letter abbreviations to an n-letter word. Motivated by information theory, to compute his abbreviation he uses both letter position in the word as well as frequency of errors in that position and word length to compute similarity. This binning of words greatly shortens search of the vocabulary. Damerau approaches this problem by precomputing the vocabulary words as number of characters and a 28-bit character register , c, c30], ck-word of the query. Note that for protein sequences with a 20 letter alphabet, the word neighborhood surrounding each k-word is very large. Step one of the algorithm is to calculate all k-words which would constitute a statistically significant match, greatly reducing the computing time compared to the method of , p, p32], pethod of . The nexFor example, in the earlier example of a local alignment of two strings, let our query sequence be AACGCAAAAACGT CGTCGTTT, which has the following 6-mers: {AACGCA, ACGCAA, CGCAAA, GCAAAA, CAAAAA, AAAAAC, AAAACG, AAACGT, AACGTC, ACGTCG, CGTCGT, GTCGTC, TCGTCG, GTCGTT, TCGTTT}. Exact matches are very often statistically significant, though in principle, anything in the word neighborhood (e.g. CAAAAA –> CAAAAC) could be significant, depending on the generalized edit distance used. Then in order to find high-scoring local alignments, we need only find exact matches in the target seqeunce TTCGTCGTCGTAAAACGTTAA to significant matches in the word neighborhood of the query, and then perform S-W around those matches.BLAST introduced many other computational optimizations to the pairwise sequence comparison problem. There are however many reviews already of BLAST and its variants –35], so, so35], k-mers  However, the asymmetry between query and database can be further exploited to reduce runtime by preprocessing the database. One of the early examples of this was in 2002, when BLAT  . Th. Th44]. Haemophilus influenzae, yeast, fruit fly, and of course human genomes —it —it Haemo genomes , 65]. W. WHaemop genomes –69], ma, maHaemoWith Next-Generation Sequencing (NGS) technologies, read lengths became shorter  yet more frequent . This dek-mers of the target genome in a fast, compressed data structure (through e.g. the FM-index or a hash table), so when a query read is input, they simply have to match k-mers in the query read to k-mers in the genome to find a starting point for a local alignment. Additionally, because read mapping admits lower sensitivity than sequence comparison search (it is not a travesty if a few reads do not get mapped), many mappers also employ a less sensitive ‘seed-and-extend’ strategy instead of a full local alignment: e.g. some early mappers  ignoredBowtie 1 ).We note here that there are several variants of the read mapping problem. The most common is ‘best-mapping’, which seeks to find the highest scoring local alignment of the entire read to the genome. Alternately, the ‘all-mapping’ task can be thought of as a threshold variant of the task, where given a threshold, we seek to find all local alignments of the read with score above that threshold. Finally, the ‘any-mapping’ task seeks only to find a single local alignment of the read above that threshold. We note that the all-mapping task is most similar in spirit to the sequence comparison task covered in the last section. Importantly, while we have presented the sequence comparison component of read mappers, read mapping is not a simple database search for approximately matching strings. Instead, modern read mappers will often make use of additional information about the genome sequencing machine’s confidence in its nucleotide measurements to build a probabilistic model of best matches. For more details on the vast field of read-mapping algorithms, we refer the reader to several other surveys , 82], , .III.k-mers. Especially once it came time for read mapping, the algorithms gained effectiveness partially through assumptions (both implicit and explicit) on the nature of particular sequencing technologies—indeed, as 3rd generation sequencing technologies  time, where S is the metric covering number of the database, a quantity closely related to both the metric (Kolmogorov) entropy  and andO(S)  entropy  of the d entropy , 98]– a aN2ϵent(Nϵent(A) , to matcϵ-sided hypercubes . H. Hϵ-sideX be the space of strings over a fixed alphabet with the Levenshtein distance as metric. Then given two strings x1 and x2, we can encode x2 in terms of x1 via the pairwise alignment, which we will denote via x2 − x1—i.e. we keep a list of the ordered insertions, deletions and substitutions needed to convert x1 to x2. For strings x1 = AAAACCCC and x2 = AAACCCTG, x2 −x1 = {, , }. Each edit can be encoded in O(log n), where n is the maximum of the lengths of x1 and x2, bits of information because the choice of indel or substitution takes constant additional information once the position in the string is specified. Let the Shannon entropy H(x1) of a string be the number of bits of information needed to specify that string . Given an encoding as an edit list, the Shannon entropy H({x2 − x1}) can be bounded by the number of edits times the logarithm of the string length. This implies that the Shannon entropy of the concatenation of two strings H ≤ H(x1) + H(x2 − x1).Thus one might ask, why define metric entropy without the logarithm? Consider the following: let A| < ∞, H ⊂ A) ≤ |B ⊂ A|ϵ log(n) + H(ai). That is to say, we can encode the entire metric ball by encoding the center element, and then encoding the list of edits needed to form the other objects within the ball—note that depending on the distribution within the ball, the optimal encoding need not use the center as reference, but that still provides a useful upper bound. Given a suitable uniformity assumption on the number of elements within each of the balls of an internal cover on A , for some constant K) and the lengths of the ai’s , this analysis shows that the covering number is proportional to the Shannon entropy of the dataset. As such, defining metric entropy without the logarithm makes it (roughly) proportional to the Shannon entropy under these circumstances. We will soon see that when these conditions are satisfied, a straightforward cluster-based similarity search has runtime roughly linear in the metric entropy, or covering number  dimensionDefinition 3.4: The local fractal dimension at a scale r and range s isA with respect to the number of points contained in a metric ball as we vary the radius of the ball. When the fractal dimension is low, that implies that all of the set A lives close to a low-dimensional manifold, and is not dense in the space X, allowing us to avoid the curse of dimensionality which often troubles similarity search . . A into  suggest . We visuorders of magnitude acceleration of BLAST variants—including genomic, protein, and metagenomic sequence comparison—when the database is much larger than the query sequence , [, [orderssequence  (See htt mappers . Similar mappers  and in o mappers  and smal mappers .IV.k-mer matching have partially supplanted the direct optimization of Levenshtein distance through dynamic programming, his formulation of metric string distance remains relevant to this day and a source of inspiration for active research.As bioinformatics data continues to grow in volume and ease of acquisition, it is essential to develop more sophisticated algorithms for data processing . Levensh


There is an ever-increasing hum-and-haw in our daily lives due to the multitude of choices at our disposal. This has led to the establishment of lists, scoring, and ranking systems on the world wide web. Ranked lists thrive primarily because they provide a sense of objective measure that appeals to the human brain, which is wired to work best when there is a reference point.Some rankings are based on subjective experiences of humans, for example, hotel reviews on Tripadvisor. Other rankings are calculated by machines that execute algorithms which are written by humans. This begs the question: is ranking objective or subjective? Is ranking a feature of modern times? Perhaps a by-product of Google's dominance of the internet? Or, is this a natural product of the evolutionary neuronal wiring that guides our social behavior?Ranking: The Unwritten Rules of the Social Games We All Play provides a way of entering this fascinating world. Erdi's account is a stimulating story of the origins of ranking in our society and its impact on the social behavior of humans and animals. Anecdotal narratives, incidents, and experiences are drawn from the author's life, to explain the hard and complex concepts that underlie ranking and rating, which is a consistent feature of the book.Peter Erdi's book illusion of objectivity” that informs objective ranking. The author discusses two other means of objective ranking, including the social dynamics underlying election manipulation and “self-appointed rankers.”In the Prolog the author paints a nostalgic picture of his childhood, when the love of soccer served as the first lesson on how post-war socio-economic settings impact simple rating exercises for school going boys. He describes how ratings of soccer players by journalists were based on their subjective take on a player's performance or even personality, an example of the “I bought a six-year-old Trabant in my mid-30s as my first car.” Loaded with humor (and one of my favorite sentences in the book), it is a demonstration of how one's social rank is often associated with their financial assets. This reference is followed by a delightfully sarcastic exchange between a donkey and a Trabant. Underlying this story, weaving in humor and anecdotes, is a demonstration of how mathematics and sports are the only two fields that come close to handling ranked lists in the purest form possible.From Chapter 2 onwards, the author starts to dive deeper into the topic. Comparison is second nature to people as cognitive and social beings. Humans rank themselves by comparing themselves with neighbors, friends, colleagues, and others. To demonstrate such “extrinsic driven self-ranking,” the author notes the following: “Kim when he was being trained to remember “long lists” — enthusiastic readers will be tempted to give it a go.The author's eye for details stands out. Readers will learn about motor cars in post-world-war Eastern Europe, whilst at the same time becoming aware of the Erdos Number, a measure that mathematicians and scientists use to rank themselves, and the Elo number, which was originally used to rank chess players. The most fun part of this section is the story of Rudyard Kipling's novel while we are not very good at memorizing long lists, lists still help us process sensory information. In addition, reading listicles can give us the impression that we have gained complete knowledge about a certain topic.” [p. 211].As Erdi writes, “Chapter 3 discusses the story of a plethora of ranking mechanisms — from the social ranking implied by the Japanese bowing hierarchy and Roman Toga colors, to Network Society, a laterally connected  society that may have more than one “leader” depending on what measure is used i.e., what is the problem at hand.ranked list of Search Engines.” Note that we are now ranking the rankers; more specifically, we are “Ranking the Ranking of the Rankers.” The author draws attention to this never-ending loop — “when you see a list of colleges or countries based on any criteria, nobody will tell you that the ranked list is produced by some random algorithms.” By changing just one parameter in the ranking algorithm, the output, i.e., the order of the ranked list changes.When one talks about ranking, can the multinational technology company Google go unmentioned? Chapter 4 introduces and discusses how and why Google's page algorithm came to top the “sources of cognitive bias and its effect on our thoughts and behaviors. Because we are presented with an abundance of information and limited capacity for making decisions, we use mental shortcuts or heuristics to help us act on the information presented by the world around us. One such heuristic that we previously mentioned is satisficing, seeking a “good-enough” decision rather than a perfect one. But there are many heuristics we unconsciously use in our day-to-day lives as a means of compensating for our cognitive shortcomings. This points to our fascination with lists” [p. 127].Chapters 4 and 5 discuss the many “Ranking games” that we as a society play every day, including worldwide university rankings, fake reviews on Tripadvisor, and a nuanced analysis (in context) of the recent controversies concerning the Oscar awards ceremonies. The discussion on quantifying artistic success is noteworthy.Chapters 6 to 8 take us on a joy ride with the different facets of the “like it or not, ranking is with us. It is not a magic bullet that produces order out of chaos, but it is not the product of some random procedure ” [p. 207]. As a reputed scientist and a teacher in complex systems, it is perhaps not surprising that Erdi deftly handles the extremely vast and complex theories of ranking and rating, and how they impact our everyday lives. This serious issue is well-narrated with engrossing anecdotal examples, and a generous dose of (subtle) humor and will resonate with professionals and scholars from all walks of life, a must-read.As Erdi observes, whether we “The author confirms being the sole contributor of this work and has approved it for publication.The author declares that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.


However, current methods for detecting recombinants are primarily designed for aligned sequences. Thus, they struggle with analyses of highly diverse genes, such as the α types in var genes from Ghana, observing that sequences belonging to the same ups group or domain subclass recombine amongst themselves more frequently, and that non-recombinant DBLα types are more conserved than recombinant ones.We introduce an algorithm to detect recent recombinant sequences from a dataset without a full multiple alignment. Our algorithm can handle thousands of gene-length sequences without the need for a reference panel. We demonstrate the accuracy of our algorithm through extensive numerical simulations; in particular, it maintains its effectiveness in the presence of insertions and deletions. We apply our algorithm to a dataset of 17 335 DBLhttps://github.com/qianfeng2/detREC_program.Source code is freely available at Bioinformatics online. Recombination, the exchange of genetic materials between two molecular sequences, is a fundamental evolutionary process in viruses, prokaryotes, eukaryotes and even between kingdoms. The biological mechanisms of recombination, which differ across different species, lead to the creation of novel ‘mosaic’ sequences in which different regions have distinct evolutionary histories.Plasmodium falciparum , which is the main target of the human immune response to the blood stages of infection. The var genes are a large and diverse gene family (up to 60 copies per genome), and high levels of diversity in the var genes have been observed in a single parasite genome, as well as small local populations  members of the var multigene family. This domain has been found to be immunogenic  we return to copying characters from the current source sequence.δ, gap extension ϵ and recombination (source switching) ρ. We first set ρ to zero, and compute maximum likelihood estimates for δ and ϵ with the Baum-Welch algorithm . The result is a ‘mosaic’ alignment for each sequence to a series of segments from the other sequences in the dataset. An example of this can be seen in δ and ϵ, and calculate the composite likelihood over 1000 randomly selected sequences to estimate ρ. This allows us to analyze large datasets (such as the DBLα dataset in Section 3.2) in a practical timeframe with only a small loss in accuracy.For large-scale datasets, training the JHMM model is a significant bottleneck for our method. We again follow For each breakpoint in each sequence, we identify the triple of the target sequence and the two sequences which contain the source segments before and after the breakpoint as a ‘recombinant triple’, that is, the two parents and the child of a recombination. This results in a list of recombinant triples, some of which may refer to the same recombination event. The JHMM method only provides a pairwise alignment of each target segment to one source segment. We take these pairwise alignments and add the corresponding segment from the remaining source sequence in the triple, using the MAFFT algorithm . For eacNote that, we require a sufficient sequence length on either side of the breakpoint to calculate distances accurately. Moreover, we observe in practice that short source segments resulting from the JHMM method tend to be artifacts of the method, rather than representing multiple consecutive recombinations. To address this, we exclude triples for which the aligned segment on either side of the breakpoint has length less than 10, which we found to be a suitable threshold in practice.We now apply the well-known principle  that twoa, b, c}, the evolutionary distance between each pair of segments before and after the breakpoint. We use here the BLOSUM62 distance (D1 and D2 for the first (pre-breakpoint) and second (post-breakpoint) segment, respectively. The pair with the smallest absolute difference in distance before and after the breakpoint are inferred to be the two non-recombinant sequences, while the third is inferred to be recombinant. Formally, we haveWe calculate, for each recombinant triple {distance  for aminThis method identifies one recombinant from each recombinant triple; note that one recombination may generate one or more triples, but the identified recombinant from each of these triples should be the same. We apply this to all triples identified above, generating a list of recombinants in the entire dataset and their putative parents.In addition to identifying recombinant sequences, we can also measure the uncertainty in our identification by using bootstrapping. For each multiple alignment of a triple, we resample characters in the alignment (columns) within each segment, with replacement. This provides us with a resampled alignment, and we generate 100 replicates per triple. We then run our distance-based method to identify the recombinant for each replicate. The proportion of replicates which infer the same recombinant as the original alignment is the support value of this detection. The larger the support value, the more certain we are of the detection.We conducted extensive simulations to evaluate the effectiveness of our method. Our simulation protocol is as follows:msprime  under the coalescent (without recombination) using Pyvolve , and unequal-length sequences with indel events, generating unaligned input.There are a wide variety of parameters which could potentially affect the performance of the method. We vary the proportion of recombinant sequences in the dataset; the number of recombinations per recombinant; the number of sequences in the dataset; the sequence length; the mutation rate; and the substitution model. For simulations with insertions and deletions, we also vary indel rate and size. To keep our simulations tractable, we only vary one parameter at a time, keeping the remainder fixed at default values . For eacOur results are shown in An important feature of our method is its ability to accept unaligned sequences as input. When we include indels in the generating process, we can see  that botWe also compared our method with a number of popular recombinant detection methods, after aligning the simulated sequences. We note that these methods only accept aligned sequences, making a direct comparison potentially biased one way or the other (depending on whether the sequences have indels or not). Despite this, we can see  that ourFinally, we studied the distributions of the support values for true and false detections, and the accuracy of the JHMM methods in our simulations (Supplementary Sections S2.3 and S2.4).var genes have focused on sequencing the DBLα domain, since nearly all var genes encode a single DBLα domain. We applied our method to detect recombinants and breakpoints in a dataset of DBLα sequences collected from individuals with microscopically confirmed P.falciparum infections (isolates) living in the Bongo District, in the Upper East region of northern Ghana (GenBank BioProject Number: PRJNA396962) . Of these, we detected 14 801 (85.4%) to be recombinant. See Population genetic studies of 3.2.1var gene can be classified into three main ups groups, upsA, upsB and upsC  Our results strongly reinforce the conclusions of earlier studies, and provide more precision with the division into three ups groups.We calculated the proportion of recombination triples which have one parent and the child, both parents and both parents and the child belonging to the same ups group . These subclasses are strongly associated with ups groups; however, they also provide greater resolution in dividing the sequences. We thus repeated our earlier analyses with regards to the subclasses. As with ups group, we found a significant  which were significantly different from the average under a Bonferroni correction for multiple testing. Of particular note is the DBLα0.1 subclass, which has been noted to involve more recombinations than other subclasses  that the isolates were collected from. We did not detect any significant differences here see .3.2.3α types are highly conserved (appear in many different isolates) in a population .We investigated this hypothesis via the recombinants identified by our method. First, we compared the observed frequencies in the dataset of the recombinants to the non-recombinants; we found that non-recombinants occurred significantly more often  occur frequently in The positions of recombination breakpoints, as found by the JHMM method, are shown in The recombination rate is not constant throughout the sequence, but displays three distinct peaks spaced in roughly equal intervals. These peaks clearly correspond to the three most frequent homology blocks, HB5, 14 and 36, with the height of the peak also corresponding to the frequency of the HB.The frequency of breakpoints drops sharply toward either end of the sequence. This is an artifact of the method and does not imply that the recombination rate is lower there; we cannot recognize a recombination which is close to one end of the sequence.This reinforces the biological theory that recombination occurs within short identical segments  may help in this regard, as the lineages must diverge beyond this threshold to be distinguished. The use of different clustering thresholds may affect the results, potentially unlocking access to signals of older recombinations.As noted above, our method is designed to only detect recent recombinants, which have not yet diverged in the dataset. For example, if a more ancient recombination produces a lineage that diverges into two sequences, they will be preferentially matched to each other by the JHMM, and it is possible that no recombination will be detected. The initial clustering of DBLNote that it is uncertain how long a recombinant will remain recent for, and this may well depend on sampling coverage and sample size. For example, although recombination events have been reported on timescales of several years  assumption which we make to obtain a tractable algorithm. As seen from our results, we do appear to obtain good accuracy with our detections even in cases where this assumption might not hold; assessing the exact impact of this assumption on our results is also the subject of future work.var genes, our approach is not restricted to these genes, but could be used for any genes which are recombinant but lack a reliable alignment or reference panel. The scalability of our method means that it will be applicable even to large datasets, thus holding great promise for broader applications.Although our methods are motivated primarily by the highly recombinant btac012_Supplementary_MaterialsClick here for additional data file.


Erysiphe necator. Based on alignment rate and gene coverage, all aligners performed well with the exception of TopHat2, which HISAT2 superseded. BWA perhaps had the best performance in these metrics, except for longer transcripts (>500 bp) for which HISAT2 and STAR performed well. HISAT2 was ~3-fold faster than the next fastest aligner in runtime, which we consider a secondary factor in most alignments. At the end, this direct comparison of commonly used aligners illustrates key considerations when choosing which tool to use for the specific sequencing data and objectives. No single tool meets all needs for every user, and there are many quality aligners available.Aligning short-read sequences is the foundational step to most genomic and transcriptomic analyses, but not all tools perform equally, and choosing among the growing body of available tools can be daunting. Here, in order to increase awareness in the research community, we discuss the merits of common algorithms and programs in a way that should be approachable to biologists with limited experience in bioinformatics. We will only in passing consider the effects of data cleanup, a precursor analysis to most alignment tools, and no consideration will be given to downstream processing of the aligned fragments. To compare aligners , an RNA-seq dataset was used containing data from 48 geographically distinct samples of the grapevine powdery mildew fungus  Sequence aligning tools, which determine where small sequence fragments align to a larger, “reference” genome or transcriptome sequences are an essential part of any toolkit for modern whole genome and transcriptome analyses. However, the plethora of available tools  and reguTo align sequenced reads, an aligner must first fragment the reference genome into smaller components. Each fragment’s location and sequence content are then stored in a data structure. The type of data structure used highly impacts an aligner’s overall runtime and memory usage. Indexing the reference genome allows for an aligner to work more efficiently by finding all exact matches to a sequenced read using a single lookup in the given data structure and not scanning the entire reference genome from start to finish for each read. As aligners have evolved over the years, the major algorithmic change that has evolved with them has been the refinement of the data structure used for indexing the reference sequence. When aligners were initially available for public use in the late 1990’s, the data structure being used to index the reference sequence was that of a suffix tree . AlthougMost modern aligners use a Full-text index in Minute space, or FM-Index , as the Although not as common, multiple high-quality aligners use an uncompressed “suffix array” as a means to index fragments . Suffix For the end user, there are two primary considerations when deciding which aligner to use: accuracy and run time.Accuracy of a tool can be estimated by multiple proxies. Unfortunately, it cannot be measured directly for any given experiment due to a “chicken or the egg” class of problem. To know the true accuracy of an alignment, one would need to know where in the genome each fragment is from. However, the location of each fragment is the purpose of doing the alignment in the first place. As a result, accuracy is often indirectly estimated based upon our expectations for a good and complete alignment.Accuracy can be partially assessed by the percent of reads aligned. Most end users would prefer to extract the maximal information possible from the sequencing data, meaning aligning as many reads as possible. For high-quality sequencing with few errors and a high degree of accuracy in alignment, most sequence fragments should be assigned to a location in the reference. A large number of unaligned fragments could indicate a low accuracy of the tool. However, this assumes that the reference sequence is relatively complete, otherwise reads may be part of previously unsequenced locations in the genome or transcriptome. Unaligned reads can also result from biological complications outside of the control of the aligner. For example, “multireads” are sequences that align to multiple locations in the reference due to repetitive sequences, paralogs, or other sequence duplications. For these, the aligner is not able to determine which of the regions is the correct match, so it typically leaves the fragment out. Some aligners, such as Burrows Wheeler aligner (BWA) and STAR, will report a quantitative measure (percent and/or counts) of fragments that are multireads. Another biological cause of reduced alignment occurs when RNA transcript sequences are aligned to a reference genome, there could be poor alignment due to the inability to span splice junctions. After considering the technical and biological sources of poor alignment, a high rate of unaligned reads should give a user pause, particularly when comparing among samples of a similar type aligned to the same reference.Accuracy is also commonly assessed by the estimated gene coverage. For an alignment of shotgun genome sequence, a low coverage of the genes despite a sufficiently large number of reads could indicate a potential systematic error in how reads are aligned. An example of such an “error” would be multireads, as discussed above. There could also be sufficient differences between the fragment and the reference, such as due to polymorphism, that a matching location is not identified. Mismatch tolerance is described in more detail below. If a transcriptome is already available for the species in question, and the aligner supports the import of gene location information for annotation of alignment results, such as with a General Feature Format (GFF) or Gene Transfer Format or General Transfer Format (GTF) file, determining gene coverage is relatively facile. If gene locations for the species are not known, and a closely related species is available, it is also possible to use tools like Exonerate  and BLASTotal runtime, the wall clock time a program takes to complete, is of secondary consideration for two reasons. First, in an ideal world, accuracy should be the primary consideration. Second, as seen in the section on Multithreading below, total runtime often is highly dependent on the hardware, the analysis is run on. However, with the growth in sequencing data sets over time, runtime is a non-trivial consideration that can create a research bottleneck. Total runtime is an interaction between program efficiency and the hardware upon which it is run. Since the hardware is often limited by budget constraints or institutional resources and is therefore effectively a constant for any given research group, it would be useful to know the relative efficiencies of alignment tools.Modern software tools usually have the ability to run multiple analyses at once, or multithread. This can work similarly to how having multiple cooks in a kitchen can increase throughput up to a point. There are diminishing returns, and eventually there can be “too many cooks in the kitchen.” For a well-written program that multithreads, if there are a large number of processor cores (“cooks”) available, the “speedup” of the program should be linear with respect to the number of cores used . Measuring the speedup this way (time on a certain number of cores divided by time on one core) can indicate how much faster a program could theoretically run given better hardware, accounting for the diminishing returns. In rare cases, programs can achieve “super-linear speedup,” in which the observed speedup is greater than the number of cores used. Typically, this is caused by good use of shared temporary memory or other resources. This would be similar to one cook retrieving a single container and adjacent cooks sharing it without having to spend time retrieving it themselves. As we will see later in a comparison of tools, super-linear speedup is observed in some sequence aligners.Although the method used for indexing the reference genome impacts an aligner’s performance, so to do the parameters chosen for an individual run of the tool. Aligners typically have differences in how tolerant they are of mismatches between the fragment and the reference sequence. Some tools allow for user specification of the degree of tolerance. Typically, analyses allow one or two nucleotide differences to account for polymorphism or minor and rare sequencing errors. Even within these tolerances, some fragments will deviate too far from the reference sequence to be aligned. Note that mismatch tolerance can affect both percent alignment and gene coverage. High stringency (low tolerance) can result in a low percent alignment with too much data discarded, and a high tolerance can result in inaccuracy. Another parameter impacting downstream results is the alignment mode. Most aligners have a pre-defined mode, which is unable to be changed, while others allow the user to choose between a local or end-to-end alignment mode. In end-to-end mode, an entire read must be aligned to the reference genome for an alignment to be returned. End-to-end alignments are considered a stricter method of alignment compared to local alignments. In local mode, bases are able to be trimmed from either the 5' or 3' end of a read for the best possible alignment to be returned. This extra trimming step often causes the runtime for local alignments to be longer than an end-to-end alignment; however, the leniency of the alignment allows for higher alignment rates. Another impactful parameter for RNA-seq aligners, such as HISAT2, STAR, and TopHat2, is the option of inputting a transcriptome alongside the reference to aid in an aligner’s ability to identify potential splice sites when aligning RNA reads. Other aligners were created to mainly handle alignment of DNA reads to a reference genome, but can map RNA reads by allowing for large gaps in the resulting alignments. In this assessment, all aligners were run without the use of a transcriptome to compare performance more equitably.In order to increase awareness among researchers of the differences between alignment programs, and to give researchers a framework for evaluating those differences, we compare a number of commonly used alignment programs in reference to the above considerations. Knowing how to choose the best tool for a particular research problem can improve the quality of downstream analyses.Erysiphe necator, or grapevine powdery mildew, were isolated and sequenced. RNA was isolated from the fungal samples by using clear nail polish on the infected leaves to separate the fungal tissue from the leaves followed by RNA extraction  with 512 GB of RAM and timed as CPU time (user + system). Only one analysis was run at a time. The final runtime for each sample was normalized by the number of reads in that sample, as samples with higher read counts take longer to process than those with lower read counts. Runtime per read was averaged across all samples.par) was estimated from the speedup (S) of runtime from 1 processor to n processors using a rearrangement of Amdahl’s law [Fpar = (1/S−1)/(1/n−1)]. The Fpar values for 2, 3, and 5 processors were averaged, and the maximum theoretical speedup calculated by Amdahl’s law for infinite processors as 1/(1−Fpar).The fraction of code that can be parallelized , so both modes were tested to examine if one was better than the other. Additionally, TopHat2 is no longer supported and has been replaced with HISAT2 but is included for reference.To compare some commonly used aligners, an RNA-seq dataset of For each of the 48 samples, the alignment rate was tracked for all aligners used, which represents the percentage of sequenced reads that were successfully mapped to the reference genome. TopHat2 returned the lowest alignment rates by far, demonstrating the significant improvements in alignment quality in this newer generation of tools. Bowtie2 in End-to-End alignment mode and HISAT2 had similar alignment rates , BWA (slope = 0.833), HISAT2 (slope = 0.876), and MUMmer4 (slope = 0.981). Bowtie2 in End-to-End mode showed slight super-linear speedup (slope = 1.059). Both STAR and TopHat2 had logarithmic speedup curves. Using Amdahl’s Law for calculations, the maximum theoretical speedup for STAR and TopHat2 were found to be 6.17 and 3.10, respectively.E. necator transcriptome was covered based on the alignment results for all 48 samples. Because each of the samples came from a geographically distinct area, representing the genetic diversity of the species, combining the results for all 48 samples was performed with cufflinks and cuffmerge to remove the bias of any sample not expressing a particular gene. In this sense, we analyzed the maximal transcriptome coverage an aligner can achieve given 48 replicates. To further analyze whether some aligners were better at mapping longer or shorter transcripts, the transcriptome coverage was calculated at various alignment length cutoffs  is genomic and the other transcriptomic. In experimentation such as RNASeq , transcrAnother concept to keep in mind when choosing an aligner is the type of downstream analysis required for the given research project. Nearly all aligners have the ability to output alignments in commonly used file formats, such as SAM/BAM files. In general, this means that most downstream analysis tools are compatible with the aligner’s output. However, some aligners, such as MUMmer4 in our case, output the data in an incorrect format. In our findings, each of the MUMmer4 alignment files were missing the required “@SQ” header lines (one for each contig in the reference genome), which meant that the outputted files were not able to be used for downstream analysis without some manipulation. To avoid problems like this, it is important to do the necessary research beforehand to ensure that the chosen aligner is compatible with the downstream analysis tool of choice.It should also be noted that aligner performance can vary significantly depending on the composition of the organism’s genome or transcriptome. Larger genomes and data sets obviously will require longer runtimes, as the search space has increased. Depending on the aligner, runtimes may not increase in a linear manner, either. The degree of duplication in the genome can also complicate analysis for aligners, impacting both speed and accuracy. For example, in a genome with evolutionarily recent duplication, a given fragment may align to multiple loci. As a result, aligners may locate the fragment to multiple locations (declaring it a multiread), choose one location over others, and throw out the read as unable to be mapped, or take some other action. Similar outcomes could happen with a fragment that spans a common repetitive element. We have not examined the effects of genome complexity, including differences in the handling of multireads, on aligner performance. This would make an excellent area for future research and trials.In practice, the choice of aligner often comes down to a trade-off between speed and completeness. As shown in If speed is the primary concern, however, a tool such as HISAT2 still has a good degree of completeness. An example of this case would be a rapid diagnostic test, such as pulsed sequence analysis , in whicAlthough a large number of sequence aligning tools exist, most modern tools have similar key metrics and perform well for a wide variety of purposes. When resources are limited or specific features are required, the choices are often themselves more limited, and one must be more careful. As small fragment sequencing rates increase, and more fragments are generated by sequencing machines, time may become the more critical concern, too. As with the underlying sequencing technologies, alignment tool choice is a moving target. Perhaps in the future, databases and summaries of performance against gold standard data sets may be developed for specific applications. Until then, users have many fine and well established tools, and few bad choices. We hope that the above analysis and discussion helps the research community to systematically identify the alignment program that best meets their needs.The names of the repository/repositories and accession number(s) can be found at: NCBI .All authors contributed to the research and writing of this manuscript.The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.


Multiple sequence alignment (MSA) is the basis for almost all sequence comparison and molecular phylogenetic inferences. Large-scale genomic analyses are typically associated with automated progressive MSA without subsequent manual adjustment, which itself is often error-prone because of the lack of a consistent and explicit criterion. Here, I outlined several commonly encountered alignment errors that cannot be avoided by progressive MSA for nucleotide, amino acid, and codon sequences. Methods that could be automated to fix such alignment errors were then presented. I emphasized the utility of position weight matrix as a new tool for MSA refinement and illustrated its usage by refining the MSA of nucleotide and amino acid sequences. The main advantages of the position weight matrix approach include (1) its use of information from all sequences, in contrast to other commonly used methods based on pairwise alignment scores and inconsistency measures, and (2) its speedy computation, making it suitable for a large number of long viral genomic sequences. High-quality multiple sequence alignment (MSA) is crucially important in sequence comparison and molecular phylogenetics because a poor alignment typically leads to bias and inaccuracy in phylogenetic estimation ,2,3. ThiMSA was traditionally followed by post-alignment visual inspection and manual adjustment. However, such post-alignment improvements gradually faded away because of three contributing factors. Firstly, it becomes less important with the emergence of more accurate MSA programs such as MUSCLE  and MAFFWhile sequence alignment with dynamic programming is guaranteed to generate the optimal sequence alignment given a scoring scheme ,12, or aNyctereutes procyonoides should be “T-”. However, N. procyonoides is more closely related to Procyon lotor and Mustela putorius furo, so the three sequences will be aligned first in progressive MSA. “-T” and “T-” are equally good when aligning these three sequences, so one of the two equally good alignments needs to be chosen. MAFFT happens to choose “-T”, which turns out to be suboptimal when the first four sequences are added to the MSA.I illustrate two such cases. The first involves aligned sequences  taken frThe second case of suboptimal alignment is caused not by the progressive MSA, but by codon sequence alignment which takes one of two approaches. One approach is to translate codon sequences into amino acid sequences, align the amino acid sequences, and then map the codons to aligned amino acid sequences ,16, pp. A. AlignmSuch suboptimal alignments  are not 1, MSA2, …, MSAn). From each of MSAs, one may reconstruct a maximum likelihood tree , with associated tree log-likelihood . MSAi is the best if lnLi is the largest. This application of the ML criterion needs to be conditional on the number of gaps in each alignment because an alignment with many additional indels to minimize nucleotide or amino acid mismatches will tend to increase likelihood. However, the real difficulty with integrating both an MSA and a phylogeny in a ML criterion is that it would be too slow to be practical [Ideally, one would use maximum likelihood (ML) as a criterion for choosing the best alignment. From the same set of sequences, alternative alignment algorithmsa and scoring schemes may generate alternative alignments /2 pairwise alignments. SPS is simply the summation of all pairwise alignment scores without penalizing shared gaps. Obtaining SPS from MSAs is easy. All we need is a scoring scheme, i.e., gap-open and gap-extension penalties plus a match/mismatch matrix. A slight variation of SPS is the weighted SPS [ijW = 1. MAFFT [WSPS when either G-INS-i or L-INS-i option is chosen.Sum-of-pairs score (SPS) ,24,25,26hted SPS ,21 in wh1. MAFFT  uses mulN. procyonoides sequence. We only need to compute SPS for these two sites. Suppose we use BLOSUM62 score matrix and a gap penalty of −6 as our scoring scheme. In this particular case, we only need to compute pairwise alignment scores between N. procyonoides and the other 10 species because all other pairwise scores are identical between the two alternative alignments /2 pairwise alignments. Pairwise alignments can be inconsistent with each other and with those implied by MSA, which had been used to refine MSA before [ijS as the pairwise alignment score between sequences i and j, and ij.MSAS as the equivalent score for paired alignment implied by the MSA, PAI isA before ,29,30,31ijS is from dynamic programming and consequently has the highest possible alignment score, whereas ij.MSAS is from the pairwise alignment implied by the progressive MSA, ijS ≥ ij.MSAS. A poor MSA will have a larger PAI than a good MSA. For the 11 amino acid sequences  have been suggested as possible metrics for evaluating alternative MSAs [PWMS can be computed for each sequence. When one or more nucleotides or amino acids are shifted along indels, the difference in PWMS before and after the shifting isPosition weight matrix (PWM) ,34,35,36ive MSAs . A PWM cPWMD is desirable. The 11 ACE2 sequences in N. procyonoides. For the PWM derived from Alignment 1, placing T at site 20 instead of 21 yields a PWMD of 0.6481 . I will illustrate this with a more realistic data set with alignment of huntingtin (HTT) proteins.n, where the subscript n is the number of consecutive CAG codons, is caused by strand slippage during DNA replication [n > 37. The longer the repeats, the earlier the disease onset [Huntington’s disease is associated with the length of glutamine  repeats in the huntingtin (HTT) protein. The expansion and shrinking of (CAG)lication . Huntingse onset .I downloaded 20 primate HTT protein sequences and aligned them using MAFFT  with thePan troglodytes) and the third (Homo sapiens) sequences. There is only one GO in the alignment between these two sequences in Both SPS and PAI indices would favor the alignment in A likelihood method, however, would favor the alignment in n tracts in the HTT gene [One might argue that the ML criterion in HTT gene .The alignment in Step 1: From the alignment of HTT sequences obtained from MAFFT with 3156 aligned sites, one can compute the 20 × 3156 PWM. Part of the PWM, with the relevant sites and the two relevant amino acids (Q and P) is shown in 6 (where the subscript 6 is the number of consecutive Qs in a sequence) should be placed at sites 28–33 , Q7 at sites 28–34, Q10 at sites 28–37, Q11 at sites 28–38, Q21 at sites 18–38, and so on.The Step 1 refinements result in a favorable PWMD of 9.198. The alignment after Step 1 is shown in Step 2: The alignment after Step 1  ACE2 sequences in M. musculus, then the three post-alignment adjustment approaches would all favor “-T” at sites 20 and 21 against the alternative “T-“ in N. procyonoides, contrary to the post-alignment adjustment that we have made before. This again highlights the need to incorporate evolutionary history in post-alignment adjustments. If M. musculus is phylogenetically closer to N. procyonoides than the first four primate species in N. procyonoides. In contrast, if the first four primate species are phylogenetically closer to N. procyonoides, then we should revise “-T” in N. procyonoides (I should emphasize the effect of taxon sampling on sequence alignment and post-alignment adjustment, as this effect is important but often neglected. Take the alignment in yonoides  to “T-“.I illustrated the importance of post-alignment adjustment, outlined criteria to rapidly evaluate alternative alignments, and presented three approaches towards post-alignment adjustment. I highlighted the potential of the position weight matrix approach and illustrated its applications for refining several sets of real sequences. The problem of post-alignment adjustment is not fully solved. I hope that my presentation of the problem and the directions towards a solution will stimulate further research in this rapidly developing field.