Class QualityUtil


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

      • QualityUtil

        public QualityUtil()
    • Method Detail

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