Numeric quality score (accepts branded QualityScore/SolexaScore or validated number)
Quality encoding scheme ('phred33', 'phred64', or 'solexa')
ASCII quality character for the encoding
// Phred+33 (modern standard)
scoreToChar(40, 'phred33'); // Returns 'I' (ASCII 73)
scoreToChar(0, 'phred33'); // Returns '!' (ASCII 33)
scoreToChar(93, 'phred33'); // Returns '~' (ASCII 126)
// Phred+64 (legacy)
scoreToChar(40, 'phred64'); // Returns 'h' (ASCII 104)
scoreToChar(0, 'phred64'); // Returns '@' (ASCII 64)
// Type-safe with branded types
const validated = 40 as QualityScore;
scoreToChar(validated, 'phred33'); // Type-safe, no runtime validation needed
Convert a numeric quality score to ASCII character with type safety