diff --git a/build.xml b/build.xml
index 438e9c90c..1e4badc2c 100644
--- a/build.xml
+++ b/build.xml
@@ -168,7 +168,7 @@
-
+
diff --git a/public/java/src/org/broadinstitute/sting/gatk/CommandLineExecutable.java b/public/java/src/org/broadinstitute/sting/gatk/CommandLineExecutable.java
index ebdafc703..efdc64066 100644
--- a/public/java/src/org/broadinstitute/sting/gatk/CommandLineExecutable.java
+++ b/public/java/src/org/broadinstitute/sting/gatk/CommandLineExecutable.java
@@ -114,7 +114,7 @@ public abstract class CommandLineExecutable extends CommandLineProgram {
logger.warn("################################################################################");
}
- Collection oldStyle = ListFileUtils.unpackRODBindings(getArgumentCollection().RODBindings, getArgumentCollection().DBSNPFile, parser);
+ Collection oldStyle = ListFileUtils.unpackRODBindingsOldStyle(getArgumentCollection().RODBindings, parser);
oldStyle.addAll(newStyle);
engine.setReferenceMetaDataFiles(oldStyle);
diff --git a/public/java/src/org/broadinstitute/sting/gatk/arguments/GATKArgumentCollection.java b/public/java/src/org/broadinstitute/sting/gatk/arguments/GATKArgumentCollection.java
index ee2e85025..62135f21b 100755
--- a/public/java/src/org/broadinstitute/sting/gatk/arguments/GATKArgumentCollection.java
+++ b/public/java/src/org/broadinstitute/sting/gatk/arguments/GATKArgumentCollection.java
@@ -117,11 +117,6 @@ public class GATKArgumentCollection {
@Argument(fullName = "nonDeterministicRandomSeed", shortName = "ndrs", doc = "Makes the GATK behave non deterministically, that is, the random numbers generated will be different in every run", required = false)
public boolean nonDeterministicRandomSeed = false;
-
- @Element(required = false)
- @Input(fullName = "DBSNP", shortName = "D", doc = "DBSNP file", required = false)
- public String DBSNPFile = null;
-
/**
* The override mechanism in the GATK, by default, populates the command-line arguments, then
* the defaults from the walker annotations. Unfortunately, walker annotations should be trumped
@@ -380,9 +375,6 @@ public class GATKArgumentCollection {
if (!other.excludeIntervals.equals(this.excludeIntervals)) {
return false;
}
- if (!other.DBSNPFile.equals(this.DBSNPFile)) {
- return false;
- }
if (!other.unsafe.equals(this.unsafe)) {
return false;
}
diff --git a/public/java/src/org/broadinstitute/sting/gatk/refdata/RefMetaDataTracker.java b/public/java/src/org/broadinstitute/sting/gatk/refdata/RefMetaDataTracker.java
index 7ee560d1d..297c163ab 100644
--- a/public/java/src/org/broadinstitute/sting/gatk/refdata/RefMetaDataTracker.java
+++ b/public/java/src/org/broadinstitute/sting/gatk/refdata/RefMetaDataTracker.java
@@ -68,66 +68,81 @@ public class RefMetaDataTracker {
//
// ------------------------------------------------------------------------------------------
- public List getValues(Class type) {
+ public List getValues(final Class type) {
return addValues(map.keySet(), type, new ArrayList(), null, false, false);
}
- public List getValues(Class type, final GenomeLoc onlyAtThisLoc) {
+ public List getValues(final Class type, final GenomeLoc onlyAtThisLoc) {
return addValues(map.keySet(), type, new ArrayList(), onlyAtThisLoc, true, false);
}
- public List getValues(Class type, final String name) {
+ public List getValues(final Class type, final String name) {
return addValues(name, type, new ArrayList(), getTrackDataByName(name), null, false, false);
}
- public List getValues(Class type, final String name, final GenomeLoc onlyAtThisLoc) {
+ public List getValues(final Class type, final String name, final GenomeLoc onlyAtThisLoc) {
return addValues(name, type, new ArrayList(), getTrackDataByName(name), onlyAtThisLoc, true, false);
}
- public List getValues(Class type, final Collection names) {
+ public List getValues(final Class type, final Collection names) {
return addValues(names, type, new ArrayList(), null, false, false);
}
- public List getValues(Class type, final Collection names, final GenomeLoc onlyAtThisLoc) {
+ public List getValues(final Class type, final Collection names, final GenomeLoc onlyAtThisLoc) {
return addValues(names, type, new ArrayList(), onlyAtThisLoc, true, false);
}
- public T getFirstValue(Class type) {
+ public T getFirstValue(final Class type) {
return safeGetFirst(getValues(type));
}
- public T getFirstValue(Class type, final GenomeLoc onlyAtThisLoc) {
+ public T getFirstValue(final Class type, final GenomeLoc onlyAtThisLoc) {
return safeGetFirst(getValues(type, onlyAtThisLoc));
}
- public T getFirstValue(Class type, final String name) {
+ public T getFirstValue(final Class type, final String name) {
return safeGetFirst(getValues(type, name));
}
- public T getFirstValue(Class type, final String name, final GenomeLoc onlyAtThisLoc) {
+ public T getFirstValue(final Class type, final String name, final GenomeLoc onlyAtThisLoc) {
return safeGetFirst(getValues(type, name, onlyAtThisLoc));
}
- public T getFirstValue(Class type, final Collection names) {
+ public T getFirstValue(final Class type, final Collection names) {
return safeGetFirst(getValues(type, names));
}
- public T getFirstValue(Class type, final Collection names, final GenomeLoc onlyAtThisLoc) {
+ public T getFirstValue(final Class type, final Collection names, final GenomeLoc onlyAtThisLoc) {
return safeGetFirst(getValues(type, names, onlyAtThisLoc));
}
//
// ROD binding accessors
//
- public List getValues(RodBinding rodBinding) {
+ public List getValues(final RodBinding rodBinding) {
return getValues(rodBinding.getType(), rodBinding.getVariableName());
}
- public List getValues(RodBinding rodBinding, final GenomeLoc onlyAtThisLoc) {
+
+ public List getValues(final Collection> rodBindings) {
+ List results = new ArrayList();
+ for ( RodBinding rodBinding : rodBindings )
+ results.addAll(getValues(rodBinding));
+ return results;
+ }
+
+ public List getValues(final RodBinding rodBinding, final GenomeLoc onlyAtThisLoc) {
return getValues(rodBinding.getType(), rodBinding.getVariableName(), onlyAtThisLoc);
}
- public T getFirstValue(RodBinding rodBinding) {
+ public List getValues(final Collection> rodBindings, final GenomeLoc onlyAtThisLoc) {
+ List results = new ArrayList();
+ for ( RodBinding rodBinding : rodBindings )
+ results.addAll(getValues(rodBinding, onlyAtThisLoc));
+ return results;
+ }
+
+ public T getFirstValue(final RodBinding rodBinding) {
return getFirstValue(rodBinding.getType(), rodBinding.getVariableName());
}
- public T getFirstValue(RodBinding rodBinding, final GenomeLoc onlyAtThisLoc) {
+ public T getFirstValue(final RodBinding rodBinding, final GenomeLoc onlyAtThisLoc) {
return getFirstValue(rodBinding.getType(), rodBinding.getVariableName(), onlyAtThisLoc);
}
- public boolean hasValues(RodBinding rodBinding) {
+ public boolean hasValues(final RodBinding rodBinding) {
return hasValues(rodBinding.getVariableName());
}
- public List getValuesAsGATKFeatures(RodBinding rodBinding) {
+ public List getValuesAsGATKFeatures(final RodBinding rodBinding) {
return getValuesAsGATKFeatures(rodBinding.getVariableName());
}
@@ -142,7 +157,7 @@ public class RefMetaDataTracker {
* @param
* @return
*/
- final private T safeGetFirst(List l) {
+ final private T safeGetFirst(final List l) {
// todo: should we be warning people here? Throwing an error?
return l.isEmpty() ? null : l.get(0);
}
@@ -277,10 +292,12 @@ public class RefMetaDataTracker {
for ( String name : names ) {
RODRecordList rodList = getTrackDataByName(name); // require that the name is an exact match
addValues(name, type, values, rodList, curLocation, requireStartHere, takeFirstOnly );
- }
+ }
+
+ return values;
+ }
+
- return values;
- }
private List addValues(final String name,
final Class type,
diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/PileupWalker.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/PileupWalker.java
index 1484841b3..fd9bf5734 100644
--- a/public/java/src/org/broadinstitute/sting/gatk/walkers/PileupWalker.java
+++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/PileupWalker.java
@@ -25,9 +25,11 @@
package org.broadinstitute.sting.gatk.walkers;
+import org.broad.tribble.Feature;
import org.broad.tribble.dbsnp.DbSNPFeature;
import org.broadinstitute.sting.commandline.Argument;
import org.broadinstitute.sting.commandline.Output;
+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;
@@ -68,6 +70,9 @@ public class PileupWalker extends LocusWalker implements TreeR
@Argument(fullName="showIndelPileups",shortName="show_indels",doc="In addition to base pileups, generate pileups of extended indel events")
public boolean SHOW_INDEL_PILEUPS = false;
+ @Argument(fullName="rodBind",shortName="-B",doc="Add these ROD bindings to the output Pileup", required=false)
+ public List> rods;
+
public void initialize() {
}
@@ -112,18 +117,11 @@ public class PileupWalker extends LocusWalker implements TreeR
*/
private String getReferenceOrderedData( RefMetaDataTracker tracker ) {
ArrayList rodStrings = new ArrayList();
- for ( GATKFeature datum : tracker.getAllValuesAsGATKFeatures() ) {
- if ( datum != null && datum.getUnderlyingObject() instanceof ReferenceOrderedDatum ) {
- rodStrings.add(((ReferenceOrderedDatum)datum.getUnderlyingObject()).toSimpleString()); // TODO: Aaron: this line still survives, try to remove it
- }
+ for ( Feature datum : tracker.getValues(rods) ) {
+ rodStrings.add(datum.toString());
}
String rodString = Utils.join(", ", rodStrings);
- DbSNPFeature dbsnp = tracker.getFirstValue(DbSNPHelper.STANDARD_DBSNP_TRACK_NAME, DbSNPFeature.class);
-
- if ( dbsnp != null)
- rodString += DbSNPHelper.toMediumString(dbsnp);
-
if ( !rodString.equals("") )
rodString = "[ROD: " + rodString + "]";
@@ -132,8 +130,6 @@ public class PileupWalker extends LocusWalker implements TreeR
@Override
public void onTraversalDone(Integer result) {
- // Double check traversal result to make count is the same.
- // TODO: Is this check necessary?
out.println("[REDUCE RESULT] Traversal result is: " + result);
}
}
diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/beagle/BeagleOutputToVCFWalker.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/beagle/BeagleOutputToVCFWalker.java
index 97a4b6a8f..e4773bf4d 100755
--- a/public/java/src/org/broadinstitute/sting/gatk/walkers/beagle/BeagleOutputToVCFWalker.java
+++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/beagle/BeagleOutputToVCFWalker.java
@@ -26,7 +26,9 @@
package org.broadinstitute.sting.gatk.walkers.beagle;
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.gatk.contexts.AlignmentContext;
import org.broadinstitute.sting.gatk.contexts.ReferenceContext;
import org.broadinstitute.sting.gatk.datasources.rmd.ReferenceOrderedDataSource;
@@ -51,15 +53,22 @@ import static java.lang.Math.log10;
/**
* Takes files produced by Beagle imputation engine and creates a vcf with modified annotations.
*/
-@Requires(value={},referenceMetaData=@RMD(name=BeagleOutputToVCFWalker.INPUT_ROD_NAME, type=VariantContext.class))
-
+@Requires(value={})
public class BeagleOutputToVCFWalker extends RodWalker {
+ @Input(fullName="variant", shortName = "V", doc="Input VCF file", required=true)
+ public RodBinding variants;
- public static final String INPUT_ROD_NAME = "variant";
- public static final String COMP_ROD_NAME = "comp";
- public static final String R2_ROD_NAME = "beagleR2";
- public static final String PROBS_ROD_NAME = "beagleProbs";
- public static final String PHASED_ROD_NAME = "beaglePhased";
+ @Input(fullName="comp", shortName = "comp", doc="Comparison VCF file", required=false)
+ public RodBinding comp;
+
+ @Input(fullName="beagleR2", shortName = "beagleR2", doc="VCF file", required=true)
+ public RodBinding beagleR2;
+
+ @Input(fullName="beagleProbs", shortName = "beagleProbs", doc="VCF file", required=true)
+ public RodBinding beagleProbs;
+
+ @Input(fullName="beaglePhased", shortName = "beaglePhased", doc="VCF file", required=true)
+ public RodBinding beaglePhased;
@Output(doc="File to which variants should be written",required=true)
protected VCFWriter vcfWriter = null;
@@ -98,7 +107,7 @@ public class BeagleOutputToVCFWalker extends RodWalker {
final List dataSources = this.getToolkit().getRodDataSources();
for( final ReferenceOrderedDataSource source : dataSources ) {
- if (source.getName().equals(COMP_ROD_NAME)) {
+ if (source.getName().equals(comp.getVariableName())) {
hInfo.add(new VCFInfoHeaderLine("ACH", 1, VCFHeaderLineType.Integer, "Allele Count from Comparison ROD at this site"));
hInfo.add(new VCFInfoHeaderLine("ANH", 1, VCFHeaderLineType.Integer, "Allele Frequency from Comparison ROD at this site"));
hInfo.add(new VCFInfoHeaderLine("AFH", 1, VCFHeaderLineType.Float, "Allele Number from Comparison ROD at this site"));
@@ -107,7 +116,7 @@ public class BeagleOutputToVCFWalker extends RodWalker {
}
- Set samples = SampleUtils.getSampleListWithVCFHeader(getToolkit(), Arrays.asList(INPUT_ROD_NAME));
+ Set samples = SampleUtils.getSampleListWithVCFHeader(getToolkit(), Arrays.asList(variants.getVariableName()));
final VCFHeader vcfHeader = new VCFHeader(hInfo, samples);
vcfWriter.writeHeader(vcfHeader);
@@ -119,9 +128,9 @@ public class BeagleOutputToVCFWalker extends RodWalker {
return 0;
GenomeLoc loc = context.getLocation();
- VariantContext vc_input = tracker.getFirstValue(VariantContext.class, INPUT_ROD_NAME, loc);
+ VariantContext vc_input = tracker.getFirstValue(variants, loc);
- VariantContext vc_comp = tracker.getFirstValue(VariantContext.class, COMP_ROD_NAME, loc);
+ VariantContext vc_comp = tracker.getFirstValue(comp, loc);
if ( vc_input == null )
return 0;
@@ -130,30 +139,24 @@ public class BeagleOutputToVCFWalker extends RodWalker {
vcfWriter.add(vc_input, ref.getBase());
return 1;
}
- List