Class GavaLogLikelihood

java.lang.Object
org.gorpipe.gor.gava.GavaLogLikelihood
Direct Known Subclasses:
DominantLogLikelihood, RecessiveLogLikelihood, RegularLogLikelihood

public abstract class GavaLogLikelihood
extends java.lang.Object
Log-likelihood ratio calculator for variant association.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected int casePenetrance
    Case penetrance (0 for no locus hetreogeneity, -1 for no constraint).
    protected int controlPenetrance
    Control penetrance (0 for complete penetrance, -1 for no constraint).
    protected boolean includeProtective
    Include protective variants in calculations.
    protected boolean noMaxAlleleCounts
    No max allele count for each case in dominant/recessive models.
    protected int numCases  
    protected int numControls  
    protected double upperFreqThreshold
    Upper threshold for the control allele frequency.
  • Constructor Summary

    Constructors 
    Constructor Description
    GavaLogLikelihood()  
  • Method Summary

    Modifier and Type Method Description
    double calcVariantLogLikelihood​(VariantCounts counts, int[] perm)
    Calculate the log-likelihood for a single variant (using the regular inheritance model).
    abstract double computeLogLikelihood​(java.util.List<org.gorpipe.gor.gava.CollapsedCounts> collapsedCounts, int[] perm, boolean debug)
    Compute the log-likelihood ratio for a feature.
    void setIncludeProtective​(boolean includeProtective)
    Set if protective variants should be included (default is false).
    void setPenetrance​(int controlPenetrance, int casePenetrance, boolean noMaxAlleleCounts)  
    void setSubjectCounts​(int numCases, int numControls)  
    void setUpperFreqThreshold​(double upperFreqThreshold)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • upperFreqThreshold

      protected double upperFreqThreshold
      Upper threshold for the control allele frequency.
    • controlPenetrance

      protected int controlPenetrance
      Control penetrance (0 for complete penetrance, -1 for no constraint).
    • casePenetrance

      protected int casePenetrance
      Case penetrance (0 for no locus hetreogeneity, -1 for no constraint).
    • noMaxAlleleCounts

      protected boolean noMaxAlleleCounts
      No max allele count for each case in dominant/recessive models.
    • includeProtective

      protected boolean includeProtective
      Include protective variants in calculations.
    • numCases

      protected int numCases
    • numControls

      protected int numControls
  • Constructor Details

  • Method Details

    • setSubjectCounts

      public void setSubjectCounts​(int numCases, int numControls)
      Parameters:
      numCases -
      numControls -
    • setPenetrance

      public void setPenetrance​(int controlPenetrance, int casePenetrance, boolean noMaxAlleleCounts)
      Parameters:
      controlPenetrance - maximum count among controls, -1 for no constraint
      casePenetrance - true if recessive/dominant with no locus heterogeneity
      noMaxAlleleCounts - true if no max allele count for each case in dominant/recessive models
    • setUpperFreqThreshold

      public void setUpperFreqThreshold​(double upperFreqThreshold)
      Parameters:
      upperFreqThreshold - upper threshold for the allele frequency
    • setIncludeProtective

      public void setIncludeProtective​(boolean includeProtective)
      Set if protective variants should be included (default is false).
      Parameters:
      includeProtective - true to include protective variants, false to exclude
    • computeLogLikelihood

      public abstract double computeLogLikelihood​(java.util.List<org.gorpipe.gor.gava.CollapsedCounts> collapsedCounts, int[] perm, boolean debug)
      Compute the log-likelihood ratio for a feature. The first numControls subjects in the given permutation are used as controls, and the remaining perm.length-numControls are used as cases.
      Parameters:
      collapsedCounts - the call counts for the subjects (with very rare variants collapsed)
      perm - permutation of the subjects
      debug - if true, print out debug information
      Returns:
      the log-likelihood
    • calcVariantLogLikelihood

      public double calcVariantLogLikelihood​(VariantCounts counts, int[] perm)
      Calculate the log-likelihood for a single variant (using the regular inheritance model).
      Parameters:
      counts - the call counts for the variant
      perm - permutation of the subjects
      Returns:
      the log-likelihood