Back

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

Groot Koerkamp, R.; Pibiri, G. E.

2024-07-07 bioinformatics
10.1101/2024.05.25.595898 bioRxiv
Show abstract

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 smallest 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 p of the smallest t-mer in a window. It then samples the k-mer at position p 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. 2012 ACM Subject ClassificationTheory of computation [->] Sketching and sampling; Applied computing [->] Bioinformatics Digital Object Identifier10.4230/LIPIcs.WABI.2024.11 Supplementary MaterialSoftware (C++): github.com/jermp/minimizers Software (Rust): github.com/RagnarGrootKoerkamp/minimizers FundingRagnar Groot Koerkamp: ETH Research Grant ETH-1721-1 to Gunnar Ratsch. Giulio Ermanno Pibiri: European Unions Horizon Europe research and innovation programme (EFRA project, Grant Agreement Number 101093026). This work was also partially supported by DAIS - Ca Foscari University of Venice within the IRIDE program.

Matching journals

The top 4 journals account for 50% of the predicted probability mass.

1
Algorithms for Molecular Biology
17 papers in training set
Top 0.1%
22.6%
2
Bioinformatics
1204 papers in training set
Top 2%
15.7%
3
Genome Research
468 papers in training set
Top 0.5%
8.1%
4
Journal of Computational Biology
48 papers in training set
Top 0.2%
5.0%
50% of probability mass above
5
Cell Systems
201 papers in training set
Top 1%
4.5%
6
PLOS Computational Biology
1863 papers in training set
Top 8%
4.2%
7
PLOS ONE
5266 papers in training set
Top 33%
4.2%
8
Nature Communications
5641 papers in training set
Top 34%
3.3%
9
iScience
1154 papers in training set
Top 10%
2.5%
10
IEEE/ACM Transactions on Computational Biology and Bioinformatics
38 papers in training set
Top 0.5%
1.8%
11
Scientific Reports
3612 papers in training set
Top 52%
1.8%
12
BMC Bioinformatics
457 papers in training set
Top 4%
1.7%
13
Proceedings of the National Academy of Sciences
2444 papers in training set
Top 30%
1.5%
14
Journal of The Royal Society Interface
235 papers in training set
Top 3%
1.5%
15
Theoretical Population Biology
50 papers in training set
Top 0.3%
1.5%
16
Biophysical Journal
631 papers in training set
Top 3%
1.5%
17
Nature Computational Science
55 papers in training set
Top 0.8%
1.5%
18
Journal of Theoretical Biology
162 papers in training set
Top 2%
1.1%
19
Nature Biotechnology
172 papers in training set
Top 4%
0.9%
20
Nature Methods
385 papers in training set
Top 6%
0.9%
21
PeerJ
308 papers in training set
Top 10%
0.9%
22
Peer Community Journal
281 papers in training set
Top 5%
0.9%
23
IEEE Transactions on Computational Biology and Bioinformatics
20 papers in training set
Top 0.7%
0.6%