Make VA annotate dbsnp again
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3345 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
b09e7231d1
commit
572b383fe2
|
|
@ -185,7 +185,7 @@ public class VariantAnnotatorEngine {
|
||||||
DbSNPFeature dbsnp = DbSNPHelper.getFirstRealSNP(tracker.getReferenceMetaData(DbSNPHelper.STANDARD_DBSNP_TRACK_NAME));
|
DbSNPFeature dbsnp = DbSNPHelper.getFirstRealSNP(tracker.getReferenceMetaData(DbSNPHelper.STANDARD_DBSNP_TRACK_NAME));
|
||||||
infoAnnotations.put(VCFRecord.DBSNP_KEY, dbsnp == null ? "0" : "1");
|
infoAnnotations.put(VCFRecord.DBSNP_KEY, dbsnp == null ? "0" : "1");
|
||||||
// annotate dbsnp id if available and not already there
|
// 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());
|
infoAnnotations.put("ID", dbsnp.getRsID());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -199,10 +199,11 @@ public class VariantAnnotatorEngine {
|
||||||
infoAnnotations.put(VCFRecord.HAPMAP3_KEY, hapmap3.size() == 0 ? "0" : "1");
|
infoAnnotations.put(VCFRecord.HAPMAP3_KEY, hapmap3.size() == 0 ? "0" : "1");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//Process the info field
|
//Process the info field
|
||||||
List<Map<String, Object>> infoAnnotationOutputsList = new LinkedList<Map<String, Object>>(); //each element in infoAnnotationOutputs corresponds to a single line in the output VCF file
|
List<Map<String, Object>> infoAnnotationOutputsList = new LinkedList<Map<String, Object>>(); //each element in infoAnnotationOutputs corresponds to a single line in the output VCF file
|
||||||
infoAnnotationOutputsList.add(new HashMap<String, Object>(vc.getAttributes())); //keep the existing info-field annotations. After this infoAnnotationOutputsList.size() == 1, which means the output VCF file gains 1 line.
|
infoAnnotationOutputsList.add(new HashMap<String, Object>(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
|
//go through all the requested info annotationTypes
|
||||||
for ( InfoFieldAnnotation annotationType : requestedInfoAnnotations )
|
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<VariantContext> returnValue = new LinkedList<VariantContext>();
|
Collection<VariantContext> returnValue = new LinkedList<VariantContext>();
|
||||||
for(Map<String, Object> infoAnnotationOutput : infoAnnotationOutputsList) {
|
for(Map<String, Object> infoAnnotationOutput : infoAnnotationOutputsList) {
|
||||||
returnValue.add( new VariantContext(vc.getName(), vc.getLocation(), vc.getAlleles(), genotypes, vc.getNegLog10PError(), vc.getFilters(), infoAnnotationOutput) );
|
returnValue.add( new VariantContext(vc.getName(), vc.getLocation(), vc.getAlleles(), genotypes, vc.getNegLog10PError(), vc.getFilters(), infoAnnotationOutput) );
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ public class GenomicAnnotatorIntegrationTest extends WalkerTest {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
String[] md5WithDashSArg = {"c5bcbad4f4bb8455eea46c1a51a77d2a"};
|
String[] md5WithDashSArg = {"fb6f52b72610a4f6bcf4c130ec14705a"};
|
||||||
WalkerTestSpec specWithSArg = new WalkerTestSpec(
|
WalkerTestSpec specWithSArg = new WalkerTestSpec(
|
||||||
"-T GenomicAnnotator -R " + oneKGLocation + "reference/human_b36_both.fasta " +
|
"-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 " +
|
"-B variant,vcf,/humgen/gsa-hpprojects/GATK/data/Annotations/examples/CEU_hapmap_nogt_23_subset.vcf " +
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue