Change to max value of ExcessHet

This commit is contained in:
meganshand 2016-06-28 14:23:39 -04:00
parent db196e709a
commit 1b921666a7
2 changed files with 5 additions and 1 deletions

View File

@ -139,8 +139,9 @@ public class ExcessHet extends InfoFieldAnnotation implements StandardAnnotation
double pval = exactTest(genotypeCounts);
//If the actual phredPval would be infinity we will probably still filter out just a very large number
//Since the method does not guarantee precision for any p-value smaller than 1e-16, we can return the phred scaled version
if (pval == 0) {
return Integer.MAX_VALUE;
return -10.0 * Math.log10(minNeededValue);
}
double phredPval = -10.0 * Math.log10(pval);

View File

@ -223,6 +223,9 @@ public class ExcessHetUnitTest {
final double EHHets = new ExcessHet().calculateEH(allHet, allHet.getGenotypes());
Assert.assertTrue(Math.abs(EHsingleton) < Math.abs(EHHets), String.format("singleton=%f allHets=%f", EHsingleton, EHHets));
//Since all hets is such an extreme case and the sample size is large here, we know that the p-value should be 0
Assert.assertTrue(EHHets == 160.0, String.format("P-value of 0 should be phred scaled to 160.0"));
}
@DataProvider(name = "smallSets")