pub struct VarIntKmer<T: PrimInt + FromPrimitive + IntHelp, KS: KmerSize> {
pub storage: T,
pub phantom: PhantomData<KS>,
}Expand description
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: T§phantom: PhantomData<KS>Implementations§
Source§impl<T: PrimInt + FromPrimitive + Hash + IntHelp, KS: KmerSize> VarIntKmer<T, KS>
impl<T: PrimInt + FromPrimitive + Hash + IntHelp, KS: KmerSize> VarIntKmer<T, KS>
Trait Implementations§
Source§impl<T: Clone + PrimInt + FromPrimitive + IntHelp, KS: Clone + KmerSize> Clone for VarIntKmer<T, KS>
impl<T: Clone + PrimInt + FromPrimitive + IntHelp, KS: Clone + KmerSize> Clone for VarIntKmer<T, KS>
Source§fn clone(&self) -> VarIntKmer<T, KS>
fn clone(&self) -> VarIntKmer<T, KS>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: PrimInt + FromPrimitive + Hash + IntHelp, KS: KmerSize> Debug for VarIntKmer<T, KS>
impl<T: PrimInt + FromPrimitive + Hash + IntHelp, KS: KmerSize> Debug for VarIntKmer<T, KS>
Source§impl<'de, T, KS: KmerSize> Deserialize<'de> for VarIntKmer<T, KS>
impl<'de, T, KS: KmerSize> Deserialize<'de> for VarIntKmer<T, KS>
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: Hash + PrimInt + FromPrimitive + IntHelp, KS: Hash + KmerSize> Hash for VarIntKmer<T, KS>
impl<T: Hash + PrimInt + FromPrimitive + IntHelp, KS: Hash + KmerSize> Hash for VarIntKmer<T, KS>
Source§impl<T: PrimInt + FromPrimitive + Hash + IntHelp, KS: KmerSize> Kmer for VarIntKmer<T, KS>
impl<T: PrimInt + FromPrimitive + Hash + IntHelp, KS: KmerSize> Kmer for VarIntKmer<T, KS>
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 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 from_u64(v: u64) -> Self
fn from_u64(v: u64) -> Self
Construct a kmer from the given lexicographic rank of the kmer.
If K > 32, the leads bases will be A’s.
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 basefn hamming_dist(&self, other: Self) -> u32
Source§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, KS: KmerSize> Mer for VarIntKmer<T, KS>
impl<T: PrimInt + FromPrimitive + Hash + IntHelp, KS: KmerSize> Mer for VarIntKmer<T, KS>
Source§impl<T: Ord + PrimInt + FromPrimitive + IntHelp, KS: Ord + KmerSize> Ord for VarIntKmer<T, KS>
impl<T: Ord + PrimInt + FromPrimitive + IntHelp, KS: Ord + KmerSize> Ord for VarIntKmer<T, KS>
Source§fn cmp(&self, other: &VarIntKmer<T, KS>) -> Ordering
fn cmp(&self, other: &VarIntKmer<T, KS>) -> Ordering
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: PartialEq + PrimInt + FromPrimitive + IntHelp, KS: PartialEq + KmerSize> PartialEq for VarIntKmer<T, KS>
impl<T: PartialEq + PrimInt + FromPrimitive + IntHelp, KS: PartialEq + KmerSize> PartialEq for VarIntKmer<T, KS>
Source§impl<T: PartialOrd + PrimInt + FromPrimitive + IntHelp, KS: PartialOrd + KmerSize> PartialOrd for VarIntKmer<T, KS>
impl<T: PartialOrd + PrimInt + FromPrimitive + IntHelp, KS: PartialOrd + KmerSize> PartialOrd for VarIntKmer<T, KS>
Source§impl<T, KS: KmerSize> Serialize for VarIntKmer<T, KS>
impl<T, KS: KmerSize> Serialize for VarIntKmer<T, KS>
impl<T: Copy + PrimInt + FromPrimitive + IntHelp, KS: Copy + KmerSize> Copy for VarIntKmer<T, KS>
impl<T: Eq + PrimInt + FromPrimitive + IntHelp, KS: Eq + KmerSize> Eq for VarIntKmer<T, KS>
impl<T: PrimInt + FromPrimitive + IntHelp, KS: KmerSize> StructuralPartialEq for VarIntKmer<T, KS>
Auto Trait Implementations§
impl<T, KS> Freeze for VarIntKmer<T, KS>where
T: Freeze,
impl<T, KS> RefUnwindSafe for VarIntKmer<T, KS>where
T: RefUnwindSafe,
KS: RefUnwindSafe,
impl<T, KS> Send for VarIntKmer<T, KS>
impl<T, KS> Sync for VarIntKmer<T, KS>
impl<T, KS> Unpin for VarIntKmer<T, KS>
impl<T, KS> UnsafeUnpin for VarIntKmer<T, KS>where
T: UnsafeUnpin,
impl<T, KS> UnwindSafe for VarIntKmer<T, KS>where
T: UnwindSafe,
KS: 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.