SeqAn3 API Documentation¶
SeqAn is an open source C++ library of efficient algorithms and data structures for the analysis of sequences with the focus on biological data. Our library applies a unique generic design that guarantees high performance, generality, extensibility, and integration with other libraries. SeqAn is easy to use and simplifies the development of new software tools with a minimal loss of performance.
Getting Started¶
1. Install SeqAn
It’s as easy as following the installation instructions.
2. Learn SeqAn
The SeqAn Tutorials in the SeqAn Manual will introduce you into SeqAn’s basic concepts and show you how to use its data structures and functions.
3. Think SeqAn
(Since our library uses advanced C++ template programming techniques, we recommend you to read our glossary of language entity types for a quick introduction.)
4. Use SeqAn
(Search the library for classes, functions, etc. using the search bar to the left. Need some orientation? Check the typical tasks below.)
Typical Tasks¶
If you know what you want to do but not how to achieve this with SeqAn, this sections gives you a nice overview of the components that might help you.
Alternatively you might want to check the SeqAn Tutorials.
- File I/O
- SeqAn has support for most common file formats in Bioinformatics. The following lists the most convenient access methods.
- Sequence Alignment
- Sequence alignment and multiple sequence alignment are classic problems in Bioinformatics.
- Graph
- Often, graphs come in handy to model subproblems in sequence analysis. SeqAn provides basic support for graphs and graph algorithms.
Alphabet¶
Meta-header for the alphabet module.
- Author
- Hannes Hauswedell <hannes.hauswedell AT fu-berlin.de>
Core alphabet concept and free function/metafunction wrappers.
- Author
- Hannes Hauswedell <hannes.hauswedell AT fu-berlin.de>
Defines
-
SEQAN3_ALPHABET_CONCEPT_INCLUDED
¶
-
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.
seqan3::alphabet_concept metafunction base classes.
Note that you need to strictly follow this include order:
#include <alphabet/concept_pre.hpp>
// your custom alphabet
#include <alphabet/concept.hpp>
- Author
- Hannes Hauswedell <hannes.hauswedell AT fu-berlin.de> Include this file, if you implement an alphabet type with free/global function and metafunction interfaces.
- Attention
If you include concept.hpp
before your definitions, than your type will not be resolved as satisfying seqan3::alphabet_concept.
This is not true for custom alphabets implementing the interfaces as member functions/variables/types.
-
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.
- template <typename alphabet_type>
-
struct
alphabet_size
¶ - #include <alphabet/concept_pre.hpp>
The size of the alphabet. [value metafunction base template].
Instead of calling seqan3::alphabet_size<alphabet_type>::value, you may use seqan3::alphabet_size_v<alphabet_type>.
- Template Parameters
alphabet_type
: Must satisfy seqan3::semi_alphabet_concept.
This is the expression to retrieve the value:
The type of the variable is seqan3::underlying_rank_t<alphabet_type>.auto i = seqan3::alphabet_size<alphabet_type>::value; // or auto i = seqan3::alphabet_size_v<alphabet_type>;
- Attention
- This is the base template, it needss to be specialised.
- template <typename alphabet_type>
-
struct
underlying_char
¶ - #include <alphabet/concept_pre.hpp>
The
char_type
of the alphabet. [type metafunction base template].Instead of calling
typename seqan3::underlying_char<alphabet_type>::type
it is recommended to just the shortcut: seqan3::underlying_char_t- Template Parameters
alphabet_type
: Must satisfy seqan3::alphabet_concept.
- Attention
- This is the base template, it needss to be specialised.
- template <typename semi_alphabet_type>
-
struct
underlying_rank
¶ - #include <alphabet/concept_pre.hpp>
The
rank_type
of the semi_alphabet. [type metafunction base template].Instead of calling
typename seqan3::underlying_rank<semi_alphabet_type>::type
it is recommended to just the shortcut: seqan3::underlying_rank_t<>- Template Parameters
semi_alphabet_type
: Must satisfy seqan3::semi_alphabet_concept.
- Attention
- This is the base template, it needss to be specialised.
Adaptation¶
Meta-header for the adaptation submodule; includes all headers from alphabet/adaptation/.
- Author
- Hannes Hauswedell <hannes.hauswedell AT fu-berlin.de>
Provides alphabet adaptations for standard char types.
This file provides function and metafunction overloads so that the following types fulfil the seqan3::alphabet_concept:
char
char16_t
char32_t
- Author
- Hannes Hauswedell <hannes.hauswedell AT fu-berlin.de>
You will likely not use these interfaces directly, they are, however, very helpful for conversions between other alphabets and between other alphabets and characters.
- Attention
- Note that
signed char
andunsigned char
are absent from the list, because of their type ambiguity withint8_t
anduint8_t
. - Note that
wchar_t
is absent from the list for its notorious brokenness (different sizes and signedness between platforms); usechar16_t
orchar32_t
instead.
- Note that
- Attention
- Please be aware that if you also include
alphabet/concept.hpp
and/oralphabet/adaptation/concept.hpp
, you need to do so after including this file, not before.
-
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.
- template <typename char_type>
-
template<>
structalphabet_size
<char_type>¶ - #include <alphabet/adaptation/char.hpp>
Specialisation of seqan3::alphabet_size that delegates for char types.
- See
- seqan3::alphabet_size_v
- Template Parameters
char_type
: One ofchar
,char16_t
orchar32_t
.
Public Types
-
using
seqan3::alphabet_size< char_type >::type = detail::min_viable_uint_t<static_cast<uint64_t>(std::numeric_limits<char_type>::max()) + 1 - std::numeric_limits<char_type>::lowest()>
Smallest unsigned integral type that can hold value;.
- template <typename char_type>
-
template<>
structunderlying_char
<char_type>¶ - #include <alphabet/adaptation/char.hpp>
Specialisation of seqan3::underlying_char for char types.
- See
- seqan3::underlying_char_t
- Template Parameters
char_type
: One ofchar
,char16_t
orchar32_t
.
Public Types
-
template<>
usingtype
= char_type¶ The same type as char_type.
- template <typename char_type>
-
template<>
structunderlying_rank
<char_type>¶ - #include <alphabet/adaptation/char.hpp>
Specialisation of seqan3::underlying_rank for char types.
- See
- seqan3::underlying_rank_t
- Template Parameters
char_type
: One ofchar
,char16_t
orchar32_t
.
Public Types
-
template<>
usingtype
= meta::at<detail::char_adaptations_rank_types, meta::find_index<detail::char_adaptations, char_type>>¶ An unsigned integer type of the same size as
char_type
.
Provides seqan3::char_adaptation_concept and seqan3::uint_adaptation_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.
Provides alphabet adaptations for standard uint types.
This file provides function and metafunction overloads so that the following types fulfil the seqan3::alphabet_concept:
uint8_t
uint16_t
uint32_t
- Author
- Hannes Hauswedell <hannes.hauswedell AT fu-berlin.de>
You will likely not use these interfaces directly, they are, however, very helpful for conversions between other alphabets and between other alphabets and characters.
- Attention
- Note that
uint64_t
is absent from the list, because there is no corresponding character type. - Attention
- Please be aware that if you also include
alphabet/concept.hpp
and/oralphabet/adaptation/concept.hpp
, you need to do so after including this file, not before.
-
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.
- template <typename uint_type>
-
template<>
structalphabet_size
<uint_type>¶ - #include <alphabet/adaptation/uint.hpp>
Specialisation of seqan3::alphabet_size that delegates for uint types.
- See
- seqan3::alphabet_size_v
- Template Parameters
uint_type
: One ofuint8_t
,uint16_t
oruint32_t
.
Public Types
-
using
seqan3::alphabet_size< uint_type >::type = detail::min_viable_uint_t<static_cast<uint64_t>(std::numeric_limits<uint_type>::max()) + 1 - std::numeric_limits<uint_type>::lowest()>
Smallest unsigned integral type that can hold value;.
- template <typename uint_type>
-
template<>
structunderlying_char
<uint_type>¶ - #include <alphabet/adaptation/uint.hpp>
Specialisation of seqan3::underlying_char for uint types.
- See
- seqan3::underlying_char_t
- Template Parameters
uint_type
: One ofuint8_t
,uint16_t
oruint32_t
.
Public Types
-
template<>
usingtype
= meta::at<detail::uint_adaptations_char_types, meta::find_index<detail::uint_adaptations, uint_type>>¶ The character type of the same size as
uint_type
.
- template <typename uint_type>
-
template<>
structunderlying_rank
<uint_type>¶ - #include <alphabet/adaptation/uint.hpp>
Specialisation of seqan3::underlying_rank for uint types.
- See
- seqan3::underlying_rank_t
- Template Parameters
uint_type
: One ofuint8_t
,uint16_t
oruint32_t
.
Public Types
-
template<>
usingtype
= uint_type¶ The same as
uint_type
.
Aminoacid¶
Contains seqan3::aa27, 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
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
aa27
¶ - #include <alphabet/aminoacid/aa27.hpp>
The twenty-seven letter amino acid alphabet.
The alphabet consists of letters A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, *
The alphabet may be brace initialized from the static letter members (see above). Note that you cannot assign regular characters, but additional functions for this are available.
aa27 my_letter{aa27::A}; // doesn't work: // aa27 my_letter{'A'}; my_letter.assign_char('C'); // <- this does! my_letter.assign_char('?'); // converted to X internally if (my_letter.to_char() == 'X') std::cout << "yeah\n"; // "yeah";
Inherits from seqan3::alphabet_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 .
Read functions
Write functions
Comparison operators
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.
Public Types
Public Static Attributes
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
¶
-
E
¶
-
F
¶
-
G
¶
-
H
¶
-
I
¶
-
J
¶
-
K
¶
-
L
¶
-
M
¶
-
N
¶
-
O
¶
-
P
¶
-
Q
¶
-
R
¶
-
S
¶
-
T
¶
-
U
¶
-
V
¶
-
W
¶
-
X
¶
-
Y
¶
-
Z
¶
-
TERMINATOR
¶
-
UNKNOWN
= X¶
-
Private Members
-
internal_type
_value
¶ The data member.
Private Static Attributes
-
constexpr char_type
value_to_char
[value_size] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '*' }¶ Value to char conversion table.
-
constexpr std::array<internal_type, 256>
char_to_value
¶ Char to value conversion table.
Related
-
using
aa27_vector
= std::vector<aa27>¶ Alias for an std::vector of seqan3::aa27.
-
using
aa27_string
= std::basic_string<aa27, std::char_traits<aa27>>¶ Alias for an std::basic_string of seqan3::aa27.
- Attention
- Note that we recommend using seqan3::aa27_vector instead of aa27_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).
-
aa27_vector
operator""_aa27
(const char *s, std::size_t n)¶ aa27 literal
You can use this string literal to easily assign to aa27_vector:
- Return
- seqan3::aa27_vector
// these don't work: // aa27_vector foo{"ABFUYR"}; // aa27_vector bar = "ABFUYR"; // but these do: using namespace seqan3::literal; aa27_vector foo{"ABFUYR"_aa27}; aa27_vector bar = "ABFUYR"_aa27; auto bax = "ABFUYR"_aa27;
- Attention
- All seqan3 literals are in the namespace seqan3::literal!
-
aa27_string
operator""_aa27s
(const char *s, std::size_t n)¶ aa27 string literal
You can use this string literal to easily assign to aa27_vector:
- Return
- seqan3::aa27_string
// these don't work: // aa27_string foo{"ABFUYR"}; // aa27_string bar = "ABFUYR"; // but these do: using namespace seqan3::literal; aa27_string foo{"ABFUYR"_aa27s}; aa27_string bar = "ABFUYR"_aa27s; auto bax = "ABFUYR"_aa27s;
Please note the limitations of seqan3::aa27_string and consider using the operator”“_aa27 instead.
- Attention
- All seqan3 literals are in the namespace seqan3::literal!
-
enum
-
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 namespaceseqan3::literal
.- Attention
- This means you cannot use them, unless you explicitly add
using namespace seqan3::literal;
(in addition tousing namespace seqan3;
).
-
struct
Composition¶
Meta-header for the composition submodule; includes all headers from alphabet/composition/. composition.
- Author
- Marcel Ehrhardt <marcel.ehrhardt AT fu-berlin.de>
Contains cartesian_composition.
- 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.
- template <typename derived_type, typename first_alphabet_type, typename... alphabet_types>
-
struct
cartesian_composition
¶ - #include <alphabet/composition/cartesian_composition.hpp>
The CRTP base of alphabets that contain multiple (different) letters at one position.
This data structure is CRTP base class for combined alphabets, where the different alphabet letters exist independently, similar to a tuple. In fact this class provides a tuple-like interface with
get<0>(t)
and objects can be brace-initialized with the individual members.- Template Parameters
first_alphabet_type
: Type of the first letter; must satisfy alphabet_concept.alphabet_types
: Types of further letters (up to 4); must satisfy alphabet_concept.
- Attention
- This is a “pure base class”, you cannot instantiate it, you can only inherit from it. Most likely you are interested in using one of it’s descendents like quality_composition.
- See
- quality_composition
- See
- mask_composition
Inherits from seqan3::pod_tuple< first_alphabet_type, alphabet_types... >
Read functions
-
constexpr rank_type
to_rank
() const¶ Return the letter combination’s numeric value (or “rank”) in the alphabet composition.
- Complexity
- Linear in the number of alphabets.
- template <typename type>
-
constexpr
operator type
() const¶ Explicit cast to a single letter. Works only if the type is unique in the type list.
- Complexity
- Linear in the number of alphabets.
Write functions
-
constexpr derived_type &
assign_rank
(rank_type const i)¶ Assign from a numeric value.
- Complexity
- Linear in the number of alpahabets.
- Exceptions
- Asserts that the parameter is smaller than value_size [only in debug mode].
Comparison operators
Lexicographically compares the values in the tuple.
Public Types
-
template<>
usingrank_type
= detail::min_viable_uint_t<(alphabet_size_v<first_alphabet_type> * ... * alphabet_size_v<alphabet_types>)>¶ The type of value_size and
alphabet_size_v<cartesian_composition<...>>
Public Static Attributes
-
constexpr rank_type
value_size
= {(alphabet_size_v<first_alphabet_type> * ... * alphabet_size_v<alphabet_types>)}¶ The product of the sizes of the individual alphabets.
Private Functions
-
cartesian_composition
()¶ declared private to prevent direct use of the CRTP base
-
constexpr
cartesian_composition
(cartesian_composition const&)¶ declared private to prevent direct use of the CRTP base
-
constexpr
cartesian_composition
(cartesian_composition&&)¶ declared private to prevent direct use of the CRTP base
-
constexpr cartesian_composition &
operator=
(cartesian_composition const&)¶ declared private to prevent direct use of the CRTP base
-
constexpr cartesian_composition &
operator=
(cartesian_composition&&)¶ declared private to prevent direct use of the CRTP base
-
~cartesian_composition
()¶ declared private to prevent direct use of the CRTP base
- template <std::size_t... idx>
-
constexpr rank_type
to_rank_impl
(std::index_sequence<idx...> const&) const¶ Implementation of to_rank().
- template <std::size_t j>
-
constexpr void
assign_rank_impl
(rank_type const i)¶ Implementation of assign_rank().
Private Members
-
friend seqan3::cartesian_composition::derived_type
befriend the derived type so that it can instantiate
Private Static Attributes
-
constexpr std::array<rank_type, sizeof...(alphabet_types) + 1>
cummulative_alph_sizes
= { [] () constexpr { std::array<rank_type, sizeof...(alphabet_types) + 1> ret{}; size_t count = 0; meta::for_each(meta::list<first_alphabet_type, alphabet_types...>{}, [&] (auto && alph) constexpr { ret[count] = static_cast<rank_type>( alphabet_size_v<std::decay_t<decltype(alph)>> * (count > 0 ? ret[count - 1] : 1)); ++count; }); return std::move(ret); }() }¶ the cummulative alphabet size products (first, first*second, first*second*third...) are cached
-
constexpr auto
positions
= std::make_index_sequence<sizeof...(alphabet_types)>{}¶ An index sequence up to the number of contained letters.
Contains seqan3::union_composition.
- Author
- Marcel Ehrhardt <marcel.ehrhardt AT fu-berlin.de>
- Author
- David Heller <david.heller 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.
- template <typename first_alphabet_type, typename... alphabet_types>
-
class
union_composition
¶ - #include <alphabet/composition/union_composition.hpp>
A composition that merges different regular alphabets as a single alphabet.
The union alphabet represents the union of two or more alphabets (e.g. the four letter DNA alphabet + the gap alphabet). Note that you cannot assign regular characters, but additional functions for this are available.
- Template Parameters
first_alphabet_type
: Type of the first letter, e.g. dna4; must satisfy seqan3::alphabet_concept.alphabet_types
: Types of further letters; must satisfy seqan3::alphabet_concept.
This class has a similar behavior as std::variant.
union_composition<dna4, gap> my_letter{}; union_composition<dna4, gap> converted_letter{dna4::C}; // doesn't work: // union_composition<dna4, gap> my_letter{'A'}; union_composition<dna4, gap>{}.assign_char('C'); // <- this does! union_composition<dna4, gap>{}.assign_char('-'); // gap character union_composition<dna4, gap>{}.assign_char('K'); // unknown characters map to the default/unknown // character of the first alphabet type (i.e. A of dna4) if (my_letter.to_char() == 'A') std::cout << "yeah\n"; // "yeah";
The union alphabet can also be constructed directly from one of the base alphabets.
using alphabet_t = union_composition<dna4, dna5, gap>; constexpr alphabet_t letter0{dna4::A}; constexpr alphabet_t letter1 = dna4::C; constexpr alphabet_t letter2 = {dna4::G}; constexpr alphabet_t letter3 = static_cast<alphabet_t>(dna4::T); assert(letter0.to_rank() == 0); assert(letter1.to_rank() == 1); assert(letter2.to_rank() == 2); assert(letter3.to_rank() == 3);
Or can be assigned by one of the base alphabets.
using alphabet_t = union_composition<dna4, dna5, gap>; alphabet_t letter; letter = dna5::A; assert(letter.to_rank() == 4); letter = {dna5::C}; assert(letter.to_rank() == 5); letter = static_cast<alphabet_t>(dna5::G); assert(letter.to_rank() == 6);
Default constructors
-
constexpr
union_composition
()¶
-
constexpr
union_composition
(union_composition const&)¶
-
constexpr
union_composition
(union_composition&&)¶
Default assignment operators
-
constexpr union_composition &
operator=
(union_composition const&)¶
-
constexpr union_composition &
operator=
(union_composition&&)¶
Conversion constructors
- template <typename alphabet_t>
-
constexpr
union_composition
(alphabet_t const &alphabet)¶ Construction via a value of the base alphabets.
union_composition<dna4, gap> letter1{dna4::C}; // or union_composition<dna4, gap> letter2 = gap::GAP;
- Template Parameters
alphabet_t
: One of the base alphabet types
- template <size_t I, typename alphabet_t>
-
constexpr
union_composition
(std::in_place_index_t<I>, alphabet_t const &alphabet)¶ Construction via a value of reoccurring alphabets.
using alphabet_t = union_composition<dna4, dna4>; constexpr alphabet_t letter0{std::in_place_index_t<0>{}, dna4::A}; constexpr alphabet_t letter4{std::in_place_index_t<1>{}, dna4::A}; EXPECT_EQ(letter0.to_rank(), 0); EXPECT_EQ(letter4.to_rank(), 4);
- Template Parameters
I
: The index of the i-th base alphabetalphabet_t
: The i-th given base alphabet type
Conversion assignment operators
- template <typename alphabet_t>
-
constexpr union_composition &
operator=
(alphabet_t const &alphabet)¶ Assignment via a value of the base alphabets.
union_composition<dna4, gap> letter1{}; letter1 = gap::GAP;
- Template Parameters
alphabet_t
: One of the base alphabet types
Read functions
-
constexpr char_type
to_char
() const¶ Return the letter as a character of char_type.
-
constexpr rank_type
to_rank
() const¶ Return the letter’s numeric value or rank in the alphabet.
Write functions
-
constexpr union_composition &
assign_char
(char_type const c)¶ Assign from a character.
-
constexpr union_composition &
assign_rank
(rank_type const i)¶ Assign from a numeric value.
Comparison operators
-
constexpr bool
operator==
(union_composition const &rhs) const¶
-
constexpr bool
operator!=
(union_composition const &rhs) const¶
-
constexpr bool
operator<
(union_composition const &rhs) const¶
-
constexpr bool
operator>
(union_composition const &rhs) const¶
-
constexpr bool
operator<=
(union_composition const &rhs) const¶
-
constexpr bool
operator>=
(union_composition const &rhs) const¶
Public Types
Public Static Functions
- template <typename alphabet_t>
-
static constexpr bool
has_type
()¶ Returns true if alphabet_t is one of the given alphabet types.
- Template Parameters
alphabet_t
: The type to check
Public Static Attributes
-
constexpr size_t
value_size
= (alphabet_types::value_size + ... + first_alphabet_type::value_size)¶ The size of the alphabet, i.e. the number of different values it can take.
Private Functions
- template <typename... alphabet_types>
-
constexpr auto
alphabet_prefix_sum_sizes
()¶ Returns an array which contains the prefix sum over all alphabet_types::value_size’s.
using namespace seqan3::detail; constexpr auto prefix_sum = alphabet_prefix_sum_sizes<dna4, gap, dna5>(); assert(prefix_sum.size() == 4); assert(prefix_sum[0] == 0); assert(prefix_sum[1] == 4); assert(prefix_sum[2] == 5); assert(prefix_sum[3] == 10);
- template <typename char_t, typename... alphabet_types>
-
constexpr auto
value_to_char_table
()¶ Returns an map at compile time where the key is the rank of the union of all alphabets and the value is the corresponding char of that rank and alphabet.
using namespace seqan3::detail::union_composition; constexpr auto value_to_char = value_to_char_table<char, dna4, gap, dna5>(); assert(value_to_char.size() == 10); assert(value_to_char[0] == 'A'); assert(value_to_char[1] == 'C'); assert(value_to_char[2] == 'G'); assert(value_to_char[3] == 'T'); assert(value_to_char[4] == '-'); assert(value_to_char[5] == 'A'); assert(value_to_char[6] == 'C'); // and so on
- template <typename char_t, typename... alphabet_types>
-
constexpr auto
char_to_value_table
()¶ Returns an map at compile time where the key is the char of one of the alphabets and the value is the corresponding rank over all alphabets (by conflict will default to the first).
using namespace seqan3::detail::union_composition; constexpr auto char_to_value = char_to_value_table<char, dna4, gap, dna5>(); assert(char_to_value.size() == 256); assert(char_to_value['A'] == 0); assert(char_to_value['C'] == 1); assert(char_to_value['G'] == 2); assert(char_to_value['T'] == 3); assert(char_to_value['-'] == 4); assert(char_to_value['A'] == 0); assert(char_to_value['C'] == 1); assert(char_to_value['G'] == 2); assert(char_to_value['T'] == 3); assert(char_to_value['N'] == 9); assert(char_to_value['*'] == 0); // every other character defaults to 0
Private Members
-
rank_type
_value
¶ The data member.
Private Static Functions
- template <size_t index, typename alphabet_t>
-
static constexpr rank_type
rank_by_index_
(alphabet_t const &alphabet)¶ Converts an object of one of the given alphabets into the internal representation.
- template <typename alphabet_t>
-
static constexpr rank_type
rank_by_type_
(alphabet_t const &alphabet)¶ Converts an object of one of the given alphabets into the internal representation.
Finds the index of alphabet_t in the given types.
Private Static Attributes
-
constexpr auto
prefix_sum_sizes
¶ Compile-time generated lookup table which contains the prefix sum up to the position of each alphabet.
- See
- alphabet_prefix_sum_sizes
-
constexpr auto
value_to_char
¶ Compile-time generated lookup table which maps the rank to char.
- See
- value_to_char_table
-
constexpr auto
char_to_value
¶ Compile-time generated lookup table which maps the char to rank.
- See
- char_to_value_table
Detail¶
Free function/metafunction wrappers for alphabets with member functions/types.
- Author
- Hannes Hauswedell <hannes.hauswedell AT fu-berlin.de> This shall not need be included manually, just include
alphabet/concept.hpp
.
-
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.
- template <typename alphabet_type>
-
constexpr underlying_rank_t<alphabet_type>
to_rank
(alphabet_type const alph)¶ Implementation of seqan3::semi_alphabet_concept::to_rank() that delegates to a member function.
- Return
- The letter’s value in the alphabet’s rank type (usually a
uint*_t
). - Template Parameters
alphabet_type
: Must provide a.to_rank()
member function.
- Parameters
alph
: The alphabet letter that you wish to convert to rank.
- template <typename alphabet_type>
-
constexpr alphabet_type &
assign_rank
(alphabet_type &alph, underlying_rank_t<alphabet_type> const rank)¶ Implementation of seqan3::semi_alphabet_concept::assign_rank() that delegates to a member function.
- Return
- A reference to the alphabet letter you passed in.
- Template Parameters
alphabet_type
: Must provide an.assign_rank()
member function.
- Parameters
alph
: The alphabet letter that you wish to assign to.rank
: Therank
value you wish to assign.
- template <typename alphabet_type>
-
constexpr alphabet_type &&
assign_rank
(alphabet_type &&alph, underlying_rank_t<alphabet_type> const rank)¶ Implementation of seqan3::semi_alphabet_concept::assign_rank() that delegates to a member function.
Use this e.g. to newly create alphabet letters from rank:
auto l = assign_rank(dna5{}, 1); // l is of type dna5 and == dna5::C
- Return
- The assignment result as a temporary.
- Template Parameters
alphabet_type
: Must provide an.assign_rank()
member function.
- Parameters
alph
: An alphabet letter temporary.rank
: Therank
value you wish to assign.
Helpers for seqan3::alphabet_concept
These functions and metafunctions expose member variables and types so that they satisfy seqan3::alphabet_concept.
- template <typename alphabet_type>
-
constexpr underlying_char_t<alphabet_type>
to_char
(alphabet_type const alph)¶ Implementation of seqan3::alphabet_concept::to_char() that delegates to a member function.
- Return
- The letter’s value in the alphabet’s rank type (usually
char
). - Template Parameters
alphabet_type
: Must provide a.to_char()
member function.
- Parameters
alph
: The alphabet letter that you wish to convert to char.
- template <typename alphabet_type>
-
std::ostream &
operator<<
(std::ostream &os, alphabet_type const alph)¶ Implementation of seqan3::alphabet_concept::operator<<() that delegates to
alph.to_char()
.- Return
- A reference to the output stream.
- Template Parameters
alphabet_type
: Must provide a.to_char()
member function.
- Parameters
os
: The output stream you are printing to.alph
: The alphabet letter that you wish to print.
- template <typename alphabet_type>
-
constexpr alphabet_type &
assign_char
(alphabet_type &alph, underlying_char_t<alphabet_type> const chr)¶ Implementation of seqan3::alphabet_concept::assign_char() that delegates to a member function.
- Return
- A reference to the alphabet letter you passed in.
- Template Parameters
alphabet_type
: Must provide an.assign_char()
member function.
- Parameters
alph
: The alphabet letter that you wish to assign to.chr
: Thechar
value you wish to assign.
- template <typename alphabet_type>
-
constexpr alphabet_type &&
assign_char
(alphabet_type &&alph, underlying_char_t<alphabet_type> const chr)¶ Implementation of seqan3::alphabet_concept::assign_char() that delegates to a member function.
Use this e.g. to newly create alphabet letters from char:
auto l = assign_char(dna5{}, 'G'); // l is of type dna5
- Return
- The assignment result as a temporary.
- Template Parameters
alphabet_type
: Must provide an.assign_char()
member function.
- Parameters
alph
: An alphabet letter temporary.chr
: Thechar
value you wish to assign.
Helpers for seqan3::nucleotide_concept
These functions and metafunctions expose member variables and types so that they satisfy seqan3::nucleotide_concept.
- template <typename nucleotide_type>
-
constexpr nucleotide_type
complement
(nucleotide_type const alph)¶ Implementation of seqan3::nucleotide_concept::complement() that delegates to a member function.
- Return
- The letter’s complement, e.g. ‘T’ for ‘A’.
- Template Parameters
nucleotide_type
: Must provide a.complement()
member function.
- Parameters
alph
: The alphabet letter for whom you wish to receive the complement.
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.
- template <typename alphabet_type_with_members>
-
template<>
structalphabet_size
<alphabet_type_with_members>¶ - #include <alphabet/detail/member_exposure.hpp>
Specialisation of seqan3::alphabet_size that delegates to
alphabet_type::value_size
.Instead of accessing this struct directly, just use seqan3::alphabet_size_v.
- Template Parameters
alphabet_type
: Must provide a static member variable callesvalue_size
.
Public Static Attributes
-
constexpr underlying_rank_t<alphabet_type_with_members>
value
= alphabet_type_with_members::value_size¶ The size retrieved from the type’s member.
- template <typename alphabet_type_with_members>
-
template<>
structunderlying_char
<alphabet_type_with_members>¶ - #include <alphabet/detail/member_exposure.hpp>
Specialisation of seqan3::underlying_char that delegates to
typename alphabet_type::char_type
.- Template Parameters
alphabet_type
: Must provide a member typechar_type
.
Public Types
-
template<>
usingtype
= typename alphabet_type_with_members::char_type¶ The forwarded char_type.
- template <typename alphabet_type_with_members>
-
template<>
structunderlying_rank
<alphabet_type_with_members>¶ - #include <alphabet/detail/member_exposure.hpp>
Specialisation of seqan3::underlying_rank that delegates to
typename alphabet_type::rank_type
.- Template Parameters
alphabet_type
: Must provide a member typerank_type
.
Public Types
-
template<>
usingtype
= typename alphabet_type_with_members::rank_type¶ The forwarded rank_type.
Gap¶
Meta-header for the gap submodule; includes all headers from alphabet/gap/. gap.
- Author
- Marcel Ehrhardt <marcel.ehrhardt AT fu-berlin.de>
Contains seqan3::gap.
- Author
- Marcel Ehrhardt <marcel.ehrhardt AT fu-berlin.de>
- Author
- David Heller <david.heller 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
gap
¶ - #include <alphabet/gap/gap.hpp>
The alphabet of a gap character ‘-‘.
The alphabet always has the same value (‘-‘).
gap my_gap = gap::GAP; gap another_gap{}.assign_char('A'); // setting this does not change anything std::cout << my_gap.to_char(); // outputs '-' if (my_gap.to_char() == another_gap.to_char()) std::cout << "Both gaps are the same!";
Inherits from seqan3::alphabet_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.
Letter values
Static member “letters” that can be assigned to the alphabet or used in aggregate initialization.
Read functions
Write functions
-
constexpr gap &
assign_char
(char_type const)¶ Assign from a character (no-op, since gap has only one character).
- Parameters
c
: not used, since gap has only one character
-
constexpr gap& seqan3::gap::assign_rank(] rank_type const i)
Assign from a numeric value (no-op, since gap has only one character).
- Parameters
i
: not used, since gap has only one character
Comparison operators
Public Types
-
constexpr gap &
-
struct
Contains seqan3::gapped.
- Author
- Marcel Ehrhardt <marcel.ehrhardt AT fu-berlin.de>
- Author
- David Heller <david.heller 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.
- template <typename alphabet_t>
-
struct
gapped
¶ - #include <alphabet/gap/gapped.hpp>
A gapped that extends a given alphabet with a gap character.
The gapped represents the union of a given alphabet and the seqan3::gap alphabet (e.g. the four letter DNA alphabet + a gap character). Note that you cannot assign regular characters, but additional functions for this are available.
- Template Parameters
alphabet_t
: Type of the letter, e.g. dna4; must satisfy seqan3::alphabet_concept.
gapped<dna4> gapped_letter{}; gapped<dna4> converted_letter{dna4::C}; // doesn't work: // gapped<dna4> my_letter{'A'}; gapped<dna4>{}.assign_char('C'); // <- this does! gapped<dna4>{}.assign_char('-'); // gap character gapped<dna4>{}.assign_char('K'); // unknown characters map to the default/unknown // character of the given alphabet type (i.e. A of dna4)
- See
- For more details see union_composition, which is the base class and more general than the gapped.
Inherits from seqan3::alphabet_concept, seqan3::union_composition< alphabet_t, gap >
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.
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 .
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
Public Types
Public Static Attributes
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!
-
constexpr char_type
-
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 namespaceseqan3::literal
.- Attention
- This means you cannot use them, unless you explicitly add
using namespace seqan3::literal;
(in addition tousing namespace seqan3;
).
-
struct
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 .
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
Public Types
Public Static Attributes
Private Members
-
internal_type
_value
¶ The data member.
Private Static Attributes
-
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; }() }¶
-
constexpr std::array<dna5, dna5::value_size>
complement_table
= { dna5::T, dna5::G, dna5::C, dna5::A, dna5::N }¶
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!
-
constexpr char_type
-
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 namespaceseqan3::literal
.- Attention
- This means you cannot use them, unless you explicitly add
using namespace seqan3::literal;
(in addition tousing namespace seqan3;
).
-
struct
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 .
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
Public Types
Public Static Attributes
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' }¶
-
constexpr std::array<internal_type, 256>
char_to_value
¶
-
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 }¶
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!
-
constexpr char_type
-
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 namespaceseqan3::literal
.- Attention
- This means you cannot use them, unless you explicitly add
using namespace seqan3::literal;
(in addition tousing namespace seqan3;
).
-
using
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 .
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' }¶
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!
-
constexpr char_type
-
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 namespaceseqan3::literal
.- Attention
- This means you cannot use them, unless you explicitly add
using namespace seqan3::literal;
(in addition tousing namespace seqan3;
).
-
struct
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 .
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' }¶
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!
-
constexpr char_type
-
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 namespaceseqan3::literal
.- Attention
- This means you cannot use them, unless you explicitly add
using namespace seqan3::literal;
(in addition tousing namespace seqan3;
).
-
struct
Quality¶
Contains aliases for quality_composition.
- 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.
Typedefs
-
using
seqan3::dna4q = typedef quality_composition<dna4, illumina18>
An alphabet that stores a seqan3::dna4 letter and an seqan3::illumina18 letter at each position.
-
using
seqan3::dna5q = typedef quality_composition<dna5, illumina18>
An alphabet that stores a seqan3::dna5 letter and an seqan3::illumina18 letter at each position.
-
using
seqan3::rna4q = typedef quality_composition<rna4, illumina18>
An alphabet that stores a seqan3::rna4 letter and an seqan3::illumina18 letter at each position.
-
using
seqan3::rna5q = typedef quality_composition<rna5, illumina18>
An alphabet that stores a seqan3::rna5 letter and an seqan3::illumina18 letter at each position.
-
using
seqan3::nucl16q = typedef quality_composition<nucl16, illumina18>
An alphabet that stores a seqan3::nucl16 letter and an seqan3::illumina18 letter at each position.
-
using
Meta-header that includes all headers from alphabet/quality/.
- 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.
Typedefs
-
using
seqan3::underlying_phred_t = typedef typename underlying_phred<alphabet_type>::type
internal phred type
Functions
- template <typename alphabet_type>
-
requires detail::internal_quality_concept<alphabet_type> constexpr alphabet_type seqan3::assign_phred(alphabet_type & c, char const in)
public setter function receiving char encoding of phred score
- template <typename alphabet_type>
-
requires detail::internal_quality_concept<alphabet_type> constexpr underlying_phred_t<alphabet_type> seqan3::to_phred(alphabet_type const & c)
public getter function for rank presentation of phred score
Variables
-
concept bool seqan3::quality_concept
= requires(q quality) { requires alphabet_concept<q>; { assign_phred(quality, typename q::rank_type{}) } -> q; { to_phred(quality) } -> const typename q::phred_type; typename underlying_phred<q>::type; } concept of a quality alphabet
-
using
-
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
illumina18
¶ - #include <alphabet/quality/illumina18.hpp>
Implementation of the Illumina 1.8 standard fulfilling the quality concept. The permitted phred score range is [0 .. 41], mapped to ascii-ordered range [‘!’ .. ‘J’]. For this standard internal and rank phred representation are both zero-based.
Public Types
-
using
phred_type
= int8_t¶ the 3 representation types of a quality score
-
using
rank_type
= uint8_t¶
-
using
char_type
= char¶
Public Functions
-
constexpr illumina18 &
operator=
(rank_type const c)¶ implicit compatibility to inner_type
-
constexpr bool
operator==
(const illumina18 &rhs) const¶ comparison operators
-
constexpr bool
operator!=
(const illumina18 &rhs) const¶
-
constexpr bool
operator<
(const illumina18 &rhs) const¶
-
constexpr bool
operator>
(const illumina18 &rhs) const¶
-
constexpr bool
operator<=
(const illumina18 &rhs) const¶
-
constexpr bool
operator>=
(const illumina18 &rhs) const¶
-
constexpr
operator char
() const¶ explicit compatibility to char code of a quality score
-
constexpr illumina18 &
assign_char
(char_type const c)¶ set internal value given 1-letter code
-
constexpr illumina18 &
assign_rank
(rank_type const c)¶ set internal value given zero-based integer c
-
constexpr illumina18 &
assign_phred
(phred_type const p)¶ set internal value given Illumina 1.8 integer code p
-
constexpr phred_type
to_phred
() const¶ get Illumina 1.8 integer code
Public Static Attributes
-
constexpr phred_type
offset_phred
= {0}¶
-
using
-
struct
Contains quality alphabet compositions.
- 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.
- template <typename sequence_alphabet_t, typename quality_alphabet_t>
-
struct
quality_composition
¶ - #include <alphabet/quality/quality_composition.hpp>
A seqan3::cartesian_composition that joins a nucleotide alphabet with a quality alphabet.
This composition pairs a nucleotide alphabet with a quality alphabet. The rank values correpsond to numeric values in the size of the composition, while the character values are taken from the sequence alphabet and the phred values are taken from the quality alphabet.
- Template Parameters
sequence_alphabet_t
: Type of the first letter; must satisfy seqan3::nucleotide_concept.quality_alphabet_t
: Types of further letters (up to 4); must satisfy seqan3::quality_concept.
As with all
seqan3::cartesian_composition
s you may access the individual alphabet letters in regular c++ tuple notation, i.e.get<0>(t)
and objects can be brace-initialized with the individual members.quality_composition<dna4, illumina18> l{dna4::A, 7}; std::cout << int(to_rank(l)) << ' ' << int(to_rank(get<0>(l))) << ' ' << int(to_rank(get<1>(l))) << '\n'; // 148 0 7 std::cout << to_char(l) << ' ' << to_char(get<0>(l)) << ' ' << to_char(get<1>(l)) << '\n'; // A A ( std::cout << int(to_phred(l)) << ' ' // << int(to_phred(get<0>(l))) << ' ' // dna4 doesn't have a phred << int(to_phred(get<1>(l))) << '\n'; // 7 7 // modify via structured bindings and references: auto & [ seq_l, qual_l ] = l; seq_l = dna4::G; std::cout << to_char(l) << '\n'; // G
This seqan3::cartesian_composition itself fulfills both seqan3::alphabet_concept and seqan3::quality_concept .
Write functions
-
constexpr quality_composition &
operator=
(sequence_alphabet_type const l)¶ Directly assign the sequence letter.
-
constexpr quality_composition &
operator=
(quality_alphabet_type const l)¶ Directly assign the quality letter.
-
constexpr quality_composition &
assign_char
(char_type const c)¶ Assign from a character. This modifies the internal sequence letter.
-
constexpr quality_composition &
assign_phred
(phred_type const c)¶ Assign from a phred value. This modifies the internal quality letter.
Read functions
-
constexpr phred_type
to_phred
() const¶ Return the phred value. This reads the internal quality letter.
-
constexpr char_type
to_char
() const¶ Return a character. This reads the internal sequence letter.
-
constexpr quality_composition
complement
() const¶ Return a quality_composition where the quality is preserved, but the sequence letter is complemented.
- See
- seqan3::complement
- See
- seqan3::nucleotide_concept::complement
Comparison operators
Lexicographically compares the values in the tuple.
Public Types
-
template<>
usingsequence_alphabet_type
= sequence_alphabet_t¶ First template parameter as member type.
-
template<>
usingquality_alphabet_type
= quality_alphabet_t¶ Second template parameter as member type.
-
template<>
usingchar_type
= underlying_char_t<sequence_alphabet_type>¶ Equals the char_type of sequence_alphabet_type.
-
template<>
usingphred_type
= underlying_phred_t<quality_alphabet_type>¶ Equals the phred_type of the quality_alphabet_type.
Related
- template <typename sequence_alphabet_type, typename quality_alphabet_type>
-
quality_composition
(sequence_alphabet_type&&, quality_alphabet_type&&)¶ Type deduction guide enables usage of quality_composition without specifying template args.
Core¶
Meta-header for the core module .
- Author
- Hannes Hauswedell <hannes.hauswedell AT fu-berlin.de>
- Author
- Rene Rahn <rene.rahn 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.
-
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 namespaceseqan3::literal
.- Attention
- This means you cannot use them, unless you explicitly add
using namespace seqan3::literal;
(in addition tousing namespace seqan3;
).
-
namespace
Contains platform and dependency checks.
- Author
- Hannes Hauswedell <hannes.hauswedell AT fu-berlin.de>
Contains seqan3::pod_tuple.
- 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.
- template <typename type0, typename... types>
-
struct
pod_tuple
¶ - #include <core/pod_tuple.hpp>
Behaves like std::tuple but is an aggregate PODType.
This class behaves like std::tuple, but it is itself a POD type while std::tuple is not (even if all contained types are POD). Since the only benefit of this class is that it stays POD it actually enforces this on all types in the tuple (if you want to add non POD types, just use std::tuple instead).
- Template Parameters
type0
: The first value’s type (every tuple must contain at least one type)....types
: 0-n further types (the types of the other values).
It (only) supports aggregate initialization, i.e. you must use brace-initializiers and cannot use paranthesis. You can use seqan3::get or std::get and also structured bindings to access the elements in the tuple.
pod_tuple<int, float> t{3, 4.7}; static_assert(std::is_pod_v<pod_tuple<int, float>>); // template parameters are automatically deduced: pod_tuple t2{17, 3.7f, 19l}; std::cout << std::get<0>(t2) << '\n'; // 17 auto [ i, f, l ] = t2; // creates an int i with value 17, float f...
Access an element of a pod_tuple by index
The same as std::get on an std::tuple.
Note that these functions are available, both, in the seqan3 namespace and in namespace std.
Access an element of a pod_tuple by type
The same as std::get on an std::tuple.
Note that these functions are available, both, in the seqan3 namespace and in namespace std. As is the case with std::tuple, this function is only defined if the type appears once in the tuple, i.e.
std::get<int>(std::tuple<int, int>{1,2})
is not defined.Comparison operators
Lexicographically compares the values in the tuple.
Related
- template <typename... types>
-
pod_tuple
(types&&...)¶ User defined deduction guide enables easy use.
Concept¶
Adaptions of core concepts from the Ranges TS.
- Author
- Rene Rahn <rene.rahn 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
Core Language Concepts
-
concept bool seqan3::same_concept
= static_cast<bool>(ranges::Same<ts...>()) Resolves to
ranges::Same<types...>()
-
concept bool seqan3::derived_from_conept
= static_cast<bool>(ranges::DerivedFrom<t, u>()) Resolves to
ranges::DerivedFrom<type1, type2>()
-
concept bool seqan3::implicitly_convertible_to_concept
= static_cast<bool>(ranges::ImplicitlyConvertibleTo<t, u>()) Resolves to
ranges::ImplicitlyConvertibleTo<type1, type2>()
-
concept bool seqan3::explicitly_convertible_to_concept
= static_cast<bool>(ranges::ExplicitlyConvertibleTo<t, u>()) Resolves to
ranges::ExplicitlyConvertibleTo<type1, type2>()
-
concept bool seqan3::convertible_to_concept
= implicitly_convertible_to_concept<t, u> && explicitly_convertible_to_concept<t, u> Resolves to
ranges::ConvertibleTo<type1, type2>()
-
concept bool seqan3::common_reference_concept
= static_cast<bool>(ranges::CommonReference<t, u, rest...>()) Resolves to
ranges::CommonReference<type1, type2, rest...>()
-
concept bool seqan3::common_concept
= static_cast<bool>(ranges::Common<t, u, rest...>()) Resolves to
ranges::Common<type1, type2, rest...>()
-
concept bool seqan3::integral_concept
= static_cast<bool>(ranges::Integral<t>()) Resolves to
ranges::Integral<type>()
-
concept bool seqan3::signed_integral_concept
= integral_concept<t> && static_cast<bool>(ranges::SignedIntegral<t>()) Resolves to
ranges::SignedIntegral<type>()
-
concept bool seqan3::unsigned_integral_concept
= integral_concept<t> && static_cast<bool>(ranges::UnsignedIntegral<t>()) Resolves to
ranges::UnsignedIntegral<type>()
-
concept bool seqan3::assignable_concept
= static_cast<bool>(ranges::Assignable<t, u>()) Resolves to
ranges::Assignable<type1, type2>()
-
concept bool seqan3::swappable_concept
= static_cast<bool>(ranges::Swappable<t, u>()) Resolves to
ranges::Swappable<type1, type2>()
Comparison concepts.
-
concept bool seqan3::weakly_equality_comparable_concept
= static_cast<bool>(ranges::WeaklyEqualityComparable<t, u>()) Resolves to
ranges::WeaklyEqualityComparable<type1, type2>()
-
concept bool seqan3::equality_comparable_concept
= static_cast<bool>(ranges::EqualityComparable<t, u>()) Resolves to
ranges::EqualityComparable<type1, type2>()
-
concept bool seqan3::weakly_ordered_concept
= static_cast<bool>(ranges::WeaklyOrdered<t>()) Resolves to
ranges::WeaklyOrdered<type1, type2>()
-
concept bool seqan3::totally_ordered_concept
= equality_comparable_concept<t, u> && weakly_ordered_concept<t, u> && static_cast<bool>(ranges::TotallyOrdered<t, u>()) Resolves to
ranges::TotallyOrdered<type1, type2>()
Object Concepts.
-
concept bool seqan3::destructible_concept
= static_cast<bool>(ranges::Destructible<t>()) Resolves to
ranges::Destructible<type>()
-
concept bool seqan3::constructible_concept
= destructible_concept<t> && static_cast<bool>(ranges::Constructible<t, args...>()) Resolves to
ranges::Constructible<type, args...>()
-
concept bool seqan3::default_constructible_concept
= constructible_concept<t> && static_cast<bool>(ranges::DefaultConstructible<t>()) Resolves to
ranges::DefaultConstructible<type>()
-
concept bool seqan3::move_constructible_concept
= static_cast<bool>(ranges::MoveConstructible<t>()) Resolves to
ranges::MoveConstructible<type>()
-
concept bool seqan3::copy_constructible_concept
= move_constructible_concept<t> && static_cast<bool>(ranges::CopyConstructible<t>()) Resolves to
ranges::CopyConstructible<type>()
-
concept bool seqan3::movable_concept
= move_constructible_concept<t> && static_cast<bool>(ranges::Movable<t>()) Resolves to
ranges::Movable<types...>()
-
concept bool seqan3::copyable_concept
= movable_concept<t> && copy_constructible_concept<t> && static_cast<bool>(ranges::Copyable<t>()) Resolves to
ranges::Copyable<type>()
-
concept bool seqan3::semi_regular_concept
= copyable_concept<t> && default_constructible_concept<t> Resolves to
ranges::SemiRegular<type>()
-
concept bool seqan3::regular_concept
= semi_regular_concept<t> && equality_comparable_concept<t> Resolves to
ranges::Regular<type>()
Callable Concepts.
-
concept bool seqan3::invocable_concept
= static_cast<bool>(ranges::Invocable<f, args...>()) Resolves to
ranges::Invocable<func, ...args>()
-
concept bool seqan3::regular_invocable_concept
= invocable_concept<f, args...> && static_cast<bool>(ranges::RegularInvocable<f, args...>()) Resolves to
ranges::RegularInvocable<func, ...args>()
-
concept bool seqan3::predicate_concept
= regular_invocable_concept<f, args...> && static_cast<bool>(ranges::Predicate<f, args...>()) Resolves to
ranges::Predicate<func, ...args>()
-
concept bool seqan3::relation_concept
= static_cast<bool>(ranges::Relation<f, t, u>()) Resolves to
ranges::Relation<func, type1, type2>()
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.
-
Adaptions of Iterator concepts from the Ranges TS.
- Author
- Rene Rahn <rene.rahn 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
Iterator Concepts
-
concept bool seqan3::readable_concept
= static_cast<bool>(ranges::Readable<t>()) Resolves to
ranges::Readable<type>()
-
concept bool seqan3::writable_concept
= static_cast<bool>(ranges::Writable<out, t>()) Resolves to
ranges::Writable<out_type, type>()
-
concept bool seqan3::weakly_incrementable_concept
= semi_regular_concept<i> && static_cast<bool>(ranges::WeaklyIncrementable<i>()) Resolves to
ranges::WeaklyIncrementable<type>()
-
concept bool seqan3::incrementable_concept
= regular_concept<i> && weakly_incrementable_concept<i> && static_cast<bool>(ranges::Incrementable<i>()) Resolves to
ranges::Incrementable<type>()
-
concept bool seqan3::iterator_concept
= weakly_incrementable_concept<i> && copyable_concept<i> && static_cast<bool>(ranges::Iterator<i>()) Resolves to
ranges::Iterator<iterator_type>()
-
concept bool seqan3::sentinel_concept
= semi_regular_concept<s> && iterator_concept<i> && static_cast<bool>(ranges::Sentinel<s, i>()) Resolves to
ranges::Sentinel<sentinel_type, iterator_type>()
-
concept bool seqan3::sized_sentinel_concept
= sentinel_concept<s, i> && static_cast<bool>(ranges::SizedSentinel<s, i>()) Resolves to
ranges::SizedSentinel<sentinel_type, iterator_type>()
-
concept bool seqan3::output_iterator_concept
= iterator_concept<out> && writable_concept<out, t> && static_cast<bool>(ranges::OutputIterator<out, t>()) Resolves to
ranges::OutputIterator<iterator_type, type>()
-
concept bool seqan3::input_iterator_concept
= iterator_concept<i> && readable_concept<i> && static_cast<bool>(ranges::InputIterator<i>()) Resolves to
ranges::InputIterator<iterator_type>()
-
concept bool seqan3::forward_iterator_concept
= input_iterator_concept<i> && incrementable_concept<i> && sentinel_concept<i, i> && static_cast<bool>(ranges::ForwardIterator<i>()) Resolves to
ranges::ForwardIterator<iterator_type>()
-
concept bool seqan3::bidirectional_iterator_concept
= forward_iterator_concept<i> && static_cast<bool>(ranges::BidirectionalIterator<i>()) Resolves to
ranges::BidirectionalIterator<iterator_type>()
-
concept bool seqan3::random_access_iterator_concept
= bidirectional_iterator_concept<i> && totally_ordered_concept<i> && sized_sentinel_concept<i, i> && static_cast<bool>(ranges::RandomAccessIterator<i>()) Resolves to
ranges::RandomAccessIterator<iterator_type>()
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.
-
Detail¶
Contains metaprogramming utilities for integer types.
- Author
- Hannes Hauswedell <hannes.hauswedell AT fu-berlin.de>
Io¶
Alignment¶
-
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.
Variables
-
concept bool seqan3::align_file_traits_concept
= requires (t v) { t::stream_type; t::valid_formats; t::valid_compression_formats; t::query_seqs_type; t::query_ids_type; t::subject_seqs_type; t::subject_ids_type; t::qry_gaps_type; t::sbj_gaps_type; }
-
std::string
align_record_field_labels
[] = { "raw score" "bit score", "edit distance", ... }¶
-
-
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.
Functions
- template <typename record_type>
-
requires seqan3::align_record_concept< record_type >(requires container_concept < record_type > &&requires align_record_concept< typename record_type::value_type >)
- template <typename align_file_in_traits = align_file_in_default_dna_traits>
-
class
align_file_in
¶ Inherits from seqan3::detail::align_file< align_file_in_traits >
Public Functions
-
align_file_in
(std::string const &_file_name)¶
-
align_file_in
(align_file_in const&)¶
-
align_file_in &
operator=
(align_file_in const&)¶
-
align_file_in
(align_file_in&&)¶
-
align_file_in &
operator=
(align_file_in&&)¶
- template <typename record_type>
-
requires seqan3::align_file_in::align_record_concept(requires container_concept < record_type > &&requires align_record_concept< typename record_type::value_type >)
- template <typename... types>
-
void
read_raw
(...)¶
-
void
set_store
(std::tuple<subject_seqs_type const&, subject_ids_type const&> const&)¶
- template <typename... arg_types>
-
void
read_raw
(arg_types&&... args)¶
Protected Functions
-
~align_file_in
()¶
Protected Attributes
-
store_type
store
¶
-
struct
store_type
¶ Public Members
-
template<>
align_file_in_traits::query_seqs_type *qry_seqs
= {nullptr}¶
-
template<>
align_file_in_traits::query_ids_type *qry_ids
= {nullptr}¶
-
template<>
align_file_in_traits::subject_seqs_type *sbj_seqs
= {nullptr}¶
-
template<>
align_file_in_traits::subject_ids_type *sbj_ids
= {nullptr}¶
-
template<>
align_file_in_traits::query_seqs_typeqry_seqs_from_file
¶
-
template<>
align_file_in_traits::query_ids_typeqry_ids_from_file
¶
-
template<>
align_file_in_traits::subject_seqs_typesbj_seqs_from_file
¶
-
template<>
align_file_in_traits::subject_ids_typesbj_ids_from_file
¶
-
template<>
align_file_in_traits::query_id_map_typequery_id_map
¶
-
template<>
align_file_in_traits::subject_id_map_typesubject_id_map
¶
-
template<>
-
-
struct
align_file_in_default_aa_traits
¶ Inherits from seqan3::align_file_in_default_dna_traits
Public Types
-
using
query_seqs_type
= std::vector<aa27_vector>¶
-
using
subject_seqs_type
= std::vector<aa27_vector>¶
-
using
stream_type
= std::ifstream¶
-
using
valid_formats
= std::variant<align_file_in_format_sam, align_file_in_format_bam, align_file_in_format_blast_tabular align_file_in_format_blast_tabular_comments>¶
-
using
query_ids_type
= std::vector<std::string>¶
-
using
subject_ids_type
= std::vector<std::string>¶
Public Static Attributes
-
constexpr std::vector<std::pair<std::string, void>>
valid_compression_formats
= {}¶
-
using
-
struct
align_file_in_default_dna_traits
¶ Subclassed by seqan3::align_file_in_default_aa_traits
Public Types
-
using
stream_type
= std::ifstream
-
using
valid_formats
= std::variant<align_file_in_format_sam, align_file_in_format_bam, align_file_in_format_blast_tabular align_file_in_format_blast_tabular_comments>
-
using
query_seqs_type
= std::vector<dna_vector>¶
-
using
query_ids_type
= std::vector<std::string>
-
using
subject_seqs_type
= std::vector<dna_vector>¶
-
using
subject_ids_type
= std::vector<std::string>
Public Static Attributes
-
constexpr std::vector<std::pair<std::string, void>>
valid_compression_formats
= {}¶
-
using
-
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.
- template <typename align_file_out_traits = align_file_out_default_dna_traits>
-
class
align_file_out
¶ Inherits from seqan3::detail::align_file< align_file_out_traits >
Public Functions
-
align_file_out
(std::string const &_file_name)¶
-
align_file_out
(align_file_out const&)¶
-
align_file_out &
operator=
(align_file_out const&)¶
-
align_file_out
(align_file_out&&)¶
-
align_file_out &
operator=
(align_file_out&&)¶
- template <typename record_type>
-
requires seqan3::align_file_out::align_record_concept(requires container_concept < record_type > &&requires align_record_concept< typename record_type::value_type >)
- template <typename... types>
-
void
write_raw
(...)¶
- template <typename... arg_types>
-
void
write_raw
(arg_types&&... args)¶
Protected Functions
-
~align_file_out
()¶
Protected Attributes
-
store_type
store
¶
-
struct
store_type
¶ Public Members
-
template<>
align_file_out_traits::query_seqs_type *qry_seqs
= {nullptr}¶
-
template<>
align_file_out_traits::query_ids_type *qry_ids
= {nullptr}¶
-
template<>
align_file_out_traits::subject_seqs_type *sbj_seqs
= {nullptr}¶
-
template<>
align_file_out_traits::subject_ids_type *sbj_ids
= {nullptr}¶
-
template<>
-
-
struct
align_file_out_default_aa_traits
¶ Inherits from seqan3::align_file_out_default_dna_traits
Public Types
-
using
query_seqs_type
= std::vector<aa27_vector>¶
-
using
subject_seqs_type
= std::vector<aa27_vector>¶
-
using
stream_type
= std::ifstream¶
-
using
valid_formats
= std::variant<align_file_out_format_sam, align_file_out_format_bam, align_file_out_format_blast_tabular align_file_out_format_blast_tabular_comments, align_file_out_format_blast_report>¶
-
using
query_ids_type
= std::vector<std::string>¶
-
using
subject_ids_type
= std::vector<std::string>¶
Public Static Attributes
-
constexpr std::vector<std::pair<std::string, void>>
valid_compression_formats
= {}¶
-
using
-
struct
align_file_out_default_dna_traits
¶ Subclassed by seqan3::align_file_out_default_aa_traits
Public Types
-
using
stream_type
= std::ifstream
-
using
valid_formats
= std::variant<align_file_out_format_sam, align_file_out_format_bam, align_file_out_format_blast_tabular align_file_out_format_blast_tabular_comments, align_file_out_format_blast_report>
-
using
query_seqs_type
= std::vector<dna_vector>¶
-
using
query_ids_type
= std::vector<std::string>
-
using
subject_seqs_type
= std::vector<dna_vector>¶
-
using
subject_ids_type
= std::vector<std::string>
Public Static Attributes
-
constexpr std::vector<std::pair<std::string, void>>
valid_compression_formats
= {}¶
-
using
Sequence¶
-
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.
Variables
-
concept bool seqan3::sequence_file_format_concept
= requires (t v) { t::file_extensions; { v.read(dna4_string{}, std::string{}, std::string{}, std::ifstream{}, options_type{}) }; { v.write(dna4_string{}, std::string{}, std::string{}, std::ofstream{}, options_type{}) }; }
-
-
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.
-
class
sequence_file_format_fasta
¶ Public Functions
-
sequence_file_format_fasta
()¶
-
sequence_file_format_fasta
()¶
-
sequence_file_format_fasta
(sequence_file_in const&)¶
-
sequence_file_format_fasta &
operator=
(sequence_file_in const&)¶
-
sequence_file_format_fasta
(sequence_file_in&&)¶
-
sequence_file_format_fasta &
operator=
(sequence_file_in&&)¶
- template <typename sequence_type, typename id_type, typename qual_type, typename stream_type, typename options_type>
-
requires container_concept<sequence_type>&& container_concept<id_type>&& container_concept<qual_type> void seqan3::sequence_file_format_fasta::read(sequence_type && seq, id_type && id, qual_type && qual, stream_type & stream, options_type const & options)
- template <typename seqs_type, typename ids_type, typename quals_type, typename stream_type, typename options_type size_t max_records = 0>
-
requires container_concept<typename seqs_type::value>&& container_concept<typename ids_type::value>&& container_concept<typename quals_type::value> void seqan3::sequence_file_format_fasta::read(seqs_type && seqs, ids_type && ids, quals_type && quals, stream_type & stream, options_type const & options)
Public Static Attributes
-
std::vector<std::string>
file_extensions
= { { "fasta" }, { "fa" } }¶
-
-
class
-
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.
Variables
-
concept bool seqan3::sequence_file_in_traits_concept
= requires (t v) { t::stream_type; t::valid_formats; requires detail::meets_concept_sequence_file_format<0, typename t::valid_formats>(); t::valid_compression_formats; }
- template <typename sequence_file_in_traits = sequence_file_in_traits_default>
-
class
sequence_file_in
¶ Public Functions
-
sequence_file_in
(std::string const &_file_name)¶
-
sequence_file_in
(sequence_file_in const&)¶
-
sequence_file_in &
operator=
(sequence_file_in const&)¶
-
sequence_file_in
(sequence_file_in&&)¶
-
sequence_file_in &
operator=
(sequence_file_in&&)¶
- template <typename sequence_type, typename id_type, typename qual_type>
-
requires container_concept< sequence_type > &&container_concept< id_type > &&container_concept< qual_type > void seqan3::sequence_file_in::read(sequence_type && seq, id_type && id, qual_type && qual)
- template <typename seqs_type, typename ids_type, typename quals_type, size_t max_records = 0>
-
requires container_concept< typename seqs_type::value > &&container_concept< typename ids_type::value > &&container_concept< typename quals_type::value > void seqan3::sequence_file_in::read(seqs_type && seqs, ids_type && ids, quals_type && quals)
Public Members
-
options_type
options
¶
Protected Functions
-
~sequence_file_in
()¶
Private Functions
-
void
select_decompression
(std::string const &compress_ext)¶
- template <size_t index>
-
void
assign_format
(std::string const &ext)¶
-
struct
options_type
¶
-
-
struct
sequence_file_in_default_traits
¶ Public Types
-
using
stream_type
= std::ofstream¶
-
using
valid_formats
= std::variant<sequence_file_format_fasta<stream_type>, sequence_file_format_fastq<stream_type>, sequence_file_format_embl<stream_type>, sequence_file_format_genbank<stream_type>, sequence_file_format_raw<stream_type>>¶
Public Static Attributes
-
constexpr std::vector<std::pair<std::string, void>>
valid_compression_formats
= {}¶
-
using
-
Range¶
Meta-header for the range module .
- Author
- Hannes Hauswedell <hannes.hauswedell AT fu-berlin.de>
Adaptations of concepts from the Ranges TS.
- 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.
-
concept bool seqan3::range_concept
= (bool)ranges::Range<type>() Defines the requirements of a type that allows iteration over its elements by providing a begin iterator and an end sentinel.
-
concept bool seqan3::sized_range_concept
= range_concept<type> && (bool)ranges::SizedRange<type>() Specifies the requirements of a Range type that knows its size in constant time with the size function.
-
concept bool seqan3::bounded_range_concept
= range_concept<type> && (bool)ranges::BoundedRange<type>() Specifies requirements of a Range type for which
begin
andend
return objects of the same type.
-
concept bool seqan3::output_range_concept
= range_concept<type> && (bool)ranges::OutputRange<type, out_type>() Specifies requirements of a Range type for which
begin
returns a type that satisfies seqan3::output_iterator_concept.
-
concept bool seqan3::input_range_concept
= range_concept<type> && (bool)ranges::InputRange<type>() Specifies requirements of an Range type for which
begin
returns a type that satisfies seqan3::input_iterator_concept.
-
concept bool seqan3::forward_range_concept
= input_range_concept<type> && (bool)ranges::ForwardRange<type>() Specifies requirements of an Range type for which
begin
returns a type that satisfies seqan3::forward_iterator_concept.
-
concept bool seqan3::bidirectional_range_concept
= forward_range_concept<type> && (bool)ranges::BidirectionalRange<type>() Specifies requirements of an Range type for which
begin
returns a type that satisfies seqan3::bidirectional_iterator_concept.
-
concept bool seqan3::random_access_range_concept
= bidirectional_range_concept<type> && (bool)ranges::RandomAccessRange<type>() Specifies requirements of an Range type for which
begin
returns a type that satisfies seqan3::random_access_iterator_concept.
Container concepts
Container concepts as defined by the standard library (or very close).
Container-of-container concepts
Shortcuts for multi-dimensional container concepts.
-
Provides various metafunctions used by the range module.
- 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.
Typedefs
-
using
seqan3::innermost_value_type_t = typedef typename innermost_value_type<t>::type
Shortcut for seqan3::innermost_value_type.
Variables
-
constexpr bool
has_value_type_v
¶ Whether a type has a
value_type
member and/orranges::value_type_t<t>
resolves [Value metafunction].- Template Parameters
t
: The type to recurse on; must haveranges::value_type_t<t>
-
constexpr size_t
dimension_v
¶ Returns the number of times you can call
ranges::value_type_t
recursively on t [Value metafunction].- Template Parameters
t
: The type to be queried; must resolveranges::value_type_t
at least once.
- template <typename t>
-
struct
innermost_value_type
¶ - #include <range/metafunction.hpp>
Recursively determines the
value_type
on containers and/or iterators [Type metafunction].- Template Parameters
t
: The type to recurse on; must haveranges::value_type_t<t>
Public Types
-
template<>
usingtype
= ranges::value_type_t<std::decay_t<t>>¶ The forwarded type.
-
using
Action¶
Meta-header for the action submodule .
- Author
- Hannes Hauswedell <hannes.hauswedell AT fu-berlin.de>
-
namespace
action
¶ The SeqAn3 namespace for actions.
Since actions often have name clashes with regular functions and views they are implemented in the sub namespace
action
.- See
- action
See the action submodule of the range module for more details.
Container¶
Meta-header for the container submodule .
- Author
- Hannes Hauswedell <hannes.hauswedell AT fu-berlin.de>
Provides seqan3::concatenated_sequences.
- 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.
- template <typename inner_type, typename data_delimiters_type = std::vector<typename inner_type::size_type>>
-
class
concatenated_sequences
¶ - #include <range/container/concatenated_sequences.hpp>
Container that stores sequences concatenated internally.
This class may be used whenever you would usually use
std::vector<std::vector<some_alphabet>>
orstd::vector<std::string>
, i.e. whenever you have a collection of sequences. It is the spiritual successor of theStringSet<TString, Owner<ConcatDirect>>
from SeqAn2.- Template Parameters
inner_type
: The type of sequences that will be stored. Must satisfy seqan3::reservable_sequence_concept.data_delimiters_type
: A container that stores the begin/end positions in the inner_type. Must be seqan3::reservable_sequence_concept and have inner_type’s size_type as value_type.
It saves all of the member sequences inside one concatenated sequence internally. If you access an element, you instead get a view on the internal string as a proxy. This has the following advantages:
- Better cache locality when parsing the sequences linearly (and often also on random access).
- Constant time access to the concatenation of the sequences via concat().
- This access is also writable so that certain transformations can be done globally, instead of element-wise.
- Also direct access to the delimiters via data() [this is used by some algorithms].
The disadvantages are:
- Slower inserts and erases because the entire concatenation might have to be copied.
- No emplace operations.
- Modifying elements is limited to operations on elements of that element, i.e. you can change a character, but you can’t assign a new member sequence to an existing position.
concatenated_sequences<dna4_vector> concat1{"ACGT"_dna4, "GAGGA"_dna4}; std::cout << concat1[0] << '\n'; // "[A,C,G,T]" std::vector<dna4_vector> concat2{"ACTA"_dna4, "AGGA"_dna4}; concat1 = concat2; // you can assign from other ranges concat2[0] = "ATTA"_dna4; // this works for vector of vector //concat1[0] = "ATTA"_dna4; // but not on concatenated_sequences concat1[0][1] = dna4::T; // this, however, does std::cout << concat1[0] << '\n'; // "[A,T,T,A]" // if you know that you will be adding a thousand vectors of length thousand: concat1.reserve(1'000); concat1.concat_reserve(1'000 * 1'000); while (...) { // ... concat1.push_back(vector_of_length1000); }
- Example
Whenever a strong exception guarantee is given for this class, it presumes that
std::is_nothrow_move_constructible<typename inner_type::value_type>
otherwise only basic exception safety can be assumed.- Exceptions
This container provides no thread-safety beyond the promise given also by the STL that all calls to
const
member function are safe from multiple threads (as long as no thread calls a non-const
member function at the same time).- Thread safety
Member types
-
template<>
usingvalue_type
= std::decay_t<inner_type>¶ == inner_type.
-
using
seqan3::concatenated_sequences< inner_type, data_delimiters_type >::reference = decltype(data_values | ranges::view::slice(0, 1))
A proxy of type ranges::view::slice that represents the range on the concatenated vector.
-
using
seqan3::concatenated_sequences< inner_type, data_delimiters_type >::const_reference = decltype(std::as_const(data_values) | ranges::view::slice(0, 1) | ranges::view::const_)
An immutable proxy of type ranges::view::slice that represents the range on the concatenated vector.
-
template<>
usingiterator
= detail::random_access_iterator<concatenated_sequences>¶ The iterator type of this container (a random access iterator).
-
template<>
usingconst_iterator
= detail::random_access_iterator<concatenated_sequences const>¶ The const iterator type of this container (a random access iterator).
-
template<>
usingdifference_type
= ranges::difference_type_t<data_delimiters_type>¶ A signed integer type (usually std::ptrdiff_t)
-
template<>
usingsize_type
= ranges::size_type_t<data_delimiters_type>¶ An unsigned integer type (usually std::size_t)
Constructors, destructor and assignment
-
concatenated_sequences
()¶ Default constructors.
-
constexpr
concatenated_sequences
(concatenated_sequences const&)¶ Default constructors.
-
constexpr
concatenated_sequences
(concatenated_sequences&&)¶ Default constructors.
-
constexpr concatenated_sequences &
operator=
(concatenated_sequences const&)¶ Default constructors.
-
constexpr concatenated_sequences &
operator=
(concatenated_sequences&&)¶ Default constructors.
-
~concatenated_sequences
()¶ Default constructors.
- template <typename rng_of_rng_type>
-
concatenated_sequences
(rng_of_rng_type &&rng_of_rng)¶ Construct/assign from a different range.
Linear in the cumulative size of
rng_of_rng
.- Complexity
- Template Parameters
rng_of_rng_type
: The type of range to be inserted; must satisfy seqan3::compatible_concept withconcatenated_sequences
.
- Parameters
rng_of_rng
: The sequences to construct/assign from.
Strong exception guarantee (no data is modified in case an exception is thrown).
- Exceptions
- template <typename rng_type>
-
concatenated_sequences
(size_type const count, rng_type &&value)¶ Construct/assign with
count
timesvalue
.In
.
- Complexity
- Template Parameters
rng_type
: The type of range to be inserted;rng_type
andvalue_type
must satisfy seqan3::compatible_concept.
- Parameters
count
: Number of elements.value
: The initial value to be assigned.
Strong exception guarantee (no data is modified in case an exception is thrown).
- Exceptions
- template <typename begin_iterator_type, typename end_iterator_type>
-
concatenated_sequences
(begin_iterator_type begin_it, end_iterator_type end_it)¶ Construct/assign from pair of iterators.
Linear in the cumulative size of the ranges between
begin_it
andend_it
.- Complexity
- Template Parameters
begin_iterator_type
: Must satisfy seqan3::forward_iterator_concept and satisfy seqan3::compatible_concept withvalue_type
.end_iterator_type
: Must satisfy seqan3::sized_sentinel_concept.
- Parameters
begin_it
: begin of range to construct/assign from.end_it
: end of range to construct/assign from.
Strong exception guarantee (no data is modified in case an exception is thrown).
- Exceptions
- template <typename rng_type = value_type>
-
concatenated_sequences
(std::initializer_list<rng_type> ilist)¶ Construct/assign from
std::initializer_list
.Linear in the cumulative size of the ranges in
ilist
.- Complexity
- Template Parameters
rng_type
: The type of range to be inserted; must satisfy seqan3::compatible_concept withvalue_type
.
- Parameters
ilist
: anstd::initializer_list
ofrng_type
.
Strong exception guarantee (no data is modified in case an exception is thrown).
- Exceptions
- template <typename rng_type>
-
concatenated_sequences &
operator=
(std::initializer_list<rng_type> ilist)¶ Construct/assign from
std::initializer_list
.Linear in the cumulative size of the elements in
ilist
.- Complexity
- Template Parameters
rng_type
: The type of range to be inserted; must satisfy seqan3::compatible_concept withvalue_type
.
- Parameters
ilist
: anstd::initializer_list
ofrng_type
.
Strong exception guarantee (no data is modified in case an exception is thrown).
- Exceptions
- template <typename rng_of_rng_type>
-
void
assign
(rng_of_rng_type &&rng_of_rng)¶ Construct/assign from a different range.
Linear in the cumulative size of
rng_of_rng
.- Complexity
- Template Parameters
rng_of_rng_type
: The type of range to be inserted; must satisfy seqan3::compatible_concept withconcatenated_sequences
.
- Parameters
rng_of_rng
: The sequences to construct/assign from.
Strong exception guarantee (no data is modified in case an exception is thrown).
- Exceptions
- template <typename rng_type>
-
void
assign
(size_type const count, rng_type &&value)¶ Construct/assign with
count
timesvalue
.In
.
- Complexity
- Template Parameters
rng_type
: The type of range to be inserted; must satisfy seqan3::compatible_concept withvalue_type
.
- Parameters
count
: Number of elements.value
: The initial value to be assigned.
Strong exception guarantee (no data is modified in case an exception is thrown).
- Exceptions
- template <typename begin_iterator_type, typename end_iterator_type>
-
void
assign
(begin_iterator_type begin_it, end_iterator_type end_it)¶ Construct/assign from pair of iterators.
Linear in the cumulative size of the ranges between
begin_it
andend_it
.- Complexity
- Template Parameters
begin_iterator_type
: Must satisfy seqan3::forward_iterator_concept and satisfy seqan3::compatible_concept withvalue_type
.end_iterator_type
: Must satisfy seqan3::sized_sentinel_concept.
- Parameters
begin_it
: begin of range to construct/assign from.end_it
: end of range to construct/assign from.
Strong exception guarantee (no data is modified in case an exception is thrown).
- Exceptions
- template <typename rng_type = value_type>
-
void
assign
(std::initializer_list<rng_type> ilist)¶ Construct/assign from
std::initializer_list
.Linear in the cumulative size of the elements in
ilist
.- Complexity
- Template Parameters
rng_type
: The type of range to be inserted; must satisfy seqan3::compatible_concept withvalue_type
.
- Parameters
ilist
: anstd::initializer_list
ofrng_type
.
Strong exception guarantee (no data is modified in case an exception is thrown).
- Exceptions
Iterators
-
iterator
begin
()¶ Returns an iterator to the first element of the container.
If the container is empty, the returned iterator will be equal to end().
- Return
- Iterator to the first element.
Constant.
- Complexity
No-throw guarantee.
- Exceptions
-
const_iterator
begin
() const¶ Returns an iterator to the first element of the container.
If the container is empty, the returned iterator will be equal to end().
- Return
- Iterator to the first element.
Constant.
- Complexity
No-throw guarantee.
- Exceptions
-
const_iterator
cbegin
() const¶ Returns an iterator to the first element of the container.
If the container is empty, the returned iterator will be equal to end().
- Return
- Iterator to the first element.
Constant.
- Complexity
No-throw guarantee.
- Exceptions
-
iterator
end
()¶ Returns an iterator to the element following the last element of the container.
This element acts as a placeholder; attempting to dereference it results in undefined behaviour.
- Return
- Iterator to the first element.
Constant.
- Complexity
No-throw guarantee.
- Exceptions
-
const_iterator
end
() const¶ Returns an iterator to the element following the last element of the container.
This element acts as a placeholder; attempting to dereference it results in undefined behaviour.
- Return
- Iterator to the first element.
Constant.
- Complexity
No-throw guarantee.
- Exceptions
-
const_iterator
cend
() const¶ Returns an iterator to the element following the last element of the container.
This element acts as a placeholder; attempting to dereference it results in undefined behaviour.
- Return
- Iterator to the first element.
Constant.
- Complexity
No-throw guarantee.
- Exceptions
Element access
-
reference
at
(size_type const i)¶ Return the i-th element as a view.
Constant.
- Return
- A ranges::view on the underlying concatenated sequences that acts as a proxy for the element.
- Complexity
- Parameters
i
: The element to retrieve.
- Exceptions
std::out_of_range
: If you access an element behind the last.
Strong exception guarantee (never modifies data)..
- Exceptions
-
const_reference
at
(size_type const i) const¶ Return the i-th element as a view.
Constant.
- Return
- A ranges::view on the underlying concatenated sequences that acts as a proxy for the element.
- Complexity
- Parameters
i
: The element to retrieve.
- Exceptions
std::out_of_range
: If you access an element behind the last.
Strong exception guarantee (never modifies data)..
- Exceptions
-
reference
operator[]
(size_type const i)¶ Return the i-th element as a view.
Accessing an element behind the last causes undefined behaviour. In debug mode an assertion checks the size of the container. Constant.
- Return
- A ranges::view on the underlying concatenated sequences that acts as a proxy for the element.
- Complexity
- Parameters
i
: The element to retrieve.
Strong exception guarantee (never modifies data)..
- Exceptions
-
const_reference
operator[]
(size_type const i) const¶ Return the i-th element as a view.
Accessing an element behind the last causes undefined behaviour. In debug mode an assertion checks the size of the container. Constant.
- Return
- A ranges::view on the underlying concatenated sequences that acts as a proxy for the element.
- Complexity
- Parameters
i
: The element to retrieve.
Strong exception guarantee (never modifies data)..
- Exceptions
-
reference
front
()¶ Return the first element as a view. Calling front on an empty container is undefined.
Calling front on an empty container is undefined. In debug mode an assertion checks the size of the container. Constant.
- Return
- A ranges::view on the underlying concatenated sequences that acts as a proxy for the element.
- Complexity
Strong exception guarantee (never modifies data).
- Exceptions
-
const_reference
front
() const¶ Return the first element as a view. Calling front on an empty container is undefined.
Calling front on an empty container is undefined. In debug mode an assertion checks the size of the container. Constant.
- Return
- A ranges::view on the underlying concatenated sequences that acts as a proxy for the element.
- Complexity
Strong exception guarantee (never modifies data).
- Exceptions
-
reference
back
()¶ Return the last element as a view.
Calling back on an empty container is undefined. In debug mode an assertion checks the size of the container. Constant.
- Return
- A ranges::view on the underlying concatenated sequences that acts as a proxy for the element.
- Complexity
Strong exception guarantee (never modifies data)..
- Exceptions
-
const_reference
back
() const¶ Return the last element as a view.
Calling back on an empty container is undefined. In debug mode an assertion checks the size of the container. Constant.
- Return
- A ranges::view on the underlying concatenated sequences that acts as a proxy for the element.
- Complexity
Strong exception guarantee (never modifies data)..
- Exceptions
-
reference
concat
()¶ Return the concatenation of all members.
This is a safe way of accessing the internal concatenated representation, i.e. you cannot do operations that would invalidate this container (like insert or resize), but you can write to the individual positions.
- Return
- A ranges::view proxy on the concatenation of underlying sequences.
Constant.
- Complexity
Strong exception guarantee (never modifies data).
- Exceptions
-
const_reference
concat
() const¶ Return the concatenation of all members.
This is a safe way of accessing the internal concatenated representation, i.e. you cannot do operations that would invalidate this container (like insert or resize), but you can write to the individual positions.
- Return
- A ranges::view proxy on the concatenation of underlying sequences.
Constant.
- Complexity
Strong exception guarantee (never modifies data).
- Exceptions
-
std::pair<decltype(data_values) &, decltype(data_delimiters) &>
data
()¶ Provides direct, unsafe access to underlying data structures.
This exact representation of the data is implementation defined. Do not rely on it for API stability.
- Return
- An std::pair of the concatenated sequences and the delimiter string.
-
std::pair<decltype(data_values) const &, decltype(data_delimiters) const &>
data
() const¶ Provides direct, unsafe access to underlying data structures.
This exact representation of the data is implementation defined. Do not rely on it for API stability.
- Return
- An std::pair of the concatenated sequences and the delimiter string.
Capacity
-
bool
empty
() const¶ Checks whether the container is empty.
Constant.
- Return
true
if the container is empty,false
otherwise.- Complexity
No-throw guarantee.
- Exceptions
-
size_type
size
() const¶ Returns the number of elements in the container, i.e. std::distance(begin(), end()).
Constant.
- Return
- The number of elements in the container.
- Complexity
No-throw guarantee.
- Exceptions
-
size_type
max_size
() const¶ Returns the maximum number of elements the container is able to hold due to system or library implementation limitations, i.e. std::distance(begin(), end()) for the largest container.
This value typically reflects the theoretical limit on the size of the container. At runtime, the size of the container may be limited to a value smaller than max_size() by the amount of RAM available. Constant.
- Return
- The number of elements in the container.
- Complexity
No-throw guarantee.
- Exceptions
-
size_type
capacity
() const¶ Returns the number of elements that the container has currently allocated space for.
This does not operate on underlying concat container, see concat_capacity().
- Return
- The capacity of the currently allocated storage.
- Attention
Constant.
- Complexity
No-throw guarantee.
- Exceptions
-
void
reserve
(size_type const new_cap)¶ Increase the capacity to a value that’s greater or equal to new_cap.
Increase the capacity of the vector to a value that’s greater or equal to new_cap. If new_cap is greater than the current capacity(), new storage is allocated, otherwise the method does nothing. If new_cap is greater than capacity(), all iterators, including the past-the-end iterator, and all references to the elements are invalidated. Otherwise, no iterators or references are invalidated.
- Parameters
new_cap
: The new capacity.
- Exceptions
std::length_error
: If new_cap > max_size().std::exception
: Any exception thrown byAllocator::allocate()
(typicallystd::bad_alloc
).
This does not operate on underlying concat container, see concat_reserve().
- Attention
At most linear in the size() of the container.
- Complexity
Strong exception guarantee (no data is modified in case an exception is thrown).
- Exceptions
-
void
shrink_to_fit
()¶ Requests the removal of unused capacity.
It is a non-binding request to reduce capacity() to size() and concat_capacity() to concat_size(). It depends on the implementation if the request is fulfilled. If reallocation occurs, all iterators, including the past the end iterator, and all references to the elements are invalidated. If no reallocation takes place, no iterators or references are invalidated.
This effects both underlying data structures.
- Attention
At most linear in the size() of the container.
- Complexity
Strong exception guarantee (no data is modified in case an exception is thrown).
- Exceptions
Capacity (concat)
-
size_type
concat_size
() const¶ Returns the cumulative size of all elements in the container.
Constant.
- Return
- The cumulative size of elements in the container.
- Complexity
No-throw guarantee.
- Exceptions
-
size_type
concat_capacity
() const¶ Returns the concatenated size the container has currently allocated space for.
Constant.
- Return
- The capacity of the currently allocated storage.
- Complexity
No-throw guarantee.
- Exceptions
-
void
concat_reserve
(size_type const new_cap)¶ Increase the concat_capacity() to a value that’s greater or equal to new_cap.
Increase the capacity of the underlying concatenated sequence to a value that’s greater or equal to new_cap. If new_cap is greater than the current concat_capacity(), new storage is allocated, otherwise the method does nothing. If new_cap is greater than concat_capacity(), all iterators, including the past-the-end iterator, and all references to the elements are invalidated. Otherwise, no iterators or references are invalidated.
- Parameters
new_cap
: The new capacity.
- Exceptions
std::length_error
: If new_cap > max_size().std::exception
: Any exception thrown byAllocator::allocate()
(typicallystd::bad_alloc
).
At most linear in the concat_size() of the container.
- Complexity
Strong exception guarantee (no data is modified in case an exception is thrown).
- Exceptions
Modifiers
-
void
clear
()¶ Removes all elements from the container.
Constant.
- Return
- The number of elements in the container.
- Complexity
No-throw guarantee.
- Exceptions
- template <typename rng_type>
-
iterator
insert
(const_iterator pos, rng_type &&value)¶ Inserts value before position in the container.
Causes reallocation if the new size() is greater than the old capacity(). If the new size() is greater than capacity(), all iterators and references are invalidated. Otherwise, only the iterators and references before the insertion point remain valid. The past-the-end iterator is also invalidated.
- Return
- Iterator pointing to the inserted value.
- Template Parameters
rng_type
: The type of range to be inserted; must satisfy seqan3::forward_range_concept and have the samevalue_type
asvalue_type
(i.e.value_type
‘svalue_type
!).
- Parameters
pos
: Iterator before which the content will be inserted.pos
may be the end() iterator.value
: Element value to insert.
Worst-case linear in concat_size(). This is a drawback over e.g.
std::vector<std::vector<alphabet>>
.- Complexity
Basic exception guarantee, i.e. guaranteed not to leak, but container my contain invalid data after exceptions is thrown.
- Exceptions
concatenated_sequences<dna4_vector> foobar; foobar.insert(foobar.end(), "ACGT"_dna4); std::cout << foobar[0] << '\n'; // [A, C, G, T]
- Example
- template <typename rng_type>
-
iterator
insert
(const_iterator pos, size_type const count, rng_type &&value)¶ Inserts count copies of value before position in the container.
Causes reallocation if the new size() is greater than the old capacity(). If the new size() is greater than capacity(), all iterators and references are invalidated. Otherwise, only the iterators and references before the insertion point remain valid. The past-the-end iterator is also invalidated.
- Return
- Iterator pointing to the first element inserted, or pos if
count==0
. - Template Parameters
rng_type
: The type of range to be inserted;rng_type
andvalue_type
must satisfy seqan3::compatible_concept.
- Parameters
pos
: Iterator before which the content will be inserted.pos
may be the end() iterator.count
: Number of copies.value
: Element value to insert.
Worst-case linear in concat_size(). This is a drawback over e.g.
std::vector<std::vector<alphabet>>
.- Complexity
Basic exception guarantee, i.e. guaranteed not to leak, but container my contain invalid data after exceptions is thrown.
- Exceptions
concatenated_sequences<dna4_vector> foobar; foobar.insert(foobar.end(), 2, "ACGT"_dna4); std::cout << foobar[0] << '\n'; // [A, C, G, T] std::cout << foobar[1] << '\n'; // [A, C, G, T]
- Example
- template <typename begin_iterator_type, typename end_iterator_type>
-
iterator
insert
(const_iterator pos, begin_iterator_type first, end_iterator_type last)¶ Inserts elements from range
[first, last)
before position in the container.The behaviour is undefined if first and last are iterators into
*this
.- Return
- Iterator pointing to the first element inserted, or pos if
first==last
. - Template Parameters
begin_iterator_type
: Must satisfy seqan3::forward_iterator_concept and satisfy seqan3::compatible_concept withvalue_type
.end_iterator_type
: Must satisfy seqan3::sized_sentinel_concept.
- Parameters
pos
: Iterator before which the content will be inserted.pos
may be the end() iterator.first
: Begin of range to insert.last
: Behind the end of range to insert.
Causes reallocation if the new size() is greater than the old capacity(). If the new size() is greater than capacity(), all iterators and references are invalidated. Otherwise, only the iterators and references before the insertion point remain valid. The past-the-end iterator is also invalidated.
Worst-case linear in concat_size(). This is a drawback over e.g.
std::vector<std::vector<alphabet>>
.- Complexity
Basic exception guarantee, i.e. guaranteed not to leak, but container my contain invalid data after exceptions is thrown.
- Exceptions
- template <typename rng_type>
-
iterator
insert
(const_iterator pos, std::initializer_list<rng_type> const &ilist)¶ Inserts elements from initializer list before position in the container.
Causes reallocation if the new size() is greater than the old capacity(). If the new size() is greater than capacity(), all iterators and references are invalidated. Otherwise, only the iterators and references before the insertion point remain valid. The past-the-end iterator is also invalidated.
- Return
- Iterator pointing to the first element inserted, or pos if
ilist
is empty. - Template Parameters
rng_type
: The type of range to be inserted; must satisfy seqan3::compatible_concept withvalue_type
.
- Parameters
pos
: Iterator before which the content will be inserted.pos
may be the end() iterator.ilist
: Initializer list with values to insert.
Worst-case linear in concat_size(). This is a drawback over e.g.
std::vector<std::vector<alphabet>>
.- Complexity
Basic exception guarantee, i.e. guaranteed not to leak, but container my contain invalid data after exceptions is thrown.
- Exceptions
-
iterator
erase
(const_iterator first, const_iterator last)¶ Removes specified elements from the container.
Invalidates iterators and references at or after the point of the erase, including the end() iterator.
- Return
- Iterator pointing to the first element inserted, or pos if
first==last
. - Parameters
first
: Begin of range to erase.last
: Behind the end of range to erase.
The iterator first does not need to be dereferenceable if first==last: erasing an empty range is a no-op.
Linear in concat_size().
- Complexity
Basic exception guarantee, i.e. guaranteed not to leak, but container my contain invalid data after exceptions is thrown.
- Exceptions
-
iterator
erase
(const_iterator pos)¶ Removes specified elements from the container.
Invalidates iterators and references at or after the point of the erase, including the end() iterator.
- Return
- Iterator pointing to the first element inserted, or pos if
first==last
. - Parameters
pos
: Remove the element at pos.
The iterator pos must be valid and dereferenceable. Thus the end() iterator (which is valid, but is not dereferencable) cannot be used as a value for pos.
Linear in concat_size().
- Complexity
Basic exception guarantee, i.e. guaranteed not to leak, but container my contain invalid data after exceptions is thrown.
- Exceptions
- template <typename rng_type>
-
void
push_back
(rng_type &&value)¶ Appends the given element value to the end of the container.
If the new size() is greater than capacity() then all iterators and references (including the past-the-end iterator) are invalidated. Otherwise only the past-the-end iterator is invalidated.
- Template Parameters
rng_type
: The type of range to be inserted; must satisfy seqan3::compatible_concept withvalue_type
.
- Parameters
value
: The value to append.
Amortised linear in the size of value. Wort-case linear in concat_size().
- Complexity
Basic exception guarantee, i.e. guaranteed not to leak, but container my contain invalid data after exceptions is thrown.
- Exceptions
-
void
pop_back
()¶ Removes the last element of the container.
Calling pop_back on an empty container is undefined. In debug mode an assertion will be thrown.
No iterators or references except for back() and end() are invalidated.
Constant.
- Complexity
No exception is thrown in release mode.
- Exceptions
Strong exception guarantee (no data is modified in case an exception is thrown).
-
void
resize
(size_type const count)¶ Resizes the container to contain count elements.
Increase the size() of the vector to count.
- Parameters
count
: The new size.
- Exceptions
std::length_error
: If count > max_size().std::exception
: Any exception thrown byAllocator::allocate()
(typicallystd::bad_alloc
).
If the current capacity() is smaller than count, new storage is allocated and all iterators, including the past-the-end iterator, and all references to the elements are invalidated. Otherwise only the past-the-end iterator is invalidated.
If the current size is greater than count, the container is reduced to its first count elements. Capacity is never reduced when resizing to smaller size because that would invalidate all iterators, rather than only the ones that would be invalidated by the equivalent sequence of pop_back() calls.
At most linear in the size() of the container.
- Complexity
Only new size: Strong exception guarantee (no data is modified in case an exception is thrown). [only new size]
- Exceptions
New default value: Basic exception guarantee, i.e. guaranteed not to leak, but container my contain bogus data after exceptions is thrown.
- template <typename rng_type>
-
void
resize
(size_type const count, rng_type &&value)¶ Resizes the container to contain count elements.
Increase the size() of the vector to count.
- Template Parameters
rng_type
: The type of range to be inserted;rng_type
andvalue_type
must satisfy seqan3::compatible_concept.
- Parameters
value
: Instead of appending empty containers, append copies of value.count
: The new size.
- Exceptions
std::length_error
: If count > max_size().std::exception
: Any exception thrown byAllocator::allocate()
(typicallystd::bad_alloc
).
If the current capacity() is smaller than count, new storage is allocated and all iterators, including the past-the-end iterator, and all references to the elements are invalidated. Otherwise only the past-the-end iterator is invalidated.
If the current size is greater than count, the container is reduced to its first count elements. Capacity is never reduced when resizing to smaller size because that would invalidate all iterators, rather than only the ones that would be invalidated by the equivalent sequence of pop_back() calls.
At most linear in the size() of the container.
- Complexity
Only new size: Strong exception guarantee (no data is modified in case an exception is thrown). [only new size]
- Exceptions
New default value: Basic exception guarantee, i.e. guaranteed not to leak, but container my contain bogus data after exceptions is thrown.
-
constexpr void
swap
(concatenated_sequences &rhs)¶ Swap contents with another instance.
Constant.
- Complexity
- Parameters
rhs
: The other instance to swap with.
No-throw guarantee.
- Exceptions
-
constexpr void
swap
(concatenated_sequences &&rhs)¶ Swap contents with another instance.
Constant.
- Complexity
- Parameters
rhs
: The other instance to swap with.
No-throw guarantee.
- Exceptions
Comparison operators
-
constexpr bool
operator==
(concatenated_sequences const &rhs) const¶
-
constexpr bool
operator!=
(concatenated_sequences const &rhs) const¶
-
constexpr bool
operator<
(concatenated_sequences const &rhs) const¶
-
constexpr bool
operator>
(concatenated_sequences const &rhs) const¶
-
constexpr bool
operator<=
(concatenated_sequences const &rhs) const¶
-
constexpr bool
operator>=
(concatenated_sequences const &rhs) const¶
Adaptations of concepts from the standard library.
- 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).
-
concept bool seqan3::container_concept
The (most general) container concept as defined by the standard library.
The container concept is modelled exactly as in the STL.
- Attention
- Other than one might expect,
std::forward_list
does not satisfy this concept (because it does not provide.size()
).
-
concept bool seqan3::sequence_concept
A more refined container concept than seqan3::container_concept.
Includes constraints on constructors,
assign()
,.insert()
,.erase()
,.push_back()
,.pop_back
,.clear()
,.size()
,front()
and.back()
member functions with corresponding signatures. Models the subset of the STL SequenceContainerConcept that is supported bystd::list
,std::vector
,std::deque
,std::basic_string
.- Attention
std::array
andstd::forward_list
do not satisfy this concept.
-
concept bool seqan3::random_access_sequence_concept
= requires (type val) { requires sequence_concept<type>; { val[0] } -> typename type::reference; { val.at(0) } -> typename type::reference; { val.resize(0) } -> void; { val.resize(0, typename type::value_type{}) } -> void; } A more refined container concept than seqan3::sequence_concept.
Adds requirements for
.at()
,.resize()
and the subscript operator[]
. Models the subset of the STL SequenceContainerConcept that is supported bystd::vector
,std::deque
andstd::basic_string
.- Attention
std::array
,std::forward_list
andstd::list
do not satisfy this concept.
-
concept bool seqan3::reservable_sequence_concept
= requires (type val) { requires random_access_sequence_concept<type>; { val.capacity() } -> typename type::size_type; { val.reserve(0) } -> void; { val.shrink_to_fit() } -> void; } A more refined container concept than seqan3::random_access_sequence_concept.
Adds requirements for
.reserve()
. Satisfied bystd::vector
andstd::basic_string
.- Attention
std::array
,std::forward_list
,std::list
andstd::deque
do not satisfy this concept.
Container-of-container concepts
Shortcuts for multi-dimensional container concepts.
-
concept bool seqan3::container_of_container_concept
= requires (type val) { requires container_concept<type>; requires container_concept<typename type::value_type>; } A multi-dimensional seqan3::container_concept.
Requires that both the type and it’s
value_type
fulfill seqan3::container_concept.
-
concept bool seqan3::sequence_of_sequence_concept
= requires (type val) { requires sequence_concept<type>; requires sequence_concept<typename type::value_type>; } A multi-dimensional seqan3::sequence_concept.
Requires that both the type and it’s
value_type
fulfill seqan3::sequence_concept.
-
concept bool seqan3::ra_sequence_of_ra_sequence_concept
= requires (type val) { requires random_access_sequence_concept<type>; requires random_access_sequence_concept<typename type::value_type>; } A multi-dimensional seqan3::random_access_sequence_concept.
Requires that both the type and it’s
value_type
fulfill seqan3::random_access_sequence_concept.
-
Detail¶
Provides the seqan3::detail::random_access_iterator class.
- Author
- Marie Hoffmann <marie.hoffmann AT fu-berlin.de>
View¶
Meta-header for the view submodule .
- Author
- Hannes Hauswedell <hannes.hauswedell AT fu-berlin.de>
-
namespace
view
¶ The SeqAn3 namespace for views.
Since views often have name clashes with regular functions and ranges they are implemented in the sub namespace
view
.See the view submodule of the range module for more details.
Provides seqan3::view::char_to.
- Author
- Hannes Hauswedell <hannes.hauswedell AT fu-berlin.de>
-
namespace
view
¶ The SeqAn3 namespace for views.
Since views often have name clashes with regular functions and ranges they are implemented in the sub namespace
view
.See the view submodule of the range module for more details.
Variables
-
auto const
char_to
¶ A view over an alphabet, given a range of characters.
- Return
- A view over alphabet_type, created from it’s character representation.
- View properties
- view type: same input_range
- value type: alphabet_type
const
iterable: yes
- Complexity
- Linear in the size if the input range (
).
- Exceptions
- Strong exception guarantee (does not modify data).
- Thread safety
- Does not modify data.
- Example
std::string s{"ACTTTGATAN"}; auto v1 = s | view::char_to<dna4>; // == "ACTTTGATAA"_dna4 auto v2 = s | view::char_to<dna5>; // == "ACTTTGATAN"_dna5
- Template Parameters
alphabet_type
: The type of the desired alphabet, must satisfy seqan3::alphabet_concept.
- Parameters
input_range
: The range you wish to convert, elements must be convertible to alphabet_type’s seqan3::underlying_char_t.
-
auto const
Provides seqan3::view::complement.
- Author
- Hannes Hauswedell <hannes.hauswedell AT fu-berlin.de>
-
namespace
view
The SeqAn3 namespace for views.
Since views often have name clashes with regular functions and ranges they are implemented in the sub namespace
view
.See the view submodule of the range module for more details.
Variables
-
auto const
complement
¶ A view that converts a range of nucleotides to their complement.
dna5_vector foo{"ACGTA"_dna5}; // pipe notation auto v = foo | view::complement; // == "TGCAT" // function notation dna5_vector v2(view::complement(foo)); // == "TGCAT" // generate the reverse complement: dna5_vector v3 = foo | view::complement | ranges::view::reverse; // == "TACGT"
- View properties
- view type: same as input_range
- value type: remove_reference_t<value_type_t<input_range>>
const
iterable: yes
- Complexity
- Linear in the size if the input range (
).
- Exceptions
- Strong exception guarantee (does not modify data).
- Thread safety
- Does not modify data.
- Example
- Parameters
input_range
: The range you wish to convert, must satisfy seqan3::input_range_concept and the value_type must satisfy seqan3::nucleotide_concept.
-
auto const
Adaptation of the view concept from the Ranges TS.
- 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.
Variables
-
concept bool seqan3::view_concept
= range_concept<type> && (bool)ranges::View<type>() Specifies the requirements of a Range type that has constant time copy, move and assignment operators.
-
Provides seqan3::view::convert.
- Author
- Hannes Hauswedell <hannes.hauswedell AT fu-berlin.de>
-
namespace
view
The SeqAn3 namespace for views.
Since views often have name clashes with regular functions and ranges they are implemented in the sub namespace
view
.See the view submodule of the range module for more details.
Variables
-
auto const
convert
¶ A view that converts each element in the input range (implicitly or via
static_cast
).Convert from
int
tobool
:// convert from int to bool std::vector<int> vec{7, 5, 0, 5, 0, 0, 4, 8, -3}; // pipe notation auto v = vec | view::convert<bool>; // == [1, 1, 0, 1, 0, 0, 1, 1, 1]; // function notation and immediate conversion to vector again std::vector<bool> v2(view::convert<bool>(vec)); // combinability auto v3 = vec | view::convert<bool> | ranges::view::reverse; // == [1, 1, 1, 0, 0, 1, 0, 1, 1];
- Return
- A view with the value_type being
out_t
- View properties
- view type: same input_range
- value type: out_t
const
iterable: yes
- Complexity
- Linear in the size if the input range (
).
- Exceptions
- Strong exception guarantee (does not modify data).
- Thread safety
- Does not modify data.
- Example
- Template Parameters
out_t
: The type to convert to (must be given).
- Parameters
input_range
: The range you wish to convert, must satisfy seqan3::input_range_concept.
Convert from seqan3::nucl16 to seqan3::dna5:
nucl16_vector vec2{"ACYGTN"_nucl16}; auto v4 = vec2 | view::convert<dna5>; // == "ACNGTN"_dna5
-
auto const
Provides seqan3::view::rank_to.
- Author
- Hannes Hauswedell <hannes.hauswedell AT fu-berlin.de>
-
namespace
view
The SeqAn3 namespace for views.
Since views often have name clashes with regular functions and ranges they are implemented in the sub namespace
view
.See the view submodule of the range module for more details.
Variables
-
auto const
rank_to
¶ A view over an alphabet, given a range of ranks.
- Return
- A view over alphabet_type, created from it’s rank representation.
- View properties
- view type: same input_range
- value type: alphabet_type
const
iterable: yes
- Complexity
- Linear in the size if the input range (
).
- Exceptions
- Strong exception guarantee (does not modify data).
- Thread safety
- Does not modify data.
- Example
std::vector<int> vec{0, 1, 3, 3, 3, 2, 0, 3, 0}; auto v1 = vec | view::rank_to<dna4>; // == "ACTTTGATA"_dna4 auto v2 = vec | view::rank_to<dna5>; // == "ACTTTGATA"_dna5
- Template Parameters
alphabet_type
: The type of the desired alphabet, must satisfy seqan3::alphabet_concept.
- Parameters
input_range
: The range you wish to convert, elements be must convertible to alphabet_type’s seqan3::underlying_rank_t.
-
auto const
Provides seqan3::view::to_char.
- Author
- Hannes Hauswedell <hannes.hauswedell AT fu-berlin.de>
-
namespace
view
The SeqAn3 namespace for views.
Since views often have name clashes with regular functions and ranges they are implemented in the sub namespace
view
.See the view submodule of the range module for more details.
Variables
-
auto const
to_char
¶ A view that calls seqan3::to_char() on each element in the input range.
- Return
- A view with the value_type being seqan3::underlying_char_t of the input alphabet.
- View properties
- view type: same input_range
- value type: seqan3::underlying_char_t of the input’s value_type
const
iterable: yes
- Complexity
- Linear in the size if the input range (
).
- Exceptions
- Strong exception guarantee (does not modify data).
- Thread safety
- Does not modify data.
- Example
dna4_vector vec = "ACTTTGATA"_dna4; auto v = vec | view::to_char; std::cout << v << '\n'; // [A,C,T,T,T,G,A,T,A] std::vector<illumina18> qvec{{0}, {7}, {5}, {3}, {7}, {4}, {30}, {16}, {23}}; auto v3 = qvec | view::to_char; std::cout << v3 << '\n'; // [!,(,&,$,(,%,?,1,8] std::vector<dna4q> qcvec{{dna4::C, 0}, {dna4::A, 7}, {dna4::G, 5}, {dna4::T, 3}, {dna4::G, 7}, {dna4::A, 4}, {dna4::C, 30}, {dna4::T, 16}, {dna4::A, 23}}; auto v4 = qcvec | view::to_char; std::cout << v4 << '\n'; // [C,A,G,T,G,A,C,T,A]
- Parameters
input_range
: The range you wish to convert, must satisfy seqan3::input_range_concept and the value_type must satisfy seqan3::alphabet_concept.
-
auto const
Provides seqan3::view::to_rank.
- Author
- Hannes Hauswedell <hannes.hauswedell AT fu-berlin.de>
-
namespace
view
The SeqAn3 namespace for views.
Since views often have name clashes with regular functions and ranges they are implemented in the sub namespace
view
.See the view submodule of the range module for more details.
Variables
-
auto const
to_rank
¶ A view that calls seqan3::to_rank() on each element in the input range.
- Return
- A view with the value_type being seqan3::underlying_rank_t of the input alphabet.
- View properties
- view type: same input_range
- value type: seqan3::underlying_rank_t of the input’s value_type
const
iterable: yes
- Complexity
- Linear in the size if the input range (
).
- Exceptions
- Strong exception guarantee (does not modify data).
- Thread safety
- Does not modify data.
- Example
- We also convert to unsigned here, because the seqan3::underlying_rank_t is often
dna4_vector vec = "ACTTTGATA"_dna4; auto v = vec | view::to_rank | view::convert<unsigned>; std::cout << v << '\n'; // [0,1,3,3,3,2,0,3,0] std::vector<illumina18> qvec{{0}, {7}, {5}, {3}, {7}, {4}, {30}, {16}, {23}}; auto v3 = qvec | view::to_rank | view::convert<unsigned>; std::cout << v3 << '\n'; // [0,7,5,3,7,4,30,16,23] std::vector<dna4q> qcvec{{dna4::C, 0}, {dna4::A, 7}, {dna4::G, 5}, {dna4::T, 3}, {dna4::G, 7}, {dna4::A, 4}, {dna4::C, 30}, {dna4::T, 16}, {dna4::A, 23}}; auto v4 = qcvec | view::to_rank | view::convert<unsigned>; std::cout << v4 << '\n'; // [1,28,22,15,30,16,121,67,92]
uint8_t
which is often implemented asunsigned char
and thus will not be printed as a number by default. - Parameters
input_range
: The range you wish to convert, must satisfy seqan3::input_range_concept and the value_type must satisfy seqan3::alphabet_concept.
-
auto const