template<
typename qgram_index_type,
typename query_iterator,
typename index_iterator>
struct nvbio::QGramFilter< device_tag, qgram_index_type, query_iterator, index_iterator >
This class implements a q-gram filter which can be used to find and filter matches between an arbitrary set of indexed query q-grams, representing q-grams of a given text, and a q-gram index. The q-gram index can be either a simple string index or a string-set index.
- For string q-gram indices, the filter will return an ordered set of (qgram-pos,query-pos) pairs, where qgram-pos is the index of the hit into the string used to build qgram-index, and query-pos corresponds to one of the input query q-gram indices.
- For string-set q-gram indices, the filter will return an ordered set of (string-id,string-pos,query-pos) pairs (encoded as uint4), where string-id is the index of the hit into the string-set used to build qgram-index, and query-pos corresponds to one of the input query q-gram indices.
- Furthermore, the filter offers the ability to merge hits by diagonal bucket: in this case, the output type will be either a simple uint32 linear coordinate describing the diagonal, or a (string-id,diagonal) for string-set indices.
Definition at line 214 of file filter.h.
|
uint64 | rank (const qgram_index_type &qgram_index, const uint32 n_queries, const query_iterator queries, const index_iterator indices) |
|
template<typename hits_iterator > |
void | locate (const uint64 begin, const uint64 end, hits_iterator hits) |
|
template<typename hits_iterator , typename output_iterator > |
void | diagonals (const uint32 n_hits, const hits_iterator hits, output_iterator diags, const uint32 interval=1) |
|
template<typename hits_iterator , typename output_iterator , typename count_iterator > |
uint32 | merge (const uint32 interval, const uint32 n_hits, const hits_iterator hits, output_iterator merged_hits, count_iterator merged_counts) |
|
const uint2 * | ranges () const |
|
const uint64 * | ranks () const |
|
template<typename qgram_index_type , typename query_iterator , typename index_iterator >
template<typename hits_iterator , typename output_iterator >
simply convert hits to diagonal coordinates
- Template Parameters
-
hits_iterator | a hit_iterator iterator |
output_iterator | a diagonal_type iterator |
- Parameters
-
n_hits | the number of input hits |
hits | the input hits |
diags | the output diagonals |
interval | the snapping interval |
Definition at line 426 of file filter_inl.h.
template<typename qgram_index_type , typename query_iterator , typename index_iterator >
template<typename hits_iterator >
enumerate all hits in a given range
hits_iterator a uint2 iterator
Definition at line 395 of file filter_inl.h.
template<typename qgram_index_type , typename query_iterator , typename index_iterator >
template<typename hits_iterator , typename output_iterator , typename count_iterator >
merge hits falling within the same diagonal interval; given a vector of hits, this method will return a compacted list of hits snapped to the closest sample diagonal (i.e. multiple of the given interval), together with a counts vector providing their multiplicity, i.e. the number of hits falling on the same spot
- Template Parameters
-
hits_iterator | a hit_iterator iterator |
output_iterator | a diagonal_type iterator |
counts_iterator | a uint8|uint16|uint32|uint64 iterator |
- Parameters
-
interval | the merging interval |
n_hits | the number of input hits |
hits | the input hits |
merged_hits | the output merged hits |
merged_counts | the output merged counts |
- Returns
- the number of merged hits
Definition at line 455 of file filter_inl.h.