Module kmer

Module kmer 

Source
Expand description

Encoded sequences of static length

Generally, the underlying storage type of Kmer should lend itself to optimisation. The default Kmer instance is packed into a usize, which can be efficiently Copyed on the stack.

k * codec::BITS must fit in the storage type, e.g. usize (64 bits).

use bio_seq::prelude::*;

for (amino_kmer, amino_string) in Seq::<Amino>::try_from("SSLMNHKKL").unwrap()
        .kmers::<3>()
        .zip(["SSL", "SLM", "LMN", "MNH", "NHK", "HKK", "KKL"])
    {
        assert_eq!(amino_kmer, amino_string);
    }

Kmers can be copied from other sequence types:

let kmer: Kmer<Dna, 8> = dna!("AGTTGGCA").try_into().unwrap();

Structs§

Kmer
By default k-mers are backed by usize and Codec::BITS * K must be <= 64 on 64-bit platforms
KmerIter
An iterator over all kmers of a sequence with a specified length

Traits§

KmerStorage