Class VariantAssociation


  • public class VariantAssociation
    extends java.lang.Object
    Variant association algorithm, based on the VAAST algorithm. http://www.ncbi.nlm.nih.gov/pubmed/21700766

    Computes a p-value for a genomic feature (typically a single gene) using a randomization test, where the affection status of the subjects is permuted and the test statistic computed using a composite likelihood ratio test as described in the VAAST paper.

    Note: This is not an exact implementation and for example we have a bailout parameter to avoid spending to much computing time on uninteresting features.

    Usage: Need to first set the case and control lists, the disease model (regular, dominant, or recessive), and other parameters. Then the procedure is as follows: - Before processing a feature, call initializeGroup() to clear the counts. - Iterate through the data for the feature and for each variant found for some subject, add the call counts using addFeature(). - Calculate the p-value (and a few other values) using calculateValues(). Repeat the process for the next feature.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean includeProtective  
    • Constructor Summary

      Constructors 
      Constructor Description
      VariantAssociation()
      Instantiate the class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addVariant​(java.lang.String variantString)
      Add a variant.
      java.lang.String calculateValues()
      Calculate the p-value and other values for the current genetic feature.
      void initializeGroup()
      Initialize the algorithm for the next feature.
      void setCancelMonitor​(org.gorpipe.gor.monitor.CancelMonitor cancelMonitor)  
      void setCollapseThreshold​(int collapseThreshold)  
      void setDebug​(boolean debug)  
      void setModel​(boolean recessiveDisease, boolean dominantDisease, int controlPenetrance, int casePenetrance, boolean noMaxAlleleCounts, double upperFreqThreshold, boolean includeProtective)
      Set the disease model (inheritance and penetrance patterns).
      void setNumRandomIterations​(int maxIterations, int bailOutAfter)  
      void setPnLists​(java.lang.String[] cases, java.lang.String[] controls)  
      • Methods inherited from class java.lang.Object

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

      • includeProtective

        protected boolean includeProtective
    • Constructor Detail

      • VariantAssociation

        public VariantAssociation()
        Instantiate the class.
    • Method Detail

      • setPnLists

        public void setPnLists​(java.lang.String[] cases,
                               java.lang.String[] controls)
        Parameters:
        cases - the cases
        controls - the controls
      • setModel

        public void setModel​(boolean recessiveDisease,
                             boolean dominantDisease,
                             int controlPenetrance,
                             int casePenetrance,
                             boolean noMaxAlleleCounts,
                             double upperFreqThreshold,
                             boolean includeProtective)
        Set the disease model (inheritance and penetrance patterns).
        Parameters:
        recessiveDisease - true if recessive disease
        dominantDisease - true if dominant disease
        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
        upperFreqThreshold - upper threshold for the allele frequency
        includeProtective - true to include protective variants, false to exclude
      • setNumRandomIterations

        public void setNumRandomIterations​(int maxIterations,
                                           int bailOutAfter)
        Parameters:
        maxIterations - the maximum number of random permutations for the p-value
        bailOutAfter - number of hits to trigger bailout
      • setCollapseThreshold

        public void setCollapseThreshold​(int collapseThreshold)
        Parameters:
        collapseThreshold - collapse variants with fewer than this number of alleles among affecteds
      • setCancelMonitor

        public void setCancelMonitor​(org.gorpipe.gor.monitor.CancelMonitor cancelMonitor)
        Parameters:
        cancelMonitor - cancel monitor
      • setDebug

        public void setDebug​(boolean debug)
        Parameters:
        debug - if true, print out debug information
      • initializeGroup

        public void initializeGroup()
        Initialize the algorithm for the next feature. (Clears the data containers.)
      • addVariant

        public void addVariant​(java.lang.String variantString)
        Add a variant.
        Parameters:
        variantString - a tab delimited string with variantId,pn,callCopies,nullScore,altScore
      • calculateValues

        public java.lang.String calculateValues()
        Calculate the p-value and other values for the current genetic feature.
        Returns:
        the values as a tab delimited string