SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
|
The seqan3::cigar semialphabet pairs a counter with a seqan3::cigar::operation letter. More...
#include <seqan3/alphabet/cigar/cigar.hpp>
Public Types | |
using | operation = exposition_only::cigar_operation |
The (extended) cigar operation alphabet of M,D,I,H,N,P,S,X,=. | |
Public Member Functions | |
Constructors, destructor and assignment | |
constexpr | cigar () noexcept=default |
Defaulted. | |
constexpr | cigar (cigar const &) noexcept=default |
Defaulted. | |
constexpr | cigar (cigar &&) noexcept=default |
Defaulted. | |
constexpr cigar & | operator= (cigar const &) noexcept=default |
Defaulted. | |
constexpr cigar & | operator= (cigar &&) noexcept=default |
Defaulted. | |
~cigar () noexcept=default | |
Defaulted. | |
constexpr | cigar (component_type const alph) noexcept |
Construction via a value of one of the components. | |
constexpr cigar & | operator= (component_type const alph) noexcept |
Assignment via a value of one of the components. | |
Read functions | |
small_string< 11 > | to_string () const noexcept |
Return the string representation. | |
Write functions | |
cigar & | assign_string (std::string_view const input) noexcept |
Assign from a std::string_view. | |
Public Member Functions inherited from seqan3::alphabet_tuple_base< cigar, uint32_t, exposition_only::cigar_operation > | |
constexpr | alphabet_tuple_base (component_types... components) noexcept |
Construction from initialiser-list. | |
constexpr | alphabet_tuple_base (component_type const alph) noexcept |
Construction via a value of one of the components. | |
constexpr | alphabet_tuple_base (indirect_component_type const alph) noexcept |
Construction via a value of a subtype that is assignable to one of the components. | |
constexpr cigar & | operator= (component_type const alph) noexcept |
Assignment via a value of one of the components. | |
constexpr cigar & | operator= (indirect_component_type const alph) noexcept |
Assignment via a value of a subtype that is assignable to one of the components. | |
constexpr | operator type () const noexcept |
Implicit cast to a single letter. Works only if the type is unique in the type list. | |
Public Member Functions inherited from seqan3::alphabet_base< derived_type, size, char_t > | |
constexpr | alphabet_base () noexcept=default |
Defaulted. | |
constexpr | alphabet_base (alphabet_base const &) noexcept=default |
Defaulted. | |
constexpr | alphabet_base (alphabet_base &&) noexcept=default |
Defaulted. | |
constexpr alphabet_base & | operator= (alphabet_base const &) noexcept=default |
Defaulted. | |
constexpr alphabet_base & | operator= (alphabet_base &&) noexcept=default |
Defaulted. | |
~alphabet_base () noexcept=default | |
Defaulted. | |
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). | |
constexpr derived_type & | assign_char (char_type const chr) noexcept |
Assign from a character, implicitly converts invalid characters. | |
constexpr derived_type & | assign_rank (rank_type const c) noexcept |
Assign from a numeric value. | |
Friends | |
Get functions | |
template<size_t index> | |
constexpr auto | get (cigar &l) noexcept |
Tuple-like access to the contained components. | |
template<typename type > | |
constexpr auto | get (cigar &l) noexcept |
Tuple-like access to the contained components. | |
Friends inherited from seqan3::alphabet_tuple_base< cigar, uint32_t, exposition_only::cigar_operation > | |
Comparison operators |
Related Symbols | |
(Note that these are not member symbols.) | |
Other literals | |
constexpr cigar::operation | operator""_cigar_operation (char const c) noexcept |
The seqan3::cigar::operation char literal. | |
Additional Inherited Members | |
Static Public Attributes inherited from seqan3::alphabet_base< derived_type, size, char_t > | |
static constexpr detail::min_viable_uint_t< size > | alphabet_size = size |
The size of the alphabet, i.e. the number of different values it can take. | |
Protected Types inherited from seqan3::alphabet_base< derived_type, size, char_t > | |
using | char_type = std::conditional_t< std::same_as< char_t, void >, char, char_t > |
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()). | |
The seqan3::cigar semialphabet pairs a counter with a seqan3::cigar::operation letter.
This semialphabet represents a unit in a CIGAR string, typically found in the SAM and BAM formats. It consists of a number and a seqan3::cigar::operation symbol.
It has a "visual representation", but since this is a string and not a char, the type only models seqan3::writable_semialphabet and not seqan3::writable_alphabet. Members for reading/writing the string are provided.
To avoid confusion between string and char literal, this alphabet has no user defined literal operators. Always assign from a pair of uint32_t and seqan3::cigar::operation.
OP | Description |
---|---|
M | Alignment match (can be a sequence match or mismatch, used only in basic CIGAR representations) |
I | Insertion to the reference |
D | Deletion from the reference |
N | Skipped region from the reference |
S | Soft clipping (clipped sequences present in seqan3::sam_record::sequence) |
H | Hard clipping (clipped sequences NOT present in seqan3::sam_record::sequence) |
P | Padding (silent deletion from padded reference) |
= | Sequence match |
X | Sequence mismatch |
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::operation alphabet is to be used in the seqan3::cigar composition, where a cigar operation is paired with a count value.
OP | Description |
---|---|
M | Alignment match (can be a sequence match or mismatch, used only in basic CIGAR representations) |
I | Insertion to the reference |
D | Deletion from the reference |
N | Skipped region from the reference |
S | Soft clipping (clipped sequences present in seqan3::sam_record::sequence) |
H | Hard clipping (clipped sequences NOT present in seqan3::sam_record::sequence) |
P | Padding (silent deletion from padded reference) |
= | Sequence match |
X | Sequence mismatch |
Example usage:
|
inlineconstexprnoexcept |
Construction via a value of one of the components.
component_type | One of the component types; must be uniquely contained in the type list of the composite. |
[in] | alph | The value of a component that should be assigned. |
|
inlinenoexcept |
Assign from a std::string_view.
In order to avoid unnecessary copies, you can initialise a seqan3::cigar from a std::string_view that contains the cigar string.
|
inlineconstexprnoexcept |
Assignment via a value of one of the components.
component_type | One of the component types; must be uniquely contained in the type list of the composite. |
[in] | alph | The value of a component that should be assigned. |
|
inlinenoexcept |
Return the string representation.
|
friend |
Tuple-like access to the contained components.
index | Return the i-th element. |
|
friend |
Tuple-like access to the contained components.
type | Return the element of specified type; only available if the type is unique in the set of components. |
|
related |
The seqan3::cigar::operation char literal.
You can use this char literal to assign a seqan3::cigar_operation character: