SeqAn3
3.4.0
The Modern C++ library for sequence analysis.
Toggle main menu visibility
Loading...
Searching...
No Matches
cigar_operation.hpp
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
2
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
3
// SPDX-License-Identifier: BSD-3-Clause
4
9
10
#pragma once
11
12
#include <
seqan3/alphabet/alphabet_base.hpp
>
13
14
// ------------------------------------------------------------------
15
// cigar_operation
16
// ------------------------------------------------------------------
17
18
namespace
seqan3::exposition_only
19
{
20
44
class
cigar_operation
:
public
alphabet_base
<cigar_operation, 9, char>
45
{
46
private
:
48
using
base_t =
alphabet_base<cigar_operation, 9, char>
;
49
51
friend
base_t;
52
53
public
:
57
constexpr
cigar_operation
() noexcept = default;
58
constexpr
cigar_operation
(
cigar_operation
const &) noexcept = default;
59
constexpr
cigar_operation
(
cigar_operation
&&) noexcept = default;
60
constexpr
cigar_operation
& operator=(
cigar_operation
const &) noexcept = default;
61
constexpr
cigar_operation
& operator=(
cigar_operation
&&) noexcept = default;
62
~
cigar_operation
() noexcept = default;
63
65
66
private:
68
static constexpr
char_type
rank_to_char_table[
alphabet_size
]{
'M'
,
'D'
,
'I'
,
'S'
,
'H'
,
'N'
,
'P'
,
'X'
,
'='
};
69
71
static
constexpr
std::array<rank_type, 256>
char_to_rank_table{[]()
constexpr
72
{
73
std::array<rank_type, 256>
ret{};
74
75
// reverse mapping for characters
76
for
(
size_t
rnk = 0u; rnk <
alphabet_size
; ++rnk)
77
{
78
ret[rank_to_char_table[rnk]] = rnk;
79
}
80
81
return
ret;
82
}()};
// namespace seqan3::exposition_only
83
85
static
constexpr
char_type
rank_to_char(
rank_type
const
rank)
86
{
87
return
rank_to_char_table[rank];
88
}
89
91
static
constexpr
rank_type
char_to_rank(
char_type
const
chr)
92
{
93
using
index_t = std::make_unsigned_t<char_type>;
94
return
char_to_rank_table[
static_cast<
index_t
>
(chr)];
95
}
96
};
97
98
}
// namespace seqan3::exposition_only
alphabet_base.hpp
Provides seqan3::alphabet_base.
std::array
seqan3::alphabet_base< cigar_operation, 9, char >::alphabet_base
constexpr alphabet_base() noexcept=default
seqan3::alphabet_base< cigar_operation, 9, char >::rank_type
detail::min_viable_uint_t< size - 1 > rank_type
Definition
alphabet_base.hpp:77
seqan3::alphabet_base< cigar_operation, 9, char >::alphabet_size
static constexpr detail::min_viable_uint_t< size > alphabet_size
Definition
alphabet_base.hpp:196
seqan3::alphabet_base< cigar_operation, 9, char >::char_type
std::conditional_t< std::same_as< char, void >, char, char > char_type
Definition
alphabet_base.hpp:69
seqan3::exposition_only::cigar_operation::cigar_operation
constexpr cigar_operation() noexcept=default
Defaulted.
seqan3::alphabet_size
constexpr auto alphabet_size
A type trait that holds the size of a (semi-)alphabet.
Definition
alphabet/concept.hpp:834
seqan3::exposition_only
A namespace for SeqAn entities that are intended for documentation purposes only.
Definition
cigar_operation.hpp:19
Hide me
Version:
seqan3
alphabet
cigar
exposition_only
cigar_operation.hpp
Generated on
for SeqAn3 by
1.17.0