Search bioRxiv⌕ Search

Biology subjects

Groot Koerkamp, R.

Publications and source records attributed to Groot Koerkamp, R..

3 recordsLinked to original sources

The mod-minimizer: a simple and efficient sampling algorithm for long k-mers

MotivationGiven a string S, a minimizer scheme is an algorithm defined by a triple (k, w, [O]) that samples a subset of k-mers (k-long substrings) from a string S. Specifically, it samples the minimal k-mer according to the order [O] from each window of w consecutive k-mers in S. Because consecutive windows can sample the same k-mer, the set of the sampled k-mers is typically much smaller than S. More generally, we consider substring sampling algorithms that respect a window guarantee: at least one k-mer must be sampled from every window of w consecutive k-mers. As a sampled k-mer is uniquely identified by its absolute position in S, we can define the density of a sampling algorithm as the fraction of distinct sampled positions. Good methods have low density which, by respecting the window guarantee, is lower bounded by 1/w. It is however difficult to design a sequence-agnostic algorithm with provably optimal density. In practice, the order [O] is usually implemented using a pseudo-random hash function to obtain the so-called random minimizer. This scheme is simple to implement, very fast to compute even in streaming fashion, and easy to analyze. However, its density is almost a factor of 2 away from the lower bound for large windows. MethodsIn this work we introduce mod-sampling, a two-step sampling algorithm to obtain new minimizer schemes. Given a (small) parameter t, the mod-sampling algorithm finds the position i of the minimal t-mer in a window. It then samples the k-mer at position i mod w. The lr-minimizer uses t = k - w and the mod-minimizer uses t {equiv} k (mod w). ResultsThese new schemes have provably lower density than random minimizers and other schemes when k is large compared to w, while being as fast to compute. Importantly, the mod-minimizer achieves optimal density when k [->] {infty}. Although the mod-minimizer is not the first method to achieve optimal density for large k, its proof of optimality is simpler than previous work. We provide pseudocode for a number of other methods and compare to them. In practice, the mod-minimizer has considerably lower density than the random minimizer and other state-of-the-art methods, like closed syncmers and miniception, when k > w. We plugged the mod-minimizer into SSHash, a k-mer dictionary based on minimizers. For default parameters (w, k) = (11, 21), space usage decreases by 15% when indexing the whole human genome (GRCh38), while maintaining its fast query time.

bioinformatics↗

A*PA2: up to 20 times faster exact global alignment

MethodsWe introduce A*PA2, an exact global pairwise aligner with respect to edit distance. The goal of A*PA2 is to unify the near-linear runtime of A*PA on similar sequences with the efficiency of dynamic programming (DP) based methods. Like EO_SCPLOWDLIBC_SCPLOW, A*PA2 uses Ukkonens band doubling in combination with Myers bitpacking. A*PA2 1) extends this with SIMD (single instruction, multiple data), 2) uses large block sizes inspired by BO_SCPLOWLOCKC_SCPLOW AO_SCPLOWLIGNERC_SCPLOW, 3) avoids recomputation of states where possible as suggested before by Fickett, 4) introduces a new optimistic technique for traceback based on diagonal transition, and 5) applies the heuristics developed in A*PA and improves them using pre-pruning. ResultsThe average runtime of A*PA2 is 19x faster than the exact aligners BO_SCPLOWIC_SCPLOWWFA and EO_SCPLOWDLIBC_SCPLOW on >500 kbp long ONT reads of a human genome having 6% divergence on average. On shorter ONT reads of 11% average divergence the speedup is 5.6x (avg. length 11 kbp) and 0.81x (avg. length 800 bp). On all tested datasets, A*PA2 is competitive with or faster than approximate methods. Availabilitygithub.com/RagnarGrootKoerkamp/astar-pairwise-aligner Contactragnar.grootkoerkamp@inf.ethz.ch

bioinformatics↗

Exact global alignment using A* with seed heuristic and match pruning

MotivationSequence alignment has been at the core of computational biology for half a century. Still, it is an open problem to design a practical algorithm for exact alignment of a pair of related sequences in linear-like time (Medvedev, 2022b). MethodsWe solve exact global pairwise alignment with respect to edit distance by using the A* shortest path algorithm. In order to efficiently align long sequences with high divergence, we extend the recently proposed seed heuristic (Ivanov et al., 2022) with match chaining, gap costs, and inexact matches. We additionally integrate the novel match pruning technique and diagonal transition (Ukkonen, 1985) to improve the A* search. We prove the correctness of our algorithm, implement it in the A*PA aligner, and justify our extensions intuitively and empirically. ResultsOn random sequences of divergence d=4% and length n, the empirical runtime of A*PA scales near-linearly with length (best fit n1.06, n[&le;]107 bp). A similar scaling remains up to d=12% (best fit n1.24, n[&le;]107 bp). For n=107 bp and d=4%, A*PA reaches >500x speedup compared to the leading exact aligners EDLIB and BIWFA. The performance of A*PA is highly influenced by long gaps. On long (n>500 kbp) ONT reads of a human sample it efficiently aligns sequences with d<10%, leading to 3x median speedup compared to EDLIB and BIWFA. When the sequences come from different human samples, A*PA performs 1.7x faster than EDLIB and BIWFA. Availabilitygithub.com/RagnarGrootKoerkamp/astar-pairwise-aligner Contactragnar.grootkoerkamp@inf.ethz.ch, pesho@inf.ethz.ch

bioinformatics↗