SeqAn3
Algorithm
Collaboration diagram for Algorithm:

Modules

 Configuration
 Data structures and utility functions for configuring search algorithm.
 

Functions

template<fm_index_concept index_t, typename queries_t , typename configuration_t >
auto seqan3::search (index_t const &index, queries_t &&queries, configuration_t const &cfg)
 Search a query or a range of queries in an index. More...
 
template<fm_index_concept index_t, typename queries_t >
auto seqan3::search (index_t const &index, queries_t &&queries)
 Search a query or a range of queries in an index. It will not allow for any errors and will output all matches as positions in the text. More...
 

Detailed Description

Search Algorithms

The Search module offers a simple unified interface that allows searching SeqAn3 indices such as FM indices or k-mer indices and choosing the best algorithm based on the index at hand.

FM Indices

The search algorithms for FM indices implement either a trivial backtracking approach or an optimum search scheme. Latter are currently only available for searches with up to and including three errors using bidirectional indices. The optimum search schemes will be improved in the future to handle unidirectional indices and higher error counts.

Reference

Kianfar, K., Pockrandt, C., Torkamandi, B., Luo, H., & Reinert, K. (2018).

Optimum Search Schemes for Approximate String Matching Using Bidirectional FM-Index. bioRxiv, 301085. https://doi.org/10.1101/301085

K-mer Indices

Todo:
Rewrite landing page.

Function Documentation

◆ search() [1/2]

template<fm_index_concept index_t, typename queries_t , typename configuration_t >
auto seqan3::search ( index_t const &  index,
queries_t &&  queries,
configuration_t const &  cfg 
)
inline

Search a query or a range of queries in an index.

Template Parameters
index_tMust model seqan3::fm_index_concept.
queries_tMust be a std::ranges::RandomAccessRange over the index's alphabet. a range of queries must additionally model std::ranges::ForwardRange.
Parameters
[in]indexString index to be searched.
[in]queriesA single query or a range of queries.
[in]cfgA configuration object specifying the search parameters (e.g. number of errors, error types, output format, etc.).
Returns
An object modelling std::ranges::Range containing the hits (the type depends on the specification in cfg), or void if an on_hit delegate has been specified.
Todo:
Update concepts and documentation of configuration_t everywhere once it has been refactored by rrahn.

Complexity

Each query with $e$ errors takes $O(|query|^e)$ where $e$ is the maximum number of errors.

Exceptions

Strong exception guarantee if iterating the query does not change its state and if invoking a possible delegate specified in cfg also has a strong exception guarantee; basic exception guarantee otherwise.

◆ search() [2/2]

template<fm_index_concept index_t, typename queries_t >
auto seqan3::search ( index_t const &  index,
queries_t &&  queries 
)
inline

Search a query or a range of queries in an index. It will not allow for any errors and will output all matches as positions in the text.

Template Parameters
index_tMust model seqan3::fm_index_concept.
queries_tMust be a std::ranges::RandomAccessRange over the index's alphabet. a range of queries must additionally model std::ranges::ForwardRange.
Parameters
[in]indexString index to be searched.
[in]queriesA single query or a range of queries.
Returns
An object modelling std::ranges::Range containing the hits as positions in the searched text.

Complexity

Each query with $e$ errors takes $O(|query|^e)$ where $e$ is the maximum number of errors.

Exceptions

Strong exception guarantee if iterating the query does not change its state; basic exception guarantee otherwise.