pub struct IntKmer<T: PrimInt + FromPrimitive + IntHelp + Sized> {
pub storage: T,
}Expand description
A Kmer sequence with a statically know K. K will fill the underlying integer type.
Fields§
§storage: TImplementations§
Trait Implementations§
Source§impl<'de, T> Deserialize<'de> for IntKmer<T>
impl<'de, T> Deserialize<'de> for IntKmer<T>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T: PrimInt + FromPrimitive + Hash + IntHelp> Kmer for IntKmer<T>
impl<T: PrimInt + FromPrimitive + Hash + IntHelp> Kmer for IntKmer<T>
Source§fn extend_left(&self, v: u8) -> Self
fn extend_left(&self, v: u8) -> Self
Shift the base v into the left end of the kmer
Source§fn hamming_dist(&self, other: Self) -> u32
fn hamming_dist(&self, other: Self) -> u32
Hamming distance between this kmer and another kmer
Source§fn from_u64(v: u64) -> IntKmer<T>
fn from_u64(v: u64) -> IntKmer<T>
Construct a kmer from the given lexicographic rank of the kmer.
If K > 32, the leads bases will be A’s.
Source§fn to_u64(&self) -> u64
fn to_u64(&self) -> u64
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.
Source§fn extend_right(&self, v: u8) -> Self
fn extend_right(&self, v: u8) -> Self
Add the base
v to the right side of the sequence, and remove the leftmost baseSource§fn extend(&self, v: u8, dir: Dir) -> Self
fn extend(&self, v: u8, dir: Dir) -> Self
Add the base
v to the side of sequence given by dir, and remove a base at the opposite sideSource§fn get_extensions(&self, exts: Exts, dir: Dir) -> Vec<Self>
fn get_extensions(&self, exts: Exts, dir: Dir) -> Vec<Self>
Generate all the extension of this sequence given by
exts in direction DirSource§fn min_rc_flip(&self) -> (Self, bool)
fn min_rc_flip(&self) -> (Self, bool)
Return the minimum of the kmer and it’s reverse complement, and a flag indicating if sequence was flipped
Source§fn is_palindrome(&self) -> bool
fn is_palindrome(&self) -> bool
Test if this Kmer and it’s reverse complement are the same
Source§fn from_bytes(bytes: &[u8]) -> Self
fn from_bytes(bytes: &[u8]) -> Self
Create a Kmer from the first K bytes of
bytes, which must be encoded as the integers 0-4.Source§fn from_ascii(bytes: &[u8]) -> Self
fn from_ascii(bytes: &[u8]) -> Self
Create a Kmer from the first K bytes of
bytes, which must be encoded as ASCII letters A,C,G, or T.Source§fn kmers_from_bytes(str: &[u8]) -> Vec<Self>
fn kmers_from_bytes(str: &[u8]) -> Vec<Self>
Generate vector of all kmers contained in
str encoded as 0-4.Source§fn kmers_from_ascii(str: &[u8]) -> Vec<Self>
fn kmers_from_ascii(str: &[u8]) -> Vec<Self>
Generate vector of all kmers contained in
str, encoded as ASCII ACGT.fn has_low_complexity(&self) -> bool
Source§impl<T: PrimInt + FromPrimitive + Hash + IntHelp> Mer for IntKmer<T>
impl<T: PrimInt + FromPrimitive + Hash + IntHelp> Mer for IntKmer<T>
Source§impl<T: Ord + PrimInt + FromPrimitive + IntHelp + Sized> Ord for IntKmer<T>
impl<T: Ord + PrimInt + FromPrimitive + IntHelp + Sized> Ord for IntKmer<T>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: PartialOrd + PrimInt + FromPrimitive + IntHelp + Sized> PartialOrd for IntKmer<T>
impl<T: PartialOrd + PrimInt + FromPrimitive + IntHelp + Sized> PartialOrd for IntKmer<T>
impl<T: Copy + PrimInt + FromPrimitive + IntHelp + Sized> Copy for IntKmer<T>
impl<T: Eq + PrimInt + FromPrimitive + IntHelp + Sized> Eq for IntKmer<T>
impl<T: PrimInt + FromPrimitive + IntHelp + Sized> StructuralPartialEq for IntKmer<T>
Auto Trait Implementations§
impl<T> Freeze for IntKmer<T>where
T: Freeze,
impl<T> RefUnwindSafe for IntKmer<T>where
T: RefUnwindSafe,
impl<T> Send for IntKmer<T>where
T: Send,
impl<T> Sync for IntKmer<T>where
T: Sync,
impl<T> Unpin for IntKmer<T>where
T: Unpin,
impl<T> UnsafeUnpin for IntKmer<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for IntKmer<T>where
T: UnwindSafe,
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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.