Skip to content

Phred Quality

Dan Katzel edited this page Jul 22, 2017 · 1 revision

Phred Quality

PhredQuality is a representation of a Phred quality score. Since there are less than 100 possible values, PhredQuality uses the flyweight pattern to reuse the same objects for the same quality score.

Create PhredQuality using valueOf

The PhredQuality class has a factory method valueOf( int) that will return the PhredQuality object of that qv value.

PhredQuality qv30 = PhredQuality.valueOf(30);

Create PhredQuality from Error Probability

There is also a factory method for converting an error probability (between 0 and 1) into a PhredQuality.

PhredQuality qv = PhredQuality.withErrorProbability(0.00001F)

assertEquals(50, qv.getQualityScore());

Clone this wiki locally