Package gorsat.gtgen

Class 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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addData​(int sampleIdx, double pAA, double pAB, double pBB)  
      void addData​(int sampleIdx, int call, int depth)  
      double get_pAB()  
      double get_pBB()  
      double getAF()  
      int getAn()  
      int getNumberOfSamples()  
      double getPriorAf()  
      int getPriorAn()  
      boolean hasCoverage​(int 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 setAFsinglePriors​(double fpab, double fpbb)  
      void setPrior​(double pab, double pbb, 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.
      void setPrior​(double af, int m)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GTGen

        public GTGen​(double e,
                     int n)
        Parameters:
        e - The estimated error frequency.
        n - The number of samples.
    • 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 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.
      • 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 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.