SeqAn3
seqan3::aminoacid_base< derived_type, size > Class Template Reference

A CRTP-base that refines seqan3::alphabet_base and is used by the amino acids. More...

#include <seqan3/alphabet/aminoacid/aminoacid_base.hpp>

Inheritance diagram for seqan3::aminoacid_base< derived_type, size >:
[legend]

Public Types

using char_type = char_t
 The type of the alphabet when converted to char (e.g. via to_char()).
 
using rank_type = detail::min_viable_uint_t< size - 1 >
 The type of the alphabet when represented as a number (e.g. via to_rank()).
 

Public Member Functions

Read functions
constexpr char_type to_char () const noexcept
 Return the letter as a character of char_type. More...
 
constexpr rank_type to_rank () const noexcept
 Return the letter's numeric value (rank in the alphabet). More...
 
Write functions
constexpr derived_type & assign_char (std::conditional_t< std::Same< char_type, void >, char, char_type > const c) noexcept
 Assign from a character. More...
 
constexpr derived_type & assign_rank (rank_type const c) noexcept
 Assign from a numeric value. More...
 

Static Public Attributes

static detail::min_viable_uint_t< size > constexpr value_size
 The size of the alphabet, i.e. the number of different values it can take.
 
Letter values

Static member "letters" that can be assigned to the alphabet or used in aggregate initialization.

Similar to an Enum interface.

static derived_type constexpr A = assign_char(derived_type{}, 'A')
 
static derived_type constexpr B = assign_char(derived_type{}, 'B')
 
static derived_type constexpr C = assign_char(derived_type{}, 'C')
 
static derived_type constexpr D = assign_char(derived_type{}, 'D')
 
static derived_type constexpr E = assign_char(derived_type{}, 'E')
 
static derived_type constexpr F = assign_char(derived_type{}, 'F')
 
static derived_type constexpr G = assign_char(derived_type{}, 'G')
 
static derived_type constexpr H = assign_char(derived_type{}, 'H')
 
static derived_type constexpr I = assign_char(derived_type{}, 'I')
 
static derived_type constexpr J = assign_char(derived_type{}, 'J')
 
static derived_type constexpr K = assign_char(derived_type{}, 'K')
 
static derived_type constexpr L = assign_char(derived_type{}, 'L')
 
static derived_type constexpr M = assign_char(derived_type{}, 'M')
 
static derived_type constexpr N = assign_char(derived_type{}, 'N')
 
static derived_type constexpr O = assign_char(derived_type{}, 'O')
 
static derived_type constexpr P = assign_char(derived_type{}, 'P')
 
static derived_type constexpr Q = assign_char(derived_type{}, 'Q')
 
static derived_type constexpr R = assign_char(derived_type{}, 'R')
 
static derived_type constexpr S = assign_char(derived_type{}, 'S')
 
static derived_type constexpr T = assign_char(derived_type{}, 'T')
 
static derived_type constexpr U = assign_char(derived_type{}, 'U')
 
static derived_type constexpr V = assign_char(derived_type{}, 'V')
 
static derived_type constexpr W = assign_char(derived_type{}, 'W')
 
static derived_type constexpr X = assign_char(derived_type{}, 'X')
 
static derived_type constexpr Y = assign_char(derived_type{}, 'Y')
 
static derived_type constexpr Z = assign_char(derived_type{}, 'Z')
 
static derived_type constexpr TERMINATOR = assign_char(derived_type{}, '*')
 
static derived_type constexpr UNKNOWN = X
 

Constructors, destructor and assignment

template<typename other_aa_type >
constexpr aminoacid_base (other_aa_type const &other) noexcept
 Allow explicit construction from any other aminoacid type and convert via the character representation.
 

Detailed Description

template<typename derived_type, auto size>
class seqan3::aminoacid_base< derived_type, size >

A CRTP-base that refines seqan3::alphabet_base and is used by the amino acids.

Template Parameters
derived_typeThe CRTP parameter type.
sizeThe size of the alphabet.

Member Function Documentation

◆ assign_char()

constexpr derived_type& seqan3::alphabet_base< derived_type, size, char >::assign_char ( std::conditional_t< std::Same< char_type, void >, char, char_type > const  c)
inlinenoexceptinherited

Assign from a character.

Satisfies the seqan3::alphabet_concept::assign_char() requirement via the seqan3::assign_char() wrapper.

Complexity

Constant.

Exceptions

Guaranteed not to throw.

◆ assign_rank()

constexpr derived_type& seqan3::alphabet_base< derived_type, size, char >::assign_rank ( rank_type const  c)
inlinenoexceptinherited

Assign from a numeric value.

Satisfies the seqan3::semi_alphabet_concept::assign_rank() requirement via the seqan3::assign_rank() wrapper.

Complexity

Constant.

Exceptions

Guaranteed not to throw.

◆ to_char()

constexpr char_type seqan3::alphabet_base< derived_type, size, char >::to_char ( ) const
inlinenoexceptinherited

Return the letter as a character of char_type.

Satisfies the seqan3::alphabet_concept::to_char() requirement via the seqan3::to_char() wrapper.

Complexity

Constant.

Exceptions

Guaranteed not to throw.

◆ to_rank()

constexpr rank_type seqan3::alphabet_base< derived_type, size, char >::to_rank ( ) const
inlinenoexceptinherited

Return the letter's numeric value (rank in the alphabet).

Satisfies the seqan3::semi_alphabet_concept::to_rank() requirement via the to_rank() wrapper.

Complexity

Constant.

Exceptions

Guaranteed not to throw.


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