-
Notifications
You must be signed in to change notification settings - Fork 596
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
Adds arg to add site level filters to genotype level in ReblockGvcfs #8484
Changes from all commits
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 |
---|---|---|
|
@@ -578,6 +578,32 @@ public void testFilters() throws IOException { | |
Assert.assertEquals(filteredRefBlockVC.getGenotype(0).getDP(), 12); // Ref block is combination of filtered variant with depth 22 and filtered ref block with depth 1 | ||
} | ||
|
||
@Test | ||
public void testMovingFilters() throws IOException { | ||
final File input = getTestFile("dragen.g.vcf"); | ||
final File output = createTempFile("reblockedgvcf", ".vcf"); | ||
|
||
final ArgumentsBuilder args = new ArgumentsBuilder(); | ||
args.addReference(new File(hg38Reference)) | ||
.add("V", input) | ||
.add("L", "chr1") | ||
.add(ReblockGVCF.ADD_FILTERS_TO_GENOTYPE, true) | ||
.addOutput(output); | ||
runCommandLine(args); | ||
|
||
final VariantContext filteredVC = VariantContextTestUtils.readEntireVCFIntoMemory(output.getAbsolutePath()).getRight().get(3); // last site in the file | ||
Assert.assertFalse(filteredVC.isFiltered()); | ||
Assert.assertTrue(filteredVC.getGenotype(0).isFiltered()); | ||
|
||
final VariantContext unfilteredVC = VariantContextTestUtils.readEntireVCFIntoMemory(output.getAbsolutePath()).getRight().get(1); | ||
Assert.assertFalse(unfilteredVC.isFiltered()); | ||
Assert.assertFalse(unfilteredVC.getGenotype(0).isFiltered()); | ||
|
||
final VariantContext filteredRefBlockVC = VariantContextTestUtils.readEntireVCFIntoMemory(output.getAbsolutePath()).getRight().get(0); | ||
Assert.assertFalse(filteredRefBlockVC.isFiltered()); // Ref block is unfiltered even though the input RefBlock and low qual variant were both filtered | ||
Assert.assertFalse(filteredRefBlockVC.getGenotype(0).isFiltered()); // Ref block genotype is also unfiltered | ||
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. Why is this what you want? 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. Hmm, that's a good question. I had assumed that it didn't make sense to have a ref block with a genotype level filter. The low quality variant here was dropped (incorporated into the Ref Block), and I was thinking that the GQ was enough information here that it would only be more confusing if we included the filter in the ref block. I suppose the outcome of this is that if we kept the filter status in the ref block it would make it into the final VCF at any sites that overlap the entire ref block. So if one variant had a dragen hard filter applied, but then was incorporated into a RefBlock, then all of the 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. To follow up here: we spoke offline and the conclusion was that GQ0 basically acts as a filter for ref blocks so it's ok to not propagate the filter from the low quality variants. |
||
} | ||
|
||
@Test | ||
public void testRemovingFormatAnnotations() { | ||
final File input = getTestFile("dragen.g.vcf"); | ||
|
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.
Do we already have a test for KEEP_SITE_FILTERS alone?
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.
Yeah, KEEP_SITE_FILTERS was put in earlier and has a test.