[−][src]Struct bio::data_structures::qgram_index::QGramIndex
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]
q: u32,
text: &[u8],
alphabet: &Alphabet,
max_count: usize
) -> Self
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]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for QGramIndex
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl Send for QGramIndex
impl Unpin for QGramIndex
impl Sync for QGramIndex
impl UnwindSafe for QGramIndex
impl RefUnwindSafe for QGramIndex
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,