[][src]Struct debruijn::kmer::VarIntKmer

pub struct VarIntKmer<T: PrimInt + FromPrimitive + IntHelp, KS: KmerSize> {
    pub storage: T,
    pub phantom: PhantomData<KS>,
}

A fixed-length Kmer sequence that may not fill the bits of T

side: L R bases: 0 0 0 A C G T T bits: H ........ L bit : 14 12 10 8 6 4 2 0

sorting the integer will give a lexicographic sorting of the corresponding string. kmers that don't fill storage are always aligned to the least signifcant bits

Fields

storage: Tphantom: PhantomData<KS>

Methods

impl<T: PrimInt + FromPrimitive + Hash + IntHelp, KS: KmerSize> VarIntKmer<T, KS>[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, 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

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, KS: KmerSize> Kmer for VarIntKmer<T, KS>[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, KS: PartialEq + KmerSize> PartialEq<VarIntKmer<T, KS>> for VarIntKmer<T, KS>[src]

impl<T: Clone + PrimInt + FromPrimitive + IntHelp, KS: Clone + KmerSize> Clone for VarIntKmer<T, KS>[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, KS: Ord + KmerSize> Ord for VarIntKmer<T, KS>[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, KS: Eq + KmerSize> Eq for VarIntKmer<T, KS>[src]

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

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

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

impl<T: Hash + PrimInt + FromPrimitive + IntHelp, KS: Hash + KmerSize> Hash for VarIntKmer<T, KS>[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, KS: KmerSize> Serialize for VarIntKmer<T, KS> where
    T: Serialize
[src]

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

Auto Trait Implementations

impl<T, KS> Send for VarIntKmer<T, KS> where
    KS: Send,
    T: Send

impl<T, KS> Sync for VarIntKmer<T, KS> where
    KS: Sync,
    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]