1
theory kmer_indexing kmers
Eric Coissac edited this page 2026-09-12 17:45:11 +02:00

Kmers

A kmer is a DNA subsequence of fixed length k. Two constraints apply to k, both enforced when a command starts (an invalid value exits immediately with an error):

  • k \in [11, 31]: long enough to be specific, short enough to fit in a single 64-bit word at 2 bits/base (k \le 32 is the hard limit; k < 11 gives insufficient specificity).
  • k is odd: an odd-length sequence can never equal its own reverse complement, so the two orientations of any kmer are always distinct. This is required for the canonical form (see DNA encoding) to be well defined.