Loading...
Searching...
No Matches
seqan3::search_cfg::max_error_substitution Class Reference
Search » Configuration

Configuration element that represents the number or rate of substitution errors. More...

`#include <seqan3/search/configuration/max_error.hpp>`

Inheritance diagram for seqan3::search_cfg::max_error_substitution:
[legend]

## Public Member Functions

Constructors, destructor and assignment
| max_error_substitution ()=default
| Defaulted.
| max_error_substitution (max_error_substitution const &)=default
| Defaulted.
| max_error_substitution (max_error_substitution &&)=default
| Defaulted.
max_error_substitution & | operator= (max_error_substitution const &)=default
| Defaulted.
max_error_substitution & | operator= (max_error_substitution &&)=default
| Defaulted.
| ~max_error_substitution ()=default
| Defaulted.
constexpr | max_error_substitution (error_count error)
| Initialises the substitution error with the given seqan3::search_cfg::error_count.
constexpr | max_error_substitution (error_rate error)
| Initialises the substitution error with the given seqan3::search_cfg::error_rate.

## Public Attributes

std::variant< error_count, error_rate > | error {error_count{0}}
| The error count or error rate.

## Detailed Description

Configuration element that represents the number or rate of substitution errors.

See also
  Configuration

This configuration element can be used to determine the number or rate of substitution errors that are supported. A substitution corresponds to diverging bases between text and query for a certain position.

### Example

// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: CC0-1.0
#include <seqan3/core/configuration/configuration.hpp>
#include <seqan3/search/configuration/max_error.hpp>
int main()
{
// Allow 1 error of any type.
seqan3::configuration const cfg1 = seqan3::search_cfg::max_error_total{seqan3::search_cfg::error_count{1}};
// Do not allow substitutions. Allow at most 1 error.
seqan3::configuration const cfg2 = seqan3::search_cfg::max_error_total{seqan3::search_cfg::error_count{1}}
| seqan3::search_cfg::max_error_substitution{seqan3::search_cfg::error_count{0}}
| seqan3::search_cfg::max_error_insertion{seqan3::search_cfg::error_count{1}}
| seqan3::search_cfg::max_error_deletion{seqan3::search_cfg::error_count{1}};
// Sets total errors to 2.
seqan3::configuration const cfg3 = seqan3::search_cfg::max_error_substitution{seqan3::search_cfg::error_count{0}}
| seqan3::search_cfg::max_error_insertion{seqan3::search_cfg::error_count{1}}
| seqan3::search_cfg::max_error_deletion{seqan3::search_cfg::error_count{1}};
// Allow 10% errors of any type.
seqan3::configuration const cfg4 = seqan3::search_cfg::max_error_total{seqan3::search_cfg::error_rate{0.1}};
// Do not allow substitutions. Allow at most 10% errors.
seqan3::configuration const cfg5 = seqan3::search_cfg::max_error_total{seqan3::search_cfg::error_rate{.1}}
| seqan3::search_cfg::max_error_substitution{seqan3::search_cfg::error_rate{.0}}
| seqan3::search_cfg::max_error_insertion{seqan3::search_cfg::error_rate{.1}}
| seqan3::search_cfg::max_error_deletion{seqan3::search_cfg::error_rate{.1}};
// Sets total errors to 20%.
seqan3::configuration const cfg6 = seqan3::search_cfg::max_error_substitution{seqan3::search_cfg::error_rate{.0}}
| seqan3::search_cfg::max_error_insertion{seqan3::search_cfg::error_rate{.1}}
| seqan3::search_cfg::max_error_deletion{seqan3::search_cfg::error_rate{.1}};
// Mixed error rate & count: Allow 2 insertions and or 2 deletions and 20% errors in total.
seqan3::configuration const cfg7 = seqan3::search_cfg::max_error_total{seqan3::search_cfg::error_rate{.2}}
| seqan3::search_cfg::max_error_substitution{seqan3::search_cfg::error_count{0}}
| seqan3::search_cfg::max_error_insertion{seqan3::search_cfg::error_count{2}}
| seqan3::search_cfg::max_error_deletion{seqan3::search_cfg::error_count{2}};
return 0;
}
seqan3::configuration
Collection of elements to configure an algorithm.
Definition configuration.hpp:42
seqan3::search_cfg::max_error_deletion
Configuration element that represents the number or rate of deletion errors.
Definition max_error.hpp:170
seqan3::search_cfg::max_error_insertion
Configuration element that represents the number or rate of insertion errors.
Definition max_error.hpp:124
seqan3::search_cfg::max_error_substitution
Configuration element that represents the number or rate of substitution errors.
Definition max_error.hpp:79
seqan3::search_cfg::max_error_total
Configuration element that represents the number or rate of total errors.
Definition max_error.hpp:34
configuration.hpp
Provides seqan3::configuration and utility functions.
max_error.hpp
Provides the configuration for maximum number of errors for all error types.
seqan3::search_cfg::error_count
A strong type of underlying type uint8_t that represents the number of errors.
Definition max_error_common.hpp:29
seqan3::search_cfg::error_rate
A strong type of underlying type double that represents the rate of errors.
Definition max_error_common.hpp:43

## Constructor & Destructor Documentation

## max_error_substitution() [1/2]

seqan3::search_cfg::max_error_substitution::max_error_substitution | ( | error_count | error | ) |

inline explicit constexpr

Initialises the substitution error with the given seqan3::search_cfg::error_count.

Parameters

  [in] | error | The maximal number of substitution errors allowed in the search.

## max_error_substitution() [2/2]

seqan3::search_cfg::max_error_substitution::max_error_substitution | ( | error_rate | error | ) |

inline explicit constexpr

Initialises the substitution error with the given seqan3::search_cfg::error_rate.

Parameters

  [in] | error | The maximal error rate for substitutions allowed in the search.

The documentation for this class was generated from the following file:

- max_error.hpp

Hide me