SeqAn3 3.4.3-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
phred42.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
45class phred42 : public phred_base<phred42, 42>
46{
47private:
50
52 friend base_t;
55 friend base_t::base_t;
57
58public:
62 constexpr phred42() noexcept = default;
68
69 // Inherit converting constructor
72
81
86 static constexpr char_type offset_char{'!'};
88};
89
90inline namespace literals
91{
92
106constexpr phred42 operator""_phred42(char const c) noexcept
107{
108 return phred42{}.assign_char(c);
109}
110
123{
125 r.resize(n);
126
127 for (size_t i = 0; i < n; ++i)
128 r[i].assign_char(s[i]);
129
130 return r;
131}
133
134} // namespace literals
135
136} // 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
A "pretty printer" for most SeqAn data structures and related types.
Definition debug_stream_type.hpp:79
Quality type for traditional Sanger and modern Illumina Phred scores.
Definition phred42.hpp:46
constexpr phred42() noexcept=default
Defaulted.
static constexpr phred_type offset_phred
The projection offset between Phred and rank score representation.
Definition phred42.hpp:80
static constexpr char_type offset_char
The projection offset between char and rank score representation.
Definition phred42.hpp:86
A CRTP-base that refines seqan3::alphabet_base and is used by the quality alphabets.
Definition phred_base.hpp:30
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
Hide me