Package htsjdk.samtools.util

# Class QualityUtil

java.lang.Object
htsjdk.samtools.util.QualityUtil

public final class QualityUtil extends Object
Utility class for working with quality scores and error probabilities.

## Constructor Summary

Constructors
Constructor
Description
`QualityUtil()`

## Method Summary

Modifier and Type
Method
Description
`static double`
`getErrorProbabilityFromPhredScore(int i)`
Given a phred score between 0 and 100 returns the probability of error.
`static int`
`getPhredScoreFromErrorProbability(double probability)`
Gets the phred score for any given probability of error.
`static int`
`getPhredScoreFromObsAndErrors(double observations, double errors)`
Gets the phred score given the specified observations and errors.
`static double`
`sumOfErrorProbabilities(SAMRecord rec)`
Calculates the sum of error probabilities for all read bases in the SAM record.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### QualityUtil

public QualityUtil()

## Method Details

### getErrorProbabilityFromPhredScore

public static double getErrorProbabilityFromPhredScore(int i)
Given a phred score between 0 and 100 returns the probability of error.

### getPhredScoreFromErrorProbability

public static int getPhredScoreFromErrorProbability(double probability)
Gets the phred score for any given probability of error.

### getPhredScoreFromObsAndErrors

public static int getPhredScoreFromObsAndErrors(double observations, double errors)
Gets the phred score given the specified observations and errors.

### sumOfErrorProbabilities

public static double sumOfErrorProbabilities(SAMRecord rec)
Calculates the sum of error probabilities for all read bases in the SAM record. Takes the SAM record as opposed to the qualities directly so that it can make sure to count no-calls as 1 instead of what the quality score says.