-
Notifications
You must be signed in to change notification settings - Fork 594
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
Fix case where hom-ref "variant" with no data had wrong sized PLs and #7644
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,6 +110,12 @@ public void testLowQualVariantToGQ0HomRef() { | |
Assert.assertTrue(!modified.filtersWereApplied()); | ||
Assert.assertEquals(modified.getLog10PError(), VariantContext.NO_LOG10_PERROR); | ||
|
||
final Genotype longPls = VariantContextTestUtils.makeG("sample1", Allele.NO_CALL, Allele.NO_CALL, 0,0,0,0,0,0); | ||
final VariantContext lotsOfZeroPls = makeNoDepthVC("lowQualVar", Arrays.asList(LONG_REF, DELETION, Allele.NON_REF_ALLELE), LONG_REF.length(), longPls); | ||
final VariantContext properlySubset = reblocker.lowQualVariantToGQ0HomRef(lotsOfZeroPls).make(); | ||
Assert.assertEquals(properlySubset.getGenotype(0).getPL().length, 3); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you check the content of PL also is correnct? is it all 0s or '.'? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Assert.assertEquals(...getPL(), new int [] { 0, 0, 0}) may just work. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It does work, thanks. This is done. |
||
|
||
|
||
//No-calls were throwing NPEs. Now they're not. | ||
final Genotype g2 = VariantContextTestUtils.makeG("sample1", Allele.NO_CALL,Allele.NO_CALL); | ||
final VariantContext noData = makeDeletionVC("noData", Arrays.asList(LONG_REF, DELETION, Allele.NON_REF_ALLELE), LONG_REF.length(), g2); | ||
|
@@ -425,6 +431,13 @@ private VariantContext makeDeletionVC(final String source, final List<Allele> al | |
.genotypes(Arrays.asList(genotypes)).unfiltered().log10PError(-3.0).attribute(VCFConstants.DEPTH_KEY, EXAMPLE_DP).make(); | ||
} | ||
|
||
private VariantContext makeNoDepthVC(final String source, final List<Allele> alleles, final int refLength, final Genotype... genotypes) { | ||
final int start = DEFAULT_START; | ||
final int stop = start+refLength-1; | ||
return new VariantContextBuilder(source, "1", start, stop, alleles) | ||
.genotypes(Arrays.asList(genotypes)).unfiltered().log10PError(-3.0).make(); | ||
} | ||
|
||
private Genotype addAD(final Genotype g, final int... ads) { | ||
return new GenotypeBuilder(g).AD(ads).make(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what a true here results into looking at the subsetAllele code. If it is what you need and that behavior from subsetAlleles is stable then I don't a problem with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The alternative is to drop the PLs, which I do not want. I've changed the parameter name to be a little more clear.