Struct bio::alphabets::RankTransform
[−]
[src]
pub struct RankTransform { pub ranks: SymbolRanks, }
Tools based on transforming the alphabet symbols to their lexicographical ranks.
Fields
ranks: SymbolRanks
Methods
impl RankTransform
[src]
fn new(alphabet: &Alphabet) -> Self
[src]
Construct a new RankTransform
.
fn get(&self, a: u8) -> u8
[src]
Get the rank of symbol a
.
fn transform<'a, T: IntoTextIterator<'a>>(&self, text: T) -> Vec<u8>
[src]
Transform a given text
.
fn qgrams<'a, T: IntoTextIterator<'a>>(
&'a self,
q: u32,
text: T
) -> QGrams<T::IntoIter>
[src]
&'a self,
q: u32,
text: T
) -> QGrams<T::IntoIter>
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.
fn alphabet(&self) -> Alphabet
[src]
Restore alphabet from transform.