A scheme for representing and computing scores against gap characters. More...
#include <seqan3/alignment/scoring/gap_scheme.hpp>
Public Types | |
Member types | |
using | score_type = score_t |
The template parameter exposed as member type. | |
Public Member Functions | |
template<cereal_archive archive_t> | |
void | serialize (archive_t &archive) |
Serialisation support function. More... | |
Constructors, destructor and assignment | |
constexpr | gap_scheme () noexcept=default |
Defaulted. | |
constexpr | gap_scheme (gap_scheme const &) noexcept=default |
Defaulted. | |
constexpr | gap_scheme (gap_scheme &&) noexcept=default |
Defaulted. | |
constexpr gap_scheme & | operator= (gap_scheme const &) noexcept=default |
Defaulted. | |
constexpr gap_scheme & | operator= (gap_scheme &&) noexcept=default |
Defaulted. | |
~gap_scheme () noexcept=default | |
Defaulted. | |
template<arithmetic score_arg_t> | |
constexpr | gap_scheme (gap_score< score_arg_t > const g, gap_open_score< score_arg_t > const go) |
Constructor for the Affine gap costs model (delegates to set_affine()). More... | |
template<arithmetic score_arg_t> | |
constexpr | gap_scheme (gap_score< score_arg_t > const g) |
Constructor for the Linear gap costs model (delegates to set_linear()). More... | |
Scheme selection | |
template<arithmetic score_arg_t> | |
constexpr void | set_affine (gap_score< score_arg_t > const g, gap_open_score< score_arg_t > const go) |
Set the Affine gap costs model. More... | |
template<arithmetic score_arg_t> | |
constexpr void | set_linear (gap_score< score_arg_t > const g) |
Set the Linear gap costs model. More... | |
Accessors | |
constexpr score_t & | get_gap_score () noexcept |
Return the gap score. | |
constexpr score_t | get_gap_score () const noexcept |
A strong type of underlying type score_type that represents the score of any character against a gap character. More... | |
constexpr score_t & | get_gap_open_score () noexcept |
Return the gap open score. | |
constexpr score_t | get_gap_open_score () const noexcept |
A strong type of underlying type score_type that represents an additional score (usually negative) that is incurred once additionaly per stretch of consecutive gaps. More... | |
constexpr ptrdiff_t | score (size_t const number_of_consecutive_gaps) const noexcept |
Compute the score of a stretch of gap characters. More... | |
Comparison operators | |
constexpr bool | operator== (gap_scheme const &rhs) const noexcept |
Checks whether *this is equal to rhs . | |
constexpr bool | operator!= (gap_scheme const &rhs) const noexcept |
Checks whether *this is not equal to rhs . | |
Private Attributes | |
score_t | gap = -1 |
The score per gap character. Defaults to -1. | |
score_t | gap_open = 0 |
The score per sequence of gaps. Defaults to 0. | |
Related Functions | |
(Note that these are not member functions.) | |
Type deduction guides | |
gap_scheme () -> gap_scheme< int8_t > | |
Default constructed objects deduce to int8_t . | |
template<floating_point score_arg_type> | |
gap_scheme (gap_score< score_arg_type >, gap_open_score< score_arg_type >) -> gap_scheme< float > | |
Attention: This guide does not actually deduce from the underlying type, but always defaults to float for floating point types. To use a larger type, specify the template argument manually. | |
template<floating_point score_arg_type> | |
gap_scheme (gap_score< score_arg_type >) -> gap_scheme< float > | |
Attention: This guide does not actually deduce from the underlying type, but always defaults to float for floating point types. To use a larger type, specify the template argument manually. | |
template<arithmetic score_arg_type> | |
gap_scheme (gap_score< score_arg_type >, gap_open_score< score_arg_type >) -> gap_scheme< int8_t > | |
Attention: This guide does not actually deduce from the underlying type, but always defaults to int8_t for integer types. To use a larger type, specify the template argument manually. | |
template<arithmetic score_arg_type> | |
gap_scheme (gap_score< score_arg_type >) -> gap_scheme< int8_t > | |
Attention: This guide does not actually deduce from the underlying type, but always defaults to int8_t for integer types. To use a larger type, specify the template argument manually. | |
A scheme for representing and computing scores against gap characters.
score_type | Type of the score values saved internally. |
|
inlineconstexpr |
Constructor for the Affine gap costs model (delegates to set_affine()).
score_arg_t | The underlying type of the arguments. |
[in] | g | The cost of each gap character (of type seqan3::gap_score). |
[in] | go | The additional cost per sequence of gaps (of type seqan3::gap_open_score). |
std::invalid_argument | Thrown if you pass a value that is too large/low to be represented by score_t . |
The score for a sequence of n
gap characters is computed as n * g + go
.
(n-1) * g + go
.
|
inlineconstexpr |
Constructor for the Linear gap costs model (delegates to set_linear()).
score_arg_t | The underlying type of the argument. |
[in] | g | The cost of each gap character (of type seqan3::gap_score). |
std::invalid_argument | Thrown if you pass a value that is to large/low to be represented by score_t . |
The score for a sequence of n
gap characters is computed as n * g
. This is the same as the affine model with a gap open score of 0
.
|
inlineconstexprnoexcept |
A strong type of underlying type score_type
that represents an additional score (usually negative) that is incurred once additionaly per stretch of consecutive gaps.
score_type | The underlying type. |
|
inlineconstexprnoexcept |
A strong type of underlying type score_type
that represents the score of any character against a gap character.
score_type | The underlying type. |
|
inlineconstexprnoexcept |
Compute the score of a stretch of gap characters.
number_of_consecutive_gaps | The number of consecutive gaps that you wish to know the score for. |
|
inline |
Serialisation support function.
archive_t | Type of archive ; must satisfy seqan3::cereal_archive. |
archive | The archive being serialised from/to. |
|
inlineconstexpr |
Set the Affine gap costs model.
score_arg_t | The underlying type of the arguments. |
[in] | g | The cost of each gap character (of type seqan3::gap_score). |
[in] | go | The additional cost per sequence of gaps (of type seqan3::gap_open_score). |
std::invalid_argument | Thrown if you pass a value that is too large/low to be represented by score_t . |
The score for a sequence of n
gap characters is computed as n * g + go
.
(n-1) * g + go
.
|
inlineconstexpr |
Set the Linear gap costs model.
score_arg_t | The underlying type of the argument. |
[in] | g | The cost of each gap character (of type seqan3::gap_score). |
std::invalid_argument | Thrown if you pass a value that is to large/low to be represented by score_t . |
The score for a sequence of n
gap characters is computed as n * g
. This is the same as the affine model with a gap open score of 0
.