Class VariantAssociation
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddVariant(String variantString) Add a variant.Calculate the p-value and other values for the current genetic feature.voidInitialize the algorithm for the next feature.voidsetCancelMonitor(org.gorpipe.gor.monitor.CancelMonitor cancelMonitor) voidsetCollapseThreshold(int collapseThreshold) voidsetDebug(boolean debug) voidsetModel(boolean recessiveDisease, boolean dominantDisease, int controlPenetrance, int casePenetrance, boolean noMaxAlleleCounts, double upperFreqThreshold, boolean includeProtective) Set the disease model (inheritance and penetrance patterns).voidsetNumRandomIterations(int maxIterations, int bailOutAfter) voidsetPnLists(String[] cases, String[] controls)
-
Field Details
-
includeProtective
protected boolean includeProtective
-
-
Constructor Details
-
VariantAssociation
public VariantAssociation()Instantiate the class.
-
-
Method Details
-
setPnLists
- Parameters:
cases- the casescontrols- 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 diseasedominantDisease- true if dominant diseasecontrolPenetrance- maximum count among controls, -1 for no constraintcasePenetrance- true if recessive/dominant with no locus heterogeneitynoMaxAlleleCounts- true if no max allele count for each case in dominant/recessive modelsupperFreqThreshold- upper threshold for the allele frequencyincludeProtective- 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-valuebailOutAfter- 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
Add a variant.- Parameters:
variantString- a tab delimited string with variantId,pn,callCopies,nullScore,altScore
-
calculateValues
Calculate the p-value and other values for the current genetic feature.- Returns:
- the values as a tab delimited string
-