Fixed a small feature/bug that I introduced with the spanning deletions genotyping.
In the case where there's a low quality SNP under a spanning deletion in the gvcfs: if the SNP is not genotyped by GenotypeGVCFs (because it's just noise) we were still emitting a record with just the symbolic DEL allele (because that allele is high quality). We no longer do that.
This commit is contained in:
parent
7a75f4ae79
commit
c752b9bca6
|
|
@ -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
|
||||
*
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue