Loading...
Searching...
No Matches
seqan3::wuss< SIZE > Class Template Reference
Alphabet » Structure

The WUSS structure alphabet of the characters .<>:,-_~;()[]{}AaBbCcDd... More...

`#include <seqan3/alphabet/structure/wuss.hpp>`

Inheritance diagram for seqan3::wuss< SIZE >:
[legend]

## Public Member Functions

constexpr char_type | to_char () const noexcept
| Return the letter as a character of char_type.
constexpr rank_type | to_rank () const noexcept
| Return the letter's numeric value (rank in the alphabet).
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.
Public Member Functions inherited from seqan3::alphabet_base< wuss< 51 >, 51 >
constexpr | alphabet_base () noexcept=default
| Defaulted.
constexpr alphabet_base & | operator= (alphabet_base const &) noexcept=default
| Defaulted.
| ~alphabet_base () noexcept=default
| Defaulted.
constexpr char_type | to_char () const noexcept
| Return the letter as a character of char_type.
constexpr rank_type | to_rank () const noexcept
| Return the letter's numeric value (rank in the alphabet).
constexpr wuss< 51 > & | assign_char (char_type const chr) noexcept
| Assign from a character, implicitly converts invalid characters.
constexpr wuss< 51 > & | assign_rank (rank_type const c) noexcept
| Assign from a numeric value.

## 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.
Static Public Attributes inherited from seqan3::alphabet_base< wuss< 51 >, 51 >
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.

## Related Symbols

(Note that these are not member symbols.)
using | wuss51 = wuss<51>
| Alias for the default type wuss51.
Structure literals
constexpr wuss51 | operator""_wuss51 (char const ch) noexcept
| The seqan3::wuss51 char literal.
constexpr std::vector< wuss51 > | operator""_wuss51 (char const *str, std::size_t len)
| The seqan3::wuss51 string literal.

## 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.
constexpr bool | is_pair_close () const noexcept
| Check whether the character represents a leftward interaction in an RNA structure.
constexpr bool | is_unpaired () const noexcept
| Check whether the character represents an unpaired position in an RNA structure.
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.

## Additional Inherited Members

Protected Types inherited from seqan3::alphabet_base< wuss< 51 >, 51 >
using | char_type
| The char representation; conditional needed to make semi alphabet definitions legal.
using | rank_type
| The type of the alphabet when represented as a number (e.g. via to_rank()).

## Detailed Description

template<uint8_t SIZE = 51>
class seqan3::wuss< SIZE >

The WUSS structure alphabet of the characters .<>:,-_~;()[]{}AaBbCcDd...

Template Parameters

  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).

<<<___>>>,,<<<__>>>
<<<<_AAAA____>>>>aaaa

### Example

// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: CC0-1.0
#include <seqan3/alphabet/structure/wuss.hpp>
#include <seqan3/core/debug_stream.hpp>
int main()
{
using namespace seqan3::literals;
seqan3::wuss51 letter{':'_wuss51};
letter.assign_char('~');
seqan3::debug_stream << letter << '\n'; // prints "~"
letter.assign_char('#'); // Unknown characters are implicitly converted to ';'.
seqan3::debug_stream << letter << '\n'; // prints ";"
}
debug_stream.hpp
Provides seqan3::debug_stream and related types.
seqan3::debug_stream
debug_stream_type debug_stream
A global instance of seqan3::debug_stream_type.
Definition debug_stream.hpp:38
seqan3::literals
The SeqAn namespace for literals.
wuss.hpp
Provides the WUSS format for RNA structure.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## Member Function Documentation

## is_pair_close()

template<uint8_t SIZE = 51>

bool seqan3::wuss< SIZE >::is_pair_close | ( |  | ) | const

inline constexpr noexcept

Check whether the character represents a leftward interaction in an RNA structure.

Returns
  True if the letter represents a leftward interaction, False otherwise.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## is_pair_open()

template<uint8_t SIZE = 51>

bool seqan3::wuss< SIZE >::is_pair_open | ( |  | ) | const

inline constexpr noexcept

Check whether the character represents a rightward interaction in an RNA structure.

Returns
  True if the letter represents a rightward interaction, False otherwise.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## is_unpaired()

template<uint8_t SIZE = 51>

bool seqan3::wuss< SIZE >::is_unpaired | ( |  | ) | const

inline constexpr noexcept

Check whether the character represents an unpaired position in an RNA structure.

Returns
  True if the letter represents an unpaired site, False otherwise.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## pseudoknot_id()

template<uint8_t SIZE = 51>

std::optional< uint8_t > seqan3::wuss< SIZE >::pseudoknot_id | ( |  | ) | const

inline constexpr noexcept

Get an identifier for a pseudoknotted interaction, where opening and closing brackets of the same type have the same id.

Returns
  The pseudoknot id, if alph denotes an interaction, and no value otherwise.

It is guaranteed to be smaller than seqan3::max_pseudoknot_depth.

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## to_char()

template<uint8_t SIZE = 51>

char_type seqan3::alphabet_base< wuss< SIZE >, size, char >::to_char | ( |  | ) | const

inline constexpr noexcept

Return the letter as a character of char_type.

Provides an implementation for seqan3::to_char, required to model seqan3::alphabet.

### Complexity

Constant.

### Exceptions

Guaranteed not to throw.

This entity is stable. Since version 3.1.

## to_rank()

template<uint8_t SIZE = 51>

rank_type seqan3::alphabet_base< wuss< SIZE >, size, char >::to_rank | ( |  | ) | const

inline constexpr noexcept

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

Provides an implementation for seqan3::to_rank, required to model seqan3::semialphabet.

### Complexity

Constant.

### Exceptions

Guaranteed not to throw.

This entity is stable. Since version 3.1.

## Friends And Related Symbol Documentation

## operator""_wuss51() [1/2]

template<uint8_t SIZE = 51>

std::vector< wuss51 > operator""_wuss51 | ( | char const * | str,
|  | std::size_t | len )

related

The seqan3::wuss51 string literal.

Parameters

  [in] | str | A pointer to the character string to assign.
  [in] | len | The size of the character string to assign.

Returns
  std::vector<seqan3::wuss51>

You can use this string literal to easily assign to std::vector<seqan3::wuss51>:

// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: CC0-1.0
#include <seqan3/alphabet/structure/wuss.hpp>
int main()
{
using namespace seqan3::literals;
std::vector<seqan3::wuss51> sequence1{".<..>."_wuss51};
std::vector<seqan3::wuss51> sequence2 = ".<..>."_wuss51;
auto sequence3 = ".<..>."_wuss51;
}
std::vector

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## operator""_wuss51() [2/2]

template<uint8_t SIZE = 51>

wuss51 operator""_wuss51 | ( | char const | ch | ) |

related

The seqan3::wuss51 char literal.

Parameters

  [in] | ch | The character to represent as wuss.

Returns
  seqan3::wuss51

You can use this char literal to assign a seqan3::wuss51 character:

// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: CC0-1.0
#include <seqan3/alphabet/structure/wuss.hpp>
int main()
{
using namespace seqan3::literals;
seqan3::wuss51 letter1{'('_wuss51};
auto letter2 = '('_wuss51;
}

This entity is experimental and subject to change in the future. Experimental since version 3.1.

## Member Data Documentation

## alphabet_size

template<uint8_t SIZE = 51>

detail::min_viable_uint_t<size> seqan3::alphabet_base< wuss< SIZE >, size, char >::alphabet_size

static constexpr

The size of the alphabet, i.e. the number of different values it can take.

This entity is stable. Since version 3.1.

## max_pseudoknot_depth

template<uint8_t SIZE = 51>

uint8_t seqan3::wuss< SIZE >::max_pseudoknot_depth {static_cast<uint8_t>((alphabet_size - 7) / 2)}

static constexpr

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).

This entity is experimental and subject to change in the future. Experimental since version 3.1.

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

- wuss.hpp

Hide me