|
A library for working with phylogenetic and population genetic data.
v0.32.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;
121 std::string
const& quality_codes,
144 if( phred_score > 93 ) {
149 throw std::invalid_argument(
150 "Cannot encode phred score outside of [0, 93] to Sanger format."
154 return static_cast<char>( phred_score + 33 );
163 std::vector<unsigned char>
const& phred_scores,
166 auto qualities = std::string( phred_scores.size(),
' ' );
167 for(
size_t i = 0; i < phred_scores.size(); ++i ) {
215 std::shared_ptr< utils::BaseInputSource > source,
216 size_t max_lines = 0,
245 #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, bool with_offset)
Return a readable name for each of the encoding types.
bool compatible_quality_encodings(QualityEncoding lhs, QualityEncoding rhs)
Return whether two quality encodings are compatible with each other.
QualityEncoding
List of quality encodings for which we support decoding.
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...
QualityEncoding guess_fastq_quality_encoding(std::shared_ptr< utils::BaseInputSource > source, size_t max_lines, size_t max_chars)
Guess the quality score encoding for a fastq input, based on counts of how often each char appeared i...
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)