SeqAn3  3.0.0
The Modern C++ library for sequence analysis.
Algorithm

Provides seqan3::search. More...

+ Collaboration diagram for Algorithm:

Functions

template<FmIndex index_t, typename queries_t , typename configuration_t >
auto seqan3::search (queries_t &&queries, index_t const &index, configuration_t const &cfg)
 Search a query or a range of queries in an index. More...
 
template<FmIndex index_t, typename configuration_t >
auto seqan3::search (char const *const queries, index_t const &index, configuration_t const &cfg)
 
template<FmIndex index_t, typename configuration_t >
auto seqan3::search (std::initializer_list< char const *const > const &queries, index_t const &index, configuration_t const &cfg)
 
template<FmIndex index_t, typename queries_t >
auto seqan3::search (queries_t &&queries, index_t const &index)
 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...
 
template<FmIndex index_t>
auto seqan3::search (index_t const &index, char const *const queries)
 
template<FmIndex index_t>
auto seqan3::search (std::initializer_list< char const *const > const &queries, index_t const &index)
 

Detailed Description

Provides seqan3::search.

Search Algorithms

The Search module offers a simple unified interface that allows searching FM 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

Function Documentation

◆ search() [1/6]

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

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

Template Parameters
index_tMust model seqan3::FmIndex.
queries_tMust model std::ranges::RandomAccessRange over the index's alphabet. a range of queries must additionally model std::ranges::ForwardRange.
Parameters
[in]queriesA single query or a range of queries.
[in]indexString index to be searched.
[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.

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/6]

template<FmIndex index_t, typename configuration_t >
auto seqan3::search ( char const *const  queries,
index_t const &  index,
configuration_t const &  cfg 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ search() [3/6]

template<FmIndex index_t, typename configuration_t >
auto seqan3::search ( std::initializer_list< char const *const > const &  queries,
index_t const &  index,
configuration_t const &  cfg 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ search() [4/6]

template<FmIndex index_t, typename queries_t >
auto seqan3::search ( queries_t &&  queries,
index_t const &  index 
)
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::FmIndex.
queries_tMust model std::ranges::RandomAccessRange over the index's alphabet. a range of queries must additionally model std::ranges::ForwardRange.
Parameters
[in]queriesA single query or a range of queries.
[in]indexString index to be searched.
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.

◆ search() [5/6]

template<FmIndex index_t>
auto seqan3::search ( index_t const &  index,
char const *const  queries 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ search() [6/6]

template<FmIndex index_t>
auto seqan3::search ( std::initializer_list< char const *const > const &  queries,
index_t const &  index 
)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.