45 #include <seqan3/alphabet/detail/convert.hpp> 56 template <
typename derived_type, auto size>
70 constexpr aminoacid_base(aminoacid_base
const &) =
default;
71 constexpr aminoacid_base(aminoacid_base &&) =
default;
72 constexpr aminoacid_base & operator=(aminoacid_base
const &) =
default;
73 constexpr aminoacid_base & operator=(aminoacid_base &&) =
default;
74 ~aminoacid_base() =
default;
93 template <
typename other_aa_type>
102 static_cast<derived_type &
>(*this) =
103 detail::convert_through_char_representation<derived_type, other_aa_type>[
to_rank(other)];
111 static derived_type constexpr A =
assign_char(derived_type{},
'A');
113 static derived_type constexpr B =
assign_char(derived_type{},
'B');
114 static derived_type constexpr C =
assign_char(derived_type{},
'C');
115 static derived_type constexpr D =
assign_char(derived_type{},
'D');
116 static derived_type constexpr E =
assign_char(derived_type{},
'E');
117 static derived_type constexpr F =
assign_char(derived_type{},
'F');
118 static derived_type constexpr G =
assign_char(derived_type{},
'G');
119 static derived_type constexpr H =
assign_char(derived_type{},
'H');
120 static derived_type constexpr I =
assign_char(derived_type{},
'I');
121 static derived_type constexpr J =
assign_char(derived_type{},
'J');
122 static derived_type constexpr K =
assign_char(derived_type{},
'K');
123 static derived_type constexpr L =
assign_char(derived_type{},
'L');
124 static derived_type constexpr M =
assign_char(derived_type{},
'M');
125 static derived_type constexpr N =
assign_char(derived_type{},
'N');
126 static derived_type constexpr O =
assign_char(derived_type{},
'O');
127 static derived_type constexpr P =
assign_char(derived_type{},
'P');
128 static derived_type constexpr Q =
assign_char(derived_type{},
'Q');
129 static derived_type constexpr R =
assign_char(derived_type{},
'R');
130 static derived_type constexpr S =
assign_char(derived_type{},
'S');
131 static derived_type constexpr T =
assign_char(derived_type{},
'T');
132 static derived_type constexpr U =
assign_char(derived_type{},
'U');
133 static derived_type constexpr V =
assign_char(derived_type{},
'V');
134 static derived_type constexpr W =
assign_char(derived_type{},
'W');
135 static derived_type constexpr X =
assign_char(derived_type{},
'X');
136 static derived_type constexpr Y =
assign_char(derived_type{},
'Y');
137 static derived_type constexpr Z =
assign_char(derived_type{},
'Z');
138 static derived_type constexpr TERMINATOR =
assign_char(derived_type{},
'*');
139 static derived_type constexpr UNKNOWN = X;
detail::min_viable_uint_t< size - 1 > rank_type
The type of the alphabet when represented as a number (e.g. via to_rank()).
Definition: alphabet_base.hpp:89
char char_type
The type of the alphabet when converted to char (e.g. via to_char()).
Definition: alphabet_base.hpp:87
A concept that indicates whether an alphabet represents amino acids.In addition to the requirements f...
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:58
constexpr aminoacid_base(other_aa_type const &other) noexcept
Allow explicit construction from any other aminoacid type and convert via the character representatio...
Definition: aminoacid_base.hpp:99
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.
Definition: alphabet_base.hpp:198
Provides seqan3::alphabet_base.
The concept std::Same<T, U> is satisfied if and only if T and U denote the same type.
constexpr derived_type & assign_char(std::conditional_t< std::Same< char_type, void >, char, char_type > const c) noexcept
Assign from a character.
Definition: alphabet_base.hpp:165
constexpr rank_type to_rank() const noexcept
Return the letter's numeric value (rank in the alphabet).
Definition: alphabet_base.hpp:142
A CRTP-base that refines seqan3::alphabet_base and is used by the amino acids.
Definition: aminoacid_base.hpp:57
A CRTP-base that makes defining a custom alphabet easier.
Definition: alphabet_base.hpp:77
Provides seqan3::aminoacid_concept.
constexpr underlying_rank_t< alphabet_type > to_rank(alphabet_type const alph) requires requires(alphabet_type alph)
Implementation of seqan3::semi_alphabet_concept::to_rank() that delegates to a member function...
Definition: member_exposure.hpp:97