1 Introduction
To handle the volume from next-generation sequencing data, modern sequence comparison often relies on summary sketches such as minimizers (Roberts et al., 2004; Schleimer et al., 2003), syncmers (Edgar, 2021) and minimally overlapping words (Frith et al., 2021). Let us call a substring of length within a sequence a -mer. Sequence sketches are often the consequence of a rule for selecting -mers from a sequence. If the rule depends only on the -mer under scrutiny and not on the sequence context (Shaw and Yu, 2021), call the rule 1-local. In this context, consider a long sequence where bases are mutated independently with probability . Eyeing applications where the mutated sequence is mapped onto the original sequence by -mer matches, Theorem 2 of Shaw and Yu (2021) quantifies how frequently -mers in a sketch are conserved under mutation of the original sequence.
Theorem 2 concerns itself with two vectors each of probabilities, denoted and . To explain , call a run of consecutive unmutated -mers, i.e. a run of unmutated letters, an -run. On the one hand, focuses on a letter chosen randomly from the middle of the long unmutated sequence. The -mers containing the chosen letter include a total of letters. Let be the probability that the longest unmutated run within the letters is an -run. A classical formula (Shaw and Yu, 2021) determines explicitly. To explain , it relates -runs directly to the sketch determined by the rule . Consider an -run () chosen randomly from the middle of a long random sequence. Let the -run probability be the probability that selects at least one -mer from the -run. For any rule , then, we can define the vector of -run probabilities. Loosely, quantifies the spread of the sketch with rule : if bunches the -mers it selects too closely, the sketch is less likely to include a -mer from a random -run in the middle of a long sequence. Further details may be found in Shaw and Yu (2021).
Among other results in Shaw and Yu (2021), Theorem 2 gave a dot-product anticipating the practical performance of a sketch using a 1-local rule in mapping applications. In particular, the probability that a randomly chosen letter is within an unmutated -mer selected by a rule is
(1) |
where the right side is the probability that the longest unmutated run containing the letter is an -run times the probability that the rule includes a -mer from the -run in the sketch, summed over by a dot-product. Details may be found in the original article (Shaw and Yu, 2021).
Shaw and Yu (2021) examine the consequences of Equation (1) for minimizers (Roberts et al., 2004; Schleimer et al., 2003) and for both closed and open syncmers (Edgar, 2021). Note that the rule for syncmers is 1-local, unlike the rule for minimizers. Section 4 in Shaw and Yu (2021) analyzes rules for selecting minimizers and syncmers under the assumption of a randomized hash function, neglecting equal -mers as rare and thereby imposing a uniform distribution on the permutation ordering the relevant -mer hashes. Recursions on four variables calculated , with variants tailored for the different rules under scrutiny. For closed syncmers, the recursion was equivalent to a closed formula for , but for minimizers and open syncmers, closed formulas appeared unavailable. From a practical point of view, the original four-variable recursions pose programming difficulties and they are computationally expensive for large parameter values. The purpose of this letter is to replace the recursion for minimizers with a simple explicit formula that alleviates these problems and to justify it directly with a combinatorial heuristic. The Section 3 points out that the formula is likely to generalize to other sketches.
2 Methods and results
Our set-up follows Section 2.2.1 in Shaw and Yu (2021). In windows consisting of -mers, therefore, the minimizers are the smallest -mers, where a fixed random hash function determines the ordering on the -mers. Minimizers are the earliest sketch (Roberts et al., 2004; Schleimer et al., 2003) and they come with two very attractive properties. First, they have a window guarantee that every substring of length contains at least one minimizer. Second, the distance between consecutive minimizers follows a uniform first-occurrence distribution: their spacing is uniform on the set (Edgar, 2021).
For brevity, this letter identifies the -mers with their random hashes, so for our purposes below a -mer or a minimizer has length 1; a -mer is positioned at the sequence index of its start; an -run has length ; every consecutive -mers contains at least one minimizer; and if a minimizer is at index 0, the next minimizer has a random index chosen uniformly from the set .
Let be the event where the random -run of the Section 1 contains no minimizer. Every window of length or more contains a minimizer, so on the one hand for , . For , on the other hand, there is a rightmost minimizer strictly to the left of the -run. For convenience, set up a sequence coordinate system assigning index 0 to . Let be the next minimizer to the right of . The minimizer is at some uniformly distributed index (Edgar, 2021). The -run starts (by stationarity) at some uniformly distributed index between and . The total number of configurations for the minimizer and the -test window is therefore .
On the event , the -run contains no minimizer, so must be strictly to the right of the -run, i.e. . The total number of configurations allowed under for the minimizer and the -run is therefore . For minimizers, all distributions involved are uniform (in particular, the first-occurrence distribution of distance between consecutive minimizers), so the probabilities are proportional to the configuration counts. Thus,
(2) |
The present author and others (J.Shaw and Y.W.Yu, personal communication) performed extensive numerical computations looping over both and to compare Equation (2) with the recursion in Theorem 7 of Shaw and Yu (2021), confirming empirically that for minimizers. Notably for , Equation (2) yields , yielding the density of minimizers , a classical result (Roberts et al., 2004; Schleimer et al., 2003).
3 Discussion
Although the uniform first-occurrence distribution between consecutive minimizers simplifies formulas in Section 2, it is inessential to the heuristic there (J.Shaw and Y.W.Yu, personal communication). Our results therefore suggest the existence of a simple general formula for interconversion of first-occurrence distributions and -run probabilities. Presently, the interconversion requires complicated recursive methods (Dutta et al., 2022). The results presented may therefore be useful in accelerating the current interest and progress in understanding -mer sketches (Belbasi et al., 2022).
Acknowledgements
The author gratefully acknowledges useful conversations with Dr Martin C. Frith, Dr Jim Shaw and Dr Yun William Yu.
Funding
This research was supported by the Intramural Research Program of the NIH, National Library of Medicine.
Conflict of Interest: none declared.
Data Availability
The article introduces no new data, so vacuously all links and identifiers for relevant data are present in the manuscript.
References
- Belbasi M. et al. (2022) The minimizer Jaccard estimator is biased and inconsistent. bioRxiv. https://doi.org/10.1101/2022.01.14.476226. [DOI] [PMC free article] [PubMed]
- Dutta A. et al. (2022) Parameterized syncmer schemes improve long-read mapping. bioRxiv. https://doi.org/10.1101/2022.01.10.475696. [DOI] [PMC free article] [PubMed]
- Edgar R. (2021) Syncmers are more sensitive than minimizers for selecting conserved k-mers in biological sequences. PeerJ, 9, e10805. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Frith M.C. et al. (2021) Minimally-overlapping words for sequence similarity search. Bioinformatics, 36, 5344–5350. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Roberts M. et al. (2004) Reducing storage requirements for biological sequence comparison. Bioinformatics, 20, 3363–3369. [DOI] [PubMed] [Google Scholar]
- Schleimer S. et al. (2003) Winnowing: local algorithms for document fingerprinting. In: SIGMOD 2003. ACM, San Diego, CA, pp. 76–85.
- Shaw J., Yu Y.W. (2021) Theory of local k-mer selection with applications to long-read alignment. bioRxiv. https://doi.org/10.1011/2021.05.22.445262. [DOI] [PMC free article] [PubMed]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Data Availability Statement
The article introduces no new data, so vacuously all links and identifiers for relevant data are present in the manuscript.