The WUSS structure alphabet of the characters .<>:,-_~;()[]{}AaBbCcDd
...
More...
#include <seqan3/alphabet/structure/wuss.hpp>
Public Types | |
using | char_type = std::conditional_t< std::same_as< char_t, void >, char, char_t > |
The char representation; conditional needed to make semi alphabet definitions legal. More... | |
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()). More... | |
Public Member 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... | |
Constructors, destructor and assignment | |
constexpr | wuss () noexcept=default |
Defaulted. | |
constexpr | wuss (wuss const &) noexcept=default |
Defaulted. | |
constexpr | wuss (wuss &&) noexcept=default |
Defaulted. | |
constexpr wuss & | operator= (wuss const &) noexcept=default |
Defaulted. | |
constexpr wuss & | operator= (wuss &&) noexcept=default |
Defaulted. | |
~wuss () noexcept=default | |
Defaulted. | |
![]() | |
constexpr | alphabet_base () noexcept=default |
Defaulted. | |
constexpr | alphabet_base (alphabet_base const &) noexcept=default |
Defaulted. | |
constexpr | alphabet_base (alphabet_base &&) noexcept=default |
Defaulted. | |
constexpr alphabet_base & | operator= (alphabet_base const &) noexcept=default |
Defaulted. | |
constexpr alphabet_base & | operator= (alphabet_base &&) noexcept=default |
Defaulted. | |
~alphabet_base () noexcept=default | |
Defaulted. | |
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... | |
constexpr wuss< 51 > & | assign_char (char_type const c) noexcept |
Assign from a character, implicitly converts invalid characters. More... | |
constexpr wuss< 51 > & | assign_rank (rank_type const c) noexcept |
Assign from a numeric value. More... | |
Static Public Attributes | |
static constexpr detail::min_viable_uint_t< size > | alphabet_size |
The size of the alphabet, i.e. the number of different values it can take. More... | |
![]() | |
static constexpr detail::min_viable_uint_t< size > | alphabet_size |
The size of the alphabet, i.e. the number of different values it can take. More... | |
Private Types | |
using | base_t = alphabet_base< wuss< SIZE >, SIZE > |
The base class. | |
Private Attributes | |
friend | base_t |
Befriend seqan3::alphabet_base. | |
Static Private Attributes | |
static constexpr std::array< rank_type, 256 > | char_to_rank |
Char-to-value conversion table. More... | |
static std::array< int8_t, SIZE > const | interaction_tab |
Lookup table for interactions: unpaired (0), pair-open (< 0), pair-close (> 0). Paired brackets have the same absolute value. More... | |
static constexpr std::array< char_type, alphabet_size > | rank_to_char |
Value-to-char conversion table. More... | |
Related Functions | |
(Note that these are not member functions.) | |
using | wuss51 = wuss< 51 > |
Alias for the default type wuss51. | |
Literals | |
std::vector< wuss51 > | operator""_wuss51 (const char *str, std::size_t len) |
The seqan3::wuss51 string literal. More... | |
constexpr wuss51 | operator""_wuss51 (char const ch) noexcept |
The seqan3::wuss51 char literal. More... | |
![]() | |
template<cereal_output_archive archive_t, semialphabet alphabet_t> | |
alphabet_rank_t< alphabet_t > | save_minimal (archive_t const &, alphabet_t const &l) |
Save an alphabet letter to stream. More... | |
RNA structure properties | |
static constexpr uint8_t | max_pseudoknot_depth {static_cast<uint8_t>((alphabet_size - 7) / 2)} |
The ability of this alphabet to represent pseudoknots, i.e. crossing interactions, up to a certain depth. It is the number of distinct pairs of interaction symbols the format supports: 4..30 (depends on size) | |
constexpr bool | is_pair_open () const noexcept |
Check whether the character represents a rightward interaction in an RNA structure. More... | |
constexpr bool | is_pair_close () const noexcept |
Check whether the character represents a leftward interaction in an RNA structure. More... | |
constexpr bool | is_unpaired () const noexcept |
Check whether the character represents an unpaired position in an RNA structure. More... | |
constexpr std::optional< uint8_t > | pseudoknot_id () const noexcept |
Get an identifier for a pseudoknotted interaction, where opening and closing brackets of the same type have the same id. More... | |
Additional Inherited Members | |
![]() | |
using | char_type = std::conditional_t< std::same_as< char, void >, char, char > |
The char representation; conditional needed to make semi alphabet definitions legal. More... | |
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()). More... | |
The WUSS structure alphabet of the characters .<>:,-_~;()[]{}AaBbCcDd
...
SIZE | The alphabet size defaults to 51 and must be an odd number in range 15..67. It determines the allowed pseudoknot depth by adding characters AaBb..Zz to the alphabet. |
The symbols .:,-_~;
denote unpaired characters, brackets <>()[]{}
represent base pair interactions and AaBbCcDd
... form pseudoknots in the structure. The default alphabet has size 51 (letters until Rr
). The size can be varied with the optional template parameter between 15 (no letters for pseudoknots) and 67 (all Aa
-Zz
for pseudoknots).
The following code example creates a wuss vector, modifies it, and prints the result to stderr.
using seqan3::alphabet_base< derived_type, size, char_t >::char_type = std::conditional_t<std::same_as<char_t, void>, char, char_t> |
The char representation; conditional needed to make semi alphabet definitions legal.
We need a return type for seqan3::alphabet_base::to_char and seqan3::alphabet_base::assign_char other than void to make these in-class definitions valid when char_t
is void.
using seqan3::alphabet_base< derived_type, size, char_t >::rank_type = detail::min_viable_uint_t<size - 1> |
The type of the alphabet when represented as a number (e.g. via to_rank()).
|
inlineconstexprnoexcept |
Check whether the character represents a leftward interaction in an RNA structure.
|
inlineconstexprnoexcept |
Check whether the character represents a rightward interaction in an RNA structure.
|
inlineconstexprnoexcept |
Check whether the character represents an unpaired position in an RNA structure.
|
inlineconstexprnoexcept |
Get an identifier for a pseudoknotted interaction, where opening and closing brackets of the same type have the same id.
|
inlineconstexprnoexcept |
Return the letter as a character of char_type.
Provides an implementation for seqan3::to_char, required to model seqan3::alphabet.
Constant.
Guaranteed not to throw.
|
inlineconstexprnoexcept |
Return the letter's numeric value (rank in the alphabet).
Provides an implementation for seqan3::to_rank, required to model seqan3::semialphabet.
Constant.
Guaranteed not to throw.
|
related |
The seqan3::wuss51 char literal.
[in] | ch | The character to represent as wuss. |
You can use this string literal to assign a seqan3::wuss51 character. For different wuss alphabet sizes the assign_char
function must be used.
|
related |
The seqan3::wuss51 string literal.
[in] | str | A pointer to the character string to assign. |
[in] | len | The size of the character string to assign. |
You can use this string literal to easily assign to a vector of seqan3::wuss51 characters:
|
staticconstexpr |
The size of the alphabet, i.e. the number of different values it can take.
|
staticconstexprprivate |
Char-to-value conversion table.
|
staticconstexprprivate |
Lookup table for interactions: unpaired (0), pair-open (< 0), pair-close (> 0). Paired brackets have the same absolute value.
|
staticconstexprprivate |
Value-to-char conversion table.