Calculate average error rate for a quality string
Converts each quality score to error probability and computes the mean.
ASCII quality string
Quality encoding scheme
Average error rate (0-1)
const errorRate = calculateErrorRate('IIIIGGGGFFFF', 'phred33');console.log(`Average error rate: ${(errorRate * 100).toFixed(2)}%`); Copy
const errorRate = calculateErrorRate('IIIIGGGGFFFF', 'phred33');console.log(`Average error rate: ${(errorRate * 100).toFixed(2)}%`);
Calculate average error rate for a quality string
Converts each quality score to error probability and computes the mean.