SeqAn3 3.4.3-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
phred94.hpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2006-2026 Knut Reinert & Freie Universität Berlin
2// SPDX-FileCopyrightText: 2016-2026 Knut Reinert & MPI für molekulare Genetik
3// SPDX-License-Identifier: BSD-3-Clause
4
10#pragma once
11
12#include <vector>
13
15
16namespace seqan3
17{
18
42class phred94 : public phred_base<phred94, 94>
43{
44private:
47
49 friend base_t;
52 friend base_t::base_t;
54
55public:
59 constexpr phred94() noexcept = default;
60 constexpr phred94(phred94 const &) noexcept = default;
61 constexpr phred94(phred94 &&) noexcept = default;
62 constexpr phred94 & operator=(phred94 const &) noexcept = default;
63 constexpr phred94 & operator=(phred94 &&) noexcept = default;
64 ~phred94() noexcept = default;
65
66 // Inherit converting constructor
67 using base_t::base_t;
69
77 static constexpr phred_type offset_phred{0};
78
83 static constexpr char_type offset_char{'!'};
85};
86
87inline namespace literals
88{
89
103constexpr phred94 operator""_phred94(char const c) noexcept
104{
105 return phred94{}.assign_char(c);
106}
107
119SEQAN3_WORKAROUND_LITERAL std::vector<phred94> operator""_phred94(char const * s, std::size_t n)
120{
122 r.resize(n);
123
124 for (size_t i = 0; i < n; ++i)
125 r[i].assign_char(s[i]);
126
127 return r;
128}
130
131} // namespace literals
132
133} // namespace seqan3
constexpr derived_type & assign_char(char_type const chr) noexcept
Assign from a character, implicitly converts invalid characters.
Definition alphabet_base.hpp:160
Quality type for PacBio Phred scores of HiFi reads.
Definition phred94.hpp:43
static constexpr char_type offset_char
The projection offset between char and rank score representation.
Definition phred94.hpp:83
static constexpr phred_type offset_phred
The projection offset between Phred and rank score representation.
Definition phred94.hpp:77
constexpr phred94() noexcept=default
Defaulted.
friend base_t
Befriend seqan3::phred_base.
Definition phred94.hpp:49
A CRTP-base that refines seqan3::alphabet_base and is used by the quality alphabets.
Definition phred_base.hpp:30
alphabet_base< phred94, size, char > base_t
The base type.
Definition phred_base.hpp:44
int8_t phred_type
The integer representation of the quality score.
Definition phred_base.hpp:39
The main SeqAn3 namespace.
Definition aligned_sequence_concept.hpp:26
Provides seqan3::phred42 quality scores.
#define SEQAN3_WORKAROUND_LITERAL
Our char literals returning std::vector should be constexpr if constexpr std::vector is supported.
Definition platform.hpp:310
T resize(T... args)
Hide me