49 template <FmIndex index_t,
typename queries_t,
typename configuration_t>
54 detail::is_type_specialisation_of_v<remove_cvref_t<configuration_t>, configuration>
56 inline auto search(queries_t && queries, index_t
const & index, configuration_t
const & cfg)
62 if constexpr (cfg_t::template exists<search_cfg::max_error>())
64 auto & [total, subs, ins, del] = get<search_cfg::max_error>(cfg).value;
66 throw std::invalid_argument(
"The substitution error threshold is higher than the total error threshold.");
68 throw std::invalid_argument(
"The insertion error threshold is higher than the total error threshold.");
70 throw std::invalid_argument(
"The deletion error threshold is higher than the total error threshold.");
72 else if constexpr (cfg_t::template exists<search_cfg::max_error_rate>())
74 auto & [total, subs, ins, del] = get<search_cfg::max_error_rate>(cfg).value;
76 throw std::invalid_argument(
"The substitution error threshold is higher than the total error threshold.");
78 throw std::invalid_argument(
"The insertion error threshold is higher than the total error threshold.");
80 throw std::invalid_argument(
"The deletion error threshold is higher than the total error threshold.");
83 if constexpr (cfg_t::template exists<search_cfg::mode>())
85 if constexpr (cfg_t::template exists<search_cfg::output>())
86 return detail::search_all(index, queries, cfg);
93 if constexpr (cfg_t::template exists<search_cfg::output>())
94 return detail::search_all(index, queries, cfg2);
101 template <FmIndex index_t,
typename configuration_t>
102 inline auto search(
char const *
const queries, index_t
const & index, configuration_t
const & cfg)
108 template <FmIndex index_t,
typename configuration_t>
110 index_t
const & index,
111 configuration_t
const & cfg)
116 return search(query, index, cfg);
136 template <FmIndex index_t,
typename queries_t>
141 inline auto search(queries_t && queries, index_t
const & index)
151 return search(queries, index, default_cfg);
155 template <FmIndex index_t>
156 inline auto search(index_t
const & index,
char const *
const queries)
162 template <FmIndex index_t>
168 return search(query, index);
Configuration element to determine the output type of hits.
Definition: output.hpp:59
detail::search_output_text_position constexpr text_position
Configuration element to receive all hits within the lowest number of errors.
Definition: output.hpp:42
auto search(queries_t &&queries, index_t const &index, configuration_t const &cfg)
Search a query or a range of queries in an index.
Definition: search.hpp:56
Provides the public interface for search algorithms.
::ranges::size size
Alias for ranges::size. Obtains the size of a range whose size can be calculated in constant time...
Definition: ranges:189
The main SeqAn3 namespace.
A strong type of underlying type uint8_t or double that represents the number or rate of deletions...
Definition: max_error_common.hpp:130
Configuration element to determine the search mode.
Definition: mode.hpp:83
A strong type of underlying type uint8_t or double that represents the number or rate of total errors...
Definition: max_error_common.hpp:30
A strong type of underlying type uint8_t or double that represents the number or rate of substitution...
Definition: max_error_common.hpp:64
Adaptations of concepts from the Ranges TS.
typename innermost_value_type< t >::type innermost_value_type_t
Shortcut for seqan3::innermost_value_type (TransformationTrait shortcut).
Definition: range.hpp:191
::ranges::for_each for_each
Alias for ranges::for_each. Applies a function object to the elements of a range. ...
Definition: algorithm:79
Specifies requirements of a Range type for which begin returns a type that models std::RandomAccessIt...
Specifies requirements of a Range type for which begin returns a type that models std::ForwardIterato...
detail::search_mode_all constexpr all
Configuration element to receive all hits within the error bounds.
Definition: mode.hpp:42
Meta-header for the FM index module.
Adaptations of algorithms from the Ranges TS.
Provides seqan3::view::persist.
Provides seqan3::detail::configuration and utility functions.
constexpr auto alphabet_size
A type trait that holds the size of a (semi-)alphabet.
Definition: concept.hpp:678
A configuration element for the maximum number of errors across all error types (mismatches, insertions, deletions). This is an upper bound of errors independent from error numbers of specific error types.
Definition: max_error.hpp:43
Collection of elements to configure an algorithm.
Definition: configuration.hpp:82
A strong type of underlying type uint8_t or double that represents the number or rate of insertions...
Definition: max_error_common.hpp:97