Package gorsat.gtgen
Class GTGen
- java.lang.Object
-
- gorsat.gtgen.GTGen
-
public class GTGen extends java.lang.ObjectA class for running simple joint variant calling.
-
-
Constructor Summary
Constructors Constructor Description GTGen(double e, int n)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddData(int sampleIdx, double pAA, double pAB, double pBB)voidaddData(int sampleIdx, int call, int depth)doubleget_pAB()doubleget_pBB()doublegetAF()intgetAn()intgetNumberOfSamples()doublegetPriorAf()intgetPriorAn()booleanhasCoverage(int idx)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.voidsetAFsinglePriors(double fpab, double fpbb)voidsetPrior(double pab, double pbb, int m)Indicates that ournsamples are a part of a bigger cohort ofm + nsamples, and for themones, excluding ours, the estimated allele frequency isaf.voidsetPrior(double af, int m)
-
-
-
Method Detail
-
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.
-
setAFsinglePriors
public void setAFsinglePriors(double fpab, double fpbb)
-
getAF
public double getAF()
-
get_pAB
public double get_pAB()
-
get_pBB
public double get_pBB()
-
hasCoverage
public boolean hasCoverage(int idx)
- Returns:
- Returns whether there is some data for sample with index
idx.
-
getAn
public int getAn()
- Returns:
- Returns the number of samples which have coverage.
-
setPrior
public void setPrior(double pab, double pbb, 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.
-
setPrior
public void setPrior(double af, int m)
-
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.
-
-