Class TheoreticalSensitivity


  • public class TheoreticalSensitivity
    extends Object
    Created by David Benjamin on 5/13/15.
    • Constructor Detail

      • TheoreticalSensitivity

        public TheoreticalSensitivity()
    • Method Detail

      • hetSNPSensitivity

        public static double hetSNPSensitivity​(double[] depthDistribution,
                                               double[] qualityDistribution,
                                               int sampleSize,
                                               double logOddsThreshold)
        Parameters:
        depthDistribution - the probability of depth n is depthDistribution[n] for n = 0, 1. . . N - 1
        qualityDistribution - the probability of quality q is qualityDistribution[q] for q = 0, 1. . . Q
        sampleSize - sample size is the number of random sums of quality scores for each m
        logOddsThreshold - is the log_10 of the likelihood ratio required to call a SNP, for example 5 if the variant likelihood must be 10^5 times greater
      • hetSNPSensitivity

        public static double hetSNPSensitivity​(double[] depthDistribution,
                                               double[] qualityDistribution,
                                               int sampleSize,
                                               double logOddsThreshold,
                                               boolean withLogging)
        Parameters:
        depthDistribution - the probability of depth n is depthDistribution[n] for n = 0, 1. . . N - 1
        qualityDistribution - the probability of quality q is qualityDistribution[q] for q = 0, 1. . . Q
        sampleSize - sample size is the number of random sums of quality scores for each m
        logOddsThreshold - is the log_10 of the likelihood ratio required to call a SNP, for example 5 if the variant likelihood must be 10^5 times greater.
        withLogging - true to output log messages, false otherwise.
      • hetAltDepthDistribution

        public static List<ArrayList<Double>> hetAltDepthDistribution​(int N)
      • normalizeHistogram

        public static double[] normalizeHistogram​(htsjdk.samtools.util.Histogram<Integer> histogram)
      • sensitivityAtConstantDepth

        public static double sensitivityAtConstantDepth​(int depth,
                                                        htsjdk.samtools.util.Histogram<Integer> qualityHistogram,
                                                        double logOddsThreshold,
                                                        int sampleSize,
                                                        double alleleFraction,
                                                        long randomSeed)
        Calculates the theoretical sensitivity with a given Phred-scaled quality score distribution at a constant depth.
        Parameters:
        depth - Depth to compute sensitivity at
        qualityHistogram - Phred-scaled quality score histogram
        logOddsThreshold - Log odd threshold necessary for variant to be called
        sampleSize - sampleSize is the total number of simulations to run
        alleleFraction - the allele fraction to evaluate sensitivity at
        randomSeed - random number seed to use for random number generator
        Returns:
        Theoretical sensitivity for the given arguments at a constant depth.
      • theoreticalSensitivity

        public static double theoreticalSensitivity​(htsjdk.samtools.util.Histogram<Integer> depthHistogram,
                                                    htsjdk.samtools.util.Histogram<Integer> qualityHistogram,
                                                    int sampleSize,
                                                    double logOddsThreshold,
                                                    double alleleFraction)
        Calculates the theoretical sensitivity with a given Phred-scaled quality score distribution and depth distribution.
        Parameters:
        depthHistogram - Depth histogram to compute theoretical sensitivity over
        qualityHistogram - Phred-scaled quality score histogram
        sampleSize - the total number of simulations to run
        logOddsThreshold - Log odds threshold necessary for variant to be called
        alleleFraction - the allele fraction to evaluate sensitivity at
        Returns:
        Theoretical sensitivity for the given arguments over a particular depth distribution.
      • calculateSensitivities

        public static List<TheoreticalSensitivityMetrics> calculateSensitivities​(int simulationSize,
                                                                                 htsjdk.samtools.util.Histogram<Integer> depthHistogram,
                                                                                 htsjdk.samtools.util.Histogram<Integer> baseQHistogram,
                                                                                 List<Double> alleleFractions)
        This is a utility function to calculate the metrics specific to running theoretical sensitivity over several different allele fractions.
        Parameters:
        simulationSize - Number of simulations to run at each depth.
        depthHistogram - Histogram of depth distribution.
        baseQHistogram - Histogram of Phred-scaled quality scores.
        alleleFractions - List of allele fractions to measure theoretical sensitivity over.