59 template <
typename configuration_t>
60 requires is_type_specialisation_of_v<configuration_t, seqan3::configuration>
82 template <std::ranges::forward_range query_t>
87 [[maybe_unused]]
auto query_size = std::ranges::size(query);
96 errors.substitution = errors.insertion = errors.deletion = errors.total;
99 errors.total = std::min<uint32_t>(255, errors.substitution + errors.insertion + errors.deletion);
103 if (errors.substitution > errors.total)
104 throw std::invalid_argument{
"The substitution error threshold is higher than the total error threshold."};
105 if (errors.insertion > errors.total)
106 throw std::invalid_argument{
"The insertion error threshold is higher than the total error threshold."};
107 if (errors.deletion > errors.total)
108 throw std::invalid_argument{
"The deletion error threshold is higher than the total error threshold."};
130 [[maybe_unused]]
size_t const query_size)
133 [&query_size](
auto error)
140 if (0.0 > error.get() || error.get() > 1.0)
144 uint8_t
const calculated_error_count =
std::clamp(error.get() * query_size, 0.0, 255.0);
145 return calculated_error_count;
Configuration element that represents the number or rate of deletion errors.
Definition max_error.hpp:170
std::variant< error_count, error_rate > error
The error count or error rate.
Definition max_error.hpp:173
Configuration element that represents the number or rate of insertion errors.
Definition max_error.hpp:124
std::variant< error_count, error_rate > error
The error count or error rate.
Definition max_error.hpp:127
Configuration element that represents the number or rate of substitution errors.
Definition max_error.hpp:79
std::variant< error_count, error_rate > error
The error count or error rate.
Definition max_error.hpp:82
Configuration element that represents the number or rate of total errors.
Definition max_error.hpp:34
std::variant< error_count, error_rate > error
The error count or error rate.
Definition max_error.hpp:37
The internal SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
Provides data structures used by different search algorithms.
Provides seqan3::detail::search_traits.
Provides the function max_error_counts if inherited by a search algorithm.
Definition policy_max_error.hpp:24
policy_max_error()=default
Defaulted.
~policy_max_error()=default
Defaulted.
policy_max_error & operator=(policy_max_error const &)=default
Defaulted.
policy_max_error(configuration_t const &config)
Initialises the policy with the given configuration.
Definition policy_max_error.hpp:61
policy_max_error(policy_max_error const &)=default
Defaulted.
policy_max_error(policy_max_error &&)=default
Defaulted.
search_cfg::max_error_substitution substitution
The substitution errors set by the user.
Definition policy_max_error.hpp:29
search_cfg::max_error_deletion deletion
The deletion errors set by the user.
Definition policy_max_error.hpp:33
bool has_max_error_total
Flag indicating if max error total was given.
Definition policy_max_error.hpp:38
auto max_error_counts(query_t &&query)
Returns a detail::search_param object filled by the information from the configuration.
Definition policy_max_error.hpp:83
search_cfg::max_error_insertion insertion
The insertion errors set by the user.
Definition policy_max_error.hpp:31
uint8_t to_error_count(std::variant< search_cfg::error_count, search_cfg::error_rate > const &error_variant, size_t const query_size)
Returns a uint8_t object directly given by the search_cfg::error_count or calculated by the search_cf...
Definition policy_max_error.hpp:129
search_cfg::max_error_total total
The total errors set by the user.
Definition policy_max_error.hpp:27
bool only_max_error_total
Flag indicating if only max error was given.
Definition policy_max_error.hpp:36
policy_max_error & operator=(policy_max_error &&)=default
Defaulted.
Object grouping numbers of errors for different kind of error types.
Definition search_common.hpp:22
A collection of traits extracted from the search configuration.
Definition search_traits.hpp:31
A strong type of underlying type uint8_t that represents the number of errors.
Definition max_error_common.hpp:29