Package vcf

Class R2Estimator


  • public final class R2Estimator
    extends java.lang.Object

    Class R2Estimator estimates the correlation between the estimated allele dose and true allele dose for a set of genotypes.

    Instances of class R2Estimator are not thread-safe.

    • Constructor Summary

      Constructors 
      Constructor Description
      R2Estimator()
      Constructs a new R2Estimator instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addSampleData​(double[] doseProbs)
      Adds the specified allele dose probabilities for a genotype to the stored allele dose data.
      double allelicR2()
      Returns the estimated squared correlation between the most probable ALT allele dose and the true ALT allele dose for the current genotype data.
      void clear()
      Clears all genotype data and sets the number of genotype with allele dose data to 0.
      double doseR2()
      Returns the estimated squared correlation between the expected ALT allele dose and the true ALT allele dose for the current genotype data.
      int nGenotypes()
      Returns the current number of genotypes with allele dose data.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • R2Estimator

        public R2Estimator()
        Constructs a new R2Estimator instance.
    • Method Detail

      • clear

        public void clear()
        Clears all genotype data and sets the number of genotype with allele dose data to 0.
      • nGenotypes

        public int nGenotypes()
        Returns the current number of genotypes with allele dose data.
        Returns:
        the current number of genotypes with allele dose data
      • addSampleData

        public void addSampleData​(double[] doseProbs)
        Adds the specified allele dose probabilities for a genotype to the stored allele dose data.
        Parameters:
        doseProbs - an array of length 3 whose j-th element is the probability that the genotype contains j non-reference alleles.
        Throws:
        java.lang.IllegalArgumentException - if doseProbs.length != 3
        java.lang.IllegalArgumentException - if any element of doseProbs is less than 0
        java.lang.IllegalArgumentException - if the sum of the elements in doseProbs differs from 1.0 by more than 1e-5
        java.lang.NullPointerException - if doseProbs == null
      • allelicR2

        public double allelicR2()
        Returns the estimated squared correlation between the most probable ALT allele dose and the true ALT allele dose for the current genotype data. Returns 0 if the marker is monomorphic or if the most probable ALT allele dose is monomorphic.
        Returns:
        the estimated squared correlation between the most likely allele dose and the true allele dose
      • doseR2

        public double doseR2()
        Returns the estimated squared correlation between the expected ALT allele dose and the true ALT allele dose for the current genotype data. Returns 0 if the marker is monomorphic.
        Returns:
        the estimated squared correlation between the expected ALT allele dose and the true ALT allele dose