phred

1.0.1 • Public • Published

phred

NPM

Build Status

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).

q to p

Inversely, P = 10^(-Q/10):

p to q

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

Dependents (1)

Package Sidebar

Install

npm i phred

Weekly Downloads

5

Version

1.0.1

License

MIT

Last publish

Collaborators

  • ekg