BioC++ core-0.7.0
The Modern C++ libraries for Bioinformatics.
 
Loading...
Searching...
No Matches
bio::alphabet::cigar_op Class Reference

The cigar operation alphabet.. More...

#include <bio/alphabet/cigar/cigar_op.hpp>

+ Inheritance diagram for bio::alphabet::cigar_op:

Public Member Functions

Constructors, destructor and assignment
constexpr cigar_op () noexcept=default
 Defaulted.
 
constexpr cigar_op (cigar_op const &) noexcept=default
 Defaulted.
 
constexpr cigar_op (cigar_op &&) noexcept=default
 Defaulted.
 
constexpr cigar_opoperator= (cigar_op const &) noexcept=default
 Defaulted.
 
constexpr cigar_opoperator= (cigar_op &&) noexcept=default
 Defaulted.
 
 ~cigar_op () noexcept=default
 
Read functions
constexpr char_type to_char () const noexcept
 Return the letter as a character of char_type.
 
constexpr rank_type to_rank () const noexcept
 Return the letter's numeric value (rank in the alphabet).
 
Write functions
constexpr cigar_opassign_char (char_type const c) noexcept
 Assign from a character, implicitly converts invalid characters.
 
constexpr cigar_opassign_rank (rank_type const c) noexcept
 Assign from a numeric value.
 

Static Public Attributes

static constexpr size_t alphabet_size
 The size of the alphabet, i.e. the number of different values it can take.
 

Protected Types

Member types
using char_type = std::conditional_t< std::same_as< char, void >, char, char >
 The char representation; conditional needed to make semi alphabet definitions legal.
 
using rank_type = meta::detail::min_viable_uint_t< size - 1 >
 The type of the alphabet when represented as a number (e.g. via to_rank()).
 

Related Functions

(Note that these are not member functions.)

Literals
consteval cigar_op operator""_cigar_op (char const c)
 The bio::alphabet::cigar_op char literal.
 

Detailed Description

The cigar operation alphabet.

.

The main purpose of the bio::alphabet::cigar_op alphabet is to be used in the bio::alphabet::cigar composition, where a cigar operation is paired with a count value.

Op Rank Description Consumes query Consumes reference
M 0 alignment match (can be a sequence match or mismatch) yes yes
I 1 insertion to the reference yes no
D 2 deletion from the reference no yes
N 3 skipped region from the reference no yes
S 4 soft clipping (clipped sequences present in SEQ) yes no
H 5 hard clipping (clipped sequences NOT present in SEQ) no no
P 6 padding (silent deletion from padded reference) no no
= 7 sequence match yes yes
X 8 sequence mismatch yes yes
B 9 ? ? ?

This table is reproduced from the SAM standard. The B operation is used internally and not documented.

Example

using namespace bio::alphabet::literals;
int main()
{
// Initialise a bio::alphabet::cigar_op:
bio::alphabet::cigar_op match{'M'_cigar_op};
// you can print cigar_op values:
fmt::print("{}\n", match); // M
}
Introduces the cigar_op alphabet.
The cigar operation alphabet..
Definition: cigar_op.hpp:59
Core alphabet concept and free function/type trait wrappers.
An inline namespace for alphabet literals. It exists to safely allow using namespace.
Definition: aa10li.hpp:183

Constructor & Destructor Documentation

◆ ~cigar_op()

bio::alphabet::cigar_op::~cigar_op ( )
defaultnoexcept

Defaulted.

Member Function Documentation

◆ assign_char()

constexpr cigar_op & bio::alphabet::base< cigar_op , size, char >::assign_char ( char_type const  c)
inlineconstexprnoexceptinherited

Assign from a character, implicitly converts invalid characters.

Parameters
cThe character to be assigned.

Provides an implementation for bio::alphabet::assign_char_to, required to model bio::alphabet::alphabet.

Complexity

Constant.

Exceptions

Guaranteed not to throw.

◆ assign_rank()

constexpr cigar_op & bio::alphabet::base< cigar_op , size, char >::assign_rank ( rank_type const  c)
inlineconstexprnoexceptinherited

Assign from a numeric value.

Parameters
cThe rank to be assigned.

Provides an implementation for bio::alphabet::assign_rank_to, required to model bio::alphabet::semialphabet.

Complexity

Constant.

Exceptions

Guaranteed not to throw.

◆ to_char()

constexpr char_type bio::alphabet::base< cigar_op , size, char >::to_char ( ) const
inlineconstexprnoexceptinherited

Return the letter as a character of char_type.

Provides an implementation for bio::alphabet::to_char, required to model bio::alphabet::alphabet.

Complexity

Constant.

Exceptions

Guaranteed not to throw.

◆ to_rank()

constexpr rank_type bio::alphabet::base< cigar_op , size, char >::to_rank ( ) const
inlineconstexprnoexceptinherited

Return the letter's numeric value (rank in the alphabet).

Provides an implementation for bio::alphabet::to_rank, required to model bio::alphabet::semialphabet.

Complexity

Constant.

Exceptions

Guaranteed not to throw.

Friends And Related Function Documentation

◆ operator""_cigar_op()

consteval cigar_op operator""_cigar_op ( char const  c)
related

The documentation for this class was generated from the following file: