Bugfix for ReferenceConfidenceModel

-- In the case where there's some variation to assembly and evaluate but the resulting haplotypes don't result in any called variants, the reference model would exception out with "java.lang.IllegalArgumentException: calledHaplotypes must contain the refHaplotype".  Now we detect this case and emit the standard no variation output.
-- [delivers #54625060]
This commit is contained in:
Mark DePristo 2013-08-06 15:51:57 -04:00
parent 6dfd17122f
commit 40bc7d6a9c
2 changed files with 16 additions and 3 deletions

View File

@ -791,9 +791,13 @@ public class HaplotypeCaller extends ActiveRegionWalker<List<VariantContext>, In
if( DEBUG ) { logger.info("----------------------------------------------------------------------------------"); }
if ( emitReferenceConfidence() ) {
return referenceConfidenceModel.calculateRefConfidence(assemblyResult.getRefHaplotype(),
calledHaplotypes.getCalledHaplotypes(), assemblyResult.paddedReferenceLoc, assemblyResult.regionForGenotyping,
stratifiedReadMap, calledHaplotypes.getCalls());
if ( calledHaplotypes.getCalls().isEmpty() ) {
// no called all of the potential haplotypes
return referenceModelForNoVariation(originalActiveRegion, false);
} else
return referenceConfidenceModel.calculateRefConfidence(assemblyResult.getRefHaplotype(),
calledHaplotypes.getCalledHaplotypes(), assemblyResult.paddedReferenceLoc, assemblyResult.regionForGenotyping,
stratifiedReadMap, calledHaplotypes.getCalls());
} else {
return calledHaplotypes.getCalls();
}

View File

@ -85,4 +85,13 @@ public class HaplotypeCallerGVCFIntegrationTest extends WalkerTest {
final WalkerTestSpec spec = new WalkerTestSpec(commandLine + " -o %s", Arrays.asList(md5));
executeTest(name, spec);
}
@Test
public void testERCRegionWithNoCalledHaplotypes() {
final String commandLine = String.format("-T HaplotypeCaller -R %s -I %s -L %s -ERC GVCF",
b37KGReference, privateTestDir + "noCallRefModel.bam", "20:17000001-18000001");
final WalkerTestSpec spec = new WalkerTestSpec(commandLine + " -o %s", Arrays.asList(""));
spec.disableShadowBCF();
executeTest("testERCRegionWithNoCalledHaplotypes", spec);
}
}