From 80a513aa8e8556590c13d5501d51fe1302ff5ea8 Mon Sep 17 00:00:00 2001 From: Megan Shand Date: Fri, 26 Jul 2024 13:16:15 -0400 Subject: [PATCH] adding test to match WARP tests edge case --- .../ReblockGVCFIntegrationTest.java | 31 ++++- .../ReblockGVCF/reblockEdgeCase.vcf | 106 ++++++++++++++++++ 2 files changed, 136 insertions(+), 1 deletion(-) create mode 100644 src/test/resources/org/broadinstitute/hellbender/tools/walkers/variantutils/ReblockGVCF/reblockEdgeCase.vcf diff --git a/src/test/java/org/broadinstitute/hellbender/tools/walkers/variantutils/ReblockGVCFIntegrationTest.java b/src/test/java/org/broadinstitute/hellbender/tools/walkers/variantutils/ReblockGVCFIntegrationTest.java index 7d7164a86da..cd93ed11985 100644 --- a/src/test/java/org/broadinstitute/hellbender/tools/walkers/variantutils/ReblockGVCFIntegrationTest.java +++ b/src/test/java/org/broadinstitute/hellbender/tools/walkers/variantutils/ReblockGVCFIntegrationTest.java @@ -711,9 +711,38 @@ public void testRemovingAnnotationFromEmptyAttributes() { args.addReference(hg38Reference) .addVCF(input) .addOutput(output) - .add("format-annotations-to-remove","PRI"); + .add("format-annotations-to-remove", "PRI"); //make sure it doesn't error runCommandLine(args); } + + @Test + public void testNoCallWhenGQ0InNonRefAllele() { + final File input = getTestFile("reblockEdgeCase.vcf"); + final File output = createTempFile("reblockedgvcf", ".vcf"); + final ArgumentsBuilder args = new ArgumentsBuilder(); + + args.addReference(hg38Reference) + .add("V", input) + .add("do-qual-approx", true) + .add("floor-blocks", true) + .add("GQB", 20) + .add("GQB", 30) + .add("GQB", 40) + .addOutput(output); + + runCommandLine(args); + + final List outVCs = VariantContextTestUtils.readEntireVCFIntoMemory(output.getAbsolutePath()).getRight(); + boolean foundNoCallSite = false; + for (VariantContext vc : outVCs) { + if (vc.getStart() == 13675308) { + Assert.assertEquals(vc.getEnd(), 13675325); + Assert.assertEquals(vc.getGenotype(0).getGQ(), 0); + foundNoCallSite = true; + } + } + Assert.assertTrue(foundNoCallSite); + } } diff --git a/src/test/resources/org/broadinstitute/hellbender/tools/walkers/variantutils/ReblockGVCF/reblockEdgeCase.vcf b/src/test/resources/org/broadinstitute/hellbender/tools/walkers/variantutils/ReblockGVCF/reblockEdgeCase.vcf new file mode 100644 index 00000000000..e56573c1ea7 --- /dev/null +++ b/src/test/resources/org/broadinstitute/hellbender/tools/walkers/variantutils/ReblockGVCF/reblockEdgeCase.vcf @@ -0,0 +1,106 @@ +##fileformat=VCFv4.2 +##ALT= +##FILTER= +##FORMAT= +##FORMAT= +##FORMAT= +##FORMAT= +##FORMAT= +##FORMAT= +##FORMAT= +##FORMAT= +##FORMAT= +##GATKCommandLine.HaplotypeCaller= +##GATKCommandLine= +##GVCFBlock0-1=minGQ=0(inclusive),maxGQ=1(exclusive) +##GVCFBlock1-2=minGQ=1(inclusive),maxGQ=2(exclusive) +##GVCFBlock10-11=minGQ=10(inclusive),maxGQ=11(exclusive) +##GVCFBlock11-12=minGQ=11(inclusive),maxGQ=12(exclusive) +##GVCFBlock12-13=minGQ=12(inclusive),maxGQ=13(exclusive) +##GVCFBlock13-14=minGQ=13(inclusive),maxGQ=14(exclusive) +##GVCFBlock14-15=minGQ=14(inclusive),maxGQ=15(exclusive) +##GVCFBlock15-16=minGQ=15(inclusive),maxGQ=16(exclusive) +##GVCFBlock16-17=minGQ=16(inclusive),maxGQ=17(exclusive) +##GVCFBlock17-18=minGQ=17(inclusive),maxGQ=18(exclusive) +##GVCFBlock18-19=minGQ=18(inclusive),maxGQ=19(exclusive) +##GVCFBlock19-20=minGQ=19(inclusive),maxGQ=20(exclusive) +##GVCFBlock2-3=minGQ=2(inclusive),maxGQ=3(exclusive) +##GVCFBlock20-21=minGQ=20(inclusive),maxGQ=21(exclusive) +##GVCFBlock21-22=minGQ=21(inclusive),maxGQ=22(exclusive) +##GVCFBlock22-23=minGQ=22(inclusive),maxGQ=23(exclusive) +##GVCFBlock23-24=minGQ=23(inclusive),maxGQ=24(exclusive) +##GVCFBlock24-25=minGQ=24(inclusive),maxGQ=25(exclusive) +##GVCFBlock25-26=minGQ=25(inclusive),maxGQ=26(exclusive) +##GVCFBlock26-27=minGQ=26(inclusive),maxGQ=27(exclusive) +##GVCFBlock27-28=minGQ=27(inclusive),maxGQ=28(exclusive) +##GVCFBlock28-29=minGQ=28(inclusive),maxGQ=29(exclusive) +##GVCFBlock29-30=minGQ=29(inclusive),maxGQ=30(exclusive) +##GVCFBlock3-4=minGQ=3(inclusive),maxGQ=4(exclusive) +##GVCFBlock30-31=minGQ=30(inclusive),maxGQ=31(exclusive) +##GVCFBlock31-32=minGQ=31(inclusive),maxGQ=32(exclusive) +##GVCFBlock32-33=minGQ=32(inclusive),maxGQ=33(exclusive) +##GVCFBlock33-34=minGQ=33(inclusive),maxGQ=34(exclusive) +##GVCFBlock34-35=minGQ=34(inclusive),maxGQ=35(exclusive) +##GVCFBlock35-36=minGQ=35(inclusive),maxGQ=36(exclusive) +##GVCFBlock36-37=minGQ=36(inclusive),maxGQ=37(exclusive) +##GVCFBlock37-38=minGQ=37(inclusive),maxGQ=38(exclusive) +##GVCFBlock38-39=minGQ=38(inclusive),maxGQ=39(exclusive) +##GVCFBlock39-40=minGQ=39(inclusive),maxGQ=40(exclusive) +##GVCFBlock4-5=minGQ=4(inclusive),maxGQ=5(exclusive) +##GVCFBlock40-41=minGQ=40(inclusive),maxGQ=41(exclusive) +##GVCFBlock41-42=minGQ=41(inclusive),maxGQ=42(exclusive) +##GVCFBlock42-43=minGQ=42(inclusive),maxGQ=43(exclusive) +##GVCFBlock43-44=minGQ=43(inclusive),maxGQ=44(exclusive) +##GVCFBlock44-45=minGQ=44(inclusive),maxGQ=45(exclusive) +##GVCFBlock45-46=minGQ=45(inclusive),maxGQ=46(exclusive) +##GVCFBlock46-47=minGQ=46(inclusive),maxGQ=47(exclusive) +##GVCFBlock47-48=minGQ=47(inclusive),maxGQ=48(exclusive) +##GVCFBlock48-49=minGQ=48(inclusive),maxGQ=49(exclusive) +##GVCFBlock49-50=minGQ=49(inclusive),maxGQ=50(exclusive) +##GVCFBlock5-6=minGQ=5(inclusive),maxGQ=6(exclusive) +##GVCFBlock50-51=minGQ=50(inclusive),maxGQ=51(exclusive) +##GVCFBlock51-52=minGQ=51(inclusive),maxGQ=52(exclusive) +##GVCFBlock52-53=minGQ=52(inclusive),maxGQ=53(exclusive) +##GVCFBlock53-54=minGQ=53(inclusive),maxGQ=54(exclusive) +##GVCFBlock54-55=minGQ=54(inclusive),maxGQ=55(exclusive) +##GVCFBlock55-56=minGQ=55(inclusive),maxGQ=56(exclusive) +##GVCFBlock56-57=minGQ=56(inclusive),maxGQ=57(exclusive) +##GVCFBlock57-58=minGQ=57(inclusive),maxGQ=58(exclusive) +##GVCFBlock58-59=minGQ=58(inclusive),maxGQ=59(exclusive) +##GVCFBlock59-60=minGQ=59(inclusive),maxGQ=60(exclusive) +##GVCFBlock6-7=minGQ=6(inclusive),maxGQ=7(exclusive) +##GVCFBlock60-70=minGQ=60(inclusive),maxGQ=70(exclusive) +##GVCFBlock7-8=minGQ=7(inclusive),maxGQ=8(exclusive) +##GVCFBlock70-80=minGQ=70(inclusive),maxGQ=80(exclusive) +##GVCFBlock8-9=minGQ=8(inclusive),maxGQ=9(exclusive) +##GVCFBlock80-90=minGQ=80(inclusive),maxGQ=90(exclusive) +##GVCFBlock9-10=minGQ=9(inclusive),maxGQ=10(exclusive) +##GVCFBlock90-99=minGQ=90(inclusive),maxGQ=99(exclusive) +##GVCFBlock99-2147483647=minGQ=99(inclusive),maxGQ=2147483647(exclusive) +##INFO= +##INFO= +##INFO= +##INFO= +##INFO= +##INFO= +##INFO= +##INFO= +##INFO= +##INFO= +##INFO= +##INFO= +##INFO= +##INFO= +##INFO= +##INFO= +##INFO= +##contig= +##source=SelectVariants +#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT NA12878 +chr20 13675306 . AGAAGGAAGGAAGGAAGGAAGGAAG A,AGAAG, 0 . DP=26;ExcessHet=3.0103;MLEAC=0,0,0;MLEAF=0.00,0.00,0.00;RAW_MQ=70609.00 GT:AD:DP:GQ:PL:SB 0/0:8,0,0,0:8:24:0,44,673,41,397,607,24,380,377,360:8,0,0,0 +chr20 13675308 . AAGGAAGGAAGGAAG A,AGAAG, 0 . DP=26;ExcessHet=3.0103;MLEAC=0,0,0;MLEAF=0.00,0.00,0.00;RAW_MQ=70609.00 GT:AD:DP:GQ:PL:SB 0/0:0,0,0,0:0:0:0,20,313,18,39,249,0,21,18,0:0,0,0,0 +chr20 13675322 . G A, 0 . DP=26;ExcessHet=3.0103;MLEAC=0,0;MLEAF=0.00,0.00;RAW_MQ=70609.00 GT:AD:DP:GQ:PL:SB 0/0:6,0,0:6:19:0,19,252,19,252,252:4,2,0,0 +chr20 13675323 . G . . END=13675325 GT:DP:GQ:MIN_DP:PL 0/0:26:0:25:0,0,25 +chr20 13675326 . G A, 0.03 . DP=26;ExcessHet=3.0103;MLEAC=0,0;MLEAF=0.00,0.00;RAW_MQ=70609.00 GT:AD:DP:GQ:PGT:PID:PL:SB 0/1:0,0,0:0:0:0|1:13675295_AAG_A:1,0,0,2,2,3:0,0,0,0 +chr20 13675327 . G . . END=13675329 GT:DP:GQ:MIN_DP:PL 0/0:26:0:24:0,0,49 +chr20 13675330 . G A, 0 . DP=26;ExcessHet=3.0103;MLEAC=0,0;MLEAF=0.00,0.00;RAW_MQ=70609.00 GT:AD:DP:GQ:PL:SB 0/0:7,0,0:7:22:0,22,316,22,316,316:6,1,0,0