|
A library for working with phylogenetic and population genetic data.
v0.27.0
|
|
Go to the documentation of this file. 1 #ifndef GENESIS_SEQUENCE_FUNCTIONS_QUALITY_H_
2 #define GENESIS_SEQUENCE_FUNCTIONS_QUALITY_H_
48 class BaseInputSource;
120 std::string
const& quality_codes,
143 if( phred_score > 93 ) {
148 throw std::invalid_argument(
149 "Cannot encode phred score outside of [0, 93] to Sanger format."
153 return static_cast<char>( phred_score + 33 );
162 std::vector<unsigned char>
const& phred_scores,
165 auto qualities = std::string( phred_scores.size(),
' ' );
166 for(
size_t i = 0; i < phred_scores.size(); ++i ) {
222 #endif // include guard
double phred_score_to_error_probability(unsigned char phred_score)
unsigned char quality_decode_to_phred_score(char quality_code, QualityEncoding encoding)
Decode a single quality score char (for example coming from a fastq file) to a phred score.
QualityEncoding guess_quality_encoding_from_name(std::string const &name)
Guess the QualityEncoding type, given its description name.
std::string quality_encoding_name(QualityEncoding encoding)
Return a readable name for each of the encoding types.
QualityEncoding
List of quality encodings for which we support decoding.
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 i...
signed char error_probability_to_solexa_score(double error_probability)
Container namespace for all symbols of genesis in order to keep them separate when used as a library.
QualityEncoding guess_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 stri...
signed char phred_score_to_solexa_score(unsigned char phred_score)
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.
unsigned char solexa_score_to_phred_score(signed char solexa_score)
double solexa_score_to_error_probability(signed char solexa_score)
unsigned char error_probability_to_phred_score(double error_probability)