Package vcf
Class R2Estimator
- java.lang.Object
-
- vcf.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 newR2Estimator
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.
-
-
-
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 whosej
-th element is the probability that the genotype containsj
non-reference alleles.- Throws:
java.lang.IllegalArgumentException
- ifdoseProbs.length != 3
java.lang.IllegalArgumentException
- if any element ofdoseProbs
is less than 0java.lang.IllegalArgumentException
- if the sum of the elements indoseProbs
differs from 1.0 by more than1e-5
java.lang.NullPointerException
- ifdoseProbs == 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
-
-