ASCII quality character from a FASTQ quality string
Quality encoding scheme ('phred33', 'phred64', or 'solexa')
Type-safe branded quality score:
// Phred+33 (modern Illumina)
const score1 = charToScore('I', 'phred33'); // Returns QualityScore 40
const score2 = charToScore('!', 'phred33'); // Returns QualityScore 0
const score3 = charToScore('~', 'phred33'); // Returns QualityScore 93
// Phred+64 (legacy Illumina)
const score4 = charToScore('h', 'phred64'); // Returns QualityScore 40
const score5 = charToScore('@', 'phred64'); // Returns QualityScore 0
// Solexa (historic, with negative scores)
const score6 = charToScore(';', 'solexa'); // Returns SolexaScore -5
const score7 = charToScore('h', 'solexa'); // Returns SolexaScore 40
Convert a single quality character to numeric score with type-safe branded types