24 namespace seqan3::detail
37 char constexpr sam_tag_type_char[12] = {
'A',
'i',
'f',
'Z',
'H',
'B',
'B',
'B',
'B',
'B',
'B',
'B'};
40 char constexpr sam_tag_type_char_extra[12] = {
'\0',
'\0',
'\0',
'\0',
'\0',
'c',
'C',
's',
'S',
'i',
'I',
'f'};
46 inline namespace literals
69 #ifdef __cpp_nontype_template_parameter_class
70 template <small_
string<2> str>
71 constexpr uint16_t
operator""_tag()
74 #pragma GCC diagnostic push
75 #pragma GCC diagnostic ignored "-Wpedantic"
76 template <
typename char_t, char_t ...s>
77 constexpr uint16_t
operator""_tag()
79 static_assert(std::same_as<char_t, char>,
"Illegal SAM tag: Type must be char.");
81 #pragma GCC diagnostic pop
84 static_assert(str.size() == 2,
"Illegal SAM tag: Exactly two characters must be given.");
86 char constexpr char0 = str[0];
87 char constexpr char1 = str[1];
90 "Illegal SAM tag: a SAM tag must match /[A-Za-z][A-Za-z0-9]/.");
92 return static_cast<uint16_t
>(char0) * 256 +
static_cast<uint16_t
>(char1);
174 template <u
int16_t tag_value>
183 template <u
int16_t tag_value>
188 template <>
struct sam_tag_type<"AS"_tag> {
using type = int32_t; };
189 template <>
struct sam_tag_type<"BC"_tag> {
using type =
std::string; };
190 template <>
struct sam_tag_type<"BQ"_tag> {
using type =
std::string; };
191 template <>
struct sam_tag_type<"BZ"_tag> {
using type =
std::string; };
192 template <>
struct sam_tag_type<"CB"_tag> {
using type =
std::string; };
193 template <>
struct sam_tag_type<"CC"_tag> {
using type =
std::string; };
195 template <>
struct sam_tag_type<"CM"_tag> {
using type = int32_t; };
196 template <>
struct sam_tag_type<"CO"_tag> {
using type =
std::string; };
197 template <>
struct sam_tag_type<"CP"_tag> {
using type = int32_t; };
198 template <>
struct sam_tag_type<"CQ"_tag> {
using type =
std::string; };
199 template <>
struct sam_tag_type<"CR"_tag> {
using type =
std::string; };
200 template <>
struct sam_tag_type<"CS"_tag> {
using type =
std::string; };
201 template <>
struct sam_tag_type<"CT"_tag> {
using type =
std::string; };
202 template <>
struct sam_tag_type<"CY"_tag> {
using type =
std::string; };
203 template <>
struct sam_tag_type<"E2"_tag> {
using type =
std::string; };
204 template <>
struct sam_tag_type<"FI"_tag> {
using type = int32_t; };
205 template <>
struct sam_tag_type<"FS"_tag> {
using type =
std::string; };
212 template <>
struct sam_tag_type<"H0"_tag> {
using type = int32_t; };
213 template <>
struct sam_tag_type<"H1"_tag> {
using type = int32_t; };
214 template <>
struct sam_tag_type<"H2"_tag> {
using type = int32_t; };
215 template <>
struct sam_tag_type<"HI"_tag> {
using type = int32_t; };
216 template <>
struct sam_tag_type<"IH"_tag> {
using type = int32_t; };
217 template <>
struct sam_tag_type<"LB"_tag> {
using type =
std::string; };
218 template <>
struct sam_tag_type<"MC"_tag> {
using type =
std::string; };
219 template <>
struct sam_tag_type<"MD"_tag> {
using type =
std::string; };
223 template <>
struct sam_tag_type<"MI"_tag> {
using type =
std::string; };
224 template <>
struct sam_tag_type<"MQ"_tag> {
using type = int32_t; };
225 template <>
struct sam_tag_type<"NH"_tag> {
using type = int32_t; };
226 template <>
struct sam_tag_type<"NM"_tag> {
using type = int32_t; };
227 template <>
struct sam_tag_type<"OC"_tag> {
using type =
std::string; };
228 template <>
struct sam_tag_type<"OP"_tag> {
using type = int32_t; };
229 template <>
struct sam_tag_type<"OQ"_tag> {
using type =
std::string; };
230 template <>
struct sam_tag_type<"OX"_tag> {
using type =
std::string; };
231 template <>
struct sam_tag_type<"PG"_tag> {
using type =
std::string; };
232 template <>
struct sam_tag_type<"PQ"_tag> {
using type = int32_t; };
233 template <>
struct sam_tag_type<"PT"_tag> {
using type =
std::string; };
234 template <>
struct sam_tag_type<"PU"_tag> {
using type =
std::string; };
235 template <>
struct sam_tag_type<"Q2"_tag> {
using type =
std::string; };
236 template <>
struct sam_tag_type<"QT"_tag> {
using type =
std::string; };
237 template <>
struct sam_tag_type<"QX"_tag> {
using type =
std::string; };
238 template <>
struct sam_tag_type<"R2"_tag> {
using type =
std::string; };
239 template <>
struct sam_tag_type<"RG"_tag> {
using type =
std::string; };
240 template <>
struct sam_tag_type<"RT"_tag> {
using type =
std::string; };
241 template <>
struct sam_tag_type<"RX"_tag> {
using type =
std::string; };
245 template <>
struct sam_tag_type<"SA"_tag> {
using type =
std::string; };
246 template <>
struct sam_tag_type<"SM"_tag> {
using type = int32_t; };
250 template <>
struct sam_tag_type<"TC"_tag> {
using type = int32_t; };
251 template <>
struct sam_tag_type<"U2"_tag> {
using type =
std::string; };
252 template <>
struct sam_tag_type<"UQ"_tag> {
using type = int32_t; };
359 template <u
int16_t tag>
361 requires (!std::same_as<sam_tag_type_t<tag>,
variant_type>)
365 if ((*this).count(tag) == 0)
366 (*this)[tag] = sam_tag_type_t<tag>{};
368 return std::get<sam_tag_type_t<tag>>((*this)[tag]);
372 template <u
int16_t tag>
374 requires (!std::same_as<sam_tag_type_t<tag>, variant_type>)
378 if ((*this).count(tag) == 0)
379 (*this)[tag] = sam_tag_type_t<tag>{};
381 return std::get<sam_tag_type_t<tag>>(std::move((*
this)[tag]));
386 template <u
int16_t tag>
388 requires (!std::same_as<sam_tag_type_t<tag>, variant_type>)
390 auto const &
get() const &
392 return std::get<sam_tag_type_t<tag>>((*this).at(tag));
397 template <u
int16_t tag>
399 requires (!std::same_as<sam_tag_type_t<tag>, variant_type>)
401 auto const &&
get() const &&
403 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:334
Implements a small string that can be used for compile time computations.
Definition: small_string.hpp:44
Provides concepts for core language types and relations that don't have concepts in C++20 (yet).
constexpr auto is_alnum
Checks whether c is a alphanumeric character.
Definition: predicate.hpp:202
constexpr auto is_alpha
Checks whether c is a alphabetical character.
Definition: predicate.hpp:221
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
constexpr auto const & get(configuration< configs_t... > const &config) noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: configuration.hpp:429
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.