Merge pull request #981 from broadinstitute/eb_no_lone_dels

Fixed a small feature/bug that I introduced with the spanning deletions genotyping
This commit is contained in:
Eric Banks 2015-05-13 13:27:16 -04:00
commit 5652cc6b5a
2 changed files with 22 additions and 1 deletions

View File

@ -261,7 +261,7 @@ public class GenotypeGVCFs extends RodWalker<VariantContext, VariantContextWrite
// only re-genotype polymorphic sites
if ( result.isVariant() ) {
VariantContext regenotypedVC = genotypingEngine.calculateGenotypes(result);
if ( regenotypedVC == null) {
if ( ! isProperlyPolymorphic(regenotypedVC) ) {
if (!INCLUDE_NON_VARIANTS)
return null;
}
@ -295,6 +295,16 @@ public class GenotypeGVCFs extends RodWalker<VariantContext, VariantContextWrite
return result;
}
/**
* Determines whether the provided VariantContext has real alternate alleles
*
* @param vc the VariantContext to evaluate
* @return true if it has proper alternate alleles, false otherwise
*/
private boolean isProperlyPolymorphic(final VariantContext vc) {
return ( vc != null && !vc.isSymbolic() );
}
/**
* Add genotyping-based annotations to the new VC
*

View File

@ -480,4 +480,15 @@ public class GenotypeGVCFsIntegrationTest extends WalkerTest {
spec.disableShadowBCF();
executeTest("testMultipleSpanningDeletionsMD5", spec);
}
@Test(enabled = true)
public void testSpanningDeletionDoesNotGetGenotypedWithNoOtherAlleles() {
WalkerTestSpec spec = new WalkerTestSpec(
"-T GenotypeGVCFs --no_cmdline_in_header -o %s -R " + b37KGReference +
" -V " + privateTestDir + "spanningDel.delOnly.g.vcf",
1,
Arrays.asList("46169d08f93e5ff57856c7b64717314b"));
spec.disableShadowBCF();
executeTest("testSpanningDeletionDoesNotGetGenotypedWithNoOtherAlleles", spec);
}
}