Skip to main content

Vmer

Trait Vmer 

Source
pub trait Vmer:
    Mer
    + PartialEq
    + Eq {
    // Required methods
    fn new(len: usize) -> Self;
    fn max_len() -> usize;
    fn get_kmer<K: Kmer>(&self, pos: usize) -> K;

    // Provided methods
    fn from_slice(seq: &[u8]) -> Self { ... }
    fn first_kmer<K: Kmer>(&self) -> K { ... }
    fn last_kmer<K: Kmer>(&self) -> K { ... }
    fn both_term_kmer<K: Kmer>(&self) -> (K, K) { ... }
    fn term_kmer<K: Kmer>(&self, dir: Dir) -> K { ... }
    fn iter_kmers<K: Kmer>(&self) -> KmerIter<'_, K, Self>  { ... }
    fn iter_kmer_exts<K: Kmer>(
        &self,
        seq_exts: Exts,
    ) -> KmerExtsIter<'_, K, Self>  { ... }
}
Expand description

A DNA sequence with run-time variable length, up to a statically known maximum length

Required Methods§

Source

fn new(len: usize) -> Self

Create a new sequence with length len, initialized to all A’s

Source

fn max_len() -> usize

Maximum sequence length that can be stored in this type

Source

fn get_kmer<K: Kmer>(&self, pos: usize) -> K

Efficiently extract a Kmer from the sequence

Provided Methods§

Source

fn from_slice(seq: &[u8]) -> Self

Create a Vmer from a sequence of bytes

Source

fn first_kmer<K: Kmer>(&self) -> K

Get the first Kmer from the sequence

Source

fn last_kmer<K: Kmer>(&self) -> K

Get the last kmer in the sequence

Source

fn both_term_kmer<K: Kmer>(&self) -> (K, K)

Get the terminal kmer of the sequence, on the both side of the sequence

Source

fn term_kmer<K: Kmer>(&self, dir: Dir) -> K

Get the terminal kmer of the sequence, on the side of the sequence given by dir

Source

fn iter_kmers<K: Kmer>(&self) -> KmerIter<'_, K, Self>

Iterate over the kmers in the sequence

Source

fn iter_kmer_exts<K: Kmer>(&self, seq_exts: Exts) -> KmerExtsIter<'_, K, Self>

Iterate over the kmers and their extensions, given the extensions of the whole sequence

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Vmer for DnaString

Source§

impl Vmer for DnaStringSlice<'_>

Source§

impl Vmer for DnaBytes

Source§

impl Vmer for DnaSlice<'_>

Source§

impl<A: Array<Item = u64> + Copy + Eq + Ord + Hash> Vmer for Lmer<A>