SeqAn3  3.0.2
The Modern C++ library for sequence analysis.
seqan3::cigar_op Class Reference

The (extended) cigar operation alphabet of M,D,I,H,N,P,S,X,=. More...

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

+ Inheritance diagram for seqan3::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. More...
 
constexpr rank_type to_rank () const noexcept
 Return the letter's numeric value (rank in the alphabet). More...
 
Write functions
constexpr cigar_opassign_char (char_type const c) noexcept
 Assign from a character, implicitly converts invalid characters. More...
 
constexpr cigar_opassign_rank (rank_type const c) noexcept
 Assign from a numeric value. More...
 

Static Public Attributes

static constexpr detail::min_viable_uint_t< size > 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 = 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
cigar_op operator""_cigar_op (char const c) noexcept
 The seqan3::cigar_op char literal. More...
 

Detailed Description

The (extended) cigar operation alphabet of M,D,I,H,N,P,S,X,=.

The CIGAR string can be either basic or extended. The only difference in the extended cigar alphabet is that aligned bases are classified as an actual match ('=') or mismatch ('X'). In contrast, the basic cigar alphabet only indicated the aligned status with an 'M', without further information if the bases are actually equal or not.

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

Example usage:

using seqan3::operator""_cigar_op;
int main()
{
// Initialise a seqan3::cigar_op:
seqan3::cigar_op match{'M'_cigar_op};
// you can print cigar_op values:
seqan3::debug_stream << match << '\n'; // M
}
Note
Usually you do not want to manipulate cigar elements and vectors on your own but convert an alignment to a cigar and back. See seqan3::get_cigar_vector for how to convert two aligned sequences into a cigar_vector.

Constructor & Destructor Documentation

◆ ~cigar_op()

seqan3::cigar_op::~cigar_op ( )
defaultnoexcept

Defaulted.

Member Function Documentation

◆ assign_char()

constexpr cigar_op & seqan3::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 seqan3::assign_char_to, required to model seqan3::alphabet.

Complexity

Constant.

Exceptions

Guaranteed not to throw.

◆ assign_rank()

constexpr cigar_op & seqan3::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 seqan3::assign_rank_to, required to model seqan3::semialphabet.

Complexity

Constant.

Exceptions

Guaranteed not to throw.

◆ to_char()

constexpr char_type seqan3::alphabet_base< cigar_op , size, char >::to_char
inlineconstexprnoexceptinherited

Return the letter as a character of char_type.

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

Complexity

Constant.

Exceptions

Guaranteed not to throw.

◆ to_rank()

constexpr rank_type seqan3::alphabet_base< cigar_op , size, char >::to_rank
inlineconstexprnoexceptinherited

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

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

Complexity

Constant.

Exceptions

Guaranteed not to throw.

Friends And Related Function Documentation

◆ operator""_cigar_op()

cigar_op operator""_cigar_op ( char const  c)
related

The seqan3::cigar_op char literal.

Returns
seqan3::cigar_op

The documentation for this class was generated from the following file:
debug_stream.hpp
Provides seqan3::debug_stream and related types.
cigar_op.hpp
Introduces the cigar_op alphabet.
seqan3::debug_stream
debug_stream_type debug_stream
A global instance of seqan3::debug_stream_type.
Definition: debug_stream.hpp:42
seqan3::cigar_op
The (extended) cigar operation alphabet of M,D,I,H,N,P,S,X,=.
Definition: cigar_op.hpp:53