pub struct Kmer { /* private fields */ }Expand description
K-mer structure that can store both direct and reverse complement representations K-mers are stored in a compact 64-bit representation, with 2 bits per base.
Implementations§
Source§impl Kmer
impl Kmer
Sourcepub fn new(max_size: u32, variant: KmerMode) -> Self
pub fn new(max_size: u32, variant: KmerMode) -> Self
Create a new empty k-mer with specified maximum size and mode
Sourcepub fn from_values(
kmer_dir: u64,
kmer_rc: u64,
max_size: u32,
cur_size: u32,
variant: KmerMode,
) -> Self
pub fn from_values( kmer_dir: u64, kmer_rc: u64, max_size: u32, cur_size: u32, variant: KmerMode, ) -> Self
Create a k-mer from existing direct and reverse complement values
Sourcepub fn insert_canonical(&mut self, symbol: u64)
pub fn insert_canonical(&mut self, symbol: u64)
Insert a symbol (base) at the end of the k-mer (canonical mode)
Sourcepub fn data_canonical(&self) -> u64
pub fn data_canonical(&self) -> u64
Get the canonical k-mer (minimum of direct and reverse complement)
Sourcepub fn get_cur_size(&self) -> u32
pub fn get_cur_size(&self) -> u32
Get current size
Sourcepub fn get_max_size(&self) -> u32
pub fn get_max_size(&self) -> u32
Get maximum size
Sourcepub fn get_symbol(&self, pos: u32) -> u64
pub fn get_symbol(&self, pos: u32) -> u64
Get a symbol at a specific position
Sourcepub fn swap_dir_rc(&mut self)
pub fn swap_dir_rc(&mut self)
Swap direct and reverse complement representations
Sourcepub fn is_dir_oriented(&self) -> bool
pub fn is_dir_oriented(&self) -> bool
Check if the k-mer is in direct orientation (for canonical mode)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Kmer
impl RefUnwindSafe for Kmer
impl Send for Kmer
impl Sync for Kmer
impl Unpin for Kmer
impl UnwindSafe for Kmer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more