Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Really don't output VCs with no ALT if * gets dropped #5844

Merged
merged 1 commit into from
Mar 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -387,12 +387,12 @@ private OutputAlleleSubset calculateOutputAlleleSubset(final AFCalculationResult
final boolean isNonRefWhichIsLoneAltAllele = alternativeAlleleCount == 1 && allele.equals(Allele.NON_REF_ALLELE);
final boolean isPlausible = afCalculationResult.isPolymorphicPhredScaledQual(allele, configuration.genotypeArgs.STANDARD_CONFIDENCE_FOR_CALLING);

siteIsMonomorphic &= !isPlausible;

//it's possible that the upstream deletion that spanned this site was not emitted, mooting the symbolic spanning deletion allele
final boolean isSpuriousSpanningDeletion = GATKVCFConstants.isSpanningDeletion(allele) && !isVcCoveredByDeletion(vc);
final boolean toOutput = (isPlausible || forceKeepAllele(allele) || isNonRefWhichIsLoneAltAllele) && !isSpuriousSpanningDeletion;

siteIsMonomorphic &= !(isPlausible && !isSpuriousSpanningDeletion);

if (toOutput) {
outputAlleles.add(allele);
mleCounts.add(afCalculationResult.getAlleleCountAtMLE(allele));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ public void testCalculateGenotypes() {
final VariantContext vcSpanDel = new VariantContextBuilder("test1", "1",2, 2 + refAlleleSpanDel.length() - 1, vcAllelesSpanDel).
genotypes(genotypesSpanDel).make();
final VariantContext vcOut1 = genotypingEngine.calculateGenotypes(vcSpanDel, GenotypeLikelihoodsCalculationModel.INDEL, null);
Assert.assertTrue(vcOut1 == null || !vcOut1.getAlleles().contains(Allele.SPAN_DEL));
//the site is monomorphic, which becomes null
Assert.assertTrue(vcOut1 == null);

final List<Allele> mutliAllelicWithSpanDel = new ArrayList<>(Arrays.asList(refAlleleSpanDel, Allele.SPAN_DEL,
Allele.create("T")));
Expand All @@ -125,7 +126,8 @@ public void testCalculateGenotypes() {
final VariantContext vcMultiWithSpanDel = new VariantContextBuilder("test2", "1",2, 2 + refAlleleSpanDel.length() - 1, mutliAllelicWithSpanDel).
genotypes(regressionGenotypes).make();
final VariantContext vcOut2 = genotypingEngine.calculateGenotypes(vcMultiWithSpanDel, GenotypeLikelihoodsCalculationModel.SNP, null);
Assert.assertTrue(vcOut2 == null || vcOut2.isMonomorphicInSamples());
//low quality T should get dropped, leaving only star, which shouldn't be output
Assert.assertTrue(vcOut2 == null);
}

@Test //test for https://github.com/broadinstitute/gatk/issues/2530
Expand Down