[][src]Struct bio::data_structures::qgram_index::QGramIndex

pub struct QGramIndex { /* fields omitted */ }

A classical, flexible, q-gram index implementation.

Methods

impl QGramIndex[src]

pub fn new(q: u32, text: &[u8], alphabet: &Alphabet) -> Self[src]

Create a new q-gram index. The q has to be smaller than b / log2(|A|) with |A| being the alphabet size and b the number bits with the usize data type.

pub fn with_max_count(
    q: u32,
    text: &[u8],
    alphabet: &Alphabet,
    max_count: usize
) -> Self
[src]

Create a new q-gram index, only considering q-grams that occur at most max_count times. The q has to be smaller than b / log2(|A|) with |A| being the alphabet size and b the number bits with the usize data type.

pub fn q(&self) -> u32[src]

The used q.

pub fn qgram_matches(&self, qgram: usize) -> &[usize][src]

Return text positions with matching q-gram. Complexity O(1).

pub fn matches(&self, pattern: &[u8], min_count: usize) -> Vec<Match>[src]

Return matches of the given pattern. Complexity O(m + k) for pattern of length m and k being the number of matching q-grams.

pub fn exact_matches(&self, pattern: &[u8]) -> Vec<ExactMatch>[src]

Return exact matches (substrings) of the given pattern. Complexity O(m + k) for pattern of length m and k being the number of matching q-grams.

Trait Implementations

impl Serialize for QGramIndex[src]

impl<'de> Deserialize<'de> for QGramIndex[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]