The distinctive characteristics of long reads resulted in methods moving from the seed-and-extend framework used for short reads to a seed-and-chain framework due to the seed abundance in each read. The main novelties are based on alternative seed constructs or chaining formulations. Dozens of tools now exist, whose heuristics have evolved considerably. We provide an overview of the methods used in long-read mappers. Since they are driven by implementation-specific parameters, we develop an original visualization tool to understand the parameter settings (The online version contains supplementary material available at 10.1186/s13059-023-02972-3. These specific problems require and motivate novel algorithmic solutions. In this survey article, we give an overview of the techniques proposed over the last decade for mapping long reads to genomes. After giving definitions and main intuitions, we describe the methodology in two steps. We first discuss seeding, up to the latest advents using novel seeds . We then discuss chaining, for which we decipher the currently used score functions. We also made available an original visualization tool that can be used to play with the different parameters in order to understand their impact on the chain  to a reference genome. We further assume that reads come from a genome that is closely related to the reference genome, such as from the same organism or a closely related species.l and n. Let x and y strings are defined on The initial sequences are retrieved through the transform: i of the strings but two dashes: Any pair of characters can be matched at a position Many alignments exist for a given pair of strings, in theory, the methods described hereafter aim at finding good alignments, i.e., alignments that optimize some distance between the pair of strings. The distance is computed using score functions which give rules on the characters pairing. Algorithms exist to compute optimal semi-global pairwise alignments between a read and the reference genome with respect to a score function. However, their complexity is read mapping and read alignment.Let read mapping as the complete procedure of finding the read’s location on the genome (through seeding and chaining steps) and extending the alignment between the read and genome region identified by the mapping location by pairwise alignment. The mapping algorithms we discuss do not guarantee to find the optimal solution. In case we discuss the procedure of only finding a reference location for the read without the alignment extension, we refer to the procedure as extension-free mapping.We will in this survey refer to query for a read and reference to denote the genome.In our survey, we discuss read mapping to a genome sequence. We will use the terms To our knowledge, the first mappers explicitly written for long-reads were YAHA  and BLASSeeding is the first operation in the heuristics used by mapping techniques.seed is a subsequence extracted from the query or the reference.A e.g., global pairwise alignment of the read to the reference. As we will see in the “chaining; “extension; “The purpose of seeding is to find relatively small matching segments between the query and the reference that serves as markers for reference regions that potentially are similar to the read. The reason seeding is used is that it is typically computationally efficient to find matching seeds that can narrow down regions of interest compared to, sketching that was introduced in MHAP, a long-read overlap finder implemented in an assembly algorithm [k-mers) into a fixed-length vector (a sketch) of representative elements called fingerprints. By comparing two sketches, one can approximate a similarity estimation of the two sets quickly and independently of their initial set sizes. Several approaches exist [An important idea for seeding is lgorithm . The rates exist , 17, 73.es exist  is a skees exist . Sketchies exist , 48, 91.A key intuition is that in short-reads mapping, the extending procedure could start after finding a single shared seed between the query and the reference, called anchors .anchor is a matching seed between the query and the reference. It is represented by a pair of coordinates on the query and the reference.An In the literature, an anchor can also be called “a fragment” or “a match.” Two anchors are said to overlap if one anchor starts or ends within the coordinate interval defined by the other anchor. In long-read mapping, the length of the reads and the short seed length used due to the initial high long-read error rates can lead to a large number of anchors. It is therefore necessary to reduce the search space by selecting subsequences of ordered anchors (chains).chain is a subset of reference, query) plane.Let Drawing inspiration from genome-wide mapping, BLASR introduced a chaining step which aims at selecting high-scoring chains from a set of candidate chains. Chaining allows to reduce the final step of a long-read mapper (the base level extension) to pairwise alignment of sub-regions between ordered anchors in chains. Chaining in long-reads has been solved using various dynamic programming procedures , 82, 95.While this survey covers the genomic mapping aspects, other important contributions have dealt with adapted procedures in the case of long-read RNA mapping , 86, 99,In the following, we hardly elaborate on complexities for the different algorithms. Some are yet unknown, but in many cases implementations simply use heuristics so that each step’s time is expected to be linear.Seeding is the procedure that consists in collecting a set k, or k-mers, are perhaps the most commonly used seed in bioinformatics. A k-mer seed can be indexed by using a hash function to produce an integer value , which is then added to a hash table. This makes indexing of k-mers computationally cheap, provided that the hash function and hash table implementations are efficient. Methods to efficiently hash k-mers have been proposed  [k-mers hash value to compute the next one using a rolling hash function.Substrings of length roposed  , which uk-mer anchor is found, it is guaranteed to be exact (disregarding hash collisions). While it is desirable to produce anchors only in identical regions to minimize hits to non-homologous regions, a downside is that mutations in homologous regions will also alter the k-mers, preventing anchors in the region. Typically, a single substitution alters k-mers. The length distribution of stretches of consecutive non-matching k-mers between two homologous regions with substitutions depends on the substitution rate, and has been studied theoretically in [If a cally in .k-mers as seeds. These approaches have proven their efficiency by drastically reducing the number of objects to index while keeping high sensitivity and specificity in mapping applications. There exist two broader classes of sketching techniques, methods that offers a distance guarantee between consecutively sampled seeds, and methods that does not. Both classes of methods have been used to estimate similarity between sequences. However, the central research questions of the former class of methods involve the distance distribution between sampled seeds, the fraction of conserved seeds under mutations, and the compression ratio to original input data. In contrast, the central studied question for sketching methods without distance guarantees is often to produce unbiased estimations of sequence identity [As two consecutive k-mers share most of their sequence, they are mostly redundant. Therefore, we could reduce the memory overhead and query time without losing much information if only some k-mers were stored. Here we present different methods for picking a subsample of representative identity , 40, 69)k-mers  from th mapping  for geno mapping , 90. Howrategies , 45. Frarategies   is desired for mapping applications, it is also desired to sample as few minimizers as possible to reduce storage. Different optimizations have been proposed to reduce the density of sampled minimizers while keeping the distance guarantee. Weighted minimizers [k-mers of variable rareness. In order for k-mers from highly repetitive regions not to be as likely as others to be selected, it first counts k-mers, and down weights the frequently occurring ones. Then it takes this weight into account for the hashing procedure. If low occurrence k-mers are too far away in a query, a solution [Since at least one minimizer is selected in each window, they have a nimizers  implemensolution  allows sk-mers in the window. This property is called context dependency [k-mers affected by mutations may alter the minimizers in a window. However, for finding anchors it is desired to guarantee that the same k-mers are sampled between two homologous regions regardless of neighboring mutations. Therefore, context-independent methods have been proposed such as syncmers [k-mers. Syncmers was used in the context of long-read mapping [s-mers of size k-mers , a more studied category is closed syncmers where p must be the first or the last s-mer position in the k-mer. This way of selection uses properties intrinsic to each k-mer, therefore is context-free. Closed syncmers also have a distance guarantee. By construction, syncmers tend to produce a more even spacing between sampled seeds while still allowing a distance guarantee.In minimizer sketching, the choice of the minimizer in each window depends on the other pendency . Contextsyncmers  and minisyncmers , where t mapping  in an al mapping 2. For thmentclass2pt{minimDue to read errors and SNPs between the reference and sequenced organism, it is in many scenarios desired that a seed anchors the query and the reference in homologous regions even if the seeds extracted in regions differ. In other words, we would want similar seeds to hash to identical hash values. A hash function that produces identical hash values for similar but not necessarily identical inputs is usually called a locality-sensitive hash function. We will refer to seeds produced under such methods as fuzzy or inexact seeds. Several methods to produce fuzzy seeds have been described.k-mer, fixed positions can be selected as wildcards by applying particular masks on the k-mer’s bases [good sets of spaced seed patterns has been optimized [Perhaps the most common one is spaced seeds. Within a spaced seed, some positions are required to match , while the remaining positions can be ignored . Within a ’s bases . Spaced ’s bases , metagen’s bases , and in ’s bases . Typical’s bases , 95 wher’s bases  to incre’s bases . Althougptimized , using sAs indels are a frequent source of variability on long-reads, spaced seeds have, except GraphMap, not been frequently used in long-read mapping algorithm designs. There are other types of fuzzy seed constructs, such as permutation-based seeds , but theTraditionally, anchoring over indels has typically been solved by querying multiple seeds in a region and performing post-clustering of nearby anchoring seeds, which are then inferred as an anchoring region. Such an approach usually provides gold standard sequence similarity queries , 52. Howlink several k-mers into a seed and represent it as a single hash value before storing it in the index. Such linking techniques has recently become popular in the long-reads era, where indels are frequent. One proposed method is to link two nearby minimizers [k-mers at seemingly random positions within a window. Such pseudo-random linking of k-mers implies that, if one seed is destroyed due to a mutation, a nearby seed may still anchor the region. Strobemers have been shown effective at finding anchors between long-reads and for long-read mapping [k-mers.To remove the overhead of post-processing of nearby seeds, one can instead nimizers  or severnimizers  into a snimizers , and lonnimizers  and erronimizers . A downsnimizers  , there is no way to alternate the seeds in this region at mapping time. There are, however, other types of seed constructs that we here refer to as dynamic seeds that can be computed on the fly at the mapping step and then used as seeds downstream in the read mapping algorithm.k-mer match and then applying an extension process. MEMs are guaranteed to be an exact match between the query and the reference and are bounded below by length k but do not have an upper threshold for seed size. MEMs have been used in earlier long-read mapping programs  [Maximal exact matches (MEMs)  are matcBWA-MEM) , 57 and BWA-MEM) , but theuniquely match (MCASs) between the query and the reference. There can be as many as the query length in theory. In practice, the more divergent the repeats, the shorter the MCASs, since a base pertaining to a single copy is more likely to be found.If a query was sampled from a repetitive region in the reference, one might likely find several clusters of anchoring seeds across the reference. Further dynamic programming operations to decipher the true origin region of the query are typically costly or even unfeasible if too many copies have to be considered. The query might also be attributed to the wrong copy because of the sequencing errors. A recent contribution  proposedk-mer a value between 0 and a maximum integer are preferred [Originally, minimizers used a lexicographical ordering. However, in our four base alphabet, this can tend to select sequences starting with long alphabetically smaller runs such as “AAA...”. Random hash functions assigning each referred .k-mers. Homopolymers longer than a size s are reduced to a single base, then k-mers are computed over the compressed sequence. For instance, for k-mers are ATGA, TGAC, GACC. This procedure allows finding more anchors while indexing fewer k-mers or minimizers. Homopolymer compression appears in long-read mapper implementations .k-mers in windows. It is then possible for two k-mers to get the minimal value and to be selected, which tends to over-sample repetitive k-mers. A robust winnowing procedure is proposed in [k-mer, but increases context dependency.In regions of low complexity  the standard minimizer procedure keeps all minimal posed in , which ak-mers exist [k-mers representatives. In other words, a hash value is associated with one and only one k-mer, and the k-mer sequence can be retrieved from the hash value . This choice allows a very fast k-mer/minimizer correspondence, but is memory-wise costly as it implies that the fingerprints of the hash table are not compressed (which is mitigated by the density of the sketching). Minimizers are then used to populate a hash table, which associates them to their position(s) in the reference and their strand information . There also exists learned index data structures [Indexing of fixed size seeds is usually done using hash tables . In theructures  that furk-mers, hash table solutions mainly prevail.Variable-length seeds are indexed in full-text data structures , which k-mers and robust winnowing heuristics), and instead skip to use highly repetitive k-mers to find anchors . The authors noticed that in cases where a query is sampled from a repetitive region, such a procedure prevents it to be seeded. Techniques that use longer fuzzy seeds  [In , it is pobemers)  reduce tobemers)  computesOnce the reference’s seeds are indexed, a set of seeds is extracted from the query and looked up in the index to find anchors. Anchors’ positions on the query and reference are stored, as well as the forward/reverse information. Instead of directly extending the alignment between anchors, as it is done in short-read mapping, a step of chaining is added and meant to accelerate further extensions. Chaining acts as a filter and a guide for smaller extensions that need to be realized only between selected anchor pairs. Without it, too many extension procedures, most of which would be dead-ends, would have to be started.reference, query) space, which passes by all the anchors. In practice, some anchors are spurious, others correspond to repeated regions and yield different possible chains. Moreover, more parameters must be taken in account. Thus, methods optimize different aspects  Do not allow anchors which are not ascending either by the anchors’ start or end coordinates in both the query and reference  Avoid discrepancies in diagonals between anchors  Do not allow large spaces between consecutive anchors of the chain  Favor the longest possible anchor chain  If inexact matches in seeds are possible, each seed represents a couple of intervals on the target and the query. Find a subsequence of seeds that minimize the sum of the Levenshtein distances computed on these couples of intervals .local chaining problem [gap score in the literature, though it includes other constraints, as described above. The chaining problem for long reads seeks to find an optimal colinear chain with a positive gap score.The problem of finding an optimal chain using non-overlapping anchors has been called the  problem , althougMainly, methods use either a two-step approach: (1) find rough clusters of seeds as putative chains, followed by (2) find the best scored chain among the selected clusters; or work in a single pass and apply a custom dynamic programming solution to find the best anchor chain. We can start by noting that one of the first mappers dedicated to long-reads solved a global chaining problem to determine a chain of maximum score, by fixing starting and ending points (anchors) such that their interval is roughly the size of the query . Such anreference, query) position space. In this space, an anchor realizing a perfect match is a line of the size of the seed. This line should have a 45-degree angle, which also corresponds to the main diagonal of a  alignment matrix. The same idea stands for a set of anchors. However, because of insertions and deletions, each small line materializing an anchor may not be on the exact same diagonal, thus realizing approximate lines in the  space. A method from image processing has been proposed to find approximate lines in this space: the Hough transform [The two-step approaches rely on a first clustering step. Although it tends to be replaced by single-step chaining see “” sectionransform , which mransform  proposesn is the number of anchors. By using an algorithm on LIS problem, we can obtain truly colinear chains in The previous clustering techniques aim at finding lines in groups of anchors that can be approximately colinear. To determine truly colinear chains, a subset of anchors can be ordered by finding a longest increasing subsequence (LIS) of anchors. Let each anchor be mapped to the order in which it appears in the reference. By crossing these map values with the order of these anchors in the query, we obtain a permutation of the set k-length substrings). Note that there is a correspondence between LIS and LCS. The LIS of P is the LCS between P and the sequence In the case of fuzzy seeds, inexact matches are to be dealt with on top of the initial increasing chain problemin order to obtain the closest base-wise anchor chain. In this case, the problem is converted to LCSk  improves the time complexity by using the wider is worse strategy [i and j: With f(i), f(j) scores for anchors This property means that at least on axis X or Y, the distance between the two anchors must be i is above and to the right of j  then X- or Y-axis between i and j) will be lower than w and therefore selected. For any other case, w which is a larger value is selected and increases more the score.This is the concave gap score penalty . Chainsw and http://bcazaux.polytech-lille.net/Minimap2/In order to test Heuristics are applied to rapidly drop a dynamic programming procedure in regions that are unlikely to align and to avoid Noticing that ’s originum queue  instead The described methods may deliver a set of chains that satisfies the chaining score threshold. To choose among the candidates and decide the final location, chains can then be categorized into primary/secondary chains. Chains with a sufficient score are ranked from highest to lowest score. Primary chains are those with the highest scores which do not overlap with another ranked chain on the target for the most of their length. Secondary chains are others. Mapping quality, which is a measure that had been introduced to assess short-reads mapping, is redefined for long-reads with slight variations according to articles. It reports, for chains, whether the primary is very far in terms of score from the best secondary, and if it is long enough.O(nm) if n and m are the lengths of the query and reference sequences, respectively. Even after locating a candidate region to extend the alignment (using the seeding and chaining steps), the quadratic complexity is still prohibitive for long reads in computation time and memory. Therefore, long read mappers typically extend the alignment of sequence segments between neighboring anchors (piece-wise extension) [While some applications, such as abundance estimation, typically need only the mapping location of a read, many applications, such as SNV and structural variation detection, rely on base-level alignments. The extension alignments step is typically computationally costly, where traditional Needleman-Wunch  and Smittension) , 82, 89.tension) , 82, 89.tension) , 82, 89.O(ns), proportional to the read length n and the alignment score s, using s is small. Since the WFA algorithm [O(s), which improves on the previously known lower memory bound O(n) [Piece-wise alignment can still be computationally costly if the distance between anchors is large enough. Recently, the Wave Front Alignment (WFA) algorithm  made a blgorithm  was publlgorithm , 70. Notund O(n) . A curreentclass1pt{minimaund O(n) 4, althouA regardless of gap length, or a linear penalty, where the penalty B is multiplied by the gap length L). Neither of these gap cost models captures very well the error profiles of long reads and characteristics of indels. While error rates of long reads are constantly changing, traditionally, the long reads had frequent shorter indels. In addition, longer insertions and deletions exist as natural sequence variation. Due to this, it seems natural to introduce a slightly higher cost at opening a gap but not penalizing successive gaps as much. Therefore, the most popular gap cost penalty in long-read aligners is the gap-affine penalty, which combines fixed and linear costs. The gap affine penalty is defined as A is typically a much higher number than B. This gap cost, to some extent, models the nature of long-read errors and smaller indels and furthermore does not increase runtime over the linear cost model due to Gotoh’s formulation [Classical pairwise alignment methods , 77 typimulation . In pracmulation  and enabetection .The extension alignment step is commonly accelerated through vectorization using single instruction multiple data (SIMD) sets of instructions , 28, whiConsidering the full matrix is unnecessarily expensive in practice in many cases. Practical alignment implementations relies on banded alignment , 80, whis X-drop , 59 implDue to sequencing errors, some spurious anchors main remain in a chain, which can lead to a sub-optimal alignment. At the alignment step,  chooses The seed-chain-extend methodology has remained a popular approach in long read mapping since the start of long-read sequencing technologies. There has also been recent advancement on the theoretical side. In , the autk-min-mers [diagonal-transition algorithms for the gap-affine model, which was initially define for edit distance [We have also seen several recent advances in e.g, the seeding and extension steps. Novel seeding techniques such as syncmers , 23, k-mmin-mers , strobemmin-mers , 84 havedistance , 55, 97,distance , 70, 71)Nevertheless, despite these recent advancements, the individual steps of seeding, chaining, and extension must be adapted to several upcoming challenges. For example, we are witnessing a drastic change in the typical reference sequence to which reads are mapped. We will witness more complete genomes that include challenging regions such as centromeres (the T2T consortium recently made available a complete human genome ), novel Additional file 1. Additional figures and details on tools’ strategies.Additional file 2. Review history.


NOTE: the Github website will be released upon publication and the R package is available for review through google drive: https://drive.google.com/drive/folders/1KgecmUoon9-h2Dg1rPCyEGFPOp28Ols3?usp=sharingMulti-omics sequencing is expected to become clinically routine within the next decade and transform clinical care. However, there is a paucity of viable and interpretable genome-wide modeling methods that can facilitate rational selection of patients for tailored intervention. Here we develop an integral genomic signature-based method called iGenSig-Rx as a white-box tool for modeling therapeutic response based on clinical trial datasets with improved cross-dataset applicability and tolerance to sequencing bias. This method leverages high-dimensional redundant genomic features to address the challenges of cross-dataset modeling, a concept similar to the use of redundant steel rods to reinforce the pillars of a building. Using genomic datasets for HER2 targeted therapies, the iGenSig-Rx model demonstrates stable predictive power across four independent clinical trials. More importantly, the iGenSig-Rx model offers the level of transparency much needed for clinical application, allowing for clear explanations as to how the predictions are produced, how the features contribute to the prediction, and what are the key underlying pathways. We expect that iGenSig-Rx as a class of biologically interpretable multi-omics modeling methods will have broad applications in big-data based precision oncology. The R package is available: https://github.com/wangxlab/iGenSig-Rx.


Efficiently aligning sequences is a fundamental problem in bioinformatics. Many recent algorithms for computing alignments through Smith–Waterman–Gotoh dynamic programming (DP) exploit Single Instruction Multiple Data (SIMD) operations on modern CPUs for speed. However, these advances have largely ignored difficulties associated with efficiently handling complex scoring matrices or large gaps (insertions or deletions).We propose a new SIMD-accelerated algorithm called Block Aligner for aligning nucleotide and protein sequences against other sequences or position-specific scoring matrices. We introduce a new paradigm that uses blocks in the DP matrix that greedily shift, grow, and shrink. This approach allows regions of the DP matrix to be adaptively computed. Our algorithm reaches over 5–10 times faster than some previous methods while incurring an error rate of less than 3% on protein and long read datasets, despite large gaps and low sequence identities.X-drop alignments. It is available as a Rust library (with C bindings) at https://github.com/Daniel-Liu-c0deb0t/block-aligner.Our algorithm is implemented for global, local, and  Efficiently aligning biological sequences is an incredibly important problem due to its prevalence in many bioinformatics workflows and the ever-increasing scale of experiments. For example, protein sequences are aligned in large-scale database searches . These aSince this alignment step is so critical, countless optimizations have been introduced in the past. Some recent advances has been on heuristics for avoiding or approximating full DP computation  and traSince alignment is a core computational primitive in bioinformatics, it is important to explore the tradeoff between efficiency, flexibility, and accuracy of alignment algorithms. We believe Block Aligner will enable more efficient analysis of large protein and sequencing datasets, with minimal accuracy loss.btad487_Supplementary_DataClick here for additional data file.


Yet many sequence datasets exhibit substantial sequence length heterogeneity, both because of large insertions and deletions in the evolutionary history of the sequences and the inclusion of unassembled reads or incompletely assembled sequences in the input. A few methods have been developed that can be highly accurate in aligning datasets with sequence length heterogeneity, with UPP one of the first methods to achieve good accuracy, and WITCH a recent improvement on UPP for accuracy. In this article, we show how we can speed up WITCH. Our improvement includes replacing a critical step in WITCH (currently performed using a heuristic search) by a polynomial time exact algorithm using Smith–Waterman. Our new method, WITCH-NG (i.e. ‘next generation WITCH’) achieves the same accuracy but is substantially faster. WITCH-NG is available at The datasets used in this study are from prior publications and are freely available in public repositories, as indicated in the Bioinformatics Advances online. Multiple sequence alignment (MSA) is a fundamental task in computational biology and is a prerequisite for many downstream analyses such as phylogeny estimation , metagenSequence length heterogeneity, in particular the presence of many short sequences, is a frequent characteristic of biological datasets . Therefohmmbuild+hmmalign pipeline), PaPaRa (add option), UPP  into the computed ‘backbone’ alignment. The last step where sequences are added into an existing alignment is a necessary step in other applications, including updating alignments, updating phylogenies (i.e. phylogenetic placement)  to represent the backbone alignment, using tools from HMMER. In the second stage, WITCH adds the remaining sequences (i.e. the query sequences) into the backbone alignment, using the eHMM. At a high level, this two-stage structure is the same as in UPP, but WITCH executes the second stage differently. While UPP simply picks a single HMM from the eHMM to add a given query sequence into the backbone alignment, WITCH computes an extended alignment for the query sequence for each of the HMMs in the ensemble, and then combines the top (default 10) of these extended alignments, weighted by the probabilities it associates to each HMM in the ensemble, into a single extended alignment using the ‘Graph Clustering Merger’ (GCM) from MAGUS .The resulting pipeline improves the accuracy of UPP when aligning datasets that have evolved under a high rate of evolution and otherwise matches UPP, but is somewhat slower , with the backbone sequences sampled from those sequences deemed to be full-length. An alignment (default: MAGUS) and its maximum likelihood tree [default: FastTree2 , this weighted alignment graph is clustered using Markov Clustering (MCL), described initially in Since Phases 2 and 3 together are the most complex and together define how to add a given query sequence into the backbone alignment, we describe them in detail here. For a given query sequence, Phase 2 operates by computing a weighted score (larger is better) for each HMM in the ensemble, and then picking the top q is added to the backbone alignment. In WITCH, this is accomplished during Phases 2 and 3, where for each query sequence a weighted alignment graph is computed, then passed to MCL, then passed to an A* method (to remove violations) so that the final output is a valid extended alignment for each query sequence . The local alignment method, Smith–Waterman  and Phase 3a ’ [a generalization of the classical Maximum Weight Trace (MWT) problem  instead of the Graph Clustering Method (GCM) produces alignments of very similar accuracy.  problem  in bioinDefinition 1 Given a weighted undirected bipartite graph with nodes T, either both subject to an additional ‘non-crossing’ constraint, where for any two different Given that the original WITCH always uses GCM to merge two alignments, we consider the problem of optimizing for the MWT-AM criterion . We give the definition of MWT-AM on two alignments below:S. This observation is far from new and is mentioned in the paper introducing the maximum weight trace (MWT) problem  for the MWT-AM problem by an exact polynomial time algorithm for the same problem.We note two major differences in the implementation of WITCH-NG aiming for better running time compared to WITCH. Our first change is a strict improvement to the very last step of WITCH before the output, when the extended alignments  are transitively merged. The original implementation in WITCH not only conceptually builds these extended alignments but also writes these extended alignments to the disk verbatim before consuming them using a generic transitivity merging subroutine. This strategy is heavy in IO usage  and is extraneous. In WITCH-NG, we directly memorize each query letter’s matched position in the backbone, which is sufficient to output the final alignment without incurring extra runtime cost in IO or parsing.hmmsearch (the bottleneck step in obtaining the bitscores for UPP and in turn the weights for WITCH). WITCH-NG aggressively avoids invoking extra IO, and especially disk writes. Both WITCH and UPP use temporary files to divide up the query sequences into chunks for hmmsearch to consume and also to save outputs of hmmsearch across often times hundreds of HMMs. Combined with the IO usage of hmmsearch reading the HMMs (saved on disk), these steps might hinder efficient parallelization. In other words, operations can become IO-bound instead of CPU-bound, in which case adding more cores will not speed up the computation of this bottleneck. To allow efficient parallelization under many cores, WITCH-NG instead relies on piping small chunks of sequences to the hmmsearch command while also parsing the hmmsearch output in-memory to minimize IO operations. This simple design allows more cores to be efficiently used until the IO bottleneck is hit.The second difference is that WITCH-NG implements a different strategy in invoking We assembled a diverse set of publicly available datasets  .To evaluate estimated alignments, we use the error metrics computed by FastSP . BrieflyFor speed, we record the wall-clock running time of the methods assuming the backbone tree and backbone alignment are given (i.e. ignoring the time used in Phase 0). Aside from the benefit of excluding a shared identical stage for all the methods, this wall-clock running time is exactly the running time for downstream analyses, such as phylogenetic placement or taxon identification, where the backbone alignment and tree are assumed to be already computed.All experiments were conducted on the Illinois Computing Cluster, a heterogeneous computing cluster where most runs are constrained to four hours with at least 64GB of available memory. For the most time-consuming dataset (16S.B.ALL), we allowed methods to run for more than four hours. We ran all methods across 16 cores.We compare WITCH-NG to WITCH and UPP, each run in default mode, but all three methods used the same backbone alignment and eHMM. See hmmbuild+hmmalign .Methods other than UPP and WITCH were not selected for comparison as prior literature and preliminary results suggest that UPP is more accurate than other published methods (that we know of). For example, prior studies suggest that UPP is more accurate than WITCH and WITCH-NG are essentially tied for average alignment accuracy (i.e. average of SPFN and SPFP) and both are more accurate than UPP , with thThe comparison between WITCH-NG and UPP depends on the dataset, with small differences on the RNASim datasets (often favoring WITCH-NG), bigger differences on the ROSE datasets (favoring WITCH-NG) and three largest CRW datasets (favoring UPP) and variable differences on the HomFam datasets (sometimes favoring UPP and sometimes favoring WITCH-NG). The two methods were essentially tied for speed on the 1000M-HF, 5S.3 and 5S.T datasets .WITCH-NG differs from WITCH in two ways: algorithmic design and algorithmic engineering (implementation). To isolate the impact of the two types of changes, we created a version of WITCH where we replaced WITCH’s GCM subroutine by our described variant of Smith–Waterman. This version of WITCH thus only includes the changes in algorithmic design. We then compare the runtimes of WITCH , ‘WITCH(Smith–Waterman)’ (the modified WITCH just described), and WITCH-NG on two very different datasets used in this study, with the results shown in WITCH-NG is faster than WITCH in all the conditions we explored, sometimes by a large amount (e.g. the simulated datasets and the 5S datasets from the CRW collection). Thus, WITCH-NG speeds up WITCH on all datasets, sometimes by a great margin. In addition, WITCH-NG is reasonably close to UPP in runtime, while this is not true for WITCH.This experiment focused on two benchmark collections (10AA and Homfam) of protein datasets with reference alignments; here we discuss both runtime and average alignment error for these benchmark collections, with results on each dataset shown in the On the 10AA datasets  as well as from the improved algorithm engineering in WITCH-NG.MSA is a step in many bioinformatics pipelines, and yet datasets that are large, highly divergent or contain fragmentary sequences are difficult to align with high accuracy. WITCH is a MSA method that aims to address the challenge of aligning datasets with many fragmentary sequences, and WITCH-NG is modification of the WITCH alignment method that aims to improve the running time without hurting accuracy. Our study shows that WITCH and WITCH-NG methods produce nearly identical alignments, but that WITCH-NG is generally faster, and sometimes greatly faster. The high similarity between WITCH and WITCH-NG alignments explains why WITCH-NG provides high accuracy in estimated alignments and suggests that WITCH-NG should be useful for those applications where WITCH alignments have already been shown to be beneficial, such as phylogeny estimation . WITCH-NG can also be used directly to add sequences into alignments, a problem that arises in updating existing alignments and trees as new sequences are assembled and in microbiome analysis. WITCH-NG should be evaluated for use in these applications, especially for those analyses where runtime is extremely important (e.g. taxon identification in metagenomics).vbad024_Supplementary_DataClick here for additional data file.


A large number of bioinformatics tools employing seed-based alignment techniques, such as k per sequencing technology, without a strong guarantee that this is the best possible value. Given the ubiquity of sequence alignment, identifying values of k that lead to more sensitive alignments is thus an important task. To aid this, we present k-mer length  based on a given alignment identity threshold. In particular, we were motivated to make Most sequence alignment techniques make use of exact The experimental results herein show improved alignments of short and divergent sequences when using the parameter values determined by https://github.com/lorrainea/Seedability (distributed under GPL v3.0). Comparing genomic sequences is essential for genome-wide analyses, such as phylogenetic inference, genome annotation, and function prediction . Similark-mers  between target and query sequences. Spaced-seeds  have also been used extensively to improve alignment results via higher sensitivity when compared to traditional seed-based techniques  x of length empty string is the string of length 0, and it is denoted by ε. A string x is a substring (or fragment) of string y if there exist two strings u and v, such that y = uxv. When x is a substring of y, we say that x occurs in y. Each occurrence of x can be specified by a position in y. We say that x occurs at (the starting) position i in y when k-mer, for any integer k > 0, is a string from x and y and an integer k > 0, we define a seed (or hit) of x and y, a pair  such that k-mer.A x and y and an integer k > 0, we say that x and y share t seeds, for some integer t positions on x and a sequence t positions on y, such that all of the following hold: Given two strings k = 3, x and y share t = 4 seeds. This is because there exists a sequence x, and a sequence y such that For example, given x of length m and a string y of length n, the Levenshtein distance (or edit distance)  , denotedinsertion: insert a letter of y in x at a given position;deletion: delete a letter of x at a given position;substitution: substitute a letter of x at a given position by a letter of y.x, y, the distance O(mn) time , cost of an alignment z is the total number of insertions, deletions and substitutions in z. In our model, an alignment z is optimal if and only if its cost is precisely alignment identity z of x and y is defined aswhere z. The alignment identity is computed by working out as a fraction, the number of matches in the alignment over the alignment length. Note that the alignment length is equal to z. The divergence z is an optimal alignment of x, y, we call optimal alignment identity and the optimal divergence, respectively.For any two strings mn) time . An aligx and an integer minimizer of x is a lexicographically smallest κ-mer in x. Given a string x and two integers w > 0, the set of x is the set of positions of minimizers of all length-x. If more than one consistently sample one of them; e.g. we can always choose the leftmost one as the minimizer.Given a string S be a set of input sequences. For presentation purposes, we will assume that all sequences in S have the same length. In practice, our algorithms will work on sequences that have different but similar lengths. We relate the proposed framework to the classic read-to-reference alignment framework , s1 and s2 have optimal alignment identity greater than or equal to e. We now formally define the problem in scope:Given Given S and an alignment identity threshold e, compute a set of pairs of sequences from S and one pair  of values, for every pair of sequences in , such that the symmetric difference of and is minimized.Problem 1 (Seedability). k-mer length for every pair of sequences in a given collection for a given alignment identity threshold, we can aggregate these k values to infer an optimal By estimating a We propose the following algorithm, which we call S be a set r sequences. The κ of minimizers. The two stages are:Let Estimating Constructing the set k-mers to identify seeds shared between the given pair of sequences. We then traverse through the seeds to estimate estimating alignment identity is, js), we want to output one  value for which the corresponding e. If such a  value exists, then  is added to The main idea of our algorithm is to use t, the number of seeds shared by is and js, which allows us to then estimate ip, jp) on the pair of sequences , if We next present the techniques which we employ to estimate is and js be two sequences, where k-mer α in is and k-mer in js. Let us assume that the pair k-mer β in is such that there exists an occurrence k-mer in js with k-mer js  time due to the condition Let n sj see  such thak-mer γ in js such that there exists an occurrence js with k-mer is (see candidate seed. This is precisely the symmetric computation of the first step. For every O(k) time due to the condition Again, let us assume that the pair n si see  such thaThe two candidate seeds are now compared to select one of them. Let the first one be S, using the two steps described above, allows us to estimate the alignment identity as follows. Let k is encountered between the two seeds  values considered. The total number of shared seeds is The computation of shared seeds, between every pair of sequences in k = 3. Clearly, the first computed seed is For example, let z1 and z2 below show the final alignments if the first seed was chosen (z1) in comparison to if the second seed was chosen (z2). If the first seed is chosen, there are no further seeds identified in is and js, and the alignment identity is 6/13. If, however, the second seed is chosen, there is one further seed identified in is and js, and the alignment identity is z2) is what our algorithm chooses.Alignments is, js), t, k), we output a pair  of values for every pair  such that Recall that we aim at minimizing the symmetric difference between k satisfying k values for k value corresponding to δ be an optional input threshold parameter . Then, we choose the maximum k value, which we denote by k over δ and its usefulness is justified in the experiments.As there could be many values of In the next section, we show how the output of C++ programming language, taking in as input a set of sequences in multiFASTA format and an optional reference sequence in FASTA format. t, k) either for the estimated alignment of all pairwise sequences or for the estimated alignment of the reference sequence and every sequence.https://github.com/lorrainea/Seedability. We have conducted experiments on a computer using an Intel Core i5-8265U CPU, running at 1.60 GHz, equipped with 8GB of RAM, under GNU/Linux. g++ version 9.3.0. The source code is distributed under the GNU General Public License (GPL v3.0) at Minimap2  is a widx, y) of sequences with varying divergence threshold Synthetic data consisted of 100 pairs (κ (the minimizer’s length) and w (the number of consecutive κ-mers considered for sampling). These preset options include:map-ont—Align noisy long reads of sr—Short single-end reads without splicing. map-pb—Align older PacBio continuous long reads (CLR) to a reference sequence. asm20—Long assembly to reference mapping k-mer length output by w was determined using The average map-ont, if the average sequence length is greater or equal to 1000; or (ii) the preset option sr, if the average sequence length is <1000. The parameter values produced by sr, the parameter values determined by t of shared seeds, for an output k value, that can be found within an aligned pair of sequences. t is within δ = 0 to evaluate how well As previously mentioned, e = 0.85 and the average length of the sequences is 200, e and when the average length of the sequences is 500, t, k) values. Furthermore, these results justify the existence of δ and its default value.To evaluate the symmetric difference between t, k). k used in practice. For divergence <0.25, map-ont. The  results  and 6a tMus spretus) (126 bp in length); the Northern American deer mouse (Peromyscus maniculatus bairdii) (125 bp in length); and the Shrew mouse (Mus pahari) (114 bp in length). These sequences have an optimal alignment identity of 0.744, 0.752, and 0.729, respectively. The orthologue identities were retrieved from the Ensebl genome browser  (699 bp in length); the Argentine black and white tegu  (714 bp in length); and the Common wombat (Vombatus ursinus) (708 bp in length). These sequences have an optimal alignment identity of 0.619, 0.567, and 0.538, respectively. There were again no output alignments by Vombatus ursinus).We also carried out similar experiments for the RAB15EP gene in human chromosome 12 (ENSG00000174236) (708 bp in length) with orthologues of this gene with the following species: the Abingdon island giant tortoise  values in comparison to those determined by k-mers as seeds. k values is challenging, and default k values provide suboptimal results.A large number of existing bioinformatics tools aim to perform sensitive sequence comparisons. Winnowmap2  values determined by no output alignments were produced using the default parameter values of In this article, we presented k consecutively sampled minimizers.For future work, we would be interested in extending vbad108_Supplementary_DataClick here for additional data file.


Kernel methods are a class of machine learning algorithms that utilise a kernel function to transform input data into a new representation. When appropriately normalised, the kernel function can be regarded as a notion of similarity between instances. However, many expressive notions of similarity are not valid kernel functions, meaning they cannot be used with standard kernel methods such as the support-vector machine (SVM). The Kreĭn-SVM represents generalisation of the standard SVM that admits a much larger class of similarity functions. In this study, we propose and develop Kreĭn-SVM models for AMP classification and prediction by employing the Levenshtein distance and local alignment score as sequence similarity functions. Utilising two datasets from the literature, each containing more than 3000 peptides, we train models to predict general antimicrobial activity. Our best models achieve an AUC of 0.967 and 0.863 on the test sets of each respective dataset, outperforming the in-house and literature baselines in both cases. We also curate a dataset of experimentally validated peptides, measured against Staphylococcus aureus and Pseudomonas aeruginosa, in order to evaluate the applicability of our methodology in predicting microbe-specific activity. In this case, our best models achieve an AUC of 0.982 and 0.891, respectively. Models to predict both general and microbe-specific activities are made available as web applications.Antimicrobial peptides (AMPs) represent a potential solution to the growing problem of antimicrobial resistance, yet their identification through wet-lab experiments is a costly and time-consuming process. Accurate computational predictions would allow rapid  We use an indefinite kernel method, the Kreĭn support vector machine, to predict antimicrobial activity of peptides. We evaluate the ability of the proposed methodology to predict general antimicrobial activity, as well as antimicrobial activity against specific species.Kernel methods are a class of machine learning algorithms that incorporate a kernel function in order to model non-linear relationships. Standard kernel methods assume that a given kernel function is positive-definite. Those kernel functions which do not satisfy this assumption are known as indefinite kernels. The assumption of positive-definiteness is restrictive, as it limits the number of applicable functions. Recent developments in the theory of learning with indefinite kernels have now removed this requirement, allowing a much broader class of functions to be incorporated into kernel methods.4–6 These molecules are usually made of 12 to 50 amino acid residues, and they typically possess certain properties, including cationicity, 30–50% hydrophobicity, and amphiphilicity. They exhibit good antimicrobial activity against a broad range of bacteria, viruses, fungi, and parasites. In addition, they have an inherent low risk of developing antimicrobial resistance (AMR), largely attributed to their underlying rapid membrane permeabilising activity.4,7,8 Such broad-spectrum and rapid antimicrobial activity has prompted researchers to consider AMPs as a potential remedy to the growing problem of AMR, which is a major global health threat.9,10 Nonetheless, there has so far been a lack of success in translating AMP-based therapy to clinical use, due to challenges such as complex structure–activity relationship (SAR), drug toxicity, instability in host and infective environment, and low financial incentives.11,12 Owing to the complex SAR and the costly and time-consuming process of wet-lab experiments associated with AMP investigations, many researchers have proposed computational approaches, including molecular dynamics (MD) simulations and machine learning (ML) algorithms, to accelerate the discovery and development of potential AMPs for clinical use.13–19AMPs, also known as host defense peptides, are a class of evolutionary conserved molecules that form an important component in the innate immune system.13–15 A wide range of ML algorithms have been utilised, including random forests,20 support vector machines (SVMs)20–24 and artificial neural networks.20–22,25,26 Many of these algorithms are used in combination with a carefully selected set of peptide features, which can be divided into two categories: compositional and physicochemical. The amino acid composition is the simplest example of a compositional feature, which is a vector containing counts of each amino acid in a given peptide. There are various extensions, such as the reduced amino acid composition27 and the pseudo amino acid composition.28 When computing the reduced amino acid composition, a peptide is represented in a reduced alphabet in which similar amino acids are grouped together. The pseudo amino acid composition accounts for composition as well as sequence-order information, as this is not considered in the standard amino acid composition. The set of physicochemical features include peptide properties such as the charge, hydrophobicity and isoelectric point.20,24,29 These features are typically average values of the respective properties calculated over the length of the peptide.Several studies have highlighted the promise of ML algorithms in predicting the antimicrobial activity, dissecting the complex SAR, and informing the drug design of AMPs.30 and Needleman–Wunsch31 algorithms, are computationally intensive and do not scale well to large problems. Many papers have advocated the use of alignment-free methods to determine sequence similarity.19,32–35 The success of these endeavours notwithstanding, sequence alignment functions are effective notions of biological-sequence similarity that can reflect ancestral, structural or functional similarity and therefore should not be overlooked. Several studies have utilised sequence alignment functions for AMP prediction. For example, Wang et al.36 and Ng et al.37 utilised the BLAST algorithm38 in a classification model by comparing the BLAST similarity scores of a query peptide to all those in the training set. Whilst these approaches led to accurate models, the BLAST algorithm is a heuristic method that finds only approximate optimal alignments. This approximation leads to generally faster results than what could be obtained by the Smith–Waterman algorithm, and it is one of the main reasons practitioners choose to use it. However, on the relatively small datasets in the aforementioned studies, it is interesting to consider whether the same approaches using the optimal alignment score would improve the models.Classical sequence alignment algorithms, such as the Smith–Waterman39–42 in that they are indefinite, meaning they cannot be used with an SVM. Recent developments have now alleviated this problem, facilitating a much larger class of similarity functions to be used in conjunction with an SVM. Loosli et al.1 present an algorithm for learning an SVM with indefinite kernels. Their approach relies on a method of stabilisation, meaning there is no guarantee of global optimality. On the other hand, the Kreĭn-SVM3 is an algorithm for learning an SVM with indefinite kernels that is guaranteed to find a globally optimal solution.The SVM is a well-known ML algorithm for classification and can incorporate a kernel function in order to learn non-linear classification boundaries. The kernel function greatly influences the performance of the resulting classification model. When appropriately normalised, a kernel function can be regarded as a similarity function. A useful kernel function should produce similarities that are relevant to the problem. Many expressive notions of similarity are not valid kernel functions,43,44 on two AMP datasets from the literature. Furthermore, we tested the ability of our approach to detect activity against specific species on a dataset of experimentally validated peptides measured against both Staphylococcus aureus ATCC 29213 and Pseudomonas aeruginosa ATCC 27853, henceforth referred to as S. aureus ATCC 29213 and P. aeruginosa ATCC 27853. Our trained models are made available as web applications at http://comp.chem.nottingham.ac.uk/KreinAMP, for the prediction of both general and species-specific activities.In this work, we utilised the Kreĭn-SVM algorithm to assess the effectiveness of sequence alignment functions for AMP classification. We performed an empirical comparison of both the local alignment score and Levenshtein distance244 and the local alignment score. Finally, we describe our computational and microbiological methodology.AMP prediction models were developed using the Kreĭn-SVM algorithm in conjunction with sequence alignment functions, which we formally define in this section. We initially describe the more familiar SVM, before moving on to the Kreĭn-SVM. We then define the Levenshtein distance2.12.1.1The SVM is a ML algorithm used for classification. The result of training an SVM is a hyperplane whose distance to the closest training instance, in either class, is maximal. Furthermore, instances from each class are required to reside on separate sides of the hyperplane. New instances are classified based solely on which side of the hyperplane they are located. The distance from the hyperplane to the closest training instance is known as the margin. The hyperplane that maximises the margin is the maximum-margin hyperplane and this is what is produced when training an SVM.xi the i-th training instance and by yi its corresponding label. Furthermore,  denotes the RKHS from which a solution is found. The solution is a function  and a vector of slack variables ξ which minimise the objective function, subject to the constraints. The constraint yif(xi) ≥ 1 − ξi imposes that the i-th instance lies on the correct side of the hyperplane and that its distance to the hyperplane is greater than or equal to the margin. An instance xj which does not satisfy this constraint contributes a value of ξj2 to the objective function, where ξj is the distance between xj and the margin. The  term in the objective function is the total contribution of all instances which do not satisfy the constraints. The  term is the norm of the considered function and acts as a measure of complexity. The hyperparameter λ can be tuned to provide a balance between the number of instances that violate the constraints and the complexity of the considered function.The decision surface associated with a hyperplane is inherently linear, which can be restrictive when the two classes are not linearly separable. This issue is mitigated through the use of a kernel function, which implicitly maps the instances into a new space. The space in which the instances are mapped is known as a reproducing kernel Hilbert space (RKHS), and every kernel function is uniquely associated to a RKHS. When incorporating a kernel function, the SVM finds the maximum-margin hyperplane in the associated RKHS and this can correspond to a non-linear decision surface in the original space. This surface allows greater flexibility when separating the two classes but also increases the possibility of overfitting. Perfectly separating a noisy dataset is often indicative of overfitting. The Soft Margin SVM helps alleviate this problem by allowing some instances to reside on the incorrect side of the hyperplane. 2.1.2 the associated RKKS. Similarly to the SVM, the solution is a function  and a vector of slack variables ξ which minimise the objective function. The first term in the objective function, as well as the constraints, have the same interpretation as in  can be expressed as a direct sum of the formwhere  are RKHSs. This means that any function  can be decomposed as f = f+ ⊕ f−, where . Hence, regularisation in λ± can be tuned to provide a balance between the number of instances that violate the constraints and the regularisation of each decomposition component.The Kreĭn-SVM is a classification algorithm that is defined to incorporate a much broader class of kernel functions, known as indefinite kernel functions. Similarly to a standard kernel function, an indefinite kernel function implicitly maps instances into a new space. However, the space associated to an indefinite kernel function is known as a reproducing kernel Kreĭn Space (RKKS). Whilst operating in different spaces, the SVM and Kreĭn-SVM are conceptually similar. Both algorithms incorporate a kernel function, find the maximum-margin hyperplane in the associated space and are capable of learning non-linear decision surfaces.2.245 and Yujian and Bo.43 First, we clarify our terminology.We now proceed to define the sequence similarities used throughout this work. This section closely follows the works of Setubal and Meidanis2.2.1n ⊆ Σ be the set of all strings of length n from Σ and Σ* the set of all strings from that alphabet. A string s ∈ Σ* of length n is a sequence of characters that can be indexed as s = s1…sn. Given a string s ∈ Σn, we say that u ∈ Σm is a subsequence of s if there exists a set of indices I = {i1, …, im} with 1 ≤ i1 ≤ … ≤ im ≤ n, such that uj = Sij for j = 1, …, m. We write u = s[I] for short. We say that v ∈ Σl is a substring of s if v is a subsequence of s with index set J = {j1, …, jl} such that jr+1 = jr + 1 for r = 1, …, l − 1. That is, v is a subsequence consisting of consecutive characters of s.Let Σ be a finite alphabet, Σ2.2.2The goal of a sequence alignment is to establish a correspondence between the characters in two sequences. In the context of bioinformatics, a pairwise alignment can indicate ancestral, structural or functional similarities between the pair of sequences. In this section, we provide a formal review of global sequence alignment.s ∈ Σn and t ∈ Σm be two strings over Σ. Define Σg = Σ ∪ {“−”} as the extension of Σ with the gap character “−”. The tuple α =  is a global alignment of sequences s and t if and only ifLet Σ be an alphabet and let (1) s′| = |t′| = l, such that max ≤ l ≤ m + n,(2) |s′ obtained by removing all gap characters is equal to s,(3) The subsequence of t′ obtained by removing all gap characters is equal to t,(4) The subsequence of .(5) Definition 2.1 provides a formal definition of global alignment. Whilst many possible alignments exist for two strings, the goal of sequence alignment is to find an alignment that optimises some criterion. A scoring function, presented in Definition 2.2, can be used to quantify the “appropriateness” of an alignment. An optimal global alignment is then one which is optimal with respect to a given scoring function, as shown in Definition 2.3.g = Σ ∪ {“−”} be the extension of Σ with the gap character “−” and  be a function defined over the elements of Σg. We say p is a similarity scoring function over Σg if, for all x, y ∈ Σ, we haveLet Σ be an alphabet, Σp > 0,(1) p > p,(2) p = p,(3) p ≤ 0,(4) p = −∞.(5) p is a distance scoring function over Σg if, for all x, y, z ∈ Σ, we haveSimilarly, we say p = 0,(1) p > 0,(2) p = p,(3) p > 0,(4) p ≤ p + p,(5) p = ∞.(6) g = Σ ∪ {“−”} be the extension of Σ with the gap character “−” and consider two strings s ∈ Σn, t ∈ Σm. Let α =  be a valid global alignment of s and t ,  be a scoring function over Σg and  be the space of all valid alignments of s and t. The score  of α with respect to the scoring function p is defined asIf p is a similarity scoring function, then the optimal global alignment α* with respect to p is defined asSimilarly, if p is a distance scoring function then the optimal global alignment α* with respect to p is defined asLet Σ be an alphabet, Σ46 as it is a standard choice when performing sequence alignment.Since an alignment is optimal with respect to a given scoring function, it is natural to consider which scoring function to use in order to obtain the most meaningful alignments. In the context of biological sequences, researchers have been considering this problem for many years. A number of families of scoring matrices have been designed to encode useful notions of similarity. In this work, we only considered the BLOSUM62 scoring matrix,2.2.3The string edit distance defines a useful notion of distance between a pair of strings. It is informally defined as the minimum number of edit operations required to transform one string into another. The Levenshtein distance is a variant of the string edit distance that allows the operations of substitution, deletion and insertion of characters, and these are defined in Definition 2.4.a, b ∈ Σ, we denote by a → b the elementary edit operation that substitutes a with b. Denoting by ε the null character (the empty string), we can define the elementary edit operations of insertion and deletion as ε → b and a → ε, respectively.Let Σ be an alphabet. For two characters In order to define more complex transformations, one can consider the consecutive application of a sequence of elementary edit operations. Of special interest to the Levenshtein distance are those sequences of operations that transform one string into another. Such a sequence is known as an edit path and its length is defined as the number of operations in the sequence. The Levenshtein distance between two strings is defined as the length of the minimum length edit path, as seen in Definition 2.5.s ∈ Σn and t ∈ Σm from Σ. An edit path from s to t is denoted by Ps,t and represents a sequence of elementary edit operations that transforms s into t. Denote by |Ps,t| the number of operations contained in Ps,t and by  the space of all edit paths from s to t. The Levenshtein distance dL between s and t is defined asLet Σ be an alphabet and consider two strings p: Σg × Σg → {0, 1} defined asDefinition 2.5 shares some interesting similarities with Definition 2.3. Both problems solve a combinatorial optimisation problem and, indeed, the Levenshtein distance can be realised as a special case of global alignment. More specifically, consider the distance scoring function s ∈ Σn and t ∈ Σm, let their optimal global alignment with respect to p be equal to α* = {s′, t′}. Define the set U asFor two strings  of α* with respect to p is equal to the cardinality of U. This is exactly equal to the Levenshtein distance between s and t.Then the score 2.2.4A global alignment produces an alignment which spans the whole length of a pair of strings. It is based on the assumption that the strings are related in their entirety. This assumption can be restrictive, since it is often the case that certain substrings exhibit high similarity whilst others do not. A local alignment produces an alignment that finds those high similarity substrings. That is, it finds the highest scoring global alignment from all possible substrings of the pair of strings. We formalise this notion in Definition 2.6.g = Σ ∪ {“−”} be the extension of Σ with the gap character “−” and  be a similarity scoring function. For a string s ∈ Σn, let  be the space of all index sets such that for any , s[Is] is a valid substring of s. Similarly, for a string t ∈ Σm, let  be the space of all index sets such that for any , t[It] is a valid substring of t. For any  and , denote by α* the optimal global alignment of s[Is] and t[It] with respect to p. The optimal local alignment  of s and t with respect to p is defined asLet Σ be an alphabet, Σ2.3This section discusses the setup of our computational evaluation, as well as the datasets used.2.3.1k-mer kernel. The former is a positive-definite kernel function; peptides are represented via their amino acid composition and the kernel is defined as the inner product under this representation. The latter is also a positive-definite kernel function. It has produced accurate models in a number of biological-sequence classification tasks47–49 and hence makes for a useful baseline. When applicable, we also compared our models with AMP identification tools from the literature. The parasail package50 was used to compute local alignment scores. We only considered normalised variants of the local alignment score and Levenshtein distance, with the normalisation performed according to Schölkopf et al.51 and Yujian and Bo,43 respectively. We report the accuracy, the area under the receiver operating characteristic curve (AUC) and Matthews correlation coefficient (MCC) to compare models. The accuracy and MCC are defined in To assess the usage of learning with sequence alignment functions, we performed a series of computational experiments on a number of AMP datasets. In each of our evaluations, we tested both the local alignment score (LA) and the Levenshtein distance (LEV) in conjunction with the Kreĭn-SVM algorithm. We compare against two baselines: an SVM with amino acid composition kernel and an SVM using the gapped 52 In order to allow for a fair comparison, all models used the same training and test splits. The optimal hyperparameters were selected by performing an exhaustive grid search over the training set, using 10-fold cross validation. The λ hyperparameter of the SVM algorithm, as well as the λ+ and λ− hyperparameters of the Kreĭn-SVM algorithm, were selected from {0.01, 0.1, 1, 10, 100}. The Levenshtein distance and amino acid composition kernel have no hyperparameters to control; we used the default values for the hyperparameters of the local alignment score. The gapped k-mer kernel has two hyperparameters g and m and is quite susceptible to their values. The optimal value of g was selected from {1, 2, 3, 4, 5} and the optimal value of m was selected from {1, 2, 3, …, 10}. It is required that g > m, so only valid combinations of the two were considered. In our nested cross-validation experiments, we used 10 inner and 10 outer folds and the reported results are averaged over the outer fold test sets.The AUC is defined as the probability that a classifier will score a randomly chosen positive instance higher than a randomly chosen negative instance.2.3.226 and DeepAMP,25 in order to test the ability of approach to predict general antimicrobial activity. Detailed discussions on the creation of these datasets can be found in the original studies. The AMPScan and DeepAMP datasets contain 3556 and 3246 instances, respectively. Each dataset also contains a 50 : 50 ratio of AMPs to non-AMPs, allowing us to avoid issues that result from class imbalance. Associated to each dataset is a specific test set, and reporting results on this set allows comparison with the authors' proposed models. Despite being of similar size, one major differentiating factor between the two datasets is the length of peptides. 53 provides evidence to reject the null hypothesis that the peptide length distributions of the AMPScan and DeepAMP datasets are identical. DeepAMP contains generally shorter peptides than AMPScan. Indeed, the DeepAMP dataset was curated since short-length AMPs have been shown to exhibit enhanced activity, lower toxicity and higher stability as opposed to their longer counterparts.54,55 More importantly, synthesis is cheaper for the short AMPs than the full-length AMPs, which increases the potential for clinical translation and commercialisation.12We selected two AMP classification datasets from the literature, which we refer to as AMPScan2.3.3S. aureus ATCC 29213 and P. aeruginosa ATCC 27853. To make this dataset suitable for classification, we label a peptide as active if its MIC <100 μg mL−1 and inactive otherwise. Further details of the microbiological experimentation used to construct this dataset can be found in Section 2.4.To test the ability of our methodology to identify activity against specific species, we have utilised an external dataset of 16 peptides with minimum inhibitory concentration (MIC) measured against et al.56 have shown that, given an appropriate training dataset, predictive models of peptide activity against specific species can be constructed. This involves training a separate model for each species of interest, which, in this case, was the DBSCAN algorithm.57 Their model predicting activity against E. coli ATCC 25922 achieved a balanced accuracy of 0.79, which was greater than a number of common AMP prediction tools.56 Furthermore, models to predict activity against S. aureus ATCC 25923 and P. aeruginosa ATCC 27853 were made publicly available as web-tools.Vishnepolsky et al. to construct useful training datasets for our problem. We utilised the Database of Antimicrobial Activity and Structure of Peptides (DBAASP) as a source of data. DBAASP contains peptide activity measurements against a wide-range of species,58 including those of interest to us. We extracted from DBAASP all peptides with activity measured against S. aureus ATCC 29213, S. aureus ATCC 25923 or P. aeruginosa ATCC 27853 subject to the following conditions: (i) peptide length in the range , (ii) without intrachain bonds, (iii) without non-standard amino acids and (iv) MIC measured in μg mL−1 or μM. Condition (i) was imposed as that is the range of peptide lengths in our external test set. Conditions (ii) and (iii) were imposed following the recommendation of the Vishnepolsky et al. and condition (iv) was imposed as conversion from μM to μg mL−1 is possible by estimating the molecular weight of a given sequence. Since no web-tool to predict activity against S. aureus ATCC 29213 was available, we couldn't directly compare our results. Instead, we collected data for peptides active against S. aureus ATCC 25923. This allowed us to compare our models with the state of the art provided by Vishnepolsky et al.We follow the methodology of Vishnepolsky S. aureus ATCC 29213, S. aureus ATCC 25923 and P. aeruginosa ATCC 27853 were created using the data collected from DBAASP. We refer to these datasets as SA29213, SA25923, and PA27853, respectively. The peptides in the respective datasets were labelled according to their activity against the specific strain. Each dataset is constructed from highly active peptides (MIC ≤25 μg mL−1) and inactive peptides (MIC ≥100 μg mL−1). A peptide with 25 μg mL−1 < MIC <100 μg mL−1 would not be included in our training dataset. This large interval allows us to account for experimental errors, which in turn increases the confidence in our class labels. In the case that a peptide was associated to multiple activity measurements, the median value was taken to represent its activity. As shown in Three separate datasets of peptides with activity measured against 2.4S. aureus and P. aeruginosa.7 These peptides were commercially synthesised by Mimotopes  via solid phase Fmoc synthesis and were purified by reverse phase high performance liquid chromatography (RP-HPLC) to >95% purity. The efficacy of these peptides was already experimentally validated using established MIC assay with broth microdilution method approved by the Clinical and Laboratory Standards Institute. Full detail of the previously conducted microbiological experiment can be found in the previous study.7A previously established dataset of 16 short-length peptides (18 amino acids or shorter in length) was used to test the ability of the developed ML algorithms in predicting antimicrobial activity against 3S. aureus ATCC 29213 and P. aeruginosa ATCC 27853 on an experimentally validated dataset of 16 peptides, for which the proposed approach produces accurate models.In Section 3.1, we discuss the ability of our models to identify general antimicrobial activity. We observe that our proposed models consistently outperform the baselines and, in some cases, the models proposed in the literature. One shortcoming of any computational model that identifies general antimicrobial activity is that it cannot be used to identify activity against specific species. We address this shortcoming in Section 3.2, by training our models to identify activity against 3.13.1.1t-test,59 with p = 0.05, is used to compare the test set AUC of our proposed models against the baseline SVM with Gapped k-mer kernel across the outer folds of nested cross-validation. Adjusting for the testing of multiple hypotheses with the Bonferroni correction, we observe a significant difference between the mean AUC of the local alignment score and that of the baseline SVM with Gapped k-mer kernel on the AMPScan dataset. All other comparisons, including those on the DeepAMP dataset, are not significant. The performance of all models is greater on the AMPScan dataset than on the DeepAMP dataset. This may, in part, be due to the fact that DeepAMP contains generally shorter peptides. Shorter peptides provide less information to the models, which can limit their discriminative ability.The performance of the AMP classifiers on the considered datasets is reported in 3.1.23.2S. aureus ATCC 29213 and P. aeruginosa ATCC 27853. In this section, we highlight the ability of our models to identify AMPs that are active against specific species, particularly et al.56 As mentioned in Section 2.3.3, at the time of publication, there is no web-tool to predict activity against S. aureus ATCC 29213. Hence, we also provide results for models trained on SA25923 and tasked with predicting activity against S. aureus ATCC 29213. There is clearly a general improvement over the models trained on the AMPScan and DeepAMP datasets, indicating that the models have much greater discriminative power. On the SA29213 dataset, the baseline SVM with amino acid composition kernel is the most predictive with respect to all the metrics. All remaining models achieve the same accuracy and MCC. Considering the SA25923 dataset, the Levenshtein distance produces a model with the same accuracy and MCC as the web-tool but with a larger AUC. It also achieves the same accuracy and AUC as the baseline SVM with amino acid composition kernel, but with a larger MCC. It is interesting to note that the models trained on SA25923 can still make accurate predictions on S. aureus ATCC 29213. Whilst these are two different strains, the findings suggest that the antimicrobial susceptibility to the AMPs is similar for both strains, implying similar mechanisms work in the same species. Considering the PA27853 dataset, the baseline SVM with amino acid composition kernel performs the best against all metrics. We find that the local alignment score, Levenshtein distance and baseline SVM with Gapped k-mer kernel produce equally accurate models, all of which are more accurate than the web-tool. However, the AUC of the local alignment score and Levenshtein distance are considerably higher than that of the baseline SVM with Gapped k-mer kernel. Whilst it is difficult to make any strong conclusions on such a small dataset, it is still encouraging to observe that our models achieve similar accuracy to both the baseline models and web-tools.4We have assessed the capabilities of sequence alignment functions coupled with the Kreĭn-SVM as AMP classification models. Our investigations indicate that the proposed methodology produces accurate classifiers of both general and species-specific antimicrobial activity of AMPs. The utility of our methodology is twofold. Firstly, since sequence alignment algorithms operate directly on amino acid sequences, these methods do not explicitly require the use of peptide features. This removes the need for the practitioner to decide which features to use, which is often a detailed and time-consuming process. Secondly, in all of our experiments, we used the local alignment score with its default hyperparameters. Having achieved such promising results, it prompts the question of whether more accurate models could be attained by also tuning the various hyperparameters of the local alignment score, such as the choice of scoring function, which we will explore in future work.de novo AMPs. In addition, the promising results generated from this study open a number of possible avenues for further work. Our identification of activity against specific species could be improved using a larger external test set, allowing us to draw stronger conclusions. Furthermore, the methodology we have presented is not specific to the classification of AMPs. We suspect that the Kreĭn-SVM coupled with sequence alignment functions could be applied to other biological-sequence classification tasks. Our computational findings demonstrate not only the feasibility of the proposed approach but more generally the utility of the Kreĭn-SVM as a classification algorithm. Its use of indefinite kernel functions provides a means for practitioners to learn from domain-specific similarity functions without the concern of verifying the positive-definite assumption. This is beneficial since it is often well beyond the expertise of the practitioner to verify this assumption. Whilst we have explored its use when combined with sequence alignment functions, there exist many more indefinite kernel functions with which the Kreĭn-SVM could be combined. Furthermore, the theoretical insight of separately regularising the decomposition components of a function in a Kreĭn space could be applied to develop other indefinite kernel-based learning algorithms. A notable example that relates to the current study would be to extend the One-Class SVM60 to incorporate indefinite kernel functions. The One-Class SVM is a kernel-based learning algorithm that performs anomaly detection.61 It has previously been applied to identify the domain of applicability of virtual screening models.62 An indefinite kernel extension of the One-Class SVM could be directly applied to estimate the domain of applicability of our models.As the chemical space of natural peptides is extremely large, the development of highly accurate classifiers will help accelerate the discovery and development of novel https://github.com/Mrjoeybux/KreinAMP.The source code and data used to reproduce the computational experiments is available at Joseph Redshaw: conceptualisation, data curation, formal analysis, investigation, software, methodology, visualisation, writing – original draft. Darren S. J. Ting: conceptualisation, methodology, resources, writing – original draft. Alex Brown: validation, software, writing – review & editing. Jonathan D. Hirst: conceptualisation, methodology, project administration, resources, supervision, writing – review & editing. Thomas Gärtner: conceptualisation, methodology, supervision, writing – review & editing.A. B. is an employee and shareholder in GSK.