SeqAn3  3.0.1
The Modern C++ library for sequence analysis.
seqan3::gap_scheme< score_t > Class Template Reference

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

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_schemeoperator= (gap_scheme const &) noexcept=default
 Defaulted.
 
constexpr gap_schemeoperator= (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.
 

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.
 

Detailed Description

template<arithmetic score_t = int8_t>
class seqan3::gap_scheme< score_t >

A scheme for representing and computing scores against gap characters.

Template Parameters
score_typeType of the score values saved internally.

Constructor & Destructor Documentation

◆ gap_scheme() [1/2]

template<arithmetic score_t = int8_t>
template<arithmetic score_arg_t>
constexpr seqan3::gap_scheme< score_t >::gap_scheme ( gap_score< score_arg_t > const  g,
gap_open_score< score_arg_t > const  go 
)
inlineconstexpr

Constructor for the Affine gap costs model (delegates to set_affine()).

Template Parameters
score_arg_tThe underlying type of the arguments.
Parameters
[in]gThe cost of each gap character (of type seqan3::gap_score).
[in]goThe additional cost per sequence of gaps (of type seqan3::gap_open_score).
Exceptions
std::invalid_argumentThrown 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 + go.

Attention
This is the formula used most commonly in the literature, but it is different from SeqAn2 where the formula was (n-1) * g + go.

◆ gap_scheme() [2/2]

template<arithmetic score_t = int8_t>
template<arithmetic score_arg_t>
constexpr seqan3::gap_scheme< score_t >::gap_scheme ( gap_score< score_arg_t > const  g)
inlineconstexpr

Constructor for the Linear gap costs model (delegates to set_linear()).

Template Parameters
score_arg_tThe underlying type of the argument.
Parameters
[in]gThe cost of each gap character (of type seqan3::gap_score).
Exceptions
std::invalid_argumentThrown 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.

Member Function Documentation

◆ get_gap_open_score()

template<arithmetic score_t = int8_t>
constexpr score_t seqan3::gap_scheme< score_t >::get_gap_open_score ( ) const
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.

Template Parameters
score_typeThe underlying type.
See also
seqan3::gap_scheme

◆ get_gap_score()

template<arithmetic score_t = int8_t>
constexpr score_t seqan3::gap_scheme< score_t >::get_gap_score ( ) const
inlineconstexprnoexcept

A strong type of underlying type score_type that represents the score of any character against a gap character.

Template Parameters
score_typeThe underlying type.
See also
seqan3::gap_scheme

◆ score()

template<arithmetic score_t = int8_t>
constexpr ptrdiff_t seqan3::gap_scheme< score_t >::score ( size_t const  number_of_consecutive_gaps) const
inlineconstexprnoexcept

Compute the score of a stretch of gap characters.

Parameters
number_of_consecutive_gapsThe number of consecutive gaps that you wish to know the score for.
Returns
A signed integer (usually 64bit) that holds the score computed based on the selected scheme.

◆ set_affine()

template<arithmetic score_t = int8_t>
template<arithmetic score_arg_t>
constexpr void seqan3::gap_scheme< score_t >::set_affine ( gap_score< score_arg_t > const  g,
gap_open_score< score_arg_t > const  go 
)
inlineconstexpr

Set the Affine gap costs model.

Template Parameters
score_arg_tThe underlying type of the arguments.
Parameters
[in]gThe cost of each gap character (of type seqan3::gap_score).
[in]goThe additional cost per sequence of gaps (of type seqan3::gap_open_score).
Exceptions
std::invalid_argumentThrown 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 + go.

Attention
This is the formula used most commonly in the literature, but it is different from SeqAn2 where the formula was (n-1) * g + go.

◆ set_linear()

template<arithmetic score_t = int8_t>
template<arithmetic score_arg_t>
constexpr void seqan3::gap_scheme< score_t >::set_linear ( gap_score< score_arg_t > const  g)
inlineconstexpr

Set the Linear gap costs model.

Template Parameters
score_arg_tThe underlying type of the argument.
Parameters
[in]gThe cost of each gap character (of type seqan3::gap_score).
Exceptions
std::invalid_argumentThrown 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.


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