Package gorsat.gtgen
Class GTGen
java.lang.Object
gorsat.gtgen.GTGen
public class GTGen
extends java.lang.Object
A class for running simple joint variant calling.
-
Constructor Summary
Constructors Constructor Description GTGen(double e, int n) -
Method Summary
Modifier and Type Method Description voidaddData(int sampleIdx, double pAA, double pAB, double pBB)voidaddData(int sampleIdx, int call, int depth)doublegetAF()intgetAn()Returns the number of samples which have coverage.intgetNumberOfSamples()doublegetPriorAf()intgetPriorAn()booleanhasCoverage(int idx)Returns whether there is some data for sample with indexidx.booleanimpute(double[] gts, double tol, int maxIt)Estimates the allele frequency of the cohort and then computes the genotype probabilities.voidreset()Resets the object.voidsetAF(double af)Sets the allele frequency which we are assuming to have been used when computing the given triplets.voidsetPrior(double af, int m)Indicates that ournsamples are a part of a bigger cohort ofm + nsamples, and for themones, excluding ours, the estimated allele frequency isaf.
-
Constructor Details
-
GTGen
public GTGen(double e, int n)- Parameters:
e- The estimated error frequency.n- The number of samples.
-
-
Method Details
-
reset
public void reset()Resets the object. Can be used as new. -
getNumberOfSamples
public int getNumberOfSamples() -
getPriorAf
public double getPriorAf() -
getPriorAn
public int getPriorAn() -
setAF
public void setAF(double af)Sets the allele frequency which we are assuming to have been used when computing the given triplets. -
getAF
public double getAF() -
hasCoverage
public boolean hasCoverage(int idx)Returns whether there is some data for sample with indexidx. -
getAn
public int getAn()Returns the number of samples which have coverage. -
setPrior
public void setPrior(double af, int m)Indicates that ournsamples are a part of a bigger cohort ofm + nsamples, and for themones, excluding ours, the estimated allele frequency isaf. The resulting allele frequency will be the same as if we had called them all together at first. -
addData
public void addData(int sampleIdx, double pAA, double pAB, double pBB) -
addData
public void addData(int sampleIdx, int call, int depth) -
impute
public boolean impute(double[] gts, double tol, int maxIt)Estimates the allele frequency of the cohort and then computes the genotype probabilities.- Parameters:
gts- An array of size3*n.tol- The tolerance in the allele frequency estimate.maxIt- The maximum number of iterations.- Returns:
- Whether we managed to estimate the allele frequency up to the desired accuracy.
-