-
Notifications
You must be signed in to change notification settings - Fork 4
Phred Quality
Dan Katzel edited this page Jul 22, 2017
·
1 revision
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.
The PhredQuality class has a factory method valueOf( int) that will return the PhredQuality object of that qv value.
PhredQuality qv30 = PhredQuality.valueOf(30);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());