minimizer-iter 1.0.0

Iterate over minimizers of a DNA sequence
Documentation

minimizer-iter

crates.io docs

Iterate over minimizers of a DNA sequence.

Features

  • iterates over minimizers in a single pass
  • yields bitpacked minimizers with their position
  • supports custom bit encoding of the nucleotides
  • supports custom hasher, using wyhash by default
  • can be seeded to produce a different ordering

Example usage

use minimizer_iter::MinimizerBuilder;

// Build an iterator over minimizers
// of size 3 with a window of size 4
// for the sequence "TGATTGCACAATC"
let min_iter = MinimizerBuilder::<u64>::new()
    .minimizer_size(3)
    .width(4)
    .iter(b"TGATTGCACAATC");

for (minimizer, position) in min_iter {
    // ...
}

If you'd like to have longer minimizers (up to 64 bases), you can use u128 instead:

MinimizerBuilder::<u128>::new()
    .minimizer_size(...)
    .width(...)
    .iter(...)