SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
seqan3::detail::policy_max_error Struct Reference

Provides the function max_error_counts if inherited by a search algorithm. More...

#include <seqan3/search/detail/policy_max_error.hpp>

Protected Member Functions

template<std::ranges::forward_range query_t>
auto max_error_counts (query_t &&query)
 Returns a detail::search_param object filled by the information from the configuration.
 
Constructors, destructor and assignment
 policy_max_error ()=default
 Defaulted.
 
 policy_max_error (policy_max_error const &)=default
 Defaulted.
 
 policy_max_error (policy_max_error &&)=default
 Defaulted.
 
policy_max_erroroperator= (policy_max_error const &)=default
 Defaulted.
 
policy_max_erroroperator= (policy_max_error &&)=default
 Defaulted.
 
 ~policy_max_error ()=default
 Defaulted.
 
template<typename configuration_t >
requires is_type_specialisation_of_v<configuration_t, seqan3::configuration>
 policy_max_error (configuration_t const &config)
 Initialises the policy with the given configuration.
 

Protected Attributes

search_cfg::max_error_deletion deletion {}
 The deletion errors set by the user.
 
bool has_max_error_total {false}
 Flag indicating if max error total was given.
 
search_cfg::max_error_insertion insertion {}
 The insertion errors set by the user.
 
bool only_max_error_total {false}
 Flag indicating if only max error was given.
 
search_cfg::max_error_substitution substitution {}
 The substitution errors set by the user.
 
search_cfg::max_error_total total {}
 The total errors set by the user.
 

Private Member Functions

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_cfg::error_rate depending on the set alternative.
 

Detailed Description

Provides the function max_error_counts if inherited by a search algorithm.

Constructor & Destructor Documentation

◆ policy_max_error()

template<typename configuration_t >
requires is_type_specialisation_of_v<configuration_t, seqan3::configuration>
seqan3::detail::policy_max_error::policy_max_error ( configuration_t const &  config)
inlineexplicitprotected

Initialises the policy with the given configuration.

Template Parameters
configuration_tThe configuration type; must be an instance of seqan3::configuration.
Parameters
[in]configThe search configuration object.

Initialises the maximal errors for the respective edit operations from the given configuration.

Member Function Documentation

◆ max_error_counts()

template<std::ranges::forward_range query_t>
auto seqan3::detail::policy_max_error::max_error_counts ( query_t &&  query)
inlineprotected

Returns a detail::search_param object filled by the information from the configuration.

Template Parameters
query_tMust model std::ranges::forward_range over the index's alphabet.
Parameters
[in]queryThe current query sequence.
Exceptions
std::invalid_argument

◆ to_error_count()

uint8_t seqan3::detail::policy_max_error::to_error_count ( std::variant< search_cfg::error_count, search_cfg::error_rate > const &  error_variant,
size_t const  query_size 
)
inlineprivate

Returns a uint8_t object directly given by the search_cfg::error_count or calculated by the search_cfg::error_rate depending on the set alternative.

Parameters
[in]error_variantA std::variant over search_cfg::error_count and search_cfg::error_rate.
[in]query_sizeThe size of the query.
Exceptions
std::invalid_argumentif error_rate is not between 0 and 1.

If seqan3::search_cfg::error_count is set in the configuration, its value already is of type uint8_t and can be returned as is. If seqan3::search_cfg::error_rate is set in the configuration, the error rates are converted to error counts based on the length of the query sequence.


The documentation for this struct was generated from the following file:
Hide me