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 detail::min_viable_uint_t< size > constexpr 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...
 
Requirements for std::totally_ordered

You can expect these functions on all types that implement std::totally_ordered.

bool operator< (type const &lhs, type const &rhs)
 Less-than, greater-than and -or-equal comparisons. More...
 
bool operator<= (type const &lhs, type const &rhs)
 Less-than, greater-than and -or-equal comparisons. More...
 
bool operator> (type const &lhs, type const &rhs)
 Less-than, greater-than and -or-equal comparisons. More...
 
bool operator>= (type const &lhs, type const &rhs)
 Less-than, greater-than and -or-equal comparisons. More...
 
Requirements for std::equality_comparable

You can expect these functions on all types that implement std::Equality_comparable.

bool operator== (type const &lhs, type const &rhs)
 (In-)Equality comparison. More...
 
bool operator!= (type const &lhs, type const &rhs)
 (In-)Equality comparison. More...
 
Requirements for std::swappable

You can expect these functions on all types that implement std::swappable.

void swap (t &lhs, t &rhs)
 Swaps the contents of two objects. 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)
inlinenoexceptinherited

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)
inlinenoexceptinherited

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 ( ) const
inlinenoexceptinherited

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 ( ) const
inlinenoexceptinherited

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: