phred
v1.0.1
Published
convert phred quality scores to and from other numerical representations
Downloads
7
Maintainers
Readme
phred
convert phred quality scores to and from other numerical representations
Overview
Phred quality scores are a humanized representation of small error probabilities. They have a long history of use in genomics, where they have been employed to represent the quality of sequencing observations.
If the probability of error is P, the phred quality score Q is defined as Q = -10 * log10(P)
.
Inversely, P = 10^(-Q/10)
:
This library encapsulates conversions between error probabilities and phred scores.
Installation
npm install phred
Usage
A Phred object is provided that allows for manipulation of quality scores.
var Phred = require('phred')
// print the phred to probability mapping
[0,10,20,30,40,50].forEach(function(x) {
var p = new Phred().fromQuality(x)
console.log(x, p.toProb())
})
/*
0 1
10 0.1
20 0.01
30 0.001
40 0.0001
50 0.00001
*/
License
MIT