Skip to content

Commit 2e459a5

Browse files
authored
Updates to VcfComparator (#8973)
* updates changes for gq0 comparison more changes some vcfs have no gqs clean up change for NPE clean up whitespace * addressing comments
1 parent 3401a33 commit 2e459a5

File tree

7 files changed

+140
-56
lines changed

7 files changed

+140
-56
lines changed

src/main/java/org/broadinstitute/hellbender/tools/walkers/variantutils/VCFComparator.java

+119-41
Large diffs are not rendered by default.

src/test/java/org/broadinstitute/hellbender/tools/walkers/variantutils/VCFComparatorIntegrationTest.java

+18-15
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,21 @@ public class VCFComparatorIntegrationTest extends CommandLineProgramTest {
2020

2121
@DataProvider(name = "getTestVcfs")
2222
public Object[][] getTestVcfs() {
23-
return new Object[][] {
24-
{ " -L chr1:186475", "expected_warning_as_vqslod.txt" },
25-
{ " -L chr1:186475 --ignore-attribute AS_VQSLOD", "empty_file.txt" },
26-
{ " -L chr1:187471 --ignore-attribute AS_VQSLOD", "expected_warning_filter.txt" },
27-
{ " -L chr1:186475-945669 " + DEFAULT_WARP_SETTINGS, "empty_file.txt" },
28-
{ " -L chr1:945670 " + DEFAULT_WARP_SETTINGS, "qual_diff_warning.txt"}, // different QUAL values
29-
{ " -L chr1:945670 --qual-change-allowed 0.1 --ignore-attribute AS_VQSLOD", "empty_file.txt"},
30-
{ " -L chr1:186475 --mute-acceptable-diffs", "empty_file.txt" } // low quality site is muted even though the AS_VQSLOD is different
23+
return new Object[][]{
24+
{" -L chr1:186475", "expected_warning_as_vqslod.txt"},
25+
{" -L chr1:186475 --ignore-attribute AS_VQSLOD", "empty_file.txt"},
26+
{" -L chr1:187471 --ignore-attribute AS_VQSLOD", "expected_warning_filter.txt"},
27+
{" -L chr1:186475-945669 " + DEFAULT_WARP_SETTINGS, "empty_file.txt"},
28+
{" -L chr1:945670 " + DEFAULT_WARP_SETTINGS, "qual_diff_warning.txt"}, // different QUAL values
29+
{" -L chr1:945670 --qual-change-allowed 0.1 --ignore-attribute AS_VQSLOD", "empty_file.txt"},
30+
{" -L chr1:186475 --mute-acceptable-diffs", "empty_file.txt"} // low quality site is muted even though the AS_VQSLOD is different
3131
};
3232
}
3333

3434
@Test(dataProvider = "getTestVcfs")
3535
public void testAnnotationDifferences(String args, String expectedWarnings) throws IOException {
3636
final IntegrationTestSpec testSpec = new IntegrationTestSpec(
37-
" -R " + hg38Reference +
37+
" -R " + hg38Reference +
3838
" -V:actual " + TEST_DATA_DIRECTORY + "actual.vcf" +
3939
" -V:expected " + TEST_DATA_DIRECTORY + "expected.vcf" +
4040
" --output-warnings %s" +
@@ -66,13 +66,16 @@ public void testExpectedFailure() {
6666

6767
@DataProvider(name = "getTestGvcfs")
6868
public Object[][] getTestGvcfs() {
69-
return new Object[][] {
70-
{ " -L chr1:864084-864610", "empty_file.txt" }, //matching ref blocks
71-
{ " -L chr1:54682-347969", "ref_block_warning.txt"}, // non-matching ref block
72-
{ " -L chr1:792417", "tree_score_warning.txt"}, // variant site
73-
{ " -L chr1:792417 --ignore-non-ref-data --" +
69+
return new Object[][]{
70+
{" -L chr1:864084-864610", "empty_file.txt"}, //matching ref blocks
71+
{" -L chr1:54682-347969", "ref_block_warning.txt"}, // non-matching ref block
72+
{" -L chr1:792417", "tree_score_warning.txt"}, // variant site
73+
{" -L chr1:792417 --ignore-non-ref-data --" +
7474
ReblockGVCF.ANNOTATIONS_TO_KEEP_LONG_NAME + " TREE_SCORE", "tree_score_warning.txt"}, // when non-ref data is dropped non-GATK annotations can be dropped
75-
{ " -L chr1:792417 --ignore-attribute TREE_SCORE", "empty_file.txt"}
75+
{" -L chr1:792417 --ignore-attribute TREE_SCORE --ignore-non-ref-data", "empty_file.txt"}, // check that RAW_MQandDP matches with and without --ignore-non-ref-data
76+
{" -L chr1:792417 --ignore-attribute TREE_SCORE", "empty_file.txt"},
77+
{" -L chr1:950542", "depth_warning.txt"},
78+
{" -L chr1:950542 --ignore-gq0", "empty_file.txt"}
7679
};
7780
}
7881

src/test/resources/org/broadinstitute/hellbender/tools/walkers/VCFComparator/actual.NA12878.rb.g.vcf

+1
Original file line numberDiff line numberDiff line change
@@ -3507,3 +3507,4 @@ chr1 922687 . C <NON_REF> . . END=922690 GT:DP:GQ 0/0:7:20
35073507
chr1 922691 . C <NON_REF> . . END=922701 GT:DP:GQ 0/0:7:0
35083508
chr1 922702 . C <NON_REF> . . END=922711 GT:DP:GQ 0/0:7:20
35093509
chr1 922712 . T <NON_REF> . . END=950541 GT:DP:GQ 0/0:4:0
3510+
chr1 950542 . G <NON_REF> . . END=950543 GT:DP:GQ 0/0:4:0

src/test/resources/org/broadinstitute/hellbender/tools/walkers/VCFComparator/expected.NA12878.rb.g.vcf

+1
Original file line numberDiff line numberDiff line change
@@ -3506,3 +3506,4 @@ chr1 922687 . C <NON_REF> . . END=922690 GT:DP:GQ 0/0:7:20
35063506
chr1 922691 . C <NON_REF> . . END=922701 GT:DP:GQ 0/0:7:0
35073507
chr1 922702 . C <NON_REF> . . END=922711 GT:DP:GQ 0/0:7:20
35083508
chr1 922712 . T <NON_REF> . . END=950541 GT:DP:GQ 0/0:4:0
3509+
chr1 950542 . G <NON_REF> . . END=950543 GT:DP:GQ 0/0:5:0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
At position chr1:950542 Genotypes have different DP value: actual has 4 expected has 5

0 commit comments

Comments
 (0)