diff --git a/src/main/java/org/broadinstitute/hellbender/engine/filters/VariantIDsVariantFilter.java b/src/main/java/org/broadinstitute/hellbender/engine/filters/VariantIDsVariantFilter.java index 32d07e82d70..1298c8b87e5 100644 --- a/src/main/java/org/broadinstitute/hellbender/engine/filters/VariantIDsVariantFilter.java +++ b/src/main/java/org/broadinstitute/hellbender/engine/filters/VariantIDsVariantFilter.java @@ -5,6 +5,8 @@ import java.util.Set; import java.util.LinkedHashSet; +import java.util.*; +import java.util.stream.*; /** * Keep only variants with any of these IDs. @@ -22,6 +24,6 @@ public VariantIDsVariantFilter(Set keepIDs) { @Override public boolean test(final VariantContext vc) { - return includeIDs.contains(vc.getID()); + return Arrays.stream(vc.getID().split(";")).anyMatch(includeIDs::contains); } } diff --git a/src/test/resources/org/broadinstitute/hellbender/tools/walkers/variantutils/SelectVariants/complexExample1.vcf b/src/test/resources/org/broadinstitute/hellbender/tools/walkers/variantutils/SelectVariants/complexExample1.vcf index 6e8deacc026..7fd5f353b99 100644 --- a/src/test/resources/org/broadinstitute/hellbender/tools/walkers/variantutils/SelectVariants/complexExample1.vcf +++ b/src/test/resources/org/broadinstitute/hellbender/tools/walkers/variantutils/SelectVariants/complexExample1.vcf @@ -29,5 +29,6 @@ 1 10044557 . C T 62.22 . AF=0.50;AlleleBalance=0.68;DoC=31;HomopolymerRun=16;MAPQ0=0;NS=1;RMSMAPQ=85.34;SB=-0.00;SpanningDeletions=0 GT:DP:GQ ./. ./. 0/1:31:15 1 10045603 . AAAA A 40.26 PASS AF=0.50 GT:DP:GQ 0/1:15:8 0/0:15:8 1/1:15:8 1 10045604 . A ACAT 41.26 PASS AF=0.50 GT:DP:GQ 1/1:14:7 0/0:15:8 1/0:15:8 +1 10046982 testid0;testid1 C T 32.01 PASS AF=0.40;AlleleBalance=0.37;DoC=21;HomopolymerRun=0;MAPQ0=8;NS=1;RMSMAPQ=12.31;SB=-4.2;SpanningDeletions=0 GT:DP:GQ 1/0:3:49 ./. ./. 1 10048142 . A G 126.81 foo AF=1.00;DoC=36;HomopolymerRun=4;MAPQ0=0;NS=1;RMSMAPQ=82.11;SB=-85.45;SpanningDeletions=0 GT:DP:GQ 0/1:15:8 0/0:15:8 1/1:15:8 1 10048580 . T A 72.22 bar;baz AF=0.50;AlleleBalance=0.69;DoC=33;HomopolymerRun=6;MAPQ0=0;NS=1;RMSMAPQ=84.45;SB=-27.41;SpanningDeletions=0 GT:DP:GQ 0/1:15:8 0/0:15:8 1/1:15:8 diff --git a/src/test/resources/org/broadinstitute/hellbender/tools/walkers/variantutils/SelectVariants/expected/testSelectVariants_KeepSelectionID.vcf b/src/test/resources/org/broadinstitute/hellbender/tools/walkers/variantutils/SelectVariants/expected/testSelectVariants_KeepSelectionID.vcf index 9d41d7d9f6a..ee1dbfa312a 100644 --- a/src/test/resources/org/broadinstitute/hellbender/tools/walkers/variantutils/SelectVariants/expected/testSelectVariants_KeepSelectionID.vcf +++ b/src/test/resources/org/broadinstitute/hellbender/tools/walkers/variantutils/SelectVariants/expected/testSelectVariants_KeepSelectionID.vcf @@ -23,3 +23,4 @@ ##source=ArbitrarySource #CHROM POS ID REF ALT QUAL FILTER INFO FORMAT NA00001 NA00002 NA00003 1 10001292 testid1 G A 12.22 PASS AF=0.50;AlleleBalance=0.57;DoC=23;HomopolymerRun=0;MAPQ0=8;NS=1;RMSMAPQ=46.31;SB=-24.92;SpanningDeletions=0 GT:DP:GQ 1/0:23:19 ./. ./. +1 10046982 testid0;testid1 C T 32.01 PASS AF=0.40;AlleleBalance=0.37;DoC=21;HomopolymerRun=0;MAPQ0=8;NS=1;RMSMAPQ=12.31;SB=-4.2;SpanningDeletions=0 GT:DP:GQ 1/0:3:49 ./. ./.