Loading...
Searching...
No Matches
seqan3::hamming_scoring_scheme Class Reference
Sequence Alignment » Scoring

A scoring scheme that assigns a score of 0 to matching letters and -1 to mismatching letters. More...

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

## Public Types

using | score_type = int32_t
| The underlying score type.

## Public Member Functions

Constructors, destructor and assignment
| hamming_scoring_scheme () noexcept=default
| Defaulted.
| hamming_scoring_scheme (hamming_scoring_scheme const &)=default
| Defaulted.
| hamming_scoring_scheme (hamming_scoring_scheme &&) noexcept=default
| Defaulted.
hamming_scoring_scheme & | operator= (hamming_scoring_scheme const &)=default
| Defaulted.
hamming_scoring_scheme & | operator= (hamming_scoring_scheme &&) noexcept=default
| Defaulted.
| ~hamming_scoring_scheme ()=default
| Defaulted.
Accessors
template<typename alph1_t, typename alph2_t> requires std::equality_comparable_with<alph1_t, alph2_t>
constexpr score_type | score (alph1_t const alph1, alph2_t const alph2) const noexcept
| Returns the score of two letters.
Comparison operators
constexpr bool | operator== (hamming_scoring_scheme const &) const noexcept
| Always true.
constexpr bool | operator!= (hamming_scoring_scheme const &) const noexcept
| Always false.

## Detailed Description

A scoring scheme that assigns a score of 0 to matching letters and -1 to mismatching letters.

This stateless scoring scheme is equivalent to the Hamming distance and assigns a score of 0 to matching letters and -1 to mismatching letters. This scheme is independent of the alphabet type and can be used whenever the two compared alphabets model the std::equality_comparable_with concept. Use this scheme if you want to use the use the more efficient bitparallel alignment algorithm often used in the context of computing the edit distance. See the documentation for seqan3::align_cfg::edit_scheme for more details.

## Member Function Documentation

## score()

template<typename alph1_t, typename alph2_t>
requires std::equality_comparable_with<alph1_t, alph2_t>

score_type seqan3::hamming_scoring_scheme::score | ( | alph1_t const | alph1,
|  | alph2_t const | alph2 ) const

inline constexpr noexcept

Returns the score of two letters.

Template Parameters

  alph1_t | The type of the first letter.
  alph2_t | The type of the second letter.

Parameters

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

This function returns 0 if the two letters are equal and -1 otherwise. Note that both alphabet types of the compared letters must model the std::equality_comparable_with concept or no overload of this function is available.

Returns
  The score of the two letters. 0 if the letters are equal, -1 otherwise.

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

- hamming_scoring_scheme.hpp

Hide me