Struct bio::alphabets::RankTransform
source · pub struct RankTransform {
pub ranks: SymbolRanks,
}
Expand description
Tools based on transforming the alphabet symbols to their lexicographical ranks.
Fields
ranks: SymbolRanks
Implementations
sourceimpl RankTransform
impl RankTransform
sourcepub fn transform<C, T>(&self, text: T) -> Vec<u8> ⓘwhere
C: Borrow<u8>,
T: IntoIterator<Item = C>,
pub fn transform<C, T>(&self, text: T) -> Vec<u8> ⓘwhere
C: Borrow<u8>,
T: IntoIterator<Item = C>,
Transform a given text
.
sourcepub fn qgrams<C, T>(&self, q: u32, text: T) -> QGrams<'_, C, T::IntoIter> ⓘwhere
C: Borrow<u8>,
T: IntoIterator<Item = C>,
pub fn qgrams<C, T>(&self, q: u32, text: T) -> QGrams<'_, C, T::IntoIter> ⓘwhere
C: Borrow<u8>,
T: IntoIterator<Item = C>,
Iterate over q-grams (substrings of length q) of given text
. The q-grams are encoded
as usize
by storing the symbol ranks in log2(|A|) bits (with |A| being the alphabet size).
If q is larger than usize::BITS / log2(|A|), this method fails with an assertion.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for RankTransform
impl<'de> Deserialize<'de> for RankTransform
sourcefn 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
sourceimpl Serialize for RankTransform
impl Serialize for RankTransform
Auto Trait Implementations
impl RefUnwindSafe for RankTransform
impl Send for RankTransform
impl Sync for RankTransform
impl Unpin for RankTransform
impl UnwindSafe for RankTransform
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more