Mer

Trait Mer 

Source
pub trait Mer: Sized + Debug {
    // Required methods
    fn len(&self) -> usize;
    fn get(&self, pos: usize) -> u8;
    fn set_mut(&mut self, pos: usize, val: u8);
    fn set_slice_mut(&mut self, pos: usize, nbases: usize, value: u64);
    fn rc(&self) -> Self;

    // Provided methods
    fn iter<'a>(&'a self) -> MerIter<'a, Self>  { ... }
    fn at_count(&self) -> u32 { ... }
    fn gc_count(&self) -> u32 { ... }
}
Expand description

Trait for interacting with DNA sequences

Required Methods§

Source

fn len(&self) -> usize

Length of DNA sequence

Source

fn get(&self, pos: usize) -> u8

Get 2-bit encoded base at position pos

Source

fn set_mut(&mut self, pos: usize, val: u8)

Set base at pos to 2-bit encoded base val

Source

fn set_slice_mut(&mut self, pos: usize, nbases: usize, value: u64)

Set nbases positions in the sequence, starting at pos. Values must be packed into the upper-most bits of value.

Source

fn rc(&self) -> Self

Return a new object containing the reverse complement of the sequence

Provided Methods§

Source

fn iter<'a>(&'a self) -> MerIter<'a, Self>

Iterate over the bases in the sequence

Source

fn at_count(&self) -> u32

Count the number of A/T bases in the kmer

Source

fn gc_count(&self) -> u32

Count the number of G/C bases in the kmer

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 Mer for DnaString

Source§

impl Mer for DnaBytes

Source§

impl<'a> Mer for DnaStringSlice<'a>

Source§

impl<'a> Mer for DnaSlice<'a>

Source§

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

Source§

impl<T: PrimInt + FromPrimitive + Hash + IntHelp> Mer for IntKmer<T>

Source§

impl<T: PrimInt + FromPrimitive + Hash + IntHelp, KS: KmerSize> Mer for VarIntKmer<T, KS>