SeqAn3  3.0.3
The Modern C++ library for sequence analysis.
phred68solexa.hpp
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------------------------------
2 // Copyright (c) 2006-2021, Knut Reinert & Freie Universität Berlin
3 // Copyright (c) 2016-2021, Knut Reinert & MPI für molekulare Genetik
4 // This file may be used, modified and/or redistributed under the terms of the 3-clause BSD-License
5 // shipped with this file and also available at: https://github.com/seqan/seqan3/blob/master/LICENSE.md
6 // -----------------------------------------------------------------------------------------------------
7 
13 #pragma once
14 
16 
17 namespace seqan3
18 {
19 
39 class phred68solexa : public phred_base<phred68solexa, 68>
40 {
41 private:
44 
46  friend base_t;
48  friend base_t::base_t;
50 
51 public:
55  constexpr phred68solexa() noexcept = default;
56  constexpr phred68solexa(phred68solexa const &) noexcept = default;
57  constexpr phred68solexa(phred68solexa &&) noexcept = default;
58  constexpr phred68solexa & operator=(phred68solexa const &) noexcept = default;
59  constexpr phred68solexa & operator=(phred68solexa &&) noexcept = default;
60  ~phred68solexa() noexcept = default;
61 
62 #ifdef SEQAN3_DEPRECATED_310
68  {
69  assign_phred(p);
70  }
71 #endif // SEQAN3_DEPRECATED_310
72 
73  // Inherit converting constructor
74  using base_t::base_t;
76 
84  static constexpr phred_type offset_phred{-5};
85 
90  static constexpr char_type offset_char{';'};
92 };
93 
94 #ifdef SEQAN3_DEPRECATED_310
97 #endif // SEQAN3_DEPRECATED_310
98 
99 inline namespace literals
100 {
101 
115 constexpr phred68solexa operator""_phred68solexa(char const c) noexcept
116 {
117  return phred68solexa{}.assign_char(c);
118 }
119 
131 inline std::vector<phred68solexa> operator""_phred68solexa(char const * s, std::size_t n)
132 {
134  r.resize(n);
135 
136  for (size_t i = 0; i < n; ++i)
137  r[i].assign_char(s[i]);
138 
139  return r;
140 }
141 
142 #ifdef SEQAN3_DEPRECATED_310
144 SEQAN3_DEPRECATED_310 constexpr phred68solexa operator""_phred68legacy(char const c) noexcept
145 {
146  return seqan3::operator""_phred68solexa(c);
147 }
148 
150 SEQAN3_DEPRECATED_310 inline std::vector<phred68solexa> operator""_phred68legacy(char const * s, size_t n)
151 {
152  return seqan3::operator""_phred68solexa(s, n);
153 }
154 #endif // SEQAN3_DEPRECATED_310
156 
157 } // inline namespace literals
158 
159 } // namespace seqan3
A CRTP-base that makes defining a custom alphabet easier.
Definition: alphabet_base.hpp:81
constexpr derived_type & assign_char(char_type const chr) noexcept
Assign from a character, implicitly converts invalid characters.
Definition: alphabet_base.hpp:211
Quality type for Solexa and deprecated Illumina formats.
Definition: phred68solexa.hpp:40
constexpr phred68solexa(phred_type const p)
Allow construction from the Phred score value.
Definition: phred68solexa.hpp:67
static constexpr phred_type offset_phred
The projection offset between Phred and rank score representation.
Definition: phred68solexa.hpp:84
static constexpr char_type offset_char
The projection offset between char and rank score representation.
Definition: phred68solexa.hpp:90
constexpr phred68solexa() noexcept=default
Defaulted.
A CRTP-base that refines seqan3::alphabet_base and is used by the quality alphabets.
Definition: phred_base.hpp:31
constexpr phred68solexa & assign_phred(phred_type const p) noexcept
Assign from the numeric Phred score value.
Definition: phred_base.hpp:137
int8_t phred_type
The integer representation of the quality score.
Definition: phred_base.hpp:40
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
Provides seqan3::phred42 quality scores.
#define SEQAN3_DEPRECATED_310
Deprecation message for SeqAn 3.1.0 release.
Definition: platform.hpp:203
T resize(T... args)