diff --git a/public/java/src/org/broadinstitute/sting/gatk/refdata/features/DbSNPHelper.java b/public/java/src/org/broadinstitute/sting/gatk/refdata/features/DbSNPHelper.java index e6e7a7588..8d32a9bf9 100644 --- a/public/java/src/org/broadinstitute/sting/gatk/refdata/features/DbSNPHelper.java +++ b/public/java/src/org/broadinstitute/sting/gatk/refdata/features/DbSNPHelper.java @@ -25,7 +25,6 @@ package org.broadinstitute.sting.gatk.refdata.features; import net.sf.samtools.util.SequenceUtil; -import org.broad.tribble.Feature; import org.broad.tribble.annotation.Strand; import org.broad.tribble.dbsnp.DbSNPFeature; import org.broadinstitute.sting.utils.Utils; @@ -44,50 +43,13 @@ public class DbSNPHelper { private DbSNPHelper() {} // don't make a DbSNPHelper - public static DbSNPFeature getFirstRealSNP(List dbsnpList) { - if (dbsnpList == null) - return null; - - DbSNPFeature dbsnp = null; - for (Object d : dbsnpList) { - if (d instanceof DbSNPFeature && DbSNPHelper.isSNP((DbSNPFeature)d)) { - dbsnp = (DbSNPFeature) d; - break; - } - } - - return dbsnp; - } - - public static String rsIDOfFirstRealSNP(List featureList, boolean deleteMe) { - if (featureList == null) - return null; - - String rsID = null; - for ( Feature d : featureList ) { - if ( d instanceof DbSNPFeature ) { - if ( DbSNPHelper.isSNP((DbSNPFeature)d) ) { - rsID = ((DbSNPFeature)d).getRsID(); - break; - } - } else if ( d instanceof VariantContext) { - if ( ((VariantContext)d).isSNP() ) { - rsID = ((VariantContext)d).getID(); - break; - } - } - } - - return rsID; - } - - public static String rsIDOfFirstRealSNP(List VCs) { + public static String rsIDOfFirstRealVariant(List VCs, VariantContext.Type type) { if ( VCs == null ) return null; String rsID = null; for ( VariantContext vc : VCs ) { - if ( vc.isSNP() ) { + if ( vc.getType() == type ) { rsID = vc.getID(); break; } @@ -96,28 +58,6 @@ public class DbSNPHelper { return rsID; } - public static String rsIDOfFirstRealIndel(List featureList) { - if (featureList == null) - return null; - - String rsID = null; - for ( Feature d : featureList ) { - if ( d instanceof DbSNPFeature ) { - if ( DbSNPHelper.isIndel((DbSNPFeature) d) ) { - rsID = ((DbSNPFeature)d).getRsID(); - break; - } - } else if ( d instanceof VariantContext) { - if ( ((VariantContext)d).isIndel() ) { - rsID = ((VariantContext)d).getID(); - break; - } - } - } - - return rsID; - } - /** * get the -1 * (log 10 of the error value) * diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/AlleleBalance.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/AlleleBalance.java index 219ccbc0c..6a2ffe189 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/AlleleBalance.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/AlleleBalance.java @@ -25,11 +25,10 @@ package org.broadinstitute.sting.gatk.walkers.annotator; -import org.broad.tribble.Feature; -import org.broadinstitute.sting.commandline.RodBinding; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; +import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompatibleWalker; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.InfoFieldAnnotation; import org.broadinstitute.sting.utils.MathUtils; import org.broadinstitute.sting.utils.codecs.vcf.VCFHeaderLineType; @@ -46,7 +45,7 @@ import java.util.Map; public class AlleleBalance extends InfoFieldAnnotation { - public Map annotate(RefMetaDataTracker tracker, Map> rodBindings, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { + public Map annotate(RefMetaDataTracker tracker, AnnotatorCompatibleWalker walker, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { if ( stratifiedContexts.size() == 0 ) return null; diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/AlleleBalanceBySample.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/AlleleBalanceBySample.java index df9890d64..ddb7ab828 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/AlleleBalanceBySample.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/AlleleBalanceBySample.java @@ -1,10 +1,9 @@ package org.broadinstitute.sting.gatk.walkers.annotator; -import org.broad.tribble.Feature; -import org.broadinstitute.sting.commandline.RodBinding; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; +import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompatibleWalker; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.ExperimentalAnnotation; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.GenotypeAnnotation; import org.broadinstitute.sting.utils.MathUtils; @@ -19,7 +18,7 @@ import java.util.*; public class AlleleBalanceBySample extends GenotypeAnnotation implements ExperimentalAnnotation { - public Map annotate(RefMetaDataTracker tracker, Map> rodBindings, ReferenceContext ref, AlignmentContext stratifiedContext, VariantContext vc, Genotype g) { + public Map annotate(RefMetaDataTracker tracker, AnnotatorCompatibleWalker walker, ReferenceContext ref, AlignmentContext stratifiedContext, VariantContext vc, Genotype g) { Double ratio = annotateSNP(stratifiedContext, vc, g); if (ratio == null) return null; diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/BaseCounts.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/BaseCounts.java index 76daaa06b..ecfd9b707 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/BaseCounts.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/BaseCounts.java @@ -31,11 +31,10 @@ package org.broadinstitute.sting.gatk.walkers.annotator; -import org.broad.tribble.Feature; -import org.broadinstitute.sting.commandline.RodBinding; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; +import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompatibleWalker; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.InfoFieldAnnotation; import org.broadinstitute.sting.utils.BaseUtils; import org.broadinstitute.sting.utils.codecs.vcf.VCFHeaderLineType; @@ -50,7 +49,7 @@ import java.util.Map; public class BaseCounts extends InfoFieldAnnotation { - public Map annotate(RefMetaDataTracker tracker, Map> rodBindings, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { + public Map annotate(RefMetaDataTracker tracker, AnnotatorCompatibleWalker walker, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { if ( stratifiedContexts.size() == 0 ) return null; diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/ChromosomeCounts.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/ChromosomeCounts.java index b2a3e6a26..ad06dcf52 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/ChromosomeCounts.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/ChromosomeCounts.java @@ -25,11 +25,10 @@ package org.broadinstitute.sting.gatk.walkers.annotator; -import org.broad.tribble.Feature; -import org.broadinstitute.sting.commandline.RodBinding; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; +import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompatibleWalker; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.InfoFieldAnnotation; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.StandardAnnotation; import org.broadinstitute.sting.utils.codecs.vcf.VCFConstants; @@ -52,7 +51,7 @@ public class ChromosomeCounts extends InfoFieldAnnotation implements StandardAnn new VCFInfoHeaderLine(VCFConstants.ALLELE_COUNT_KEY, VCFHeaderLineCount.A, VCFHeaderLineType.Integer, "Allele count in genotypes, for each ALT allele, in the same order as listed"), new VCFInfoHeaderLine(VCFConstants.ALLELE_NUMBER_KEY, 1, VCFHeaderLineType.Integer, "Total number of alleles in called genotypes") }; - public Map annotate(RefMetaDataTracker tracker, Map> rodBindings, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { + public Map annotate(RefMetaDataTracker tracker, AnnotatorCompatibleWalker walker, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { if ( ! vc.hasGenotypes() ) return null; diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/DepthOfCoverage.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/DepthOfCoverage.java index f2abbc5b8..a4d8db5bd 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/DepthOfCoverage.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/DepthOfCoverage.java @@ -1,10 +1,9 @@ package org.broadinstitute.sting.gatk.walkers.annotator; -import org.broad.tribble.Feature; -import org.broadinstitute.sting.commandline.RodBinding; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; +import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompatibleWalker; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.InfoFieldAnnotation; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.StandardAnnotation; import org.broadinstitute.sting.utils.codecs.vcf.VCFConstants; @@ -20,7 +19,7 @@ import java.util.Map; public class DepthOfCoverage extends InfoFieldAnnotation implements StandardAnnotation { - public Map annotate(RefMetaDataTracker tracker, Map> rodBindings, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { + public Map annotate(RefMetaDataTracker tracker, AnnotatorCompatibleWalker walker, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { if ( stratifiedContexts.size() == 0 ) return null; diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/DepthPerAlleleBySample.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/DepthPerAlleleBySample.java index 958075a92..1652c8de7 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/DepthPerAlleleBySample.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/DepthPerAlleleBySample.java @@ -1,10 +1,9 @@ package org.broadinstitute.sting.gatk.walkers.annotator; -import org.broad.tribble.Feature; -import org.broadinstitute.sting.commandline.RodBinding; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; +import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompatibleWalker; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.GenotypeAnnotation; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.StandardAnnotation; import org.broadinstitute.sting.utils.codecs.vcf.VCFFormatHeaderLine; @@ -30,7 +29,7 @@ public class DepthPerAlleleBySample extends GenotypeAnnotation implements Standa private static String DEL = "DEL"; // constant, for speed: no need to create a key string for deletion allele every time - public Map annotate(RefMetaDataTracker tracker, Map> rodBindings, ReferenceContext ref, AlignmentContext stratifiedContext, VariantContext vc, Genotype g) { + public Map annotate(RefMetaDataTracker tracker, AnnotatorCompatibleWalker walker, ReferenceContext ref, AlignmentContext stratifiedContext, VariantContext vc, Genotype g) { if ( g == null || !g.isCalled() ) return null; diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/FisherStrand.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/FisherStrand.java index 0ad643a4e..0cfca48fa 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/FisherStrand.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/FisherStrand.java @@ -25,11 +25,10 @@ package org.broadinstitute.sting.gatk.walkers.annotator; import cern.jet.math.Arithmetic; -import org.broad.tribble.Feature; -import org.broadinstitute.sting.commandline.RodBinding; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; +import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompatibleWalker; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.InfoFieldAnnotation; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.StandardAnnotation; import org.broadinstitute.sting.gatk.walkers.genotyper.IndelGenotypeLikelihoodsCalculationModel; @@ -48,7 +47,7 @@ public class FisherStrand extends InfoFieldAnnotation implements StandardAnnotat private static final String FS = "FS"; private static final double MIN_PVALUE = 1E-320; - public Map annotate(RefMetaDataTracker tracker, Map> rodBindings, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { + public Map annotate(RefMetaDataTracker tracker, AnnotatorCompatibleWalker walker, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { if ( ! vc.isVariant() || vc.isFiltered() ) return null; diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/GCContent.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/GCContent.java index f8e422e23..a46473f60 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/GCContent.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/GCContent.java @@ -1,10 +1,9 @@ package org.broadinstitute.sting.gatk.walkers.annotator; -import org.broad.tribble.Feature; -import org.broadinstitute.sting.commandline.RodBinding; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; +import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompatibleWalker; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.ExperimentalAnnotation; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.InfoFieldAnnotation; import org.broadinstitute.sting.utils.BaseUtils; @@ -20,7 +19,7 @@ import java.util.Map; public class GCContent extends InfoFieldAnnotation implements ExperimentalAnnotation { - public Map annotate(RefMetaDataTracker tracker, Map> rodBindings, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { + public Map annotate(RefMetaDataTracker tracker, AnnotatorCompatibleWalker walker, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { double content = computeGCContent(ref); Map map = new HashMap(); map.put(getKeyNames().get(0), String.format("%.2f", content)); diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/GLstats.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/GLstats.java index 8fde3a20f..5295d6d21 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/GLstats.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/GLstats.java @@ -1,10 +1,9 @@ package org.broadinstitute.sting.gatk.walkers.annotator; -import org.broad.tribble.Feature; -import org.broadinstitute.sting.commandline.RodBinding; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; +import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompatibleWalker; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.InfoFieldAnnotation; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.StandardAnnotation; import org.broadinstitute.sting.utils.MathUtils; @@ -29,7 +28,7 @@ public class GLstats extends InfoFieldAnnotation implements StandardAnnotation { private static final int MIN_SAMPLES = 10; - public Map annotate(RefMetaDataTracker tracker, Map> rodBindings, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { + public Map annotate(RefMetaDataTracker tracker, AnnotatorCompatibleWalker walker, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { final Map genotypes = vc.getGenotypes(); if ( genotypes == null || genotypes.size() < MIN_SAMPLES ) diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HaplotypeScore.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HaplotypeScore.java index 24571aee1..9af3b8e8e 100644 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HaplotypeScore.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HaplotypeScore.java @@ -25,12 +25,11 @@ package org.broadinstitute.sting.gatk.walkers.annotator; import net.sf.samtools.SAMRecord; -import org.broad.tribble.Feature; -import org.broadinstitute.sting.commandline.RodBinding; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.AlignmentContextUtils; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; +import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompatibleWalker; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.InfoFieldAnnotation; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.StandardAnnotation; import org.broadinstitute.sting.gatk.walkers.genotyper.IndelGenotypeLikelihoodsCalculationModel; @@ -56,7 +55,7 @@ public class HaplotypeScore extends InfoFieldAnnotation implements StandardAnnot private final static int MAX_CONSENSUS_HAPLOTYPES_TO_CONSIDER = 50; private final static char REGEXP_WILDCARD = '.'; - public Map annotate(RefMetaDataTracker tracker, Map> rodBindings, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { + public Map annotate(RefMetaDataTracker tracker, AnnotatorCompatibleWalker walker, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { if (stratifiedContexts.size() == 0 ) // size 0 means that call was made by someone else and we have no data here return null; diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HardyWeinberg.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HardyWeinberg.java index 292a6c5e5..045505698 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HardyWeinberg.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HardyWeinberg.java @@ -1,11 +1,10 @@ package org.broadinstitute.sting.gatk.walkers.annotator; -import org.broad.tribble.Feature; import org.broad.tribble.util.popgen.HardyWeinbergCalculation; -import org.broadinstitute.sting.commandline.RodBinding; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; +import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompatibleWalker; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.InfoFieldAnnotation; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.WorkInProgressAnnotation; import org.broadinstitute.sting.utils.QualityUtils; @@ -26,7 +25,7 @@ public class HardyWeinberg extends InfoFieldAnnotation implements WorkInProgress private static final int MIN_GENOTYPE_QUALITY = 10; private static final int MIN_NEG_LOG10_PERROR = MIN_GENOTYPE_QUALITY / 10; - public Map annotate(RefMetaDataTracker tracker, Map> rodBindings, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { + public Map annotate(RefMetaDataTracker tracker, AnnotatorCompatibleWalker walker, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { final Map genotypes = vc.getGenotypes(); if ( genotypes == null || genotypes.size() < MIN_SAMPLES ) diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HomopolymerRun.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HomopolymerRun.java index 97ac3ab6d..4102d811c 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HomopolymerRun.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/HomopolymerRun.java @@ -1,10 +1,9 @@ package org.broadinstitute.sting.gatk.walkers.annotator; -import org.broad.tribble.Feature; -import org.broadinstitute.sting.commandline.RodBinding; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; +import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompatibleWalker; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.InfoFieldAnnotation; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.StandardAnnotation; import org.broadinstitute.sting.utils.GenomeLoc; @@ -22,7 +21,7 @@ public class HomopolymerRun extends InfoFieldAnnotation implements StandardAnnot private boolean ANNOTATE_INDELS = true; - public Map annotate(RefMetaDataTracker tracker, Map> rodBindings, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { + public Map annotate(RefMetaDataTracker tracker, AnnotatorCompatibleWalker walker, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { if ( !vc.isBiallelic() ) return null; diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/IndelType.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/IndelType.java index 7308f7f25..ff7f9a8f6 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/IndelType.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/IndelType.java @@ -1,10 +1,9 @@ package org.broadinstitute.sting.gatk.walkers.annotator; -import org.broad.tribble.Feature; -import org.broadinstitute.sting.commandline.RodBinding; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; +import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompatibleWalker; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.ExperimentalAnnotation; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.InfoFieldAnnotation; import org.broadinstitute.sting.utils.IndelUtils; @@ -23,7 +22,7 @@ import java.util.*; */ public class IndelType extends InfoFieldAnnotation implements ExperimentalAnnotation { - public Map annotate(RefMetaDataTracker tracker, Map> rodBindings, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { + public Map annotate(RefMetaDataTracker tracker, AnnotatorCompatibleWalker walker, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { int run; if (vc.isMixed()) { diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/LowMQ.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/LowMQ.java index 492578839..09ffe0fb6 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/LowMQ.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/LowMQ.java @@ -1,10 +1,9 @@ package org.broadinstitute.sting.gatk.walkers.annotator; -import org.broad.tribble.Feature; -import org.broadinstitute.sting.commandline.RodBinding; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; +import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompatibleWalker; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.InfoFieldAnnotation; import org.broadinstitute.sting.utils.codecs.vcf.VCFHeaderLineType; import org.broadinstitute.sting.utils.codecs.vcf.VCFInfoHeaderLine; @@ -20,7 +19,7 @@ import java.util.Map; public class LowMQ extends InfoFieldAnnotation { - public Map annotate(RefMetaDataTracker tracker, Map> rodBindings, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { + public Map annotate(RefMetaDataTracker tracker, AnnotatorCompatibleWalker walker, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { if ( stratifiedContexts.size() == 0 ) return null; diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MappingQualityZero.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MappingQualityZero.java index 2c5314822..f9caae227 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MappingQualityZero.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MappingQualityZero.java @@ -1,10 +1,9 @@ package org.broadinstitute.sting.gatk.walkers.annotator; -import org.broad.tribble.Feature; -import org.broadinstitute.sting.commandline.RodBinding; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; +import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompatibleWalker; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.InfoFieldAnnotation; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.StandardAnnotation; import org.broadinstitute.sting.utils.codecs.vcf.VCFConstants; @@ -22,7 +21,7 @@ import java.util.Map; public class MappingQualityZero extends InfoFieldAnnotation implements StandardAnnotation { - public Map annotate(RefMetaDataTracker tracker, Map> rodBindings, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { + public Map annotate(RefMetaDataTracker tracker, AnnotatorCompatibleWalker walker, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { if ( stratifiedContexts.size() == 0 ) return null; diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MappingQualityZeroBySample.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MappingQualityZeroBySample.java index f4d80f554..3d234a1e3 100644 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MappingQualityZeroBySample.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MappingQualityZeroBySample.java @@ -25,11 +25,10 @@ package org.broadinstitute.sting.gatk.walkers.annotator; -import org.broad.tribble.Feature; -import org.broadinstitute.sting.commandline.RodBinding; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; +import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompatibleWalker; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.GenotypeAnnotation; import org.broadinstitute.sting.utils.codecs.vcf.VCFConstants; import org.broadinstitute.sting.utils.codecs.vcf.VCFFormatHeaderLine; @@ -52,8 +51,8 @@ import java.util.Map; * To change this template use File | Settings | File Templates. */ public class MappingQualityZeroBySample extends GenotypeAnnotation { - public Map annotate(RefMetaDataTracker tracker, Map> rodBindings, - ReferenceContext ref, AlignmentContext context, VariantContext vc, Genotype g) { + public Map annotate(RefMetaDataTracker tracker, + AnnotatorCompatibleWalker walker, ReferenceContext ref, AlignmentContext context, VariantContext vc, Genotype g) { if ( g == null || !g.isCalled() ) return null; diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MappingQualityZeroFraction.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MappingQualityZeroFraction.java index 2b8296778..3e8fe8998 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MappingQualityZeroFraction.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/MappingQualityZeroFraction.java @@ -1,10 +1,9 @@ package org.broadinstitute.sting.gatk.walkers.annotator; -import org.broad.tribble.Feature; -import org.broadinstitute.sting.commandline.RodBinding; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; +import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompatibleWalker; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.ExperimentalAnnotation; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.InfoFieldAnnotation; import org.broadinstitute.sting.utils.codecs.vcf.VCFHeaderLineType; @@ -22,7 +21,7 @@ import java.util.Map; public class MappingQualityZeroFraction extends InfoFieldAnnotation implements ExperimentalAnnotation { - public Map annotate(RefMetaDataTracker tracker, Map> rodBindings, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { + public Map annotate(RefMetaDataTracker tracker, AnnotatorCompatibleWalker walker, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { if ( stratifiedContexts.size() == 0 ) return null; diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/NBaseCount.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/NBaseCount.java index 3ce01bc2a..74c562045 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/NBaseCount.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/NBaseCount.java @@ -1,10 +1,9 @@ package org.broadinstitute.sting.gatk.walkers.annotator; -import org.broad.tribble.Feature; -import org.broadinstitute.sting.commandline.RodBinding; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; +import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompatibleWalker; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.InfoFieldAnnotation; import org.broadinstitute.sting.utils.BaseUtils; import org.broadinstitute.sting.utils.codecs.vcf.VCFHeaderLineType; @@ -24,7 +23,7 @@ import java.util.Map; */ public class NBaseCount extends InfoFieldAnnotation { - public Map annotate(RefMetaDataTracker tracker, Map> rodBindings, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { + public Map annotate(RefMetaDataTracker tracker, AnnotatorCompatibleWalker walker, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { if( stratifiedContexts.size() == 0 ) return null; diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/QualByDepth.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/QualByDepth.java index 7b97a9c38..9a292c39a 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/QualByDepth.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/QualByDepth.java @@ -1,11 +1,9 @@ package org.broadinstitute.sting.gatk.walkers.annotator; -import org.broad.tribble.Feature; -import org.broadinstitute.sting.commandline.RodBinding; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; -import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.InfoFieldAnnotation; +import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompatibleWalker; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.StandardAnnotation; import org.broadinstitute.sting.utils.codecs.vcf.VCFHeaderLineType; import org.broadinstitute.sting.utils.codecs.vcf.VCFInfoHeaderLine; @@ -20,7 +18,7 @@ import java.util.Map; public class QualByDepth extends AnnotationByDepth implements StandardAnnotation { - public Map annotate(RefMetaDataTracker tracker, Map> rodBindings, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { + public Map annotate(RefMetaDataTracker tracker, AnnotatorCompatibleWalker walker, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { if ( stratifiedContexts.size() == 0 ) return null; diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/RMSMappingQuality.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/RMSMappingQuality.java index 38345a1c4..668129888 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/RMSMappingQuality.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/RMSMappingQuality.java @@ -1,10 +1,9 @@ package org.broadinstitute.sting.gatk.walkers.annotator; -import org.broad.tribble.Feature; -import org.broadinstitute.sting.commandline.RodBinding; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; +import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompatibleWalker; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.InfoFieldAnnotation; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.StandardAnnotation; import org.broadinstitute.sting.utils.MathUtils; @@ -24,7 +23,7 @@ import java.util.Map; public class RMSMappingQuality extends InfoFieldAnnotation implements StandardAnnotation { - public Map annotate(RefMetaDataTracker tracker, Map> rodBindings, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { + public Map annotate(RefMetaDataTracker tracker, AnnotatorCompatibleWalker walker, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { if ( stratifiedContexts.size() == 0 ) return null; diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/RankSumTest.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/RankSumTest.java index cad10c77d..52c704055 100644 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/RankSumTest.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/RankSumTest.java @@ -1,10 +1,9 @@ package org.broadinstitute.sting.gatk.walkers.annotator; -import org.broad.tribble.Feature; -import org.broadinstitute.sting.commandline.RodBinding; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; +import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompatibleWalker; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.InfoFieldAnnotation; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.StandardAnnotation; import org.broadinstitute.sting.gatk.walkers.genotyper.IndelGenotypeLikelihoodsCalculationModel; @@ -27,7 +26,7 @@ public abstract class RankSumTest extends InfoFieldAnnotation implements Standar static final double INDEL_LIKELIHOOD_THRESH = 0.1; static final boolean DEBUG = false; - public Map annotate(RefMetaDataTracker tracker, Map> rodBindings, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { + public Map annotate(RefMetaDataTracker tracker, AnnotatorCompatibleWalker walker, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { if ( stratifiedContexts.size() == 0 ) return null; diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/ReadDepthAndAllelicFractionBySample.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/ReadDepthAndAllelicFractionBySample.java index 68cc86478..26ca08380 100644 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/ReadDepthAndAllelicFractionBySample.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/ReadDepthAndAllelicFractionBySample.java @@ -25,11 +25,10 @@ package org.broadinstitute.sting.gatk.walkers.annotator; -import org.broad.tribble.Feature; -import org.broadinstitute.sting.commandline.RodBinding; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; +import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompatibleWalker; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.GenotypeAnnotation; import org.broadinstitute.sting.utils.codecs.vcf.VCFFormatHeaderLine; import org.broadinstitute.sting.utils.codecs.vcf.VCFHeaderLineCount; @@ -60,7 +59,7 @@ public class ReadDepthAndAllelicFractionBySample extends GenotypeAnnotation { private static String DEL = "DEL"; // constant, for speed: no need to create a key string for deletion allele every time - public Map annotate(RefMetaDataTracker tracker, Map> rodBindings, ReferenceContext ref, + public Map annotate(RefMetaDataTracker tracker, AnnotatorCompatibleWalker walker, ReferenceContext ref, AlignmentContext stratifiedContext, VariantContext vc, Genotype g) { if ( g == null || !g.isCalled() ) return null; diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/SBByDepth.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/SBByDepth.java index 662b5cdce..180bed24d 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/SBByDepth.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/SBByDepth.java @@ -1,10 +1,9 @@ package org.broadinstitute.sting.gatk.walkers.annotator; -import org.broad.tribble.Feature; -import org.broadinstitute.sting.commandline.RodBinding; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; +import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompatibleWalker; import org.broadinstitute.sting.utils.codecs.vcf.VCFConstants; import org.broadinstitute.sting.utils.codecs.vcf.VCFHeaderLineType; import org.broadinstitute.sting.utils.codecs.vcf.VCFInfoHeaderLine; @@ -20,7 +19,7 @@ import java.util.Map; public class SBByDepth extends AnnotationByDepth { - public Map annotate(RefMetaDataTracker tracker, Map> rodBindings, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { + public Map annotate(RefMetaDataTracker tracker, AnnotatorCompatibleWalker walker, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { if ( stratifiedContexts.size() == 0 ) return null; diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/SampleList.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/SampleList.java index 0977a041f..cd396036f 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/SampleList.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/SampleList.java @@ -25,11 +25,10 @@ package org.broadinstitute.sting.gatk.walkers.annotator; -import org.broad.tribble.Feature; -import org.broadinstitute.sting.commandline.RodBinding; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; +import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompatibleWalker; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.InfoFieldAnnotation; import org.broadinstitute.sting.utils.codecs.vcf.VCFHeaderLineCount; import org.broadinstitute.sting.utils.codecs.vcf.VCFHeaderLineType; @@ -45,7 +44,7 @@ import java.util.Map; public class SampleList extends InfoFieldAnnotation { - public Map annotate(RefMetaDataTracker tracker, Map> rodBindings, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { + public Map annotate(RefMetaDataTracker tracker, AnnotatorCompatibleWalker walker, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { if ( vc.isMonomorphic() || !vc.hasGenotypes() ) return null; diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/SnpEff.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/SnpEff.java index 26a9b2edd..635afd158 100644 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/SnpEff.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/SnpEff.java @@ -24,11 +24,11 @@ package org.broadinstitute.sting.gatk.walkers.annotator; -import org.broad.tribble.Feature; import org.broadinstitute.sting.commandline.RodBinding; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; +import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompatibleWalker; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.ExperimentalAnnotation; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.InfoFieldAnnotation; import org.broadinstitute.sting.utils.Utils; @@ -70,10 +70,8 @@ public class SnpEff extends InfoFieldAnnotation implements ExperimentalAnnotatio public static final String CODON_NUM_KEY = "CODON_NUM"; public static final String CDS_SIZE_KEY = "CDS_SIZE"; - public static final String SNPEFF_ROD_NAME = "snpEffFile"; - - public Map annotate ( RefMetaDataTracker tracker, Map> rodBindings, ReferenceContext ref, Map stratifiedContexts, VariantContext vc ) { - RodBinding snpEffRodBinding = (RodBinding)rodBindings.get(SNPEFF_ROD_NAME); + public Map annotate(RefMetaDataTracker tracker, AnnotatorCompatibleWalker walker, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { + RodBinding snpEffRodBinding = walker.getSnpEffRodBinding(); List features = tracker.getValues(snpEffRodBinding); // Add only annotations for one of the most biologically-significant effects as defined in diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/SpanningDeletions.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/SpanningDeletions.java index c11634c94..42203824f 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/SpanningDeletions.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/SpanningDeletions.java @@ -1,10 +1,9 @@ package org.broadinstitute.sting.gatk.walkers.annotator; -import org.broad.tribble.Feature; -import org.broadinstitute.sting.commandline.RodBinding; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; +import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompatibleWalker; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.InfoFieldAnnotation; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.StandardAnnotation; import org.broadinstitute.sting.utils.codecs.vcf.VCFHeaderLineType; @@ -20,7 +19,7 @@ import java.util.Map; public class SpanningDeletions extends InfoFieldAnnotation implements StandardAnnotation { - public Map annotate(RefMetaDataTracker tracker, Map> rodBindings, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { + public Map annotate(RefMetaDataTracker tracker, AnnotatorCompatibleWalker walker, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { if ( stratifiedContexts.size() == 0 ) return null; diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/TechnologyComposition.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/TechnologyComposition.java index 12e7259a9..fa48c57a3 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/TechnologyComposition.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/TechnologyComposition.java @@ -1,10 +1,9 @@ package org.broadinstitute.sting.gatk.walkers.annotator; -import org.broad.tribble.Feature; -import org.broadinstitute.sting.commandline.RodBinding; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; +import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompatibleWalker; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.ExperimentalAnnotation; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.InfoFieldAnnotation; import org.broadinstitute.sting.utils.codecs.vcf.VCFHeaderLineType; @@ -31,7 +30,7 @@ public class TechnologyComposition extends InfoFieldAnnotation implements Experi private String n454 ="Num454"; private String nSolid = "NumSOLiD"; private String nOther = "NumOther"; - public Map annotate(RefMetaDataTracker tracker, Map> rodBindings, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { + public Map annotate(RefMetaDataTracker tracker, AnnotatorCompatibleWalker walker, ReferenceContext ref, Map stratifiedContexts, VariantContext vc) { if ( stratifiedContexts.size() == 0 ) return null; diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotator.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotator.java index a8fe46ab8..492606688 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotator.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotator.java @@ -25,7 +25,6 @@ package org.broadinstitute.sting.gatk.walkers.annotator; -import org.broad.tribble.Feature; import org.broadinstitute.sting.commandline.*; import org.broadinstitute.sting.gatk.arguments.DbsnpArgumentCollection; import org.broadinstitute.sting.gatk.arguments.StandardVariantContextInputArgumentCollection; @@ -35,6 +34,7 @@ import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; import org.broadinstitute.sting.gatk.walkers.*; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotationType; +import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompatibleWalker; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.GenotypeAnnotation; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.InfoFieldAnnotation; import org.broadinstitute.sting.utils.BaseUtils; @@ -55,7 +55,7 @@ import java.util.*; @Allows(value={DataSource.READS, DataSource.REFERENCE}) @Reference(window=@Window(start=-50,stop=50)) @By(DataSource.REFERENCE) -public class VariantAnnotator extends RodWalker { +public class VariantAnnotator extends RodWalker implements AnnotatorCompatibleWalker { @ArgumentCollection protected StandardVariantContextInputArgumentCollection variantCollection = new StandardVariantContextInputArgumentCollection(); @@ -64,8 +64,9 @@ public class VariantAnnotator extends RodWalker { * The INFO field will be annotated with information on the most biologically-significant effect * listed in the SnpEff output file for each variant. */ - @Input(fullName="snpEffFile", shortName = "snpEffFile", doc="A SnpEff output file from which to add annotations", required=false) + @Input(fullName="snpEffFile", shortName = "snpEffFile", doc="SnpEff file", required=false) public RodBinding snpEffFile; + public RodBinding getSnpEffRodBinding() { return snpEffFile; } /** * A dbSNP VCF file from which to annotate. @@ -74,14 +75,28 @@ public class VariantAnnotator extends RodWalker { */ @ArgumentCollection protected DbsnpArgumentCollection dbsnp = new DbsnpArgumentCollection(); + public RodBinding getDbsnpRodBinding() { return dbsnp.dbsnp; } /** * If a record in the 'variant' track overlaps with a record from the provided comp track, the INFO field will be annotated * as such in the output with the track name (e.g. -comp:FOO will have 'FOO' in the INFO field). Records that are filtered in the comp track will be ignored. * Note that 'dbSNP' has been special-cased (see the --dbsnp argument). */ - @Input(fullName="comp", shortName = "comp", doc="A comparisons VCF file from which to annotate", required=false) - public RodBinding comps; + @Input(fullName="comp", shortName = "comp", doc="comparison VCF file", required=false) + public List> comps = Collections.emptyList(); + public List> getCompRodBindings() { return comps; } + + /** + * An external resource VCF file or files from which to annotate. + * + * One can add annotations from one of the resource VCFs to the output. + * For example, if you want to annotate your 'variant' VCF with the AC field value from the rod bound to 'resource', + * you can specify '-E resource.AC' and records in the output VCF will be annotated with 'resource.AC=N' when a record exists in that rod at the given position. + * If multiple records in the rod overlap the given position, one is chosen arbitrarily. + */ + @Input(fullName="resource", shortName = "resource", doc="external resource VCF file", required=false) + public List> resources = Collections.emptyList(); + public List> getResourceRodBindings() { return resources; } @Output(doc="File to which variants should be written",required=true) protected VCFWriter vcfWriter = null; @@ -118,8 +133,6 @@ public class VariantAnnotator extends RodWalker { private Collection indelBufferContext; - private Map> rodBindings = new HashMap>(); - private void listAnnotationsAndExit() { List> infoAnnotationClasses = new PluginManager(InfoFieldAnnotation.class).getPlugins(); @@ -162,12 +175,10 @@ public class VariantAnnotator extends RodWalker { logger.warn("There are no samples input at all; use the --sampleName argument to specify one if desired."); } - initializeRodBindingMap(); - if ( USE_ALL_ANNOTATIONS ) - engine = new VariantAnnotatorEngine(getToolkit(), rodBindings); + engine = new VariantAnnotatorEngine(this); else - engine = new VariantAnnotatorEngine(getToolkit(), annotationGroupsToUse, annotationsToUse, rodBindings); + engine = new VariantAnnotatorEngine(annotationGroupsToUse, annotationsToUse, this); engine.initializeExpressions(expressionsToUse); // setup the header fields @@ -187,13 +198,6 @@ public class VariantAnnotator extends RodWalker { } } - private void initializeRodBindingMap() { - rodBindings.put(variantCollection.variants.getName(), variantCollection.variants); - rodBindings.put(snpEffFile.getName(), snpEffFile); - rodBindings.put(dbsnp.dbsnp.getName(), dbsnp.dbsnp); - rodBindings.put(comps.getName(), comps); - } - public static boolean isUniqueHeaderLine(VCFHeaderLine line, Set currentSet) { if ( !(line instanceof VCFCompoundHeaderLine) ) return true; diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorEngine.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorEngine.java index cae9ab00c..a7837813a 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorEngine.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorEngine.java @@ -25,15 +25,13 @@ package org.broadinstitute.sting.gatk.walkers.annotator; -import org.broad.tribble.Feature; import org.broadinstitute.sting.commandline.RodBinding; -import org.broadinstitute.sting.gatk.GenomeAnalysisEngine; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; -import org.broadinstitute.sting.gatk.datasources.rmd.ReferenceOrderedDataSource; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; import org.broadinstitute.sting.gatk.refdata.features.DbSNPHelper; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotationInterfaceManager; +import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompatibleWalker; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.GenotypeAnnotation; import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.InfoFieldAnnotation; import org.broadinstitute.sting.utils.codecs.vcf.VCFConstants; @@ -49,49 +47,56 @@ import java.util.*; public class VariantAnnotatorEngine { - public static final String dbPrefix = "comp"; - private List requestedInfoAnnotations; private List requestedGenotypeAnnotations; private List requestedExpressions = new ArrayList(); - private HashMap dbAnnotations = new HashMap(); - private Map> rodBindings; + private HashMap, String> dbAnnotations = new HashMap, String>(); + private AnnotatorCompatibleWalker walker; private static class VAExpression { - public String fullName, bindingName, fieldName; - public VAExpression(String fullEpression) { + public String fullName, fieldName; + public RodBinding binding; + + public VAExpression(String fullEpression, List> bindings) { int indexOfDot = fullEpression.lastIndexOf("."); if ( indexOfDot == -1 ) throw new UserException.BadArgumentValue(fullEpression, "it should be in rodname.value format"); fullName = fullEpression; - bindingName = fullEpression.substring(0, indexOfDot); fieldName = fullEpression.substring(indexOfDot+1); + + String bindingName = fullEpression.substring(0, indexOfDot); + for ( RodBinding rod : bindings ) { + if ( rod.getName().equals(bindingName) ) { + binding = rod; + break; + } + } } } // use this constructor if you want all possible annotations - public VariantAnnotatorEngine(GenomeAnalysisEngine engine, Map> rodBindings) { + public VariantAnnotatorEngine(AnnotatorCompatibleWalker walker) { + this.walker = walker; requestedInfoAnnotations = AnnotationInterfaceManager.createAllInfoFieldAnnotations(); requestedGenotypeAnnotations = AnnotationInterfaceManager.createAllGenotypeAnnotations(); - initializeDBs(engine); - this.rodBindings = rodBindings; + initializeDBs(); } // use this constructor if you want to select specific annotations (and/or interfaces) - public VariantAnnotatorEngine(GenomeAnalysisEngine engine, List annotationGroupsToUse, List annotationsToUse, Map> rodBindings) { + public VariantAnnotatorEngine(List annotationGroupsToUse, List annotationsToUse, AnnotatorCompatibleWalker walker) { + this.walker = walker; initializeAnnotations(annotationGroupsToUse, annotationsToUse); - initializeDBs(engine); - this.rodBindings = rodBindings; + initializeDBs(); } // select specific expressions to use public void initializeExpressions(List expressionsToUse) { // set up the expressions for ( String expression : expressionsToUse ) - requestedExpressions.add(new VAExpression(expression)); + requestedExpressions.add(new VAExpression(expression, walker.getResourceRodBindings())); } private void initializeAnnotations(List annotationGroupsToUse, List annotationsToUse) { @@ -100,18 +105,16 @@ public class VariantAnnotatorEngine { requestedGenotypeAnnotations = AnnotationInterfaceManager.createGenotypeAnnotations(annotationGroupsToUse, annotationsToUse); } - private void initializeDBs(GenomeAnalysisEngine engine) { + private void initializeDBs() { // check to see whether comp rods were included - List dataSources = engine.getRodDataSources(); - for ( ReferenceOrderedDataSource source : dataSources ) { - if ( source.getName().equals(DbSNPHelper.STANDARD_DBSNP_TRACK_NAME) ) { - dbAnnotations.put(DbSNPHelper.STANDARD_DBSNP_TRACK_NAME, VCFConstants.DBSNP_KEY); - } - else if ( source.getName().startsWith(dbPrefix) ) { - dbAnnotations.put(source.getName(), source.getName().substring(dbPrefix.length())); - } - } + final RodBinding dbsnp = walker.getDbsnpRodBinding(); + if ( dbsnp != null && dbsnp.isBound() ) + dbAnnotations.put(dbsnp, VCFConstants.DBSNP_KEY); + + final List> comps = walker.getCompRodBindings(); + for ( RodBinding rod : comps ) + dbAnnotations.put(rod, rod.getName()); } public Set getVCFAnnotationDescriptions() { @@ -122,8 +125,8 @@ public class VariantAnnotatorEngine { descriptions.addAll(annotation.getDescriptions()); for ( GenotypeAnnotation annotation : requestedGenotypeAnnotations ) descriptions.addAll(annotation.getDescriptions()); - for ( Map.Entry dbSet : dbAnnotations.entrySet() ) - descriptions.add(new VCFInfoHeaderLine(dbSet.getValue(), 0, VCFHeaderLineType.Flag, (dbSet.getKey().equals(DbSNPHelper.STANDARD_DBSNP_TRACK_NAME) ? "dbSNP" : dbSet.getValue()) + " Membership")); + for ( String db : dbAnnotations.values() ) + descriptions.add(new VCFInfoHeaderLine(db, 0, VCFHeaderLineType.Flag, (db.equals(VCFConstants.DBSNP_KEY) ? "dbSNP" : db) + " Membership")); return descriptions; } @@ -140,7 +143,7 @@ public class VariantAnnotatorEngine { // go through all the requested info annotationTypes for ( InfoFieldAnnotation annotationType : requestedInfoAnnotations ) { - Map annotationsFromCurrentType = annotationType.annotate(tracker, rodBindings, ref, stratifiedContexts, vc); + Map annotationsFromCurrentType = annotationType.annotate(tracker, walker, ref, stratifiedContexts, vc); if ( annotationsFromCurrentType != null ) infoAnnotations.putAll(annotationsFromCurrentType); } @@ -153,21 +156,16 @@ public class VariantAnnotatorEngine { } private void annotateDBs(RefMetaDataTracker tracker, ReferenceContext ref, VariantContext vc, Map infoAnnotations) { - for ( Map.Entry dbSet : dbAnnotations.entrySet() ) { - if ( dbSet.getKey().equals(DbSNPHelper.STANDARD_DBSNP_TRACK_NAME) ) { - String rsID = null; - - if (vc.isSNP()) - rsID = DbSNPHelper.rsIDOfFirstRealSNP(tracker.getValues(Feature.class, DbSNPHelper.STANDARD_DBSNP_TRACK_NAME), true); - else if (vc.isIndel()) - rsID = DbSNPHelper.rsIDOfFirstRealIndel(tracker.getValues(Feature.class, DbSNPHelper.STANDARD_DBSNP_TRACK_NAME)); - infoAnnotations.put(VCFConstants.DBSNP_KEY, rsID != null ); + for ( Map.Entry, String> dbSet : dbAnnotations.entrySet() ) { + if ( dbSet.getValue().equals(VCFConstants.DBSNP_KEY) ) { + String rsID = DbSNPHelper.rsIDOfFirstRealVariant(tracker.getValues(dbSet.getKey(), ref.getLocus()), vc.getType()); + infoAnnotations.put(VCFConstants.DBSNP_KEY, rsID != null); // annotate dbsnp id if available and not already there if ( rsID != null && (!vc.hasID() || vc.getID().equals(VCFConstants.EMPTY_ID_FIELD)) ) infoAnnotations.put(VariantContext.ID_KEY, rsID); } else { boolean overlapsComp = false; - for ( VariantContext comp : tracker.getValues(VariantContext.class, dbSet.getKey()) ) { + for ( VariantContext comp : tracker.getValues(dbSet.getKey(), ref.getLocus()) ) { if ( !comp.isFiltered() ) { overlapsComp = true; break; @@ -180,7 +178,7 @@ public class VariantAnnotatorEngine { private void annotateExpressions(RefMetaDataTracker tracker, ReferenceContext ref, Map infoAnnotations) { for ( VAExpression expression : requestedExpressions ) { - Collection VCs = tracker.getValues(VariantContext.class, expression.bindingName); + Collection VCs = tracker.getValues(expression.binding, ref.getLocus()); if ( VCs.size() == 0 ) continue; @@ -205,7 +203,7 @@ public class VariantAnnotatorEngine { Map genotypeAnnotations = new HashMap(genotype.getAttributes()); for ( GenotypeAnnotation annotation : requestedGenotypeAnnotations ) { - Map result = annotation.annotate(tracker, rodBindings, ref, context, vc, genotype); + Map result = annotation.annotate(tracker, walker, ref, context, vc, genotype); if ( result != null ) genotypeAnnotations.putAll(result); } @@ -214,404 +212,4 @@ public class VariantAnnotatorEngine { return genotypes; } - - -/* - - // Finish processing data from GenomicAnnotation. - private List> processGenomicAnnotation( List> infoAnnotationOutputsList, Map annotationsForCurrentLocusFromAllAnnotatorInputTables) - { - - //process the map returned by GenomicAnnotation. This completes processing of the -B args. - for( Map.Entry annotationsFromOneInputTable : annotationsForCurrentLocusFromAllAnnotatorInputTables.entrySet() ) - { - final String inputTableBindingName = annotationsFromOneInputTable.getKey(); - final List> matchingRecords = (List>) annotationsFromOneInputTable.getValue(); - - if( matchingRecords.size() > 1 && oneToMany) - { - //More than one record matched in this file. After this, infoAnnotationOutputsList.size() will be infoAnnotationOutputsList.size()*matchingRecords.size(). - infoAnnotationOutputsList = explodeInfoAnnotationOutputsList( infoAnnotationOutputsList, matchingRecords, inputTableBindingName ); - } - else - { - //This doesn't change infoAnnotationOutputsList.size(). If more than one record matched, their annotations will - //all be added to the same output line, with keys disambiguated by appending _i . - addToExistingAnnotationOutputs( infoAnnotationOutputsList, matchingRecords, inputTableBindingName ); - } - } - - //process -J args - if(joinTables != null) - { - //for each joinTable, join it with the data in the info-field of each output line. - for(JoinTable joinTable : joinTables) - { - //for each info field, join it to the current join table - final List> previousInfoAnnotationOutputsList = new LinkedList>(infoAnnotationOutputsList); //create a shallow copy because infoAnnotationOutputsList will change during the iteration. - for(Map outputRecordInfoField : previousInfoAnnotationOutputsList) - { - infoAnnotationOutputsList = performJoin( infoAnnotationOutputsList, outputRecordInfoField, joinTable ); - } - } - } - - //apply -S args last to select the columns requested by the user - if(requestedColumnsMap != null) { - infoAnnotationOutputsList = applySelectArg(infoAnnotationOutputsList); - } - - return infoAnnotationOutputsList; - } - - // Performs a join between the an info field record represented by outputRecordInfoField and the infoAnnotationOutputsList. - private List> performJoin( List> infoAnnotationOutputsList, Map outputRecordInfoField, JoinTable joinTable) - { - //System.err.println("Looking at: " + joinTable.getLocalBindingName()+ "- join to " + joinTable.getExternalBindingName() + "." + joinTable.getExternalColumnName() ); - //for the current joinTable, for each output line, find the externalJoinColumnValue and see if it matches the joinColumnValue of any record(s) in this joinTable. - final String externalBindingName = joinTable.getExternalBindingName(); - final String externalColumnName = joinTable.getExternalColumnName(); - final String fullyQualifiedExternalColumnName = GenomicAnnotation.generateInfoFieldKey(externalBindingName, externalColumnName); - - //find the externalJoinColumnValue in the current info field, and then look up any joinTable records that have this value for the localJoinColumnValue - ArrayList matchingJoinTableRecord = null; //record in the join table whose joinColumnValue matches the joinColumnValue inside the current outputRecordInfoField. - final Object numInfoFieldKeysToCheckObj = outputRecordInfoField.get(GenomicAnnotation.generateInfoFieldKey(externalBindingName, GenomicAnnotation.NUM_MATCHES_SPECIAL_INFO_FIELD)); - if(numInfoFieldKeysToCheckObj == null) { - //only 1 record in the externalBindingName -B AnnotationInfoTable overlapped the current position - Object externalColumnValue = outputRecordInfoField.get(fullyQualifiedExternalColumnName); - if(externalColumnValue != null) { - matchingJoinTableRecord = joinTable.get(externalColumnValue.toString()); - //System.err.println("Found matching record in join table for record: " + outputRecordInfoField + " where " + fullyQualifiedExternalColumnName + "==" + externalColumnValue + ": " + matchingJoinTableRecords); - } - } else { - //multiple records in the externalBindingName -B AnnotationInfoTable overlapped the current position - final int numInfoFieldKeysToCheck = Integer.parseInt(numInfoFieldKeysToCheckObj.toString()); - for (int i = 0; i < numInfoFieldKeysToCheck; i++) { - final Object externalColumnValue = outputRecordInfoField.get(fullyQualifiedExternalColumnName + "_" + i); - if ( externalColumnValue != null ) { - matchingJoinTableRecord = joinTable.get(externalColumnValue.toString()); - if ( matchingJoinTableRecord != null ) { - //System.err.println("Found matching record(s) in join table for record: " + outputRecordInfoField + " where " + fullyQualifiedExternalColumnName + "==" + externalColumnValue + ": " + matchingJoinTableRecords); - break; - } - } - } - } - - //if a match for the externalJoinColumnValue in the current outputRecordInfoField has been found in the join table, perform the join. - if ( matchingJoinTableRecord != null ) - { - final String joinTableBindingName = joinTable.getLocalBindingName(); - - //convert the List> to List> by hashing the values from the ArrayList by their column names. - final List> matchingJoinTableRecordsConverted = new LinkedList>(); - final List columnNames = joinTable.getColumnNames(); - - final Map matchingRecord = new LinkedHashMap(); - for (int i = 0; i < columnNames.size(); i++) - matchingRecord.put(columnNames.get(i), matchingJoinTableRecord.get(i)); - - matchingJoinTableRecordsConverted.add(GenomicAnnotation.convertRecordToAnnotations(joinTableBindingName, matchingRecord)); - - // do the join between the outputRecordInfoField and the matchingJoinTableRecords, then add the results to to infoAnnotationOutputsList - List> tempList = new LinkedList>(); - tempList.add(outputRecordInfoField); - if( matchingJoinTableRecordsConverted.size() > 1 && oneToMany) - { - //More than one record in the joinTable matched the current info field. After this, infoAnnotationOutputsList.size() will be infoAnnotationOutputsList.size()*matchingRecords.size(). - tempList = explodeInfoAnnotationOutputsList( tempList, matchingJoinTableRecordsConverted, joinTableBindingName ); - } - else - { - //This doesn't change infoAnnotationOutputsList.size(). If more than one record matched, their annotations will - //all be added to the same output line, with keys disambiguated by appending _i . - addToExistingAnnotationOutputs( tempList, matchingJoinTableRecordsConverted, joinTableBindingName ); - } - - infoAnnotationOutputsList.remove(outputRecordInfoField); //remove the old info field - infoAnnotationOutputsList.addAll(tempList); //add the new info field(s) that have been joined with the matchingJoinTableRecords - } - return infoAnnotationOutputsList; - } - - - // Implements not-oneToMany mode, where the output lines have a one-to-one relationship - // with the input variants, and all multiple-match records are collapsed into the single info field. - // The collapsing is done by appending an _i to each key name (where 'i' is a record counter), as well - // as a special bindingName.numMatchingRecords=n key-value pair which specifies the upper limit of the counter. - private void addToExistingAnnotationOutputs( - final List> infoAnnotationOutputsList, - final List> matchingRecords, - final String bindingName) { - //For each matching record, just add its annotations to all existing output lines. - final boolean renameKeys = matchingRecords.size() > 1; - for(int i = 0; i < matchingRecords.size(); i++) { - Map currentRecord = matchingRecords.get(i); - - if(renameKeys) { - //Rename keys to avoid naming conflicts. After this all keys from the i'th matching record will have _i appended to them. - // (This solves the following problem: if you have multiple dbsnp matches - such as dbSNP.avHet=value1 from record 1 and - // dbSNP.avHet=value2 from record 2, the keys will be renamed to dbSNP.avHet_1=value1 and dbSNP.avHet_2=value2 ) - Map currentRecordWithRenamedKeys = new LinkedHashMap(); - for(final Map.Entry annotation : currentRecord.entrySet()) { - currentRecordWithRenamedKeys.put(annotation.getKey() + "_" + (i + 1), annotation.getValue()); - } - currentRecordWithRenamedKeys.put(GenomicAnnotation.generateInfoFieldKey(bindingName, GenomicAnnotation.NUM_MATCHES_SPECIAL_INFO_FIELD), - Integer.toString(matchingRecords.size())); //add the special field that specifies how many matchingRecords there were. - currentRecord = currentRecordWithRenamedKeys; - } - - //Add the annotations from this record to each output line. - for(Map outputRecordInfoField : infoAnnotationOutputsList) { - outputRecordInfoField.putAll(currentRecord); - } - } - - incrementStatsCounter(bindingName, infoAnnotationOutputsList.size()); - } - - */ -/** - * Records statistics that will be printed when GenomicAnnotator finishes. - * - * @param bindingName The table from which annotations were gotten - * @param numNewRecords The number of new output VCF records created with annotations from this table - *//* - - private void incrementStatsCounter( final String bindingName, int numNewRecords) { - //record some stats - there were infoAnnotationOutputsList.size() output VCF records annotated with data from the 'bindingName' input table. - Integer counter = inputTableHitCounter.get(bindingName); - if( counter == null ) { - inputTableHitCounter.put(bindingName, numNewRecords); //init the counter - } else { - inputTableHitCounter.put(bindingName, counter + numNewRecords); //increment the counter - } - } - - // Implements oneToMany mode. Takes the current infoAnnotationOutputsList - // (where each element represents a line in the output VCF file), and - // generates a new infoAnnotationOutputsList which contains one copy of the current - // infoAnnotationOutputs for each record matchingRecords. - // The returned list will have size: - // infoAnnotationOutputsList.size() * matchingRecords.size() - private List> explodeInfoAnnotationOutputsList( - final List> infoAnnotationOutputsList, - final List> matchingRecords, - final String bindingName) { - - - //This is the return value. It represents the new list of lines in the output VCF file. - final List> newInfoAnnotationOutputsList = new LinkedList>(); - - //For each matching record, generate a new output line - for(int i = 0; i < matchingRecords.size(); i++) { - Map annotationsForRecord = matchingRecords.get(i); - - //Add the annotations from this record to each output line. - for(Map outputRecordInfoField : infoAnnotationOutputsList) { - Map outputRecordInfoFieldCopy = new LinkedHashMap(outputRecordInfoField); //create a new copy of this line. - outputRecordInfoFieldCopy.putAll(annotationsForRecord); //Adds the column-value pairs from this record to this line. - - newInfoAnnotationOutputsList.add(outputRecordInfoFieldCopy); //Add the line to the new list of lines. - } - } - - recordStats(bindingName, newInfoAnnotationOutputsList.size(), infoAnnotationOutputsList, matchingRecords.size()); - - return newInfoAnnotationOutputsList; - } - - - */ -/** - * Records statistics for the explodeInfoAnnotationOutputsList(..) calculation. - * @param bindingName The table from which annotations were gotten - * @param numNewVCFRecordsAnnotatedWithBindingNameData The number of new output VCF records created with annotations from this table - * @param infoAnnotationOutputsList output list - * @param matchingRecordsSize matching records size - *//* - - private void recordStats( final String bindingName, int numNewVCFRecordsAnnotatedWithBindingNameData, final List> infoAnnotationOutputsList, int matchingRecordsSize ) { - - //update stats for the 'bindingName' table - incrementStatsCounter(bindingName, numNewVCFRecordsAnnotatedWithBindingNameData); //All records in newInfoAnnotationOutputsList were annotated with data from bindingName. - - //update stats for all other tables besides 'bindingName' - for(String otherBindingName : inputTableHitCounter.keySet()) { - if(otherBindingName.equals(bindingName)) { - continue; - } - - //count how many records in the initial infoAnnotationOutputsList were annotated with data from otherBindingName - int numAnnotatedWithOtherBindingNameData = 0; - for(Map outputRecordInfoField : infoAnnotationOutputsList) { - for(String outputRecordInfoFieldKey : outputRecordInfoField.keySet()) { - if(outputRecordInfoFieldKey.contains(otherBindingName)) { - //this record has some annotations from the otherBindingName table - numAnnotatedWithOtherBindingNameData++; - break; - } - } - } - - if(numAnnotatedWithOtherBindingNameData > 0) { - //numAnnotatedWithOtherBindingNameData * (matchingRecordsSize - 1) is how many additional output VCF records were created with annotations from otherBindingName - incrementStatsCounter(otherBindingName, numAnnotatedWithOtherBindingNameData * (matchingRecordsSize - 1)); - } - } - } - - - // Applies the -S arg to the results - private List> applySelectArg( final List> infoAnnotationOutputsList ) - { - final List> newInfoAnnotationOutputList = new LinkedList>(); - for(final Map outputRecordInfoField : infoAnnotationOutputsList) { - final Map newOutputRecordInfoField = new LinkedHashMap(); - for(final Entry keyValue : outputRecordInfoField.entrySet()) { - if(!isKeyFilteredOutBySelectArg(keyValue.getKey())) { - newOutputRecordInfoField.put(keyValue.getKey(), keyValue.getValue()); - } - } - newInfoAnnotationOutputList.add(newOutputRecordInfoField); - } - - return newInfoAnnotationOutputList; - } - - - */ -/** - * Determines whether to exclude the given column from the annotations. - * @param key The fully qualified columnName - * @return Whether the -S arg specifies that this column should be included in the annotations. - * - *//* - - private boolean isKeyFilteredOutBySelectArg(String key) - { - for(final String bindingName : requestedColumnsMap.keySet()) { - - if(key.contains(bindingName)) { - final Set selectArgsWithThisBindingName = requestedColumnsMap.get(bindingName); - for(final String selectArgWithThisBindingName : selectArgsWithThisBindingName) { - if(key.contains(selectArgWithThisBindingName)) { - return false; //this key matches one of the -s args, so the user explicitly requested this key - } - } - if(!selectArgsWithThisBindingName.isEmpty()) { - return true; //the -S arg contains some keys with this binding name, but doesn't include this key - } - } - } - - return false; //the -S arg doesn't have anything with the same binding name as this key, so the user implicitly requested this key - } - - */ -/** - * Determines how the engine will handle the case where multiple records in a ROD file - * overlap a particular single locus. If oneToMany is set to true, the output will be - * one-to-many, so that each locus in the input VCF file could result in multiple - * entries in the output VCF file. Otherwise, the output will be one-to-one, and - * all multiple-match records will be collapsed into the single info field. - * The collapsing is done by appending an _i to each key name (where 'i' is a - * record counter). - * - * See class-level comments for more details. - * - * @param oneToMany true if we should break out from one to many - *//* - - public void setOneToMany(boolean oneToMany) { - this.oneToMany = oneToMany; - } - - */ -/** - * Sets the columns that will be used for the info annotation field. - * Column names should be of the form bindingName.columnName (eg. dbsnp.avHet). - * - * @param columns An array of strings where each string is a comma-separated list - * of columnNames (eg ["dbsnp.avHet,dbsnp.valid", "file2.col1,file3.col1"] ). - *//* - - public void setRequestedColumns(String[] columns) { - if(columns == null) { - throw new IllegalArgumentException("columns arg is null. Please check the -s command-line arg."); - } - - //System.err.println("COLUMNS: "+Arrays.asList(columns).toString()); - - this.requestedColumnsMap = parseColumnsArg(columns); - } - - - */ -/** - * Passes in a pointer to the JoinTables. - * - * @param joinTables The list of JoinTables. There should be one JoinTable object for each -J arg. - *//* - - public void setJoinTables(List joinTables) { - this.joinTables = joinTables; - } - - - */ -/** - * Parses the columns arg and returns a Map of columns hashed by their binding name. - * For example: - * The command line: - * -s dbSnp.valid,dbsnp.avHet -s refGene.txStart,refGene.txEnd - * - * will be passed to this method as: - * ["dbSnp.valid,dbsnp.avHet", "refGene.txStart,refGene.txEnd"] - * - * resulting in a return value of: - * { - * "dbSnp" -> "dbSnp.valid" , - * "dbSnp" -> "dbsnp.avHet" , - * "refGene" -> "refGene.txStart", - * "refGene" -> "refGene.txEnd" - * } - * - * @param columnsArg The -s command line arg value. - * - * @return Map representing a parsed version of this arg - see above. - *//* - - private static Map> parseColumnsArg(String[] columnsArg) { - Map> result = new HashMap>(); - - for(String s : columnsArg) { - for(String columnSpecifier : s.split(",") ) { - String[] rodNameColumnName = columnSpecifier.split("\\."); - if(rodNameColumnName.length != 2) { - throw new IllegalArgumentException("The following column specifier in the -s arg is invalid: [" + columnSpecifier + "]. It must be of the form 'bindingName.columnName'."); - } - String rodName = rodNameColumnName[0]; - //String columnName = rodNameColumnName[1]; - - Set requestedColumns = result.get(rodName); - if(requestedColumns == null) { - requestedColumns = new HashSet(); - result.put(rodName, requestedColumns); - } - requestedColumns.add(columnSpecifier); - } - } - - return result; - } - - - //Returns a map containing stats on how many output vcf records were annotated from each database - public Map getInputTableHitCounter() { - return Collections.unmodifiableMap(inputTableHitCounter); - } - -*/ - } diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/AnnotatorCompatibleWalker.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/AnnotatorCompatibleWalker.java new file mode 100644 index 000000000..20a2aea0e --- /dev/null +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/AnnotatorCompatibleWalker.java @@ -0,0 +1,16 @@ +package org.broadinstitute.sting.gatk.walkers.annotator.interfaces; + +import org.broadinstitute.sting.commandline.RodBinding; +import org.broadinstitute.sting.utils.codecs.snpEff.SnpEffFeature; +import org.broadinstitute.sting.utils.variantcontext.VariantContext; + +import java.util.List; + +public interface AnnotatorCompatibleWalker { + + // getter methods for various used bindings + public abstract RodBinding getSnpEffRodBinding(); + public abstract RodBinding getDbsnpRodBinding(); + public abstract List> getCompRodBindings(); + public abstract List> getResourceRodBindings(); +} \ No newline at end of file diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/GenotypeAnnotation.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/GenotypeAnnotation.java index 29d90b5bf..f87f0e310 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/GenotypeAnnotation.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/GenotypeAnnotation.java @@ -1,7 +1,5 @@ package org.broadinstitute.sting.gatk.walkers.annotator.interfaces; -import org.broad.tribble.Feature; -import org.broadinstitute.sting.commandline.RodBinding; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; @@ -15,7 +13,7 @@ import java.util.Map; public abstract class GenotypeAnnotation extends VariantAnnotatorAnnotation { // return annotations for the given contexts/genotype split by sample - public abstract Map annotate(RefMetaDataTracker tracker, Map> rodBindings, + public abstract Map annotate(RefMetaDataTracker tracker, AnnotatorCompatibleWalker walker, ReferenceContext ref, AlignmentContext stratifiedContext, VariantContext vc, Genotype g); // return the descriptions used for the VCF FORMAT meta field diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/InfoFieldAnnotation.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/InfoFieldAnnotation.java index 63dea93d2..b94bee31b 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/InfoFieldAnnotation.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/annotator/interfaces/InfoFieldAnnotation.java @@ -1,7 +1,5 @@ package org.broadinstitute.sting.gatk.walkers.annotator.interfaces; -import org.broad.tribble.Feature; -import org.broadinstitute.sting.commandline.RodBinding; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; @@ -13,7 +11,7 @@ import java.util.Map; public abstract class InfoFieldAnnotation extends VariantAnnotatorAnnotation { // return annotations for the given contexts split by sample - public abstract Map annotate(RefMetaDataTracker tracker, Map> rodBindings, + public abstract Map annotate(RefMetaDataTracker tracker, AnnotatorCompatibleWalker walker, ReferenceContext ref, Map stratifiedContexts, VariantContext vc); // return the descriptions used for the VCF INFO meta field diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java index 07ba27639..0f2d73c3a 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/genotyper/UnifiedGenotyper.java @@ -25,7 +25,6 @@ package org.broadinstitute.sting.gatk.walkers.genotyper; -import org.broad.tribble.Feature; import org.broadinstitute.sting.commandline.Argument; import org.broadinstitute.sting.commandline.ArgumentCollection; import org.broadinstitute.sting.commandline.Output; @@ -34,16 +33,17 @@ import org.broadinstitute.sting.gatk.DownsampleType; import org.broadinstitute.sting.gatk.arguments.DbsnpArgumentCollection; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; -import org.broadinstitute.sting.gatk.datasources.rmd.ReferenceOrderedDataSource; import org.broadinstitute.sting.gatk.filters.BadMateFilter; import org.broadinstitute.sting.gatk.filters.MappingQualityUnavailableReadFilter; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; -import org.broadinstitute.sting.gatk.refdata.features.DbSNPHelper; import org.broadinstitute.sting.gatk.walkers.*; import org.broadinstitute.sting.gatk.walkers.annotator.VariantAnnotatorEngine; +import org.broadinstitute.sting.gatk.walkers.annotator.interfaces.AnnotatorCompatibleWalker; import org.broadinstitute.sting.utils.SampleUtils; import org.broadinstitute.sting.utils.baq.BAQ; +import org.broadinstitute.sting.utils.codecs.snpEff.SnpEffFeature; import org.broadinstitute.sting.utils.codecs.vcf.*; +import org.broadinstitute.sting.utils.variantcontext.VariantContext; import java.io.PrintStream; import java.util.*; @@ -58,7 +58,7 @@ import java.util.*; @Reference(window=@Window(start=-200,stop=200)) @By(DataSource.REFERENCE) @Downsample(by=DownsampleType.BY_SAMPLE, toCoverage=250) -public class UnifiedGenotyper extends LocusWalker implements TreeReducible { +public class UnifiedGenotyper extends LocusWalker implements TreeReducible, AnnotatorCompatibleWalker { @ArgumentCollection private UnifiedArgumentCollection UAC = new UnifiedArgumentCollection(); @@ -68,6 +68,10 @@ public class UnifiedGenotyper extends LocusWalker getDbsnpRodBinding() { return dbsnp.dbsnp; } + public RodBinding getSnpEffRodBinding() { return null; } + public List> getCompRodBindings() { return Collections.emptyList(); } + public List> getResourceRodBindings() { return Collections.emptyList(); } // control the output @Output(doc="File to which variants should be written",required=true) @@ -140,8 +144,7 @@ public class UnifiedGenotyper extends LocusWalker>()); + annotationEngine = new VariantAnnotatorEngine(Arrays.asList(annotationClassesToUse), annotationsToUse, this); UG_engine = new UnifiedGenotyperEngine(getToolkit(), UAC, logger, verboseWriter, annotationEngine, samples); // initialize the header @@ -160,16 +163,8 @@ public class UnifiedGenotyper extends LocusWalker dataSources = getToolkit().getRodDataSources(); - for ( ReferenceOrderedDataSource source : dataSources ) { - if ( source.getName().equals(DbSNPHelper.STANDARD_DBSNP_TRACK_NAME) ) { - headerInfo.add(new VCFInfoHeaderLine(VCFConstants.DBSNP_KEY, 0, VCFHeaderLineType.Flag, "dbSNP Membership")); - } - else if ( source.getName().startsWith(VariantAnnotatorEngine.dbPrefix) ) { - String name = source.getName().substring(VariantAnnotatorEngine.dbPrefix.length()); - headerInfo.add(new VCFInfoHeaderLine(name, 0, VCFHeaderLineType.Flag, name + " Membership")); - } - } + if ( dbsnp.dbsnp.isBound() ) + headerInfo.add(new VCFInfoHeaderLine(VCFConstants.DBSNP_KEY, 0, VCFHeaderLineType.Flag, "dbSNP Membership")); // FORMAT and INFO fields headerInfo.addAll(getSupportedHeaderStrings()); diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToVCF.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToVCF.java index f9e9562ca..723341d48 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToVCF.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/variantutils/VariantsToVCF.java @@ -27,10 +27,8 @@ package org.broadinstitute.sting.gatk.walkers.variantutils; import net.sf.samtools.util.CloseableIterator; import org.broad.tribble.Feature; -import org.broadinstitute.sting.commandline.Argument; -import org.broadinstitute.sting.commandline.Input; -import org.broadinstitute.sting.commandline.Output; -import org.broadinstitute.sting.commandline.RodBinding; +import org.broadinstitute.sting.commandline.*; +import org.broadinstitute.sting.gatk.arguments.DbsnpArgumentCollection; import org.broadinstitute.sting.gatk.contexts.AlignmentContext; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker; @@ -66,8 +64,8 @@ public class VariantsToVCF extends RodWalker { @Input(fullName="variant", shortName = "V", doc="Input variant file", required=true) public RodBinding variants; - @Input(fullName="dbsnp", shortName = "D", doc="dbSNP VCF for populating rsIDs", required=false) - public RodBinding dbsnp; + @ArgumentCollection + protected DbsnpArgumentCollection dbsnp = new DbsnpArgumentCollection(); @Argument(fullName="sample", shortName="sample", doc="The sample name represented by the variant rod (for data like GELI with genotypes)", required=false) protected String sampleName = null; @@ -89,7 +87,7 @@ public class VariantsToVCF extends RodWalker { if ( tracker == null || !BaseUtils.isRegularBase(ref.getBase()) ) return 0; - String rsID = dbsnp == null ? null : DbSNPHelper.rsIDOfFirstRealSNP(tracker.getValues(dbsnp, context.getLocation())); + String rsID = dbsnp == null ? null : DbSNPHelper.rsIDOfFirstRealVariant(tracker.getValues(dbsnp.dbsnp, context.getLocation()), VariantContext.Type.SNP); Collection contexts = getVariantContexts(tracker, ref); @@ -169,7 +167,7 @@ public class VariantsToVCF extends RodWalker { throw new UserException.BadInput("No dbSNP rod was provided, but one is needed to decipher the correct indel alleles from the HapMap records"); RMDTrackBuilder builder = new RMDTrackBuilder(getToolkit().getReferenceDataSource().getReference().getSequenceDictionary(),getToolkit().getGenomeLocParser(),getToolkit().getArguments().unsafe); - dbsnpIterator = builder.createInstanceOfTrack(VCFCodec.class, new File(dbsnp.getSource())).getIterator(); + dbsnpIterator = builder.createInstanceOfTrack(VCFCodec.class, new File(dbsnp.dbsnp.getSource())).getIterator(); // Note that we should really use some sort of seekable iterator here so that the search doesn't take forever // (but it's complicated because the hapmap location doesn't match the dbsnp location, so we don't know where to seek to) } diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorIntegrationTest.java b/public/java/test/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorIntegrationTest.java index af29bd01f..f54bfa40c 100755 --- a/public/java/test/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorIntegrationTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/walkers/annotator/VariantAnnotatorIntegrationTest.java @@ -94,7 +94,7 @@ public class VariantAnnotatorIntegrationTest extends WalkerTest { @Test public void testDBTagWithDbsnp() { WalkerTestSpec spec = new WalkerTestSpec( - baseTestString() + " -B:dbsnp,vcf " + b36dbSNP129 + " -G \"Standard\" --variant:VCF3 " + validationDataLocation + "vcfexample3empty.vcf -BTI variant", 1, + baseTestString() + " --dbsnp " + b36dbSNP129 + " -G \"Standard\" --variant:VCF3 " + validationDataLocation + "vcfexample3empty.vcf -BTI variant", 1, Arrays.asList("3da8ca2b6bdaf6e92d94a8c77a71313d")); executeTest("getting DB tag with dbSNP", spec); } @@ -102,7 +102,7 @@ public class VariantAnnotatorIntegrationTest extends WalkerTest { @Test public void testDBTagWithHapMap() { WalkerTestSpec spec = new WalkerTestSpec( - baseTestString() + " -B:compH3,VCF " + validationDataLocation + "fakeHM3.vcf -G \"Standard\" --variant:VCF3 " + validationDataLocation + "vcfexample3empty.vcf -BTI variant", 1, + baseTestString() + " --comp:H3 " + validationDataLocation + "fakeHM3.vcf -G \"Standard\" --variant:VCF3 " + validationDataLocation + "vcfexample3empty.vcf -BTI variant", 1, Arrays.asList("1bc01c5b3bd0b7aef75230310c3ce688")); executeTest("getting DB tag with HM3", spec); } @@ -110,7 +110,7 @@ public class VariantAnnotatorIntegrationTest extends WalkerTest { @Test public void testUsingExpression() { WalkerTestSpec spec = new WalkerTestSpec( - baseTestString() + " -B:foo,VCF " + validationDataLocation + "targetAnnotations.vcf -G \"Standard\" --variant:VCF3 " + validationDataLocation + "vcfexample3empty.vcf -E foo.AF -BTI variant", 1, + baseTestString() + " --resource:foo " + validationDataLocation + "targetAnnotations.vcf -G \"Standard\" --variant:VCF3 " + validationDataLocation + "vcfexample3empty.vcf -E foo.AF -BTI variant", 1, Arrays.asList("e9c0d832dc6b4ed06c955060f830c140")); executeTest("using expression", spec); }