diff --git a/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorEngine.java b/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorEngine.java index c51349408..b9526be48 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorEngine.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorEngine.java @@ -188,8 +188,14 @@ public class VariantAnnotatorEngine { if ( dbsnp != null && (!vc.hasAttribute(VariantContext.ID_KEY) || vc.getAttribute(VariantContext.ID_KEY).equals(VCFConstants.EMPTY_ID_FIELD)) ) infoAnnotations.put(VariantContext.ID_KEY, dbsnp.getRsID()); } else { - List dbRod = tracker.getReferenceMetaData(dbSet.getKey()); - infoAnnotations.put(dbSet.getValue(), dbRod.size() == 0 ? false : true); + boolean overlapsComp = false; + for ( VariantContext comp : tracker.getVariantContexts(ref, dbSet.getKey(), null, ref.getLocus(), false, false) ) { + if ( !comp.isFiltered() ) { + overlapsComp = true; + break; + } + } + infoAnnotations.put(dbSet.getValue(), overlapsComp ? true : false); } } diff --git a/java/test/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorIntegrationTest.java b/java/test/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorIntegrationTest.java index 5d515422b..9c2a989e5 100755 --- a/java/test/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorIntegrationTest.java +++ b/java/test/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorIntegrationTest.java @@ -84,10 +84,18 @@ public class VariantAnnotatorIntegrationTest extends WalkerTest { } @Test - public void testDBTag() { + public void testDBTagWithDbsnp() { WalkerTestSpec spec = new WalkerTestSpec( baseTestString() + " -D " + GATKDataLocation + "dbsnp_129_b36.rod -G \"Standard\" -B variant,VCF," + validationDataLocation + "vcfexample3empty.vcf -BTI variant", 1, Arrays.asList("24d9649943be876e78f76bbf9ff5b501")); - executeTest("getting DB tag", spec); + executeTest("getting DB tag with dbSNP", spec); + } + + @Test + public void testDBTagWithHapMap() { + WalkerTestSpec spec = new WalkerTestSpec( + baseTestString() + " -B compH3,VCF," + validationDataLocation + "fakeHM3.vcf -G \"Standard\" -B variant,VCF," + validationDataLocation + "vcfexample3empty.vcf -BTI variant", 1, + Arrays.asList("77980e4f741c09d88f7a91faf86037c6")); + executeTest("getting DB tag with HM3", spec); } }