Nucleotide

Meta-header for the nucleotide submodule; includes all headers from alphabet/nucleotide/.

Author
Hannes Hauswedell <hannes.hauswedell AT fu-berlin.de>

Provides seqan3::nucleotide_concept.

Author
Hannes Hauswedell <hannes.hauswedell AT fu-berlin.de>

namespace seqan3

The main SeqAn3 namespace.

Helpers for seqan3::semi_alphabet_concept

These functions and metafunctions expose member variables and types so that they satisfy seqan3::semi_alphabet_concept.

Helpers for seqan3::alphabet_concept

These functions and metafunctions expose member variables and types so that they satisfy seqan3::alphabet_concept.

Helpers for seqan3::nucleotide_concept

These functions and metafunctions expose member variables and types so that they satisfy seqan3::nucleotide_concept.

Alphabet aliases

Other names (typedefs) for seqan3::nucl16

Range concepts

Adapted from the Ranges TS.

Container concepts

Container concepts as defined by the standard library (or very close).

Container-of-container concepts

Shortcuts for multi-dimensional container concepts.

Contains seqan3::dna4, container aliases and string literals.

Author
Hannes Hauswedell <hannes.hauswedell AT fu-berlin.de>

namespace seqan3

The main SeqAn3 namespace.

Helpers for seqan3::semi_alphabet_concept

These functions and metafunctions expose member variables and types so that they satisfy seqan3::semi_alphabet_concept.

Helpers for seqan3::alphabet_concept

These functions and metafunctions expose member variables and types so that they satisfy seqan3::alphabet_concept.

Helpers for seqan3::nucleotide_concept

These functions and metafunctions expose member variables and types so that they satisfy seqan3::nucleotide_concept.

Alphabet aliases

Other names (typedefs) for seqan3::nucl16

Range concepts

Adapted from the Ranges TS.

Container concepts

Container concepts as defined by the standard library (or very close).

Container-of-container concepts

Shortcuts for multi-dimensional container concepts.

struct dna4
#include <alphabet/nucleotide/dna4.hpp>

The four letter DNA alphabet of A,C,G,T.

Note that you can assign ‘U’ as a character to dna4 and it will silently be converted to ‘T’.

dna4 my_letter{dna4::A};
// doesn't work:
// dna4 my_letter{'A'};

my_letter.assign_char('C'); // <- this does!

my_letter.assign_char('F'); // converted to A internally
if (my_letter.to_char() == 'A')
   std::cout << "yeah\n"; // "yeah";

Inherits from seqan3::nucleotide_concept

Subclassed by seqan3::rna4

Requirements for seqan3::semi_alphabet_concept

You can expect these functions on all types that implement seqan3::semi_alphabet_concept.

Requirements for seqan3::alphabet_concept

You can expect these functions on all types that implement seqan3::alphabet_concept.

Requirements for seqan3::nucleotide_concept

You can expect these functions on all types that implement seqan3::nucleotide_concept.

Letter values

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

Similar to an Enum interface. Don’t worry about the .

constexpr dna4 A = {internal_type::A}
constexpr dna4 C = {internal_type::C}
constexpr dna4 G = {internal_type::G}
constexpr dna4 T = {internal_type::T}
constexpr dna4 U = {dna4::T}
constexpr dna4 UNKNOWN = {dna4::A}

Read functions

constexpr char_type to_char() const

Return the letter as a character of char_type.

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

Constant.

Complexity

Guaranteed not to throw.

Exceptions

constexpr rank_type to_rank() const

Return the letter’s numeric value or rank in the alphabet.

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

Constant.

Complexity

Guaranteed not to throw.

Exceptions

constexpr dna4 complement() const

Return the complement of the letter.

See Nucleotide for the actual values.

Satisfies the seqan3::nucleotide_concept::complement() requirement via the seqan3::complement() wrapper.

Constant.

Complexity

Guaranteed not to throw.

Exceptions

Write functions

constexpr dna4 &assign_char(char_type const c)

Assign from a character.

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

Constant.

Complexity

Guaranteed not to throw.

Exceptions

constexpr dna4 &assign_rank(rank_type const c)

Assign from a numeric value.

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

Constant.

Complexity

Guaranteed not to throw.

Exceptions

Conversion operators

template <typename other_nucl_type>
constexpr operator other_nucl_type() const

Implicit conversion between dna* and rna* of the same size.

Template Parameters
  • other_nucl_type: The type to convert to; must satisfy seqan3::nucleotide_concept and have the same value_size.

template <typename other_nucl_type>
constexpr operator other_nucl_type() const

Explicit conversion to any other nucleotide alphabet (via char representation).

Template Parameters
  • other_nucl_type: The type to convert to; must satisfy seqan3::nucleotide_concept.

Comparison operators

constexpr bool operator==(dna4 const &rhs) const
constexpr bool operator!=(dna4 const &rhs) const
constexpr bool operator<(dna4 const &rhs) const
constexpr bool operator>(dna4 const &rhs) const
constexpr bool operator<=(dna4 const &rhs) const
constexpr bool operator>=(dna4 const &rhs) const

Public Types

using char_type = char

The type of the alphabet when converted to char (e.g. via to_char()).

using rank_type = uint8_t

The type of the alphabet when represented as a number (e.g. via to_rank()).

Public Static Attributes

constexpr rank_type value_size = {4}

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

Private Types

enum internal_type

The internal type is a strictly typed enum.

This is done to prevent aggregate initialization from numbers and/or chars. It is has the drawback that it also introduces a scope which in turn makes the static “letter values ” members necessary.

Values:

A
C
G
T
U = T
UNKNOWN = A

Private Members

internal_type _value

The data member.

Private Static Attributes

constexpr char_type value_to_char[value_size] = { 'A', 'C', 'G', 'T' }

Value to char conversion table.

constexpr std::array<internal_type, 256> char_to_value

Char to value conversion table.

constexpr std::array<dna4, dna4::value_size> complement_table = { dna4::T, dna4::G, dna4::C, dna4::A }

The complement table.

Related

using dna4_vector = std::vector<dna4>

Alias for an std::vector of seqan3::dna4.

using dna4_string = std::basic_string<dna4, std::char_traits<dna4>>

Alias for an std::basic_string of seqan3::dna4.

Attention
Note that we recommend using seqan3::dna4_vector instead of dna4_string in almost all situations. While the C++ style operations on the string are well supported, you should not access the internal c-string and should not use C-Style operations on it, e.g. the char_traits::strlen function will not return the correct length of the string (while the .size() returns the correct value).

dna4_vector operator""_dna4(const char *s, std::size_t n)

dna4 literal

You can use this string literal to easily assign to dna4_vector:

Return
seqan3::dna4_vector

// these don't work:
// dna4_vector foo{"ACGTTA"};
// dna4_vector bar = "ACGTTA";

// but these do:
using namespace seqan3::literal;
dna4_vector foo{"ACGTTA"_dna4};
dna4_vector bar = "ACGTTA"_dna4;
auto bax = "ACGTTA"_dna4;

Attention
All user-defined literals are in the namespace seqan3::literal!

dna4_string operator""_dna4s(const char *s, std::size_t n)

dna4 string literal

You can use this string literal to easily assign to dna4_vector:

Return
seqan3::dna4_string

// these don't work:
// dna4_string foo{"ACGTTA"};
// dna4_string bar = "ACGTTA";

// but these do:
using namespace seqan3::literal;
dna4_string foo{"ACGTTA"_dna4s};
dna4_string bar = "ACGTTA"_dna4s;
auto bax = "ACGTTA"_dna4s;

Please note the limitations of seqan3::dna4_string and consider using the operator”“_dna4 instead.

Attention
All seqan3 literals are in the namespace seqan3::literal!

namespace literal

The SeqAn3 namespace for literals.

SeqAn implements “user defined” literals in multiple places, e.g. auto foo = "ACGTG"_dna4. These make working with small examples and tests a lot easier, but the risk of having a name collision with another library is higher so follow the example of the standard library and define all our literals in the namespace seqan3::literal.

Attention
This means you cannot use them, unless you explicitly add using namespace seqan3::literal; (in addition to using namespace seqan3;).

Contains seqan3::dna5, container aliases and string literals.

Author
David Heller <david.heller AT fu-berlin.de>
Author
Hannes Hauswedell <hannes.hauswedell AT fu-berlin.de>

namespace seqan3

The main SeqAn3 namespace.

Helpers for seqan3::semi_alphabet_concept

These functions and metafunctions expose member variables and types so that they satisfy seqan3::semi_alphabet_concept.

Helpers for seqan3::alphabet_concept

These functions and metafunctions expose member variables and types so that they satisfy seqan3::alphabet_concept.

Helpers for seqan3::nucleotide_concept

These functions and metafunctions expose member variables and types so that they satisfy seqan3::nucleotide_concept.

Alphabet aliases

Other names (typedefs) for seqan3::nucl16

Range concepts

Adapted from the Ranges TS.

Container concepts

Container concepts as defined by the standard library (or very close).

Container-of-container concepts

Shortcuts for multi-dimensional container concepts.

struct dna5
#include <alphabet/nucleotide/dna5.hpp>

The five letter DNA alphabet of A,C,G,T and the unknown character N.

Note that you can assign ‘U’ as a character to dna5 and it will silently be converted to ‘T’.

dna5 my_letter{dna5::A};
// doesn't work:
// dna5 my_letter{'A'};

my_letter.assign_char('C'); // <- this does!

my_letter.assign_char('F'); // converted to N internally
if (my_letter.to_char() == 'N')
   std::cout << "yeah\n"; // "yeah";

Inherits from seqan3::nucleotide_concept

Subclassed by seqan3::rna5

Requirements for seqan3::semi_alphabet_concept

You can expect these functions on all types that implement seqan3::semi_alphabet_concept.

Requirements for seqan3::alphabet_concept

You can expect these functions on all types that implement seqan3::alphabet_concept.

Requirements for seqan3::nucleotide_concept

You can expect these functions on all types that implement seqan3::nucleotide_concept.

Letter values

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

Similar to an Enum interface . Don’t worry about the .

constexpr dna5 A = {internal_type::A}
constexpr dna5 C = {internal_type::C}
constexpr dna5 G = {internal_type::G}
constexpr dna5 T = {internal_type::T}
constexpr dna5 N = {internal_type::N}
constexpr dna5 U = {dna5::T}
constexpr dna5 UNKNOWN = {dna5::N}

Read functions

constexpr char_type to_char() const

Return the letter as a character of char_type.

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

Constant.

Complexity

Guaranteed not to throw.

Exceptions

constexpr rank_type to_rank() const

Return the letter’s numeric value or rank in the alphabet.

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

Constant.

Complexity

Guaranteed not to throw.

Exceptions

constexpr dna5 complement() const

Return the complement of the letter.

See Nucleotide for the actual values.

Satisfies the seqan3::nucleotide_concept::complement() requirement via the seqan3::complement() wrapper.

Constant.

Complexity

Guaranteed not to throw.

Exceptions

Write functions

constexpr dna5 &assign_char(char_type const c)

Assign from a character.

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

Constant.

Complexity

Guaranteed not to throw.

Exceptions

constexpr dna5 &assign_rank(rank_type const c)

Assign from a numeric value.

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

Constant.

Complexity

Guaranteed not to throw.

Exceptions

Conversion operators

template <typename other_nucl_type>
constexpr operator other_nucl_type() const

Implicit conversion between dna* and rna* of the same size.

Template Parameters
  • other_nucl_type: The type to convert to; must satisfy seqan3::nucleotide_concept and have the same value_size.

template <typename other_nucl_type>
constexpr operator other_nucl_type() const

Explicit conversion to any other nucleotide alphabet (via char representation).

Template Parameters
  • other_nucl_type: The type to convert to; must satisfy seqan3::nucleotide_concept.

Comparison operators

constexpr bool operator==(dna5 const &rhs) const
constexpr bool operator!=(dna5 const &rhs) const
constexpr bool operator<(dna5 const &rhs) const
constexpr bool operator>(dna5 const &rhs) const
constexpr bool operator<=(dna5 const &rhs) const
constexpr bool operator>=(dna5 const &rhs) const

Public Types

using char_type = char

The type of the alphabet when converted to char (e.g. via to_char()).

using rank_type = uint8_t

The type of the alphabet when represented as a number (e.g. via to_rank()).

Public Static Attributes

constexpr rank_type value_size = {5}

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

Private Types

enum internal_type

The internal type is a strictly typed enum.

This is done to prevent aggregate initialization from numbers and/or chars. It is has the drawback that it also introduces a scope which in turn makes the static “letter values ” members necessary.

Values:

A
C
G
T
N
U = T
UNKNOWN = N

Private Members

internal_type _value

The data member.

Private Static Attributes

constexpr char_type value_to_char[value_size] = { 'A', 'C', 'G', 'T', 'N' }

Value to char conversion table.

constexpr std::array<internal_type, 256> char_to_value = { [] () constexpr { using in_t = internal_type; std::array<in_t, 256> ret{}; for (auto & c : ret) c = in_t::UNKNOWN; ret['A'] = in_t::A; ret['a'] = in_t::A; ret['C'] = in_t::C; ret['c'] = in_t::C; ret['G'] = in_t::G; ret['g'] = in_t::G; ret['T'] = in_t::T; ret['t'] = in_t::T; ret['U'] = in_t::U; ret['u'] = in_t::U; return ret; }() }

Char to value conversion table.

constexpr std::array<dna5, dna5::value_size> complement_table = { dna5::T, dna5::G, dna5::C, dna5::A, dna5::N }

The complement table.

Related

using dna5_vector = std::vector<dna5>

Alias for an std::vector of seqan3::dna5.

using dna5_string = std::basic_string<dna5, std::char_traits<dna5>>

Alias for an std::basic_string of seqan3::dna5.

Attention
Note that we recommend using seqan3::dna5_vector instead of dna5_string in almost all situations. While the C++ style operations on the string are well supported, you should not access the internal c-string and should not use C-Style operations on it, e.g. the char_traits::strlen function will not return the correct length of the string (while the .size() returns the correct value).

dna5_vector operator""_dna5(const char *s, std::size_t n)

dna5 literal

You can use this string literal to easily assign to dna5_vector:

Return
seqan3::dna5_vector

// these don't work:
// dna5_vector foo{"ACGTTA"};
// dna5_vector bar = "ACGTTA";

// but these do:
using namespace seqan3::literal;
dna5_vector foo{"ACGTTA"_dna5};
dna5_vector bar = "ACGTTA"_dna5;
auto bax = "ACGTTA"_dna5;

Attention
All seqan3 literals are in the namespace seqan3::literal!

dna5_string operator""_dna5s(const char *s, std::size_t n)

dna5 string literal

You can use this string literal to easily assign to dna5_vector:

Return
seqan3::dna5_string

// these don't work:
// dna5_string foo{"ACGTTA"};
// dna5_string bar = "ACGTTA";

// but these do:
using namespace seqan3::literal;
dna5_string foo{"ACGTTA"_dna5s};
dna5_string bar = "ACGTTA"_dna5s;
auto bax = "ACGTTA"_dna5s;

Please note the limitations of seqan3::dna5_string and consider using the operator”“_dna5 instead.

Attention
All seqan3 literals are in the namespace seqan3::literal!

namespace literal

The SeqAn3 namespace for literals.

SeqAn implements “user defined” literals in multiple places, e.g. auto foo = "ACGTG"_dna4. These make working with small examples and tests a lot easier, but the risk of having a name collision with another library is higher so follow the example of the standard library and define all our literals in the namespace seqan3::literal.

Attention
This means you cannot use them, unless you explicitly add using namespace seqan3::literal; (in addition to using namespace seqan3;).

Contains seqan3::nucl16, container aliases and string literals.

Author
Sara Hetzel <sara.hetzel AT fu-berlin.de>

namespace seqan3

The main SeqAn3 namespace.

Helpers for seqan3::semi_alphabet_concept

These functions and metafunctions expose member variables and types so that they satisfy seqan3::semi_alphabet_concept.

Helpers for seqan3::alphabet_concept

These functions and metafunctions expose member variables and types so that they satisfy seqan3::alphabet_concept.

Helpers for seqan3::nucleotide_concept

These functions and metafunctions expose member variables and types so that they satisfy seqan3::nucleotide_concept.

Alphabet aliases

Other names (typedefs) for seqan3::nucl16

using seqan3::dna16 = typedef nucl16
using seqan3::rna16 = typedef nucl16
using seqan3::dna = typedef nucl16
using seqan3::rna = typedef nucl16

Range concepts

Adapted from the Ranges TS.

Container concepts

Container concepts as defined by the standard library (or very close).

Container-of-container concepts

Shortcuts for multi-dimensional container concepts.

struct nucl16
#include <alphabet/nucleotide/nucl16.hpp>

The 16 letter DNA alphabet, containing all IUPAC smybols.

Note that in contrast to seqan3::dna4, seqan3::rna4, seqan3::dna5 and seqan3::rna5 the letters ‘T’ and ‘U’ are distinct values in this alphabet.

nucl16 my_letter{nucl16::A};
// doesn't work:
// nucl16 my_letter{'A'};

my_letter.assign_char('C'); // <- this does!

my_letter.assign_char('F'); // converted to N internally
if (my_letter.to_char() == 'N')
   std::cout << "yeah\n"; // "yeah";

Inherits from seqan3::nucleotide_concept

Requirements for seqan3::semi_alphabet_concept

You can expect these functions on all types that implement seqan3::semi_alphabet_concept.

Requirements for seqan3::alphabet_concept

You can expect these functions on all types that implement seqan3::alphabet_concept.

Requirements for seqan3::nucleotide_concept

You can expect these functions on all types that implement seqan3::nucleotide_concept.

Letter values

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

Similar to an Enum interface . Don’t worry about the .

constexpr nucl16 A = {internal_type::A}
constexpr nucl16 B = {internal_type::B}
constexpr nucl16 C = {internal_type::C}
constexpr nucl16 D = {internal_type::D}
constexpr nucl16 G = {internal_type::G}
constexpr nucl16 H = {internal_type::H}
constexpr nucl16 K = {internal_type::K}
constexpr nucl16 M = {internal_type::M}
constexpr nucl16 N = {internal_type::N}
constexpr nucl16 R = {internal_type::R}
constexpr nucl16 S = {internal_type::S}
constexpr nucl16 T = {internal_type::T}
constexpr nucl16 U = {internal_type::U}
constexpr nucl16 V = {internal_type::V}
constexpr nucl16 W = {internal_type::W}
constexpr nucl16 Y = {internal_type::Y}
constexpr nucl16 UNKNOWN = {nucl16::N}

Read functions

constexpr char_type to_char() const

Return the letter as a character of char_type.

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

Constant.

Complexity

Guaranteed not to throw.

Exceptions

constexpr rank_type to_rank() const

Return the letter’s numeric value or rank in the alphabet.

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

Constant.

Complexity

Guaranteed not to throw.

Exceptions

constexpr nucl16 complement() const

Return the complement of the letter.

See Nucleotide for the actual values.

Satisfies the seqan3::nucleotide_concept::complement() requirement via the seqan3::complement() wrapper.

Constant.

Complexity

Guaranteed not to throw.

Exceptions

Write functions

constexpr nucl16 &assign_char(char_type const c)

Assign from a character.

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

Constant.

Complexity

Guaranteed not to throw.

Exceptions

constexpr nucl16 &assign_rank(rank_type const c)

Assign from a numeric value.

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

Constant.

Complexity

Guaranteed not to throw.

Exceptions

Conversion operators

template <typename other_nucl_type>
constexpr operator other_nucl_type() const

Explicit conversion to any other nucleotide alphabet (via char representation).

Template Parameters
  • other_nucl_type: The type to convert to; must satisfy seqan3::nucleotide_concept.

Comparison operators

constexpr bool operator==(nucl16 const &rhs) const
constexpr bool operator!=(nucl16 const &rhs) const
constexpr bool operator<(nucl16 const &rhs) const
constexpr bool operator>(nucl16 const &rhs) const
constexpr bool operator<=(nucl16 const &rhs) const
constexpr bool operator>=(nucl16 const &rhs) const

Public Types

using char_type = char

The type of the alphabet when converted to char (e.g. via to_char()).

using rank_type = uint8_t

The type of the alphabet when represented as a number (e.g. via to_rank()).

Public Static Attributes

constexpr rank_type value_size = {16}

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

Private Types

enum internal_type

The internal type is a strictly typed enum.

This is done to prevent aggregate initialization from numbers and/or chars. It is has the drawback that it also introduces a scope which in turn makes the static “letter values ” members necessary.

Values:

A
B
C
D
G
H
K
M
N
R
S
T
U
V
W
Y
UNKNOWN = N

Private Members

internal_type _value

The data member.

Private Static Attributes

constexpr char_type value_to_char[value_size] = { 'A', 'B', 'C', 'D', 'G', 'H', 'K', 'M', 'N', 'R', 'S', 'T', 'U', 'V', 'W', 'Y' }

Value to char conversion table.

constexpr std::array<internal_type, 256> char_to_value

Char to value conversion table.

constexpr std::array<nucl16, nucl16::value_size> complement_table = { nucl16::T, nucl16::V, nucl16::G, nucl16::H, nucl16::C, nucl16::D, nucl16::M, nucl16::K, nucl16::N, nucl16::Y, nucl16::S, nucl16::A, nucl16::A, nucl16::B, nucl16::W, nucl16::R }

The complement table.

Related

using nucl16_vector = std::vector<nucl16>

Alias for an std::vector of seqan3::nucl16.

using nucl16_string = std::basic_string<nucl16, std::char_traits<nucl16>>

Alias for an std::basic_string of seqan3::nucl16.

Attention
Note that we recommend using seqan3::nucl16_vector instead of nucl16_string in almost all situations. While the C++ style operations on the string are well supported, you should not access the internal c-string and should not use C-Style operations on it, e.g. the char_traits::strlen function will not return the correct length of the string (while the .size() returns the correct value).

nucl16_vector operator""_nucl16(const char *s, std::size_t n)

nucl16 literal

You can use this string literal to easily assign to nucl16_vector:

Return
seqan3::nucl16_vector

// these don't work:
// nucl16_vector foo{"ACGTTA"};
// nucl16_vector bar = "ACGTTA";

// but these do:
using namespace seqan3::literal;
nucl16_vector foo{"ACGTTA"_nucl16};
nucl16_vector bar = "ACGTTA"_nucl16;
auto bax = "ACGTTA"_nucl16;

Attention
All seqan3 literals are in the namespace seqan3::literal!

nucl16_string operator""_nucl16s(const char *s, std::size_t n)

nucl16 string literal

You can use this string literal to easily assign to nucl16_vector:

Return
seqan3::nucl16_string

// these don't work:
// nucl16_string foo{"ACGTTA"};
// nucl16_string bar = "ACGTTA";

// but these do:
using namespace seqan3::literal;
nucl16_string foo{"ACGTTA"_nucl16s};
nucl16_string bar = "ACGTTA"_nucl16s;
auto bax = "ACGTTA"_nucl16s;

Please note the limitations of seqan3::nucl16_string and consider using the operator”“_nucl16 instead.

Attention
All seqan3 literals are in the namespace seqan3::literal!

namespace literal

The SeqAn3 namespace for literals.

SeqAn implements “user defined” literals in multiple places, e.g. auto foo = "ACGTG"_dna4. These make working with small examples and tests a lot easier, but the risk of having a name collision with another library is higher so follow the example of the standard library and define all our literals in the namespace seqan3::literal.

Attention
This means you cannot use them, unless you explicitly add using namespace seqan3::literal; (in addition to using namespace seqan3;).

Contains seqan3::rna4, container aliases and string literals.

Author
Hannes Hauswedell <hannes.hauswedell AT fu-berlin.de>

namespace seqan3

The main SeqAn3 namespace.

Helpers for seqan3::semi_alphabet_concept

These functions and metafunctions expose member variables and types so that they satisfy seqan3::semi_alphabet_concept.

Helpers for seqan3::alphabet_concept

These functions and metafunctions expose member variables and types so that they satisfy seqan3::alphabet_concept.

Helpers for seqan3::nucleotide_concept

These functions and metafunctions expose member variables and types so that they satisfy seqan3::nucleotide_concept.

Alphabet aliases

Other names (typedefs) for seqan3::nucl16

Range concepts

Adapted from the Ranges TS.

Container concepts

Container concepts as defined by the standard library (or very close).

Container-of-container concepts

Shortcuts for multi-dimensional container concepts.

struct rna4
#include <alphabet/nucleotide/rna4.hpp>

The four letter RNA alphabet of A,C,G,U.

This alphabet inherits from seqan3::dna4 and is guaranteed to have the same internal representation of data. The only difference is that it prints ‘U’ on character conversion instead of ‘T’. You assign between values of seqan3::dna4 and seqan3::rna4.

rna4 my_letter{rna4::A};
// doesn't work:
// rna4 my_letter{'A'};

my_letter.assign_char('C'); // <- this does!

my_letter.assign_char('F'); // converted to A internally
if (my_letter.to_char() == 'A')
   std::cout << "yeah\n"; // "yeah";

Inherits from seqan3::dna4

Requirements for seqan3::semi_alphabet_concept

You can expect these functions on all types that implement seqan3::semi_alphabet_concept.

Requirements for seqan3::alphabet_concept

You can expect these functions on all types that implement seqan3::alphabet_concept.

Requirements for seqan3::nucleotide_concept

You can expect these functions on all types that implement seqan3::nucleotide_concept.

Letter values

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

Similar to an Enum interface . Don’t worry about the .

constexpr rna4 A = {internal_type::A}
constexpr rna4 C = {internal_type::C}
constexpr rna4 G = {internal_type::G}
constexpr rna4 U = {internal_type::U}
constexpr rna4 T = {rna4::U}
constexpr rna4 UNKNOWN = {rna4::A}

Read functions

constexpr char_type to_char() const

Return the letter as a character of char_type.

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

Constant.

Complexity

Guaranteed not to throw.

Exceptions

constexpr rna4 complement() const

Return the complement of the letter.

See Nucleotide for the actual values.

Satisfies the seqan3::nucleotide_concept::complement() requirement via the seqan3::complement() wrapper.

Constant.

Complexity

Guaranteed not to throw.

Exceptions

Write functions

constexpr rna4 &assign_char(char_type const c)

Assign from a character.

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

Constant.

Complexity

Guaranteed not to throw.

Exceptions

constexpr rna4 &assign_rank(rank_type const c)

Assign from a numeric value.

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

Constant.

Complexity

Guaranteed not to throw.

Exceptions

Conversion operators

template <typename other_nucl_type>
constexpr operator other_nucl_type() const

Implicit conversion between dna* and rna* of the same size.

Template Parameters
  • other_nucl_type: The type to convert to; must satisfy seqan3::nucleotide_concept and have the same value_size.

template <typename other_nucl_type>
constexpr operator other_nucl_type() const

Explicit conversion to any other nucleotide alphabet (via char representation).

Template Parameters
  • other_nucl_type: The type to convert to; must satisfy seqan3::nucleotide_concept.

Private Static Attributes

constexpr char_type value_to_char[value_size] = { 'A', 'C', 'G', 'U' }

Value to char conversion table.

Related

using rna4_vector = std::vector<rna4>

Alias for an std::vector of seqan3::rna4.

using rna4_string = std::basic_string<rna4, std::char_traits<rna4>>

Alias for an std::basic_string of seqan3::rna4.

Attention
Note that we recommend using seqan3::rna4_vector instead of rna4_string in almost all situations. While the C++ style operations on the string are well supported, you should not access the internal c-string and should not use C-Style operations on it, e.g. the char_traits::strlen function will not return the correct length of the string (while the .size() returns the correct value).

rna4_vector operator""_rna4(const char *s, std::size_t n)

rna4 literal

You can use this string literal to easily assign to rna4_vector:

Return
seqan3::rna4_vector

// these don't work:
// rna4_vector foo{"ACGTTA"};
// rna4_vector bar = "ACGTTA";

// but these do:
using namespace seqan3::literal;
rna4_vector foo{"ACGTTA"_rna4};
rna4_vector bar = "ACGTTA"_rna4;
auto bax = "ACGTTA"_rna4;

Attention
All seqan3 literals are in the namespace seqan3::literal!

rna4_string operator""_rna4s(const char *s, std::size_t n)

rna4 string literal

You can use this string literal to easily assign to rna4_vector:

Return
seqan3::rna4_string

// these don't work:
// rna4_string foo{"ACGTTA"};
// rna4_string bar = "ACGTTA";

// but these do:
using namespace seqan3::literal;
rna4_string foo{"ACGTTA"_rna4s};
rna4_string bar = "ACGTTA"_rna4s;
auto bax = "ACGTTA"_rna4s;

Please note the limitations of seqan3::rna4_string and consider using the operator”“_rna4 instead.

Attention
All seqan3 literals are in the namespace seqan3::literal!

namespace literal

The SeqAn3 namespace for literals.

SeqAn implements “user defined” literals in multiple places, e.g. auto foo = "ACGTG"_dna4. These make working with small examples and tests a lot easier, but the risk of having a name collision with another library is higher so follow the example of the standard library and define all our literals in the namespace seqan3::literal.

Attention
This means you cannot use them, unless you explicitly add using namespace seqan3::literal; (in addition to using namespace seqan3;).

Contains seqan3::rna5, container aliases and string literals.

Author
Hannes Hauswedell <hannes.hauswedell AT fu-berlin.de>

namespace seqan3

The main SeqAn3 namespace.

Helpers for seqan3::semi_alphabet_concept

These functions and metafunctions expose member variables and types so that they satisfy seqan3::semi_alphabet_concept.

Helpers for seqan3::alphabet_concept

These functions and metafunctions expose member variables and types so that they satisfy seqan3::alphabet_concept.

Helpers for seqan3::nucleotide_concept

These functions and metafunctions expose member variables and types so that they satisfy seqan3::nucleotide_concept.

Alphabet aliases

Other names (typedefs) for seqan3::nucl16

Range concepts

Adapted from the Ranges TS.

Container concepts

Container concepts as defined by the standard library (or very close).

Container-of-container concepts

Shortcuts for multi-dimensional container concepts.

struct rna5
#include <alphabet/nucleotide/rna5.hpp>

The five letter RNA alphabet of A,C,G,U and the unknown character N.

This alphabet inherits from seqan3::dna5 and is guaranteed to have the same internal representation of data. The only difference is that it prints ‘U’ on character conversion instead of ‘T’. You assign between values of seqan3::dna5 and seqan3::rna5.

rna5 my_letter{rna5::A};
// doesn't work:
// rna5 my_letter{'A'};

my_letter.assign_char('C'); // <- this does!

my_letter.assign_char('F'); // converted to A internally
if (my_letter.to_char() == 'A')
   std::cout << "yeah\n"; // "yeah";

Inherits from seqan3::dna5

Requirements for seqan3::semi_alphabet_concept

You can expect these functions on all types that implement seqan3::semi_alphabet_concept.

Requirements for seqan3::alphabet_concept

You can expect these functions on all types that implement seqan3::alphabet_concept.

Requirements for seqan3::nucleotide_concept

You can expect these functions on all types that implement seqan3::nucleotide_concept.

Letter values

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

Similar to an Enum interface . Don’t worry about the .

constexpr rna5 A = {internal_type::A}
constexpr rna5 C = {internal_type::C}
constexpr rna5 G = {internal_type::G}
constexpr rna5 T = {rna5::U}
constexpr rna5 N = {internal_type::N}
constexpr rna5 U = {internal_type::U}
constexpr rna5 UNKNOWN = {rna5::N}

Read functions

constexpr char_type to_char() const

Return the letter as a character of char_type.

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

Constant.

Complexity

Guaranteed not to throw.

Exceptions

constexpr rna5 complement() const

Return the complement of the letter.

See Nucleotide for the actual values.

Satisfies the seqan3::nucleotide_concept::complement() requirement via the seqan3::complement() wrapper.

Constant.

Complexity

Guaranteed not to throw.

Exceptions

Write functions

constexpr rna5 &assign_char(char_type const c)

Assign from a character.

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

Constant.

Complexity

Guaranteed not to throw.

Exceptions

constexpr rna5 &assign_rank(rank_type const c)

Assign from a numeric value.

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

Constant.

Complexity

Guaranteed not to throw.

Exceptions

Conversion operators

template <typename other_nucl_type>
constexpr operator other_nucl_type() const

Implicit conversion between dna* and rna* of the same size.

Template Parameters
  • other_nucl_type: The type to convert to; must satisfy seqan3::nucleotide_concept and have the same value_size.

template <typename other_nucl_type>
constexpr operator other_nucl_type() const

Explicit conversion to any other nucleotide alphabet (via char representation).

Template Parameters
  • other_nucl_type: The type to convert to; must satisfy seqan3::nucleotide_concept.

Private Static Attributes

constexpr char_type value_to_char[value_size] = { 'A', 'C', 'G', 'U', 'N' }

Value to char conversion table.

Related

using rna5_vector = std::vector<rna5>

Alias for an std::vector of seqan3::rna5.

using rna5_string = std::basic_string<rna5, std::char_traits<rna5>>

Alias for an std::basic_string of seqan3::rna5.

Attention
Note that we recommend using seqan3::rna5_vector instead of rna5_string in almost all situations. While the C++ style operations on the string are well supported, you should not access the internal c-string and should not use C-Style operations on it, e.g. the char_traits::strlen function will not return the correct length of the string (while the .size() returns the correct value).

rna5_vector operator""_rna5(const char *s, std::size_t n)

rna5 literal

You can use this string literal to easily assign to rna5_vector:

Return
seqan3::rna5_vector

// these don't work:
// rna5_vector foo{"ACGTTA"};
// rna5_vector bar = "ACGTTA";

// but these do:
using namespace seqan3::literal;
rna5_vector foo{"ACGTTA"_rna5};
rna5_vector bar = "ACGTTA"_rna5;
auto bax = "ACGTTA"_rna5;

Attention
All seqan3 literals are in the namespace seqan3::literal!

rna5_string operator""_rna5s(const char *s, std::size_t n)

rna5 string literal

You can use this string literal to easily assign to rna5_vector:

Return
seqan3::rna5_string

// these don't work:
// rna5_string foo{"ACGTTA"};
// rna5_string bar = "ACGTTA";

// but these do:
using namespace seqan3::literal;
rna5_string foo{"ACGTTA"_rna5s};
rna5_string bar = "ACGTTA"_rna5s;
auto bax = "ACGTTA"_rna5s;

Please note the limitations of seqan3::rna5_string and consider using the operator”“_rna5 instead.

Attention
All seqan3 literals are in the namespace seqan3::literal!

namespace literal

The SeqAn3 namespace for literals.

SeqAn implements “user defined” literals in multiple places, e.g. auto foo = "ACGTG"_dna4. These make working with small examples and tests a lot easier, but the risk of having a name collision with another library is higher so follow the example of the standard library and define all our literals in the namespace seqan3::literal.

Attention
This means you cannot use them, unless you explicitly add using namespace seqan3::literal; (in addition to using namespace seqan3;).