Bugfix for FisherStrand

-- FisherStrand pValues can sum to slightly greater than 1.0, so they need to be capped to convert to a Phred-scaled quality score
This commit is contained in:
Mark DePristo 2013-02-11 11:16:19 -08:00
parent 9a29d6d4be
commit 3231031c1a
1 changed files with 11 additions and 10 deletions

View File

@ -176,7 +176,8 @@ public class FisherStrand extends InfoFieldAnnotation implements StandardAnnotat
//System.out.printf("P-cutoff: %f\n", pCutoff); //System.out.printf("P-cutoff: %f\n", pCutoff);
//System.out.printf("P-value: %f\n\n", pValue); //System.out.printf("P-value: %f\n\n", pValue);
return pValue; // min is necessary as numerical precision can result in pValue being slightly greater than 1.0
return Math.min(pValue, 1.0);
} }
private static int [][] copyContingencyTable(int [][] t) { private static int [][] copyContingencyTable(int [][] t) {