A toolkit for working with phylogenetic data.
v0.24.0
quality.hpp File Reference
#include <array>
#include <iosfwd>
#include <memory>
#include <stdexcept>
#include <string>
#include <vector>

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
 
 genesis::utils
 

Enumerations

enum  QualityEncoding {
  kSanger, kSolexa, kIllumina13, kIllumina15,
  kIllumina18
}
 List of quality encodings for which we support decoding. More...
 

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...
 
char quality_encode_from_phred_score (unsigned char phred_score, bool clamp=true)
 Encode a phred score into a quality char, using the Sanger convention. More...
 
std::string quality_encode_from_phred_score (std::vector< unsigned char > const &phred_scores, bool clamp=true)
 Encode phred scores into quality chars, using the Sanger convention. 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)