Loading...
Searching...
No Matches
seqan3::scoring_scheme_base< derived_t, alphabet_t, score_t > Class Template Reference
Sequence Alignment » Scoring

A CRTP base class for scoring schemes. More...

`#include <seqan3/alignment/scoring/scoring_scheme_base.hpp>`

Inheritance diagram for seqan3::scoring_scheme_base< derived_t, alphabet_t, score_t >:
[legend]

## Public Types

Member types
using | score_type = score_t
| Type of the score values.
using | alphabet_type = alphabet_t
| Type of the underlying alphabet.
using | matrix_size_type = std::remove_const_t<decltype(alphabet_size<alphabet_t>)>
| Size type that can hold the dimension of the matrix (i.e. size of the alphabet).
using | matrix_type = std::array<std::array<score_type, matrix_size>, matrix_size>
| Type of the internal matrix (a two-dimensional array).

## Public Member Functions

Constructors, destructor and assignment
constexpr | scoring_scheme_base (scoring_scheme_base const &) noexcept=default
| Defaulted.
constexpr | scoring_scheme_base (scoring_scheme_base &&) noexcept=default
| Defaulted.
constexpr scoring_scheme_base & | operator= (scoring_scheme_base const &) noexcept=default
| Defaulted.
constexpr scoring_scheme_base & | operator= (scoring_scheme_base &&) noexcept=default
| Defaulted.
| ~scoring_scheme_base () noexcept=default
| Defaulted.
constexpr | scoring_scheme_base () noexcept
| The default constructor (delegates to set_hamming_distance()).
template<arithmetic score_arg_t>
constexpr | scoring_scheme_base (match_score< score_arg_t > const ms, mismatch_score< score_arg_t > const mms)
| Constructor for the simple scheme (delegates to set_simple_scheme()).
constexpr | scoring_scheme_base (matrix_type const &matrix) noexcept
| Constructor for a custom scheme (delegates to set_custom_matrix()).
Scheme selection
constexpr void | set_hamming_distance () noexcept
| Set the hamming scheme, a variant of the simple scheme where match is scored 0 and mismatch -1.
template<arithmetic score_arg_t>
constexpr void | set_simple_scheme (match_score< score_arg_t > const ms, mismatch_score< score_arg_t > const mms)
| Set the simple scheme (everything is either match or mismatch).
constexpr void | set_custom_matrix (matrix_type const &matrix) noexcept
| Set a custom scheme by passing a full matrix with arbitrary content.
Accessors
template<typename alph1_t, typename alph2_t> requires explicitly_convertible_to<alph1_t, alphabet_t> && explicitly_convertible_to<alph2_t, alphabet_t>
constexpr score_t & | score (alph1_t const alph1, alph2_t const alph2) noexcept
| Score two letters (either two nucleotids or two amino acids).
template<typename alph1_t, typename alph2_t> requires explicitly_convertible_to<alph1_t, alphabet_t> && explicitly_convertible_to<alph2_t, alphabet_t>
constexpr score_t | score (alph1_t const alph1, alph2_t const alph2) const noexcept
| Score two letters (either two nucleotids or two amino acids).
Comparison operators
constexpr bool | operator== (derived_t const &rhs) const noexcept
| Checks whether *this is equal to rhs.
constexpr bool | operator!= (derived_t const &rhs) const noexcept
| Checks whether *this is not equal to rhs.

## Static Public Attributes

static constexpr matrix_size_type | matrix_size = alphabet_size<alphabet_t>
| Size of the matrix dimensions (i.e. size of the alphabet).

## Detailed Description

template<typename derived_t, alphabet alphabet_t, arithmetic score_t>
class seqan3::scoring_scheme_base< derived_t, alphabet_t, score_t >

A CRTP base class for scoring schemes.

Template Parameters

  derived_t | The derived type.
  alphabet_t | Type of the largest target alphabet.
  score_type | Type of the score values in the internal matrix.

This type is never used directly, instead use seqan3::nucleotide_scoring_scheme or seqan3::aminoacid_scoring_scheme.

This class is only implementation detail and not required for most users. Types that model seqan3::scoring_scheme can (but don't need to!) inherit from it.

## Constructor & Destructor Documentation

## scoring_scheme_base() [1/2]

template<typename derived_t, alphabet alphabet_t, arithmetic score_t>
template<arithmetic score_arg_t>

seqan3::scoring_scheme_base< derived_t, alphabet_t, score_t >::scoring_scheme_base | ( | match_score< score_arg_t > const | ms,
|  | mismatch_score< score_arg_t > const | mms )

inline constexpr

Constructor for the simple scheme (delegates to set_simple_scheme()).

Template Parameters

  score_arg_t | The underlying type of the arguments.

Parameters

  [in] | ms | Matches shall be given this value (of type seqan3::match_score).
  [in] | mms | Mismatches shall be given this value (of type seqan3::mismatch_score).

Exceptions

  std::invalid_argument | Thrown if you pass a value that is to large/low to be represented by score_t.

## scoring_scheme_base() [2/2]

template<typename derived_t, alphabet alphabet_t, arithmetic score_t>

seqan3::scoring_scheme_base< derived_t, alphabet_t, score_t >::scoring_scheme_base | ( | matrix_type const & | matrix | ) |

inline constexpr noexcept

Constructor for a custom scheme (delegates to set_custom_matrix()).

Parameters

  [in] | matrix | A full matrix that is copied into the scheme.

## Member Function Documentation

## score() [1/2]

template<typename derived_t, alphabet alphabet_t, arithmetic score_t>
template<typename alph1_t, typename alph2_t>
requires explicitly_convertible_to<alph1_t, alphabet_t> && explicitly_convertible_to<alph2_t, alphabet_t>

score_t seqan3::scoring_scheme_base< derived_t, alphabet_t, score_t >::score | ( | alph1_t const | alph1,
|  | alph2_t const | alph2 ) const

inline constexpr noexcept

Score two letters (either two nucleotids or two amino acids).

Template Parameters

  alph1_t | Type of the first letter.
  alph2_t | Type of the second letter (needn't be the same as alph1_t).

Parameters

  [in] | alph1 | The first letter to score.
  [in] | alph2 | The second letter to score.

Returns
  The score of the two letters in the current scheme.

## score() [2/2]

template<typename derived_t, alphabet alphabet_t, arithmetic score_t>
template<typename alph1_t, typename alph2_t>
requires explicitly_convertible_to<alph1_t, alphabet_t> && explicitly_convertible_to<alph2_t, alphabet_t>

score_t & seqan3::scoring_scheme_base< derived_t, alphabet_t, score_t >::score | ( | alph1_t const | alph1,
|  | alph2_t const | alph2 )

inline constexpr noexcept

Score two letters (either two nucleotids or two amino acids).

Template Parameters

  alph1_t | Type of the first letter.
  alph2_t | Type of the second letter (needn't be the same as alph1_t).

Parameters

  [in] | alph1 | The first letter to score.
  [in] | alph2 | The second letter to score.

Returns
  The score of the two letters in the current scheme.

## set_custom_matrix()

template<typename derived_t, alphabet alphabet_t, arithmetic score_t>

void seqan3::scoring_scheme_base< derived_t, alphabet_t, score_t >::set_custom_matrix | ( | matrix_type const & | matrix | ) |

inline constexpr noexcept

Set a custom scheme by passing a full matrix with arbitrary content.

Parameters

  [in] | matrix | A full matrix that is copied into the scheme.

## set_simple_scheme()

template<typename derived_t, alphabet alphabet_t, arithmetic score_t>
template<arithmetic score_arg_t>

void seqan3::scoring_scheme_base< derived_t, alphabet_t, score_t >::set_simple_scheme | ( | match_score< score_arg_t > const | ms,
|  | mismatch_score< score_arg_t > const | mms )

inline constexpr

Set the simple scheme (everything is either match or mismatch).

Template Parameters

  score_arg_t | The underlying type of the arguments.

Parameters

  [in] | ms | Matches shall be given this value (of type seqan3::match_score).
  [in] | mms | Mismatches shall be given this value (of type seqan3::mismatch_score).

Exceptions

  std::invalid_argument | Thrown if you pass a value that is to large/low to be represented by score_t.

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

- scoring_scheme_base.hpp

Hide me