SeqAn3  3.0.1
The Modern C++ library for sequence analysis.
phred68legacy.hpp
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------------------------------
2 // Copyright (c) 2006-2020, Knut Reinert & Freie Universität Berlin
3 // Copyright (c) 2016-2020, 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 // ------------------------------------------------------------------
18 // phred68legacy
19 // ------------------------------------------------------------------
20 
21 namespace seqan3
22 {
23 
41 class phred68legacy : public quality_base<phred68legacy, 68>
42 {
43 private:
46 
48  friend base_t;
50  friend base_t::base_t;
52 
53 public:
57  constexpr phred68legacy() noexcept = default;
58  constexpr phred68legacy(phred68legacy const &) noexcept = default;
59  constexpr phred68legacy(phred68legacy &&) noexcept = default;
60  constexpr phred68legacy & operator=(phred68legacy const &) noexcept = default;
61  constexpr phred68legacy & operator=(phred68legacy &&) noexcept = default;
62  ~phred68legacy() noexcept = default;
63 
65  constexpr phred68legacy(phred_type const p) : base_t{p} {}
66 
67  // Inherit converting constructor
68  using base_t::base_t;
70 
74  static constexpr phred_type offset_phred{-5};
76 
78  static constexpr char_type offset_char{';'};
80 };
81 
89 constexpr phred68legacy operator""_phred68legacy(char const c) noexcept
90 {
91  return phred68legacy{}.assign_char(c);
92 }
93 
104 inline std::vector<phred68legacy> operator""_phred68legacy(char const * s, std::size_t n)
105 {
107  r.resize(n);
108 
109  for (size_t i = 0; i < n; ++i)
110  r[i].assign_char(s[i]);
111 
112  return r;
113 }
115 
116 } // namespace seqan3
std::vector::resize
T resize(T... args)
seqan3::phred68legacy::~phred68legacy
~phred68legacy() noexcept=default
Defaulted.
seqan3::phred68legacy::offset_char
static constexpr char_type offset_char
The projection offset between char and rank score representation.
Definition: phred68legacy.hpp:78
seqan3::phred68legacy::operator=
constexpr phred68legacy & operator=(phred68legacy const &) noexcept=default
Defaulted.
seqan3::phred68legacy
Quality type for Solexa and deprecated Illumina formats.
Definition: phred68legacy.hpp:41
std::vector
seqan3::alphabet_base< phred68legacy, size, char >
seqan3::quality_base< phred68legacy, 68 >::phred_type
int8_t phred_type
The integer representation of a quality score assignable with =operator.
Definition: quality_base.hpp:35
quality_base.hpp
Provides seqan3::phred42 quality scores.
seqan3::phred68legacy::phred68legacy
constexpr phred68legacy(phred_type const p)
Construct from phred value.
Definition: phred68legacy.hpp:65
seqan3::alphabet_base::assign_char
constexpr derived_type & assign_char(char_type const c) noexcept
Assign from a character, implicitly converts invalid characters.
Definition: alphabet_base.hpp:140
seqan3::phred68legacy::phred68legacy
constexpr phred68legacy() noexcept=default
Defaulted.
seqan3
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:36
seqan3::quality_base
A CRTP-base that refines seqan3::alphabet_base and is used by the quality alphabets.
Definition: quality_base.hpp:28
std::size_t
std::conditional_t
seqan3::phred68legacy::offset_phred
static constexpr phred_type offset_phred
The projection offset between phred and rank score representation.
Definition: phred68legacy.hpp:75