SeqAn3  3.2.0
The Modern C++ library for sequence analysis.
phred68solexa.hpp
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------------------------------
2 // Copyright (c) 2006-2022, Knut Reinert & Freie Universität Berlin
3 // Copyright (c) 2016-2022, 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  // Inherit converting constructor
63  using base_t::base_t;
65 
73  static constexpr phred_type offset_phred{-5};
74 
79  static constexpr char_type offset_char{';'};
81 };
82 
83 inline namespace literals
84 {
85 
99 constexpr phred68solexa operator""_phred68solexa(char const c) noexcept
100 {
101  return phred68solexa{}.assign_char(c);
102 }
103 
115 inline std::vector<phred68solexa> operator""_phred68solexa(char const * s, std::size_t n)
116 {
118  r.resize(n);
119 
120  for (size_t i = 0; i < n; ++i)
121  r[i].assign_char(s[i]);
122 
123  return r;
124 }
126 
127 } // namespace literals
128 
129 } // namespace seqan3
A CRTP-base that makes defining a custom alphabet easier.
Definition: alphabet_base.hpp:57
constexpr derived_type & assign_char(char_type const chr) noexcept requires(!std
Assign from a character, implicitly converts invalid characters.
Definition: alphabet_base.hpp:163
Quality type for Solexa and deprecated Illumina formats.
Definition: phred68solexa.hpp:40
static constexpr phred_type offset_phred
The projection offset between Phred and rank score representation.
Definition: phred68solexa.hpp:73
static constexpr char_type offset_char
The projection offset between char and rank score representation.
Definition: phred68solexa.hpp:79
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
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.
T resize(T... args)