Module bio::data_structures::qgram_index
[−]
[src]
A classical, flexible, q-gram index implementation.
Example
use bio::data_structures::qgram_index; use bio::alphabets; let text = b"ACGGCTGAGATGAT"; let alphabet = alphabets::dna::alphabet(); let q = 3; let qgram_index = qgram_index::QGramIndex::new(q, text, &alphabet); let pattern = b"GCTG"; let matches = qgram_index.matches(pattern, 1); assert_eq!(matches, [ qgram_index::Match { pattern: qgram_index::Interval { start: 0, stop: 4 }, text: qgram_index::Interval { start: 3, stop: 7 }, count: 2 } ]);
Structs
ExactMatch |
An exact match between the pattern and the text. |
Interval |
An interval, consisting of start and stop position (the latter exclusive). |
Match |
A match between the pattern and the text. |
QGramIndex |
A classical, flexible, q-gram index implementation. |