docs: update k-mer indexing docs to use obiskim terminology
Replace references to OBIKmer with obiskim in k-mer indexing documentation and clarify technical constraints. The changes align the documentation with the current implementation details, including representation limits and ordering rules. - Update `.crate-kit/VERSION` from 0.3.6+0.1.1 to 0.3.7+0.1.1. - Modify `Makefile` `clean-doc-user` target to delete existing wiki markdown files before regeneration and clarify that wiki commits are manual. - Rename `OBIKmer` to `obiskim` in `UserDocMD/theory/kmer_indexing/kmers.md` and update k-mer constraints to reflect obiskim's two-bit-per-nucleotide representation ($k \leq 32$, odd $k$). - Update `UserDocMD/theory/kmer_indexing/minimizer_selection.md` to reference obiskim and specify ordering via deterministic hash function $H$. - Apply corresponding terminology and constraint updates in `doc/theory/kmer_indexing/kmers/index.html`, including the $11 \leq k \leq 31$ range rationale. - Update `doc/theory/kmer_indexing/minimizer_selection/index.html` to reference obiskim and the deterministic hash ordering rule.
This commit is contained in:
1 parent
f935fb66c4
commit
e4528725d4
6 files changed
+27
-24
No files matched your search
+1
-1
@@ -1 +1 @@
|
||||
0.3.6+0.1.1
|
||||
0.3.7+0.1.1
|
||||
@@ -134,13 +134,16 @@ clean-doc-user:
|
||||
# Regenerates the Gitea/Forgejo wiki (a separate repository, checked out next
|
||||
# to this one) from the user documentation. Only rewrites its working tree:
|
||||
# committing and pushing it stays a manual step. Not part of `clean`.
|
||||
# The wiki is flat and entirely generated: its pages (top-level *.md) are deleted first, so that a page
|
||||
# renamed or removed in the sources does not linger. Only *.md at the top level are touched (.git, .jj kept).
|
||||
DOC_WIKI_DIR := ../obiskim.wiki
|
||||
|
||||
.PHONY: wiki
|
||||
## wiki: Regenerates the wiki working tree (../obiskim.wiki); commit and push stay manual
|
||||
## wiki: Regenerates the wiki working tree (../obiskim.wiki) from scratch; commit and push stay manual
|
||||
wiki:
|
||||
@command -v pmotransdoc >/dev/null || { echo "pmotransdoc not found in PATH" >&2; exit 1; }
|
||||
@test -d $(DOC_WIKI_DIR)/.git || { echo "$(DOC_WIKI_DIR) is not a git checkout of the wiki" >&2; exit 1; }
|
||||
find $(DOC_WIKI_DIR) -maxdepth 1 -type f -name '*.md' -delete
|
||||
pmotransdoc $(DOC_USER_DIR) $(DOC_WIKI_DIR)
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# K-mer size
|
||||
|
||||
A k-mer is a DNA sequence of length $k$. OBIKmer is designed to index
|
||||
A k-mer is a DNA sequence of length $k$. obiskim is designed to index
|
||||
large k-mers. Here, *large* refers to a k-mer length for which the
|
||||
probability of observing the same k-mer in several genomes by chance
|
||||
alone is sufficiently small. The k-mer length must therefore be large
|
||||
@@ -8,14 +8,14 @@ enough that, when a k-mer is observed in several genomes of the dataset,
|
||||
the probability that this shared occurrence is due to chance alone is
|
||||
sufficiently low for the match to be considered evidence of homology.
|
||||
|
||||
OBIKmer restricts $k$ to odd values in the range
|
||||
obiskim restricts $k$ to odd values in the range
|
||||
|
||||
$$
|
||||
11 \leq k \leq 31.
|
||||
$$
|
||||
|
||||
These limits result from two different considerations. The upper bound
|
||||
is imposed by the representation used by OBIKmer, whereas the lower
|
||||
is imposed by the representation used by obiskim, whereas the lower
|
||||
bound defines a practical range of k-mer lengths for genome-scale
|
||||
sequence comparisons. This range covers most practical applications: the
|
||||
lower limit is well below the k-mer size that can be considered large,
|
||||
@@ -25,8 +25,8 @@ involving very large genomes.
|
||||
|
||||
## Representation limit
|
||||
|
||||
OBIKmer uses two bits to encode each nucleotide. Therefore, a k-mer
|
||||
requires $2k$ bits. To ensure computational efficiency, OBIKmer limits
|
||||
obiskim uses two bits to encode each nucleotide. Therefore, a k-mer
|
||||
requires $2k$ bits. To ensure computational efficiency, obiskim limits
|
||||
the representation of k-mers to a single 64-bit word, thereby
|
||||
restricting their length.
|
||||
|
||||
@@ -35,12 +35,12 @@ $$
|
||||
$$
|
||||
|
||||
This gives the hard representation limit: $k \leq 32.$ Furthermore,
|
||||
OBIKmer only considers odd values of $k$, meaning the largest supported
|
||||
obiskim only considers odd values of $k$, meaning the largest supported
|
||||
k-mer size is $31$.
|
||||
|
||||
## Odd k-mer lengths
|
||||
|
||||
OBIKmer additionally requires $k$ to be odd. This constraint is
|
||||
obiskim additionally requires $k$ to be odd. This constraint is
|
||||
independent of the specificity considerations discussed below.
|
||||
|
||||
For an odd-length DNA sequence, a k-mer cannot be identical to its own
|
||||
@@ -56,7 +56,7 @@ $$
|
||||
|
||||
is well defined for both odd and even lengths. Restricting $k$ to odd
|
||||
values guarantees that the two orientations are always distinct,
|
||||
simplifying the representation and orientation handling used by OBIKmer.
|
||||
simplifying the representation and orientation handling used by obiskim.
|
||||
|
||||
## K-mer specificity
|
||||
|
||||
@@ -95,7 +95,7 @@ The following section introduces a random-sequence model to quantify the probabi
|
||||
|
||||
## Chance sharing across genomes
|
||||
|
||||
OBIKmer indexes distinct canonical k-mers and records the genomes in
|
||||
obiskim indexes distinct canonical k-mers and records the genomes in
|
||||
which each k-mer occurs. This makes it possible to compare the observed
|
||||
sharing of k-mers with the sharing expected under a random-sequence
|
||||
model. The same probability model can be used for two related purposes:
|
||||
@@ -109,7 +109,7 @@ The null hypothesis assumes that the $S$ indexed genomes are unrelated
|
||||
and that each genome is an independent random sequence in which
|
||||
nucleotides are independent and equiprobable.
|
||||
|
||||
Since OBIKmer uses odd-length canonical k-mers, reverse-complement
|
||||
Since obiskim uses odd-length canonical k-mers, reverse-complement
|
||||
canonicalization reduces the number of possible k-mers by half. The size
|
||||
of the canonical k-mer space is therefore
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
The **minimizer** of a k-mer is the canonical form of the m-mer that is smallest according to a chosen ordering among the $k-m+1$ overlapping m-mers contained in the k-mer, with $m<k$ [@Roberts2004-rz]. Canonical form is the same operation defined for a full kmer (see [DNA encoding](encoding.md)), applied here to an m-mer $s$ instead: $s^c = \min_{\mathrm{lex}}\left(s,\operatorname{RC}(s)\right)$.
|
||||
|
||||
In **OBIkmer**, canonical m-mers are ordered according to a deterministic hash function $H$ applied to their canonical form:
|
||||
In **obiskim**, canonical m-mers are ordered according to a deterministic hash function $H$ applied to their canonical form:
|
||||
|
||||
$$
|
||||
s_1^c <_h s_2^c
|
||||
|
||||
@@ -1723,19 +1723,19 @@
|
||||
|
||||
|
||||
<h1 id="k-mer-size">K-mer size</h1>
|
||||
<p>A k-mer is a DNA sequence of length <span class="arithmatex">\(k\)</span>. OBIKmer is designed to index
|
||||
<p>A k-mer is a DNA sequence of length <span class="arithmatex">\(k\)</span>. obiskim is designed to index
|
||||
large k-mers. Here, <em>large</em> refers to a k-mer length for which the
|
||||
probability of observing the same k-mer in several genomes by chance
|
||||
alone is sufficiently small. The k-mer length must therefore be large
|
||||
enough that, when a k-mer is observed in several genomes of the dataset,
|
||||
the probability that this shared occurrence is due to chance alone is
|
||||
sufficiently low for the match to be considered evidence of homology.</p>
|
||||
<p>OBIKmer restricts <span class="arithmatex">\(k\)</span> to odd values in the range</p>
|
||||
<p>obiskim restricts <span class="arithmatex">\(k\)</span> to odd values in the range</p>
|
||||
<div class="arithmatex">\[
|
||||
11 \leq k \leq 31.
|
||||
\]</div>
|
||||
<p>These limits result from two different considerations. The upper bound
|
||||
is imposed by the representation used by OBIKmer, whereas the lower
|
||||
is imposed by the representation used by obiskim, whereas the lower
|
||||
bound defines a practical range of k-mer lengths for genome-scale
|
||||
sequence comparisons. This range covers most practical applications: the
|
||||
lower limit is well below the k-mer size that can be considered large,
|
||||
@@ -1743,18 +1743,18 @@ even for the smallest bacterial genomes, whereas the upper limit
|
||||
provides sufficient specificity for most applications, including those
|
||||
involving very large genomes.</p>
|
||||
<h2 id="representation-limit">Representation limit</h2>
|
||||
<p>OBIKmer uses two bits to encode each nucleotide. Therefore, a k-mer
|
||||
requires <span class="arithmatex">\(2k\)</span> bits. To ensure computational efficiency, OBIKmer limits
|
||||
<p>obiskim uses two bits to encode each nucleotide. Therefore, a k-mer
|
||||
requires <span class="arithmatex">\(2k\)</span> bits. To ensure computational efficiency, obiskim limits
|
||||
the representation of k-mers to a single 64-bit word, thereby
|
||||
restricting their length.</p>
|
||||
<div class="arithmatex">\[
|
||||
2k \leq 64,
|
||||
\]</div>
|
||||
<p>This gives the hard representation limit: <span class="arithmatex">\(k \leq 32.\)</span> Furthermore,
|
||||
OBIKmer only considers odd values of <span class="arithmatex">\(k\)</span>, meaning the largest supported
|
||||
obiskim only considers odd values of <span class="arithmatex">\(k\)</span>, meaning the largest supported
|
||||
k-mer size is <span class="arithmatex">\(31\)</span>.</p>
|
||||
<h2 id="odd-k-mer-lengths">Odd k-mer lengths</h2>
|
||||
<p>OBIKmer additionally requires <span class="arithmatex">\(k\)</span> to be odd. This constraint is
|
||||
<p>obiskim additionally requires <span class="arithmatex">\(k\)</span> to be odd. This constraint is
|
||||
independent of the specificity considerations discussed below.</p>
|
||||
<p>For an odd-length DNA sequence, a k-mer cannot be identical to its own
|
||||
reverse complement. Every k-mer therefore belongs to a pair of distinct
|
||||
@@ -1766,7 +1766,7 @@ s^c=\min_{\mathrm{lex}}\left(s,\operatorname{RC}(s)\right)
|
||||
\]</div>
|
||||
<p>is well defined for both odd and even lengths. Restricting <span class="arithmatex">\(k\)</span> to odd
|
||||
values guarantees that the two orientations are always distinct,
|
||||
simplifying the representation and orientation handling used by OBIKmer.</p>
|
||||
simplifying the representation and orientation handling used by obiskim.</p>
|
||||
<h2 id="k-mer-specificity">K-mer specificity</h2>
|
||||
<p>A simple way to illustrate the effect of k-mer size is to consider a
|
||||
random DNA sequence in which the four nucleotides are independent and
|
||||
@@ -1823,7 +1823,7 @@ assessed across an indexed set of genomes.</p>
|
||||
<p>The supported range <span class="arithmatex">\(11\leq k\leq31\)</span> should therefore be understood as an engineering and application-oriented compromise, not as a universal biological optimum. Shorter k-mers are more likely to be shared by unrelated regions, whereas longer k-mers provide greater sequence specificity. However, longer k-mers are also more sensitive to substitutions and indels: a single difference can disrupt an exact match across the whole k-mer. The appropriate value within the supported range consequently depends on the size and characteristics of the genomes being compared, as well as on the biological question.</p>
|
||||
<p>The following section introduces a random-sequence model to quantify the probability of chance sharing across an indexed set of genomes. This provides a formal basis for assessing how the choice of <span class="arithmatex">\(k\)</span> affects the interpretation of shared k-mers.</p>
|
||||
<h2 id="chance-sharing-across-genomes">Chance sharing across genomes</h2>
|
||||
<p>OBIKmer indexes distinct canonical k-mers and records the genomes in
|
||||
<p>obiskim indexes distinct canonical k-mers and records the genomes in
|
||||
which each k-mer occurs. This makes it possible to compare the observed
|
||||
sharing of k-mers with the sharing expected under a random-sequence
|
||||
model. The same probability model can be used for two related purposes:
|
||||
@@ -1834,7 +1834,7 @@ specified number of genomes.</p>
|
||||
<p>The null hypothesis assumes that the <span class="arithmatex">\(S\)</span> indexed genomes are unrelated
|
||||
and that each genome is an independent random sequence in which
|
||||
nucleotides are independent and equiprobable.</p>
|
||||
<p>Since OBIKmer uses odd-length canonical k-mers, reverse-complement
|
||||
<p>Since obiskim uses odd-length canonical k-mers, reverse-complement
|
||||
canonicalization reduces the number of possible k-mers by half. The size
|
||||
of the canonical k-mer space is therefore</p>
|
||||
<div class="arithmatex">\[
|
||||
|
||||
@@ -1571,7 +1571,7 @@
|
||||
<h1 id="minimizer-selection">Minimizer selection</h1>
|
||||
<h2 id="definition">Definition</h2>
|
||||
<p>The <strong>minimizer</strong> of a k-mer is the canonical form of the m-mer that is smallest according to a chosen ordering among the <span class="arithmatex">\(k-m+1\)</span> overlapping m-mers contained in the k-mer, with <span class="arithmatex">\(m<k\)</span> (Roberts <em>et al.</em> 2004)<sup id="fnref:Roberts2004-rz"><a class="footnote-ref" href="#fn:Roberts2004-rz">1</a></sup>. Canonical form is the same operation defined for a full kmer (see <a href="../encoding/">DNA encoding</a>), applied here to an m-mer <span class="arithmatex">\(s\)</span> instead: <span class="arithmatex">\(s^c = \min_{\mathrm{lex}}\left(s,\operatorname{RC}(s)\right)\)</span>.</p>
|
||||
<p>In <strong>OBIkmer</strong>, canonical m-mers are ordered according to a deterministic hash function <span class="arithmatex">\(H\)</span> applied to their canonical form:</p>
|
||||
<p>In <strong>obiskim</strong>, canonical m-mers are ordered according to a deterministic hash function <span class="arithmatex">\(H\)</span> applied to their canonical form:</p>
|
||||
<div class="arithmatex">\[
|
||||
s_1^c <_h s_2^c
|
||||
\quad\Longleftrightarrow\quad
|
||||
|
||||
Reference in new issue
Block a user