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 and Description |
---|
R2Estimator()
Constructs a new
R2Estimator instance. |
Modifier and Type | Method and 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.
|
public void clear()
public int nGenotypes()
public void addSampleData(double[] doseProbs)
doseProbs
- an array of length 3 whose j
-th element
is the probability that the genotype contains j
non-reference
alleles.java.lang.IllegalArgumentException
- if doseProbs.length != 3
java.lang.IllegalArgumentException
- if any element of doseProbs
is
less than 0java.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
public double allelicR2()
public double doseR2()