Merge pull request #1426 from broadinstitute/ms_excessHetSmallP
Changes max value output for ExcessHet
This commit is contained in:
commit
6471bda0cd
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Reference in New Issue