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 56f842533..91e3a9329 100755 --- a/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorEngine.java +++ b/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorEngine.java @@ -185,7 +185,7 @@ public class VariantAnnotatorEngine { DbSNPFeature dbsnp = DbSNPHelper.getFirstRealSNP(tracker.getReferenceMetaData(DbSNPHelper.STANDARD_DBSNP_TRACK_NAME)); infoAnnotations.put(VCFRecord.DBSNP_KEY, dbsnp == null ? "0" : "1"); // annotate dbsnp id if available and not already there - if ( dbsnp != null && !vc.hasAttribute("ID") ) + if ( dbsnp != null && (!vc.hasAttribute("ID") || vc.getAttribute("ID").equals(VCFRecord.EMPTY_ID_FIELD)) ) infoAnnotations.put("ID", dbsnp.getRsID()); } @@ -199,10 +199,11 @@ public class VariantAnnotatorEngine { infoAnnotations.put(VCFRecord.HAPMAP3_KEY, hapmap3.size() == 0 ? "0" : "1"); } - //Process the info field List> infoAnnotationOutputsList = new LinkedList>(); //each element in infoAnnotationOutputs corresponds to a single line in the output VCF file infoAnnotationOutputsList.add(new HashMap(vc.getAttributes())); //keep the existing info-field annotations. After this infoAnnotationOutputsList.size() == 1, which means the output VCF file gains 1 line. + // put the DB membership info in + infoAnnotationOutputsList.get(0).putAll(infoAnnotations); //go through all the requested info annotationTypes for ( InfoFieldAnnotation annotationType : requestedInfoAnnotations ) @@ -266,7 +267,7 @@ public class VariantAnnotatorEngine { } } - //Create a separate VariantContext (aka. output line) for each element in infoAnnotationOutputsList + //Create a separate VariantContext (aka. output line) for each element in infoAnnotationOutputsList Collection returnValue = new LinkedList(); for(Map infoAnnotationOutput : infoAnnotationOutputsList) { returnValue.add( new VariantContext(vc.getName(), vc.getLocation(), vc.getAlleles(), genotypes, vc.getNegLog10PError(), vc.getFilters(), infoAnnotationOutput) ); diff --git a/java/test/org/broadinstitute/sting/playground/gatk/walkers/annotator/GenomicAnnotatorIntegrationTest.java b/java/test/org/broadinstitute/sting/playground/gatk/walkers/annotator/GenomicAnnotatorIntegrationTest.java index e57ba1923..bff12b8ee 100755 --- a/java/test/org/broadinstitute/sting/playground/gatk/walkers/annotator/GenomicAnnotatorIntegrationTest.java +++ b/java/test/org/broadinstitute/sting/playground/gatk/walkers/annotator/GenomicAnnotatorIntegrationTest.java @@ -26,7 +26,7 @@ public class GenomicAnnotatorIntegrationTest extends WalkerTest { */ - String[] md5WithDashSArg = {"c5bcbad4f4bb8455eea46c1a51a77d2a"}; + String[] md5WithDashSArg = {"fb6f52b72610a4f6bcf4c130ec14705a"}; WalkerTestSpec specWithSArg = new WalkerTestSpec( "-T GenomicAnnotator -R " + oneKGLocation + "reference/human_b36_both.fasta " + "-B variant,vcf,/humgen/gsa-hpprojects/GATK/data/Annotations/examples/CEU_hapmap_nogt_23_subset.vcf " +