parent
967b4f4ae8
commit
16417bbf34
|
|
@ -159,8 +159,15 @@ public final class AlleleFrequencyCalculator extends AFCalculator {
|
|||
pOfNonZeroAltAlleles[alleleIndex] += genotypePosterior);
|
||||
}
|
||||
|
||||
// Make sure that we handle appropriately pOfNonZeroAltAlleles that are close to 1; values just over 1.0 due to
|
||||
// rounding error would result in NaN.
|
||||
// As every allele is present in at least one genotype, the p-non-zero-count for
|
||||
// any allele is bound above by 1.0 - minimum genotype posterior because at least one genotype
|
||||
// does not contain this allele.
|
||||
final double maximumPNonZeroCount = 1.0 - MathUtils.arrayMin(genotypePosteriors);
|
||||
|
||||
for (int allele = 0; allele < numAlleles; allele++) {
|
||||
log10POfZeroCountsByAllele[allele] += Math.log10(1 - pOfNonZeroAltAlleles[allele]);
|
||||
log10POfZeroCountsByAllele[allele] += Math.log10(1.0 - Math.min(maximumPNonZeroCount, pOfNonZeroAltAlleles[allele]));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -681,4 +681,13 @@ public class GenotypeGVCFsIntegrationTest extends WalkerTest {
|
|||
spec.disableShadowBCF();
|
||||
executeTest("testGenotypingSpanningDeletionAcrossLines", spec);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNewQualNaNBugFix() {
|
||||
final WalkerTestSpec spec = new WalkerTestSpec(
|
||||
baseTestString(" -newQual -V " + privateTestDir + "input-newqual-nan-bug-fix.vcf", b37KGReferenceWithDecoy),
|
||||
Collections.singletonList("503f4193c22fbcc451bd1c425b8b6bf8"));
|
||||
spec.disableShadowBCF();
|
||||
executeTest("testNewQualNaNBugFix", spec);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue