Skip to content

Commit 99a20d5

Browse files
committed
Adding in a specific test that the FILTER field exists.
1 parent 5bed7cf commit 99a20d5

File tree

11 files changed

+128
-0
lines changed

11 files changed

+128
-0
lines changed

src/test/java/org/broadinstitute/hellbender/tools/funcotator/FuncotatorIntegrationTest.java

+38
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ public class FuncotatorIntegrationTest extends CommandLineProgramTest {
6060
private static final String GERMLINE_DATASOURCES_FOLDER = "funcotator_dataSources_germline_latest";
6161

6262
private static final String XSV_CLINVAR_MULTIHIT_TEST_VCF = toolsTestDir + "funcotator" + File.separator + "clinvar_hg19_multihit_test.vcf";
63+
private static final String FILTER_TEST_VCF = toolsTestDir + "funcotator" + File.separator + "FILTER_test.vcf";
6364
private static final String DS_XSV_CLINVAR_TESTS = largeFileTestDir + "funcotator" + File.separator + "small_ds_clinvar_hg19" + File.separator;
65+
private static final String DS_FILTER_PARSE_TESTS = largeFileTestDir + "funcotator" + File.separator + "small_ds_FILTER_test" + File.separator;
66+
6467
private static final String NOT_M2_TEST_HG19 = toolsTestDir + "funcotator/NotM2_test_custom_maf_fields.vcf";
6568
private static final String M2_TEST_HG19 = toolsTestDir + "funcotator/M2_test_custom_maf_fields.vcf";
6669
private static final String NOT_M2_TEST_HG19_TUMOR_ONLY = toolsTestDir + "funcotator/NotM2_test_custom_maf_fields_tumor_only.vcf";
@@ -903,6 +906,41 @@ public void testCanAnnotateHg38ClinvarAndGencodeV28() {
903906
.count(), NUM_CLINVAR_HITS);
904907
}
905908

909+
@Test
910+
public void testFilterParsing() {
911+
912+
final File outputFile = createTempFile("tmpTestFilterParsing", "vcf");
913+
914+
final ArgumentsBuilder arguments = createBaselineArgumentsForFuncotator(
915+
FILTER_TEST_VCF,
916+
outputFile,
917+
b37Reference,
918+
DS_FILTER_PARSE_TESTS,
919+
FuncotatorTestConstants.REFERENCE_VERSION_HG19,
920+
FuncotatorArgumentDefinitions.OutputFormatType.VCF,
921+
false);
922+
923+
arguments.addBooleanArgument(FuncotatorArgumentDefinitions.FORCE_B37_TO_HG19_REFERENCE_CONTIG_CONVERSION, true);
924+
925+
runCommandLine(arguments);
926+
927+
final Pair<VCFHeader, List<VariantContext>> tempVcf = VariantContextTestUtils.readEntireVCFIntoMemory(outputFile.getAbsolutePath());
928+
Assert.assertEquals( tempVcf.getRight().size(), 1 );
929+
930+
final String[] funcotatorKeys = FuncotatorUtils.extractFuncotatorKeysFromHeaderDescription(tempVcf.getLeft().getInfoHeaderLine(VcfOutputRenderer.FUNCOTATOR_VCF_FIELD_NAME).getDescription());
931+
932+
final VariantContext variantContext = tempVcf.getRight().get(0);
933+
final Map<Allele, FuncotationMap> funcs = FuncotatorUtils.createAlleleToFuncotationMapFromFuncotationVcfAttribute(
934+
funcotatorKeys, variantContext, "Gencode_19_annotationTranscript", "FAKE_SOURCE");
935+
936+
final String txId = funcs.get(variantContext.getAlternateAllele(0)).getTranscriptList().get(0);
937+
Assert.assertEquals( funcs.get(variantContext.getAlternateAllele(0)).get(txId).size(), 1 );
938+
939+
final Funcotation funcotation = funcs.get(variantContext.getAlternateAllele(0)).get(txId).get(0);
940+
941+
Assert.assertEquals(funcotation.getField("dbSnp_FILTER"), "FILTER_8");
942+
}
943+
906944
@Test
907945
public void testExclusionFromDatasourceVcfToVcf() {
908946
// Clinvar datasource did go through one round of preprocessing to make contig names "1" --> "chr1" (for example). This is an issue with ClinVar, not GATK.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:6e43b7f14d6f7836abef57eefb2d309ccd1f2c0b34ba5fea5759af3f3daac602
3+
size 1771
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:987bf261c1152138adc618567d2ca689bac39c58058fcad0425a1fc43689ba10
3+
size 33359546
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:a923868bb4e69c3919dcb1ff1d8e81c9f3d617c51e5b933df45ec410b3297992
3+
size 18844
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:cb604e5862217c3978cc2fb0abf2f6f2cb8b4cf34681a026fedcd891aa0aa6f0
3+
size 1679
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:e7c09d309121a8664c3f465ca169fadbfe539a188ab541052c4e6719aa209a15
3+
size 23214
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:fd2aa8475b77a6c8e2c782a2de47c7ec8070bfd541303e548e96f787a8920c1d
3+
size 312
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:74883af09a5772034d53f2df884a82e34df415951081e5754bedf1517ee9faa9
3+
size 968
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:4d3f582d1ca1ed259c77e4a82f4bfed8e9253b4b5c3aba9a63eb08f75f5cc68d
3+
size 10353
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:d4e49f4d57d32943e1663cf9902460ff7a2e2c03dfaf0bd3c5fc7ad9f01c2d47
3+
size 441

0 commit comments

Comments
 (0)