A toolkit for working with phylogenetic data.
v0.24.0
quality.cpp File Reference
#include "genesis/sequence/functions/quality.hpp"
#include "genesis/sequence/formats/fastq_reader.hpp"
#include "genesis/sequence/sequence.hpp"
#include "genesis/utils/io/char.hpp"
#include "genesis/utils/io/input_source.hpp"
#include "genesis/utils/io/input_stream.hpp"
#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdint>
#include <stdexcept>

Go to the source code of this file.

Namespaces

 genesis
 Container namespace for all symbols of genesis in order to keep them separate when used as a library.
 
 genesis::sequence
 

Functions

unsigned char error_probability_to_phred_score (double error_probability)
 
signed char error_probability_to_solexa_score (double error_probability)
 
QualityEncoding guess_fastq_quality_encoding (std::array< size_t, 128 > const &char_counts)
 Guess the quality score encoding, based on counts of how often each char appeared in the quality string (of a fastq file for example). More...
 
QualityEncoding guess_fastq_quality_encoding (std::shared_ptr< utils::BaseInputSource > source)
 Guess the quality score encoding for a fastq input, based on counts of how often each char appeared in the quality string (of the input fastq file for example). More...
 
double phred_score_to_error_probability (unsigned char phred_score)
 
signed char phred_score_to_solexa_score (unsigned char phred_score)
 
unsigned char quality_decode_to_phred_score (char quality_code, QualityEncoding encoding=QualityEncoding::kSanger)
 Decode a single quality score char (for example coming from a fastq file) to a phred score. More...
 
std::vector< unsigned char > quality_decode_to_phred_score (std::string const &quality_codes, QualityEncoding encoding=QualityEncoding::kSanger)
 Decode a string of quality scores (for example coming from a fastq file) to phred scores. More...
 
std::string quality_encoding_name (QualityEncoding encoding)
 Return a readable name for each of the encoding types. More...
 
double solexa_score_to_error_probability (signed char solexa_score)
 
unsigned char solexa_score_to_phred_score (signed char solexa_score)
 
void throw_invalid_quality_code_ (char quality_code, QualityEncoding encoding)
 Local helper function to throw if any invalid fastq quality chars are being used. More...