A data structure for managing and computing the score of two amino acids. More...
#include <seqan3/alignment/scoring/aminoacid_scoring_scheme.hpp>
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). | |
Public Member Functions | |
Constructors, destructor and assignment | |
constexpr | aminoacid_scoring_scheme () noexcept=default |
The default constructor (delegates to set_hamming_distance()). More... | |
template<arithmetic score_arg_t> | |
constexpr | aminoacid_scoring_scheme (match_score< score_arg_t > const ms, mismatch_score< score_arg_t > const mms) |
Constructor for the simple scheme (delegates to set_simple_scheme()). More... | |
constexpr | aminoacid_scoring_scheme (matrix_type const &matrix) noexcept |
Constructor for a custom scheme (delegates to set_custom_matrix()). More... | |
constexpr | aminoacid_scoring_scheme (aminoacid_similarity_matrix const matrix_id) |
Construct for seqan3::aminoacid_similarity_matrix. More... | |
Scheme selection | |
constexpr void | set_similarity_matrix (aminoacid_similarity_matrix const matrix_id) |
Set the similarity matrix scheme (e.g. BLOSUM62). More... | |
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 . | |
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). More... | |
constexpr void | set_custom_matrix (matrix_type const &matrix) noexcept |
Set a custom scheme by passing a full matrix with arbitrary content. More... | |
Accessors | |
constexpr score_t & | score (alph1_t const alph1, alph2_t const alph2) noexcept |
Score two letters (either two nucleotids or two amino acids). More... | |
constexpr score_t | score (alph1_t const alph1, alph2_t const alph2) const noexcept |
Score two letters (either two nucleotids or two amino acids). More... | |
Comparison operators | |
constexpr bool | operator== (aminoacid_scoring_scheme< int8_t > const &rhs) const noexcept |
Checks whether *this is equal to rhs . | |
constexpr bool | operator!= (aminoacid_scoring_scheme< int8_t > const &rhs) const noexcept |
Checks whether *this is not equal to rhs . | |
Static Public Attributes | |
static constexpr matrix_size_type | matrix_size |
Size of the matrix dimensions (i.e. size of the alphabet). | |
Related Functions | |
(Note that these are not member functions.) | |
Type deduction guides | |
aminoacid_scoring_scheme () -> aminoacid_scoring_scheme< int8_t > | |
Default constructed objects deduce to int8_t . | |
template<arithmetic score_arg_type> | |
aminoacid_scoring_scheme (match_score< score_arg_type >, mismatch_score< score_arg_type >) -> aminoacid_scoring_scheme< int8_t > | |
Attention: This guide does not actually deduce from the underlying type, but always defaults to int8_t . To use a larger type, specify the template argument manually. | |
template<arithmetic score_arg_type> | |
aminoacid_scoring_scheme (std::array< std::array< score_arg_type, 27 >, 27 >) -> aminoacid_scoring_scheme< score_arg_type > | |
Deduce the score type from the provided matrix. | |
aminoacid_scoring_scheme (aminoacid_similarity_matrix) -> aminoacid_scoring_scheme< int8_t > | |
Attention: This guide does not actually deduce from the underlying type, but always defaults to int8_t . To use a larger type, specify the template argument manually. | |
A data structure for managing and computing the score of two amino acids.
You can use an instance of this class to score two amino acids. The amino acids need not be of the same type. Different scoring behaviour can be set via the member functions.
|
constexprdefaultnoexcept |
The default constructor (delegates to set_hamming_distance()).
|
inlineconstexpr |
Constructor for the simple scheme (delegates to set_simple_scheme()).
score_arg_t | The underlying type of the arguments. |
[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). |
std::invalid_argument | Thrown if you pass a value that is to large/low to be represented by score_t . |
|
inlineconstexprnoexcept |
Constructor for a custom scheme (delegates to set_custom_matrix()).
[in] | matrix | A full matrix that is copied into the scheme. |
|
inlineconstexpr |
Construct for seqan3::aminoacid_similarity_matrix.
[in] | matrix_id | The enum ID of the matrix, see seqan3::aminoacid_similarity_matrix. |
std::invalid_argument | If there is no matrix data for the given ID (usually a BUG). |
|
inlineconstexprnoexceptinherited |
Score two letters (either two nucleotids or two amino acids).
alph1_t | Type of the first letter. |
alph2_t | Type of the second letter (needn't be the same as alph1_t). |
[in] | alph1 | The first letter to score. |
[in] | alph2 | The second letter to score. |
|
inlineconstexprnoexceptinherited |
Score two letters (either two nucleotids or two amino acids).
alph1_t | Type of the first letter. |
alph2_t | Type of the second letter (needn't be the same as alph1_t). |
[in] | alph1 | The first letter to score. |
[in] | alph2 | The second letter to score. |
|
inlineconstexprnoexceptinherited |
Set a custom scheme by passing a full matrix with arbitrary content.
[in] | matrix | A full matrix that is copied into the scheme. |
|
inlineconstexpr |
Set the similarity matrix scheme (e.g. BLOSUM62).
[in] | matrix_id | The enum ID of the matrix, see seqan3::aminoacid_similarity_matrix. |
std::invalid_argument | If there is no matrix data for the given ID (usually a BUG). |
|
inlineconstexprinherited |
Set the simple scheme (everything is either match or mismatch).
score_arg_t | The underlying type of the arguments. |
[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). |
std::invalid_argument | Thrown if you pass a value that is to large/low to be represented by score_t . |