Struct debruijn::kmer::VarIntKmer [−][src]
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
Trait Implementations
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>
impl<'de, T: PrimInt + FromPrimitive + IntHelp, KS: KmerSize> Deserialize<'de> for VarIntKmer<T, KS> where
T: Deserialize<'de>,
impl<'de, T: PrimInt + FromPrimitive + IntHelp, KS: KmerSize> Deserialize<'de> for VarIntKmer<T, KS> where
T: Deserialize<'de>,
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
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>
Shift the base v into the left end of the kmer
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. Read more
Construct a kmer from the given lexicographic rank of the kmer. If K > 32, the leads bases will be A’s. Read more
Add the base v
to the right side of the sequence, and remove the leftmost base
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
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.
Generate vector of all kmers contained in str
encoded as 0-4.
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.
impl<T: PartialEq + PrimInt + FromPrimitive + IntHelp, KS: PartialEq + KmerSize> PartialEq<VarIntKmer<T, KS>> for VarIntKmer<T, KS>
impl<T: PartialEq + PrimInt + FromPrimitive + IntHelp, KS: PartialEq + KmerSize> PartialEq<VarIntKmer<T, KS>> for VarIntKmer<T, KS>
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
impl<T: PartialOrd + PrimInt + FromPrimitive + IntHelp, KS: PartialOrd + KmerSize> PartialOrd<VarIntKmer<T, KS>> for VarIntKmer<T, KS>
impl<T: PartialOrd + PrimInt + FromPrimitive + IntHelp, KS: PartialOrd + KmerSize> PartialOrd<VarIntKmer<T, KS>> for VarIntKmer<T, KS>
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
impl<T: PrimInt + FromPrimitive + IntHelp, KS: KmerSize> Serialize for VarIntKmer<T, KS> where
T: Serialize,
impl<T: PrimInt + FromPrimitive + IntHelp, KS: KmerSize> Serialize for VarIntKmer<T, KS> where
T: Serialize,
impl<T: Copy + PrimInt + FromPrimitive + IntHelp, KS: Copy + KmerSize> Copy for VarIntKmer<T, KS>
impl<T: PrimInt + FromPrimitive + IntHelp, KS: KmerSize> StructuralPartialEq for VarIntKmer<T, KS>
Auto Trait Implementations
impl<T, KS> RefUnwindSafe for VarIntKmer<T, KS> where
KS: RefUnwindSafe,
T: RefUnwindSafe,
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,
impl<T, KS> Unpin for VarIntKmer<T, KS> where
KS: Unpin,
T: Unpin,
impl<T, KS> UnwindSafe for VarIntKmer<T, KS> where
KS: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more