Trait debruijn::Kmer[][src]

pub trait Kmer: Mer + Sized + Copy + PartialEq + PartialOrd + Eq + Ord + Hash {
Show 17 methods fn empty() -> Self;
fn k() -> usize;
fn to_u64(&self) -> u64;
fn from_u64(value: u64) -> Self;
fn hamming_dist(&self, other: Self) -> u32;
fn extend_left(&self, v: u8) -> Self;
fn extend_right(&self, v: u8) -> Self; fn extend(&self, v: u8, dir: Dir) -> Self { ... }
fn get_extensions(&self, exts: Exts, dir: Dir) -> Vec<Self> { ... }
fn min_rc_flip(&self) -> (Self, bool) { ... }
fn min_rc(&self) -> Self { ... }
fn is_palindrome(&self) -> bool { ... }
fn from_bytes(bytes: &[u8]) -> Self { ... }
fn from_ascii(bytes: &[u8]) -> Self { ... }
fn to_string(&self) -> String { ... }
fn kmers_from_bytes(str: &[u8]) -> Vec<Self> { ... }
fn kmers_from_ascii(str: &[u8]) -> Vec<Self> { ... }
}
Expand description

Encapsulates a Kmer sequence with statically known K.

Required methods

Create a Kmer initialized to all A’s

K value for this concrete type.

Return the rank of this kmer in an lexicographic ordering of all kmers E.g. ‘AAAA’ -> 0, ‘AAAT’ -> 1, etc. This will panic if K > 32.

Construct a kmer from the given lexicographic rank of the kmer. If K > 32, the leads bases will be A’s.

Add the base v to the left side of the sequence, and remove the rightmost base

Add the base v to the right side of the sequence, and remove the leftmost base

Provided methods

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

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

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

Return the minimum of the kmer and it’s reverse complement

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

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

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

Return String containing Kmer sequence

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

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

Implementors