36char constexpr sam_tag_type_char[12] = {
'A',
'i',
'f',
'Z',
'H',
'B',
'B',
'B',
'B',
'B',
'B',
'B'};
39char constexpr sam_tag_type_char_extra[12] = {
'\0',
'\0',
'\0',
'\0',
'\0',
'c',
'C',
's',
'S',
'i',
'I',
'f'};
45inline namespace literals
68#ifdef __cpp_nontype_template_parameter_class
69template <small_
string<2> str>
70constexpr uint16_t
operator""_tag()
73#pragma GCC diagnostic push
74#pragma GCC diagnostic ignored "-Wpedantic"
75template <
typename char_t, char_t ...s>
76constexpr uint16_t
operator""_tag()
78 static_assert(std::same_as<char_t, char>,
"Illegal SAM tag: Type must be char.");
80#pragma GCC diagnostic pop
83 static_assert(str.size() == 2,
"Illegal SAM tag: Exactly two characters must be given.");
85 char constexpr char0 = str[0];
86 char constexpr char1 = str[1];
89 "Illegal SAM tag: a SAM tag must match /[A-Za-z][A-Za-z0-9]/.");
91 return static_cast<uint16_t
>(char0) * 256 +
static_cast<uint16_t
>(char1);
174template <u
int16_t tag_value>
183template <u
int16_t tag_value>
188template <>
struct sam_tag_type<"AS"_tag> {
using type = int32_t; };
189template <>
struct sam_tag_type<"BC"_tag> {
using type =
std::string; };
190template <>
struct sam_tag_type<"BQ"_tag> {
using type =
std::string; };
191template <>
struct sam_tag_type<"BZ"_tag> {
using type =
std::string; };
192template <>
struct sam_tag_type<"CB"_tag> {
using type =
std::string; };
193template <>
struct sam_tag_type<"CC"_tag> {
using type =
std::string; };
195template <>
struct sam_tag_type<"CM"_tag> {
using type = int32_t; };
196template <>
struct sam_tag_type<"CO"_tag> {
using type =
std::string; };
197template <>
struct sam_tag_type<"CP"_tag> {
using type = int32_t; };
198template <>
struct sam_tag_type<"CQ"_tag> {
using type =
std::string; };
199template <>
struct sam_tag_type<"CR"_tag> {
using type =
std::string; };
200template <>
struct sam_tag_type<"CS"_tag> {
using type =
std::string; };
201template <>
struct sam_tag_type<"CT"_tag> {
using type =
std::string; };
202template <>
struct sam_tag_type<"CY"_tag> {
using type =
std::string; };
203template <>
struct sam_tag_type<"E2"_tag> {
using type =
std::string; };
204template <>
struct sam_tag_type<"FI"_tag> {
using type = int32_t; };
205template <>
struct sam_tag_type<"FS"_tag> {
using type =
std::string; };
212template <>
struct sam_tag_type<"H0"_tag> {
using type = int32_t; };
213template <>
struct sam_tag_type<"H1"_tag> {
using type = int32_t; };
214template <>
struct sam_tag_type<"H2"_tag> {
using type = int32_t; };
215template <>
struct sam_tag_type<"HI"_tag> {
using type = int32_t; };
216template <>
struct sam_tag_type<"IH"_tag> {
using type = int32_t; };
217template <>
struct sam_tag_type<"LB"_tag> {
using type =
std::string; };
218template <>
struct sam_tag_type<"MC"_tag> {
using type =
std::string; };
219template <>
struct sam_tag_type<"MD"_tag> {
using type =
std::string; };
223template <>
struct sam_tag_type<"MI"_tag> {
using type =
std::string; };
224template <>
struct sam_tag_type<"MQ"_tag> {
using type = int32_t; };
225template <>
struct sam_tag_type<"NH"_tag> {
using type = int32_t; };
226template <>
struct sam_tag_type<"NM"_tag> {
using type = int32_t; };
227template <>
struct sam_tag_type<"OC"_tag> {
using type =
std::string; };
228template <>
struct sam_tag_type<"OP"_tag> {
using type = int32_t; };
229template <>
struct sam_tag_type<"OQ"_tag> {
using type =
std::string; };
230template <>
struct sam_tag_type<"OX"_tag> {
using type =
std::string; };
231template <>
struct sam_tag_type<"PG"_tag> {
using type =
std::string; };
232template <>
struct sam_tag_type<"PQ"_tag> {
using type = int32_t; };
233template <>
struct sam_tag_type<"PT"_tag> {
using type =
std::string; };
234template <>
struct sam_tag_type<"PU"_tag> {
using type =
std::string; };
235template <>
struct sam_tag_type<"Q2"_tag> {
using type =
std::string; };
236template <>
struct sam_tag_type<"QT"_tag> {
using type =
std::string; };
237template <>
struct sam_tag_type<"QX"_tag> {
using type =
std::string; };
238template <>
struct sam_tag_type<"R2"_tag> {
using type =
std::string; };
239template <>
struct sam_tag_type<"RG"_tag> {
using type =
std::string; };
240template <>
struct sam_tag_type<"RT"_tag> {
using type =
std::string; };
241template <>
struct sam_tag_type<"RX"_tag> {
using type =
std::string; };
245template <>
struct sam_tag_type<"SA"_tag> {
using type =
std::string; };
246template <>
struct sam_tag_type<"SM"_tag> {
using type = int32_t; };
250template <>
struct sam_tag_type<"TC"_tag> {
using type = int32_t; };
251template <>
struct sam_tag_type<"U2"_tag> {
using type =
std::string; };
252template <>
struct sam_tag_type<"UQ"_tag> {
using type = int32_t; };
361 template <u
int16_t tag>
363 requires (!std::same_as<sam_tag_type_t<tag>,
variant_type>)
367 if ((*this).count(tag) == 0)
368 (*
this)[tag] = sam_tag_type_t<tag>{};
370 return std::get<sam_tag_type_t<tag>>((*this)[tag]);
374 template <u
int16_t tag>
376 requires (!std::same_as<sam_tag_type_t<tag>, variant_type>)
380 if ((*this).count(tag) == 0)
381 (*
this)[tag] = sam_tag_type_t<tag>{};
383 return std::get<sam_tag_type_t<tag>>(std::move((*
this)[tag]));
388 template <u
int16_t tag>
390 requires (!std::same_as<sam_tag_type_t<tag>, variant_type>)
392 auto const &
get()
const &
394 return std::get<sam_tag_type_t<tag>>((*this).at(tag));
399 template <u
int16_t tag>
401 requires (!std::same_as<sam_tag_type_t<tag>, variant_type>)
403 auto const &&
get()
const &&
405 return std::get<sam_tag_type_t<tag>>(std::move((*this).at(tag)));
The SAM tag dictionary class that stores all optional SAM fields.
Definition: sam_tag_dictionary.hpp:336
auto && get() &&
Uses std::map::operator[] for access and default initializes new keys.
Definition: sam_tag_dictionary.hpp:378
auto const & get() const &
Uses std::map::at() for access and throws when the key is unknown.
Definition: sam_tag_dictionary.hpp:392
auto const && get() const &&
Uses std::map::at() for access and throws when the key is unknown.
Definition: sam_tag_dictionary.hpp:403
auto & get() &
Uses std::map::operator[] for access and default initializes new keys.
Definition: sam_tag_dictionary.hpp:365
Implements a small string that can be used for compile time computations.
Definition: small_string.hpp:44
std::variant< char, int32_t, float, std::string, std::vector< std::byte >, std::vector< int8_t >, std::vector< uint8_t >, std::vector< int16_t >, std::vector< uint16_t >, std::vector< int32_t >, std::vector< uint32_t >, std::vector< float > > sam_tag_variant
std::variant of allowed types for optional tag fields of the SAM format.
Definition: sam_tag_dictionary.hpp:32
char constexpr sam_tag_type_char[12]
Each SAM tag type char identifier. Index corresponds to the seqan3::detail::sam_tag_variant types.
Definition: sam_tag_dictionary.hpp:36
char constexpr sam_tag_type_char_extra[12]
Each types SAM tag type extra char id. Index corresponds to the seqan3::detail::sam_tag_variant types...
Definition: sam_tag_dictionary.hpp:39
auto constexpr is_alpha
Checks whether c is a alphabetical character.
Definition: predicate.hpp:221
auto constexpr is_alnum
Checks whether c is a alphanumeric character.
Definition: predicate.hpp:202
The internal SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
Provides character predicates for tokenisation.
A constexpr string implementation to manipulate string literals at compile time.
The generic base class.
Definition: sam_tag_dictionary.hpp:176
typename sam_tag_type< tag_value >::type sam_tag_type_t
Short cut helper for seqan3::sam_tag_type::type.
Definition: sam_tag_dictionary.hpp:184
Provides type traits for working with templates.