[][src]Trait debruijn::Mer

pub trait Mer: Sized + Debug {
    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; fn iter<'a>(&'a self) -> MerIter<'a, Self> { ... }
fn at_count(&self) -> u32 { ... }
fn gc_count(&self) -> u32 { ... } }

Trait for interacting with DNA sequences

Required methods

fn len(&self) -> usize

Length of DNA sequence

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

Get 2-bit encoded base at position pos

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

Set base at pos to 2-bit encoded base val

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.

fn rc(&self) -> Self

Return a new object containing the reverse complement of the sequence

Loading content...

Provided methods

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

Iterate over the bases in the sequence

fn at_count(&self) -> u32

Count the number of A/T bases in the kmer

fn gc_count(&self) -> u32

Count the number of G/C bases in the kmer

Loading content...

Implementors

impl Mer for DnaString[src]

fn get(&self, i: usize) -> u8[src]

Get the value at position i.

fn set_mut(&mut self, i: usize, value: u8)[src]

Set the value as position i.

impl Mer for DnaBytes[src]

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

Set base at pos to 2-bit encoded base val

fn set_slice_mut(&mut self, _pos: usize, _nbases: usize, _value: u64)[src]

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

fn rc(&self) -> Self[src]

Return a new object containing the reverse complement of the sequence

impl<'a> Mer for DnaStringSlice<'a>[src]

fn get(&self, i: usize) -> u8[src]

Get the base at position i.

fn set_mut(&mut self, _: usize, _: u8)[src]

Set the base as position i.

impl<'a> Mer for DnaSlice<'a>[src]

fn set_mut(&mut self, _pos: usize, _val: u8)[src]

Set base at pos to 2-bit encoded base val

fn set_slice_mut(&mut self, _pos: usize, _nbases: usize, _value: u64)[src]

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

fn rc(&self) -> Self[src]

Return a new object containing the reverse complement of the sequence

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

fn len(&self) -> usize[src]

The length of the DNA string

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

Get the base at position pos

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

Return a new Lmer with position pos set to base val

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

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

Get the letter at the given position.

fn set_slice_mut(&mut self, pos: usize, n_bases: usize, value: u64)[src]

Set a slice of bases in the kmer, using the packed representation in value. Sets n_bases, starting at pos. Bases must always be packed into the upper-most bits of the value.

fn rc(&self) -> Self[src]

Return the reverse complement of this kmer

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

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

Get the letter at the given position.

fn set_slice_mut(&mut self, pos: usize, n_bases: usize, value: u64)[src]

Set a slice of bases in the kmer, using the packed representation in value. Sets n_bases, starting at pos. Incoming bases must always be packed into the upper-most bits of the value.

fn rc(&self) -> Self[src]

Return the reverse complement of this kmer

Loading content...