[][src]Struct debruijn::kmer::IntKmer

pub struct IntKmer<T: PrimInt + FromPrimitive + IntHelp> {
    pub storage: T,
}

A Kmer sequence with a statically know K. K will fill the underlying integer type.

Fields

storage: T

Methods

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

pub fn top_mask(n_bases: usize) -> T[src]

pub fn bottom_mask(n_bases: usize) -> T[src]

Trait Implementations

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

Important traits for MerIter<'a, M>
fn iter<'a>(&'a self) -> MerIter<'a, Self>[src]

Iterate over the bases in the sequence

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

fn extend_left(&self, v: u8) -> Self[src]

Shift the base v into the left end of the kmer

fn extend(&self, v: u8, dir: Dir) -> Self[src]

Add the base v to the side of sequence given by dir, and remove a base at the opposite side

fn get_extensions(&self, exts: Exts, dir: Dir) -> Vec<Self>[src]

Generate all the extension of this sequence given by exts in direction Dir

fn min_rc_flip(&self) -> (Self, bool)[src]

Return the minimum of the kmer and it's reverse complement, and a flag indicating if sequence was flipped

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

fn is_palindrome(&self) -> bool[src]

Test if this Kmer and it's reverse complement are the same

fn from_bytes(bytes: &[u8]) -> Self[src]

Create a Kmer from the first K bytes of bytes, which must be encoded as the integers 0-4.

fn from_ascii(bytes: &[u8]) -> Self[src]

Create a Kmer from the first K bytes of bytes, which must be encoded as ASCII letters A,C,G, or T.

fn to_string(&self) -> String[src]

Return String containing Kmer sequence

fn kmers_from_bytes(str: &[u8]) -> Vec<Self>[src]

Generate vector of all kmers contained in str encoded as 0-4.

fn kmers_from_ascii(str: &[u8]) -> Vec<Self>[src]

Generate vector of all kmers contained in str, encoded as ASCII ACGT.

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

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

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

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

fn max(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

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

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

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

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

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

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<T: PrimInt + FromPrimitive + IntHelp> Serialize for IntKmer<T> where
    T: Serialize
[src]

impl<'de, T: PrimInt + FromPrimitive + IntHelp> Deserialize<'de> for IntKmer<T> where
    T: Deserialize<'de>, 
[src]

Auto Trait Implementations

impl<T> Send for IntKmer<T> where
    T: Send

impl<T> Sync for IntKmer<T> where
    T: Sync

Blanket Implementations

impl<T> MerImmut for T where
    T: Mer + Clone
[src]

fn set(&self, pos: usize, val: u8) -> Self[src]

fn set_slice(&self, pos: usize, nbases: usize, bits: u64) -> Self[src]

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]