Quality

Contains aliases for quality_composition.

Author
Hannes Hauswedell <hannes.hauswedell AT fu-berlin.de>

namespace seqan3

The main SeqAn3 namespace.

Helpers for seqan3::semi_alphabet_concept

These functions and metafunctions expose member variables and types so that they satisfy seqan3::semi_alphabet_concept.

Helpers for seqan3::alphabet_concept

These functions and metafunctions expose member variables and types so that they satisfy seqan3::alphabet_concept.

Helpers for seqan3::nucleotide_concept

These functions and metafunctions expose member variables and types so that they satisfy seqan3::nucleotide_concept.

Alphabet aliases

Other names (typedefs) for seqan3::nucl16

Range concepts

Adapted from the Ranges TS.

Container concepts

Container concepts as defined by the standard library (or very close).

Container-of-container concepts

Shortcuts for multi-dimensional container concepts.

Typedefs

using seqan3::dna4q = typedef quality_composition<dna4, illumina18>

An alphabet that stores a seqan3::dna4 letter and an seqan3::illumina18 letter at each position.

using seqan3::dna5q = typedef quality_composition<dna5, illumina18>

An alphabet that stores a seqan3::dna5 letter and an seqan3::illumina18 letter at each position.

using seqan3::rna4q = typedef quality_composition<rna4, illumina18>

An alphabet that stores a seqan3::rna4 letter and an seqan3::illumina18 letter at each position.

using seqan3::rna5q = typedef quality_composition<rna5, illumina18>

An alphabet that stores a seqan3::rna5 letter and an seqan3::illumina18 letter at each position.

using seqan3::nucl16q = typedef quality_composition<nucl16, illumina18>

An alphabet that stores a seqan3::nucl16 letter and an seqan3::illumina18 letter at each position.

Meta-header that includes all headers from alphabet/quality/.

Author
Hannes Hauswedell <hannes.hauswedell AT fu-berlin.de>

namespace seqan3

The main SeqAn3 namespace.

Helpers for seqan3::semi_alphabet_concept

These functions and metafunctions expose member variables and types so that they satisfy seqan3::semi_alphabet_concept.

Helpers for seqan3::alphabet_concept

These functions and metafunctions expose member variables and types so that they satisfy seqan3::alphabet_concept.

Helpers for seqan3::nucleotide_concept

These functions and metafunctions expose member variables and types so that they satisfy seqan3::nucleotide_concept.

Alphabet aliases

Other names (typedefs) for seqan3::nucl16

Range concepts

Adapted from the Ranges TS.

Container concepts

Container concepts as defined by the standard library (or very close).

Container-of-container concepts

Shortcuts for multi-dimensional container concepts.

Typedefs

using seqan3::underlying_phred_t = typedef typename underlying_phred<alphabet_type>::type

internal phred type

Functions

template <typename alphabet_type>
requires detail::internal_quality_concept<alphabet_type> constexpr alphabet_type seqan3::assign_phred(alphabet_type & c, char const in)

public setter function receiving char encoding of phred score

template <typename alphabet_type>
requires detail::internal_quality_concept<alphabet_type> constexpr underlying_phred_t<alphabet_type> seqan3::to_phred(alphabet_type const & c)

public getter function for rank presentation of phred score

Variables

concept bool seqan3::quality_concept = requires(q quality) { requires alphabet_concept<q>; { assign_phred(quality, typename q::rank_type{}) } -> q; { to_phred(quality) } -> const typename q::phred_type; typename underlying_phred<q>::type; }

concept of a quality alphabet

template <typename alphabet_type>
struct underlying_phred
#include <alphabet/quality/concept.hpp>

internal phred

Public Types

template<>
using type = typename alphabet_type::phred_type
namespace seqan3

The main SeqAn3 namespace.

Helpers for seqan3::semi_alphabet_concept

These functions and metafunctions expose member variables and types so that they satisfy seqan3::semi_alphabet_concept.

Helpers for seqan3::alphabet_concept

These functions and metafunctions expose member variables and types so that they satisfy seqan3::alphabet_concept.

Helpers for seqan3::nucleotide_concept

These functions and metafunctions expose member variables and types so that they satisfy seqan3::nucleotide_concept.

Alphabet aliases

Other names (typedefs) for seqan3::nucl16

Range concepts

Adapted from the Ranges TS.

Container concepts

Container concepts as defined by the standard library (or very close).

Container-of-container concepts

Shortcuts for multi-dimensional container concepts.

struct illumina18
#include <alphabet/quality/illumina18.hpp>

Implementation of the Illumina 1.8 standard fulfilling the quality concept. The permitted phred score range is [0 .. 41], mapped to ascii-ordered range [‘!’ .. ‘J’]. For this standard internal and rank phred representation are both zero-based.

Public Types

using phred_type = int8_t

the 3 representation types of a quality score

using rank_type = uint8_t
using char_type = char

Public Functions

constexpr illumina18 &operator=(rank_type const c)

implicit compatibility to inner_type

constexpr bool operator==(const illumina18 &rhs) const

comparison operators

constexpr bool operator!=(const illumina18 &rhs) const
constexpr bool operator<(const illumina18 &rhs) const
constexpr bool operator>(const illumina18 &rhs) const
constexpr bool operator<=(const illumina18 &rhs) const
constexpr bool operator>=(const illumina18 &rhs) const
constexpr operator char() const

explicit compatibility to char code of a quality score

constexpr char_type to_char() const

convert quality score to its 1-letter code

constexpr illumina18 &assign_char(char_type const c)

set internal value given 1-letter code

constexpr rank_type to_rank() const

explicit compatibility to internal rank representation

constexpr illumina18 &assign_rank(rank_type const c)

set internal value given zero-based integer c

constexpr illumina18 &assign_phred(phred_type const p)

set internal value given Illumina 1.8 integer code p

constexpr phred_type to_phred() const

get Illumina 1.8 integer code

Public Members

rank_type value

internal rank value representation

Public Static Attributes

constexpr char_type offset_char = {'!'}

projection offsets of char and rank quality score

constexpr phred_type offset_phred = {0}
constexpr rank_type value_size = {42}

phred score range for Illumina 1.8 standard

Protected Static Attributes

constexpr std::array<char_type, 256> char_to_value = { [] () constexpr { std::array<char_type, 256> ret{}; for (char_type c = '!'; c <= 'J'; ++c) ret[c] = c - '!'; return ret; }() }

Char to value conversion table.

Contains quality alphabet compositions.

Author
Hannes Hauswedell <hannes.hauswedell AT fu-berlin.de>

namespace seqan3

The main SeqAn3 namespace.

Helpers for seqan3::semi_alphabet_concept

These functions and metafunctions expose member variables and types so that they satisfy seqan3::semi_alphabet_concept.

Helpers for seqan3::alphabet_concept

These functions and metafunctions expose member variables and types so that they satisfy seqan3::alphabet_concept.

Helpers for seqan3::nucleotide_concept

These functions and metafunctions expose member variables and types so that they satisfy seqan3::nucleotide_concept.

Alphabet aliases

Other names (typedefs) for seqan3::nucl16

Range concepts

Adapted from the Ranges TS.

Container concepts

Container concepts as defined by the standard library (or very close).

Container-of-container concepts

Shortcuts for multi-dimensional container concepts.

template <typename sequence_alphabet_t, typename quality_alphabet_t>
struct quality_composition
#include <alphabet/quality/quality_composition.hpp>

A seqan3::cartesian_composition that joins a nucleotide alphabet with a quality alphabet.

This composition pairs a nucleotide alphabet with a quality alphabet. The rank values correpsond to numeric values in the size of the composition, while the character values are taken from the sequence alphabet and the phred values are taken from the quality alphabet.

Template Parameters
  • sequence_alphabet_t: Type of the first letter; must satisfy seqan3::nucleotide_concept.
  • quality_alphabet_t: Types of further letters (up to 4); must satisfy seqan3::quality_concept.

As with all seqan3::cartesian_composition s you may access the individual alphabet letters in regular c++ tuple notation, i.e. get<0>(t) and objects can be brace-initialized with the individual members.

quality_composition<dna4, illumina18> l{dna4::A, 7};
std::cout << int(to_rank(l)) << ' '
          << int(to_rank(get<0>(l))) << ' '
          << int(to_rank(get<1>(l))) << '\n';
// 148 0 7

std::cout << to_char(l) << ' '
          << to_char(get<0>(l)) << ' '
          << to_char(get<1>(l)) << '\n';
// A A (

std::cout << int(to_phred(l)) << ' '
//           << int(to_phred(get<0>(l))) << ' ' // dna4 doesn't have a phred
          << int(to_phred(get<1>(l))) << '\n';
// 7 7

// modify via structured bindings and references:
auto & [ seq_l, qual_l ] = l;
seq_l = dna4::G;
std::cout << to_char(l) << '\n';
// G

This seqan3::cartesian_composition itself fulfills both seqan3::alphabet_concept and seqan3::quality_concept .

Inherits from seqan3::cartesian_composition< quality_composition< sequence_alphabet_t, quality_alphabet_t >, sequence_alphabet_t, quality_alphabet_t >

Write functions

constexpr quality_composition &operator=(sequence_alphabet_type const l)

Directly assign the sequence letter.

constexpr quality_composition &operator=(quality_alphabet_type const l)

Directly assign the quality letter.

constexpr quality_composition &assign_char(char_type const c)

Assign from a character. This modifies the internal sequence letter.

constexpr quality_composition &assign_phred(phred_type const c)

Assign from a phred value. This modifies the internal quality letter.

Read functions

constexpr phred_type to_phred() const

Return the phred value. This reads the internal quality letter.

constexpr char_type to_char() const

Return a character. This reads the internal sequence letter.

constexpr quality_composition complement() const

Return a quality_composition where the quality is preserved, but the sequence letter is complemented.

See
seqan3::complement
See
seqan3::nucleotide_concept::complement

Comparison operators

Lexicographically compares the values in the tuple.

Public Types

template<>
using sequence_alphabet_type = sequence_alphabet_t

First template parameter as member type.

template<>
using quality_alphabet_type = quality_alphabet_t

Second template parameter as member type.

template<>
using char_type = underlying_char_t<sequence_alphabet_type>

Equals the char_type of sequence_alphabet_type.

template<>
using phred_type = underlying_phred_t<quality_alphabet_type>

Equals the phred_type of the quality_alphabet_type.

Related

template <typename sequence_alphabet_type, typename quality_alphabet_type>
quality_composition(sequence_alphabet_type&&, quality_alphabet_type&&)

Type deduction guide enables usage of quality_composition without specifying template args.