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
    void addData​(int sampleIdx, double pAA, double pAB, double pBB)  
    void addData​(int sampleIdx, int call, int depth)  
    double getAF()  
    int getAn()
    Returns the number of samples which have coverage.
    int getNumberOfSamples()  
    double getPriorAf()  
    int getPriorAn()  
    boolean hasCoverage​(int idx)
    Returns whether there is some data for sample with index idx.
    boolean impute​(double[] gts, double tol, int maxIt)
    Estimates the allele frequency of the cohort and then computes the genotype probabilities.
    void reset()
    Resets the object.
    void setAF​(double af)
    Sets the allele frequency which we are assuming to have been used when computing the given triplets.
    void setPrior​(double af, int m)
    Indicates that our n samples are a part of a bigger cohort of m + n samples, and for the m ones, excluding ours, the estimated allele frequency is af.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 index idx.
    • getAn

      public int getAn()
      Returns the number of samples which have coverage.
    • setPrior

      public void setPrior​(double af, int m)
      Indicates that our n samples are a part of a bigger cohort of m + n samples, and for the m ones, excluding ours, the estimated allele frequency is af. 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 size 3*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.