Updating tools to use the RodBinding<T> syntax

This commit is contained in:
Mark DePristo 2011-08-02 14:05:51 -04:00
parent 184030dd56
commit a366f9a18d
35 changed files with 245 additions and 256 deletions

View File

@ -168,7 +168,7 @@
<target name="init.buildall">
<!-- Set the properties needed to build everything -->
<property name="gatk.target" value="private"/>
<property name="scala.target" value="core"/>
<!-- <property name="scala.target" value="core"/> -->
</target>
<target name="git.describe">

View File

@ -114,7 +114,7 @@ public abstract class CommandLineExecutable extends CommandLineProgram {
logger.warn("################################################################################");
}
Collection<RMDTriplet> oldStyle = ListFileUtils.unpackRODBindings(getArgumentCollection().RODBindings, getArgumentCollection().DBSNPFile, parser);
Collection<RMDTriplet> oldStyle = ListFileUtils.unpackRODBindingsOldStyle(getArgumentCollection().RODBindings, parser);
oldStyle.addAll(newStyle);
engine.setReferenceMetaDataFiles(oldStyle);

View File

@ -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;
}

View File

@ -68,66 +68,81 @@ public class RefMetaDataTracker {
//
// ------------------------------------------------------------------------------------------
public <T extends Feature> List<T> getValues(Class<T> type) {
public <T extends Feature> List<T> getValues(final Class<T> type) {
return addValues(map.keySet(), type, new ArrayList<T>(), null, false, false);
}
public <T extends Feature> List<T> getValues(Class<T> type, final GenomeLoc onlyAtThisLoc) {
public <T extends Feature> List<T> getValues(final Class<T> type, final GenomeLoc onlyAtThisLoc) {
return addValues(map.keySet(), type, new ArrayList<T>(), onlyAtThisLoc, true, false);
}
public <T extends Feature> List<T> getValues(Class<T> type, final String name) {
public <T extends Feature> List<T> getValues(final Class<T> type, final String name) {
return addValues(name, type, new ArrayList<T>(), getTrackDataByName(name), null, false, false);
}
public <T extends Feature> List<T> getValues(Class<T> type, final String name, final GenomeLoc onlyAtThisLoc) {
public <T extends Feature> List<T> getValues(final Class<T> type, final String name, final GenomeLoc onlyAtThisLoc) {
return addValues(name, type, new ArrayList<T>(), getTrackDataByName(name), onlyAtThisLoc, true, false);
}
public <T extends Feature> List<T> getValues(Class<T> type, final Collection<String> names) {
public <T extends Feature> List<T> getValues(final Class<T> type, final Collection<String> names) {
return addValues(names, type, new ArrayList<T>(), null, false, false);
}
public <T extends Feature> List<T> getValues(Class<T> type, final Collection<String> names, final GenomeLoc onlyAtThisLoc) {
public <T extends Feature> List<T> getValues(final Class<T> type, final Collection<String> names, final GenomeLoc onlyAtThisLoc) {
return addValues(names, type, new ArrayList<T>(), onlyAtThisLoc, true, false);
}
public <T extends Feature> T getFirstValue(Class<T> type) {
public <T extends Feature> T getFirstValue(final Class<T> type) {
return safeGetFirst(getValues(type));
}
public <T extends Feature> T getFirstValue(Class<T> type, final GenomeLoc onlyAtThisLoc) {
public <T extends Feature> T getFirstValue(final Class<T> type, final GenomeLoc onlyAtThisLoc) {
return safeGetFirst(getValues(type, onlyAtThisLoc));
}
public <T extends Feature> T getFirstValue(Class<T> type, final String name) {
public <T extends Feature> T getFirstValue(final Class<T> type, final String name) {
return safeGetFirst(getValues(type, name));
}
public <T extends Feature> T getFirstValue(Class<T> type, final String name, final GenomeLoc onlyAtThisLoc) {
public <T extends Feature> T getFirstValue(final Class<T> type, final String name, final GenomeLoc onlyAtThisLoc) {
return safeGetFirst(getValues(type, name, onlyAtThisLoc));
}
public <T extends Feature> T getFirstValue(Class<T> type, final Collection<String> names) {
public <T extends Feature> T getFirstValue(final Class<T> type, final Collection<String> names) {
return safeGetFirst(getValues(type, names));
}
public <T extends Feature> T getFirstValue(Class<T> type, final Collection<String> names, final GenomeLoc onlyAtThisLoc) {
public <T extends Feature> T getFirstValue(final Class<T> type, final Collection<String> names, final GenomeLoc onlyAtThisLoc) {
return safeGetFirst(getValues(type, names, onlyAtThisLoc));
}
//
// ROD binding accessors
//
public <T extends Feature> List<T> getValues(RodBinding<T> rodBinding) {
public <T extends Feature> List<T> getValues(final RodBinding<T> rodBinding) {
return getValues(rodBinding.getType(), rodBinding.getVariableName());
}
public <T extends Feature> List<T> getValues(RodBinding<T> rodBinding, final GenomeLoc onlyAtThisLoc) {
public <T extends Feature> List<T> getValues(final Collection<RodBinding<T>> rodBindings) {
List<T> results = new ArrayList<T>();
for ( RodBinding<T> rodBinding : rodBindings )
results.addAll(getValues(rodBinding));
return results;
}
public <T extends Feature> List<T> getValues(final RodBinding<T> rodBinding, final GenomeLoc onlyAtThisLoc) {
return getValues(rodBinding.getType(), rodBinding.getVariableName(), onlyAtThisLoc);
}
public <T extends Feature> T getFirstValue(RodBinding<T> rodBinding) {
public <T extends Feature> List<T> getValues(final Collection<RodBinding<T>> rodBindings, final GenomeLoc onlyAtThisLoc) {
List<T> results = new ArrayList<T>();
for ( RodBinding<T> rodBinding : rodBindings )
results.addAll(getValues(rodBinding, onlyAtThisLoc));
return results;
}
public <T extends Feature> T getFirstValue(final RodBinding<T> rodBinding) {
return getFirstValue(rodBinding.getType(), rodBinding.getVariableName());
}
public <T extends Feature> T getFirstValue(RodBinding<T> rodBinding, final GenomeLoc onlyAtThisLoc) {
public <T extends Feature> T getFirstValue(final RodBinding<T> 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<GATKFeature> getValuesAsGATKFeatures(RodBinding rodBinding) {
public List<GATKFeature> getValuesAsGATKFeatures(final RodBinding rodBinding) {
return getValuesAsGATKFeatures(rodBinding.getVariableName());
}
@ -142,7 +157,7 @@ public class RefMetaDataTracker {
* @param <T>
* @return
*/
final private <T extends Feature> T safeGetFirst(List<T> l) {
final private <T extends Feature> T safeGetFirst(final List<T> 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 <T extends Feature> List<T> addValues(final String name,
final Class<T> type,

View File

@ -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<Integer, Integer> 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<RodBinding<Feature>> rods;
public void initialize() {
}
@ -112,18 +117,11 @@ public class PileupWalker extends LocusWalker<Integer, Integer> implements TreeR
*/
private String getReferenceOrderedData( RefMetaDataTracker tracker ) {
ArrayList<String> rodStrings = new ArrayList<String>();
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<Integer, Integer> 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);
}
}

View File

@ -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<Integer, Integer> {
@Input(fullName="variant", shortName = "V", doc="Input VCF file", required=true)
public RodBinding<VariantContext> 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<VariantContext> comp;
@Input(fullName="beagleR2", shortName = "beagleR2", doc="VCF file", required=true)
public RodBinding<BeagleFeature> beagleR2;
@Input(fullName="beagleProbs", shortName = "beagleProbs", doc="VCF file", required=true)
public RodBinding<BeagleFeature> beagleProbs;
@Input(fullName="beaglePhased", shortName = "beaglePhased", doc="VCF file", required=true)
public RodBinding<BeagleFeature> 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<Integer, Integer> {
final List<ReferenceOrderedDataSource> 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<Integer, Integer> {
}
Set<String> samples = SampleUtils.getSampleListWithVCFHeader(getToolkit(), Arrays.asList(INPUT_ROD_NAME));
Set<String> 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<Integer, Integer> {
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<Integer, Integer> {
vcfWriter.add(vc_input, ref.getBase());
return 1;
}
List<Object> r2rods = tracker.getValues(R2_ROD_NAME);
BeagleFeature beagleR2Feature = tracker.getFirstValue(beagleR2);
// ignore places where we don't have a variant
if ( r2rods.size() == 0 )
if ( beagleR2Feature == null )
return 0;
BeagleFeature beagleR2Feature = (BeagleFeature)r2rods.get(0);
List<Object> gProbsrods = tracker.getValues(PROBS_ROD_NAME);
BeagleFeature beagleProbsFeature = tracker.getFirstValue(beagleProbs);
// ignore places where we don't have a variant
if ( gProbsrods.size() == 0 )
if ( beagleProbsFeature == null )
return 0;
BeagleFeature beagleProbsFeature = (BeagleFeature)gProbsrods.get(0);
List<Object> gPhasedrods = tracker.getValues(PHASED_ROD_NAME);
BeagleFeature beaglePhasedFeature = tracker.getFirstValue(beaglePhased);
// ignore places where we don't have a variant
if ( gPhasedrods.size() == 0 )
if ( beaglePhasedFeature == null )
return 0;
BeagleFeature beaglePhasedFeature = (BeagleFeature)gPhasedrods.get(0);
// get reference base for current position
byte refByte = ref.getBase();

View File

@ -25,10 +25,7 @@
package org.broadinstitute.sting.gatk.walkers.beagle;
import org.broadinstitute.sting.commandline.Argument;
import org.broadinstitute.sting.commandline.Hidden;
import org.broadinstitute.sting.commandline.Input;
import org.broadinstitute.sting.commandline.Output;
import org.broadinstitute.sting.commandline.*;
import org.broadinstitute.sting.gatk.GenomeAnalysisEngine;
import org.broadinstitute.sting.gatk.contexts.AlignmentContext;
import org.broadinstitute.sting.gatk.contexts.ReferenceContext;
@ -54,10 +51,13 @@ import java.util.*;
/**
* Produces an input file to Beagle imputation engine, listing genotype likelihoods for each sample in input variant file
*/
@Requires(value={},referenceMetaData=@RMD(name=ProduceBeagleInputWalker.ROD_NAME, type=VariantContext.class))
@Requires(value={})
public class ProduceBeagleInputWalker extends RodWalker<Integer, Integer> {
public static final String ROD_NAME = "variant";
public static final String VALIDATION_ROD_NAME = "validation";
@Input(fullName="variant", shortName = "V", doc="Input VCF file", required=true)
public RodBinding<VariantContext> variants;
@Input(fullName="validation", shortName = "validation", doc="Input VCF file", required=false)
public RodBinding<VariantContext> validation;
@Output(doc="File to which BEAGLE input should be written",required=true)
protected PrintStream beagleWriter = null;
@ -99,7 +99,7 @@ public class ProduceBeagleInputWalker extends RodWalker<Integer, Integer> {
public void initialize() {
samples = SampleUtils.getSampleListWithVCFHeader(getToolkit(), Arrays.asList(ROD_NAME));
samples = SampleUtils.getSampleListWithVCFHeader(getToolkit(), Arrays.asList(variants.getVariableName()));
beagleWriter.print("marker alleleA alleleB");
for ( String sample : samples )
@ -121,8 +121,8 @@ public class ProduceBeagleInputWalker extends RodWalker<Integer, Integer> {
public Integer map( RefMetaDataTracker tracker, ReferenceContext ref, AlignmentContext context ) {
if( tracker != null ) {
GenomeLoc loc = context.getLocation();
VariantContext variant_eval = tracker.getFirstValue(VariantContext.class, ROD_NAME, loc);
VariantContext validation_eval = tracker.getFirstValue(VariantContext.class, VALIDATION_ROD_NAME, loc);
VariantContext variant_eval = tracker.getFirstValue(variants, loc);
VariantContext validation_eval = tracker.getFirstValue(validation, loc);
if ( goodSite(variant_eval,validation_eval) ) {
if ( useValidation(validation_eval, ref) ) {
@ -303,9 +303,7 @@ public class ProduceBeagleInputWalker extends RodWalker<Integer, Integer> {
}
private void initializeVcfWriter() {
final ArrayList<String> inputNames = new ArrayList<String>();
inputNames.add( VALIDATION_ROD_NAME );
final List<String> inputNames = Arrays.asList(validation.getVariableName());
// setup the header fields
Set<VCFHeaderLine> hInfo = new HashSet<VCFHeaderLine>();

View File

@ -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.refdata.RefMetaDataTracker;
@ -54,9 +56,10 @@ import java.util.Set;
* in input variant file. Will additional hold back a fraction of the sites for evaluation, marking the
* genotypes at that sites as missing, and writing the truth of these sites to a second VCF file
*/
@Requires(value={},referenceMetaData=@RMD(name= VariantsToBeagleUnphasedWalker.ROD_NAME, type=VariantContext.class))
@Requires(value={})
public class VariantsToBeagleUnphasedWalker extends RodWalker<Integer, Integer> {
public static final String ROD_NAME = "variant";
@Input(fullName="variant", shortName = "V", doc="Input VCF file", required=true)
public RodBinding<VariantContext> variants;
@Output(doc="File to which BEAGLE unphased genotypes should be written",required=true)
protected PrintStream beagleWriter = null;
@ -75,7 +78,7 @@ public class VariantsToBeagleUnphasedWalker extends RodWalker<Integer, Integer>
private int testSetSize = 0;
public void initialize() {
samples = SampleUtils.getSampleListWithVCFHeader(getToolkit(), Arrays.asList(ROD_NAME));
samples = SampleUtils.getSampleListWithVCFHeader(getToolkit(), Arrays.asList(variants.getVariableName()));
beagleWriter.print("I marker alleleA alleleB");
for ( String sample : samples )
@ -102,7 +105,7 @@ public class VariantsToBeagleUnphasedWalker extends RodWalker<Integer, Integer>
public Integer map( RefMetaDataTracker tracker, ReferenceContext ref, AlignmentContext context ) {
if( tracker != null ) {
GenomeLoc loc = context.getLocation();
VariantContext vc = tracker.getFirstValue(VariantContext.class, ROD_NAME, loc);
VariantContext vc = tracker.getFirstValue(variants, loc);
if ( ProduceBeagleInputWalker.canBeOutputToBeagle(vc) ) {
// do we want to hold back this site?

View File

@ -22,12 +22,13 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
package org.broadinstitute.sting.gatk.walkers;
package org.broadinstitute.sting.gatk.walkers.coverage;
import org.broadinstitute.sting.commandline.Output;
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.*;
import org.broadinstitute.sting.utils.BaseUtils;
import org.broadinstitute.sting.utils.GenomeLoc;
import org.broadinstitute.sting.utils.collections.Pair;

View File

@ -25,6 +25,8 @@
package org.broadinstitute.sting.gatk.walkers.fasta;
import org.broadinstitute.sting.commandline.Input;
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;
@ -45,6 +47,8 @@ import java.util.Collection;
@Reference(window=@Window(start=-1,stop=50))
@Requires(value={DataSource.REFERENCE})
public class FastaAlternateReferenceWalker extends FastaReferenceWalker {
@Input(fullName="snpmask", shortName = "snpmask", doc="SNP mask VCF file", required=true)
public RodBinding<VariantContext> snpmask;
private int deletionBasesRemaining = 0;
@ -57,20 +61,18 @@ public class FastaAlternateReferenceWalker extends FastaReferenceWalker {
String refBase = String.valueOf((char)ref.getBase());
Collection<VariantContext> vcs = tracker.getValues(VariantContext.class);
Collection<VariantContext> vcs = tracker.getValues(snpmask);
// Check to see if we have a called snp
for ( VariantContext vc : vcs ) {
if ( !vc.getSource().startsWith("snpmask") ) {
if ( vc.isDeletion()) {
deletionBasesRemaining = vc.getReference().length();
// delete the next n bases, not this one
return new Pair<GenomeLoc, String>(context.getLocation(), refBase);
} else if ( vc.isInsertion()) {
return new Pair<GenomeLoc, String>(context.getLocation(), refBase.concat(vc.getAlternateAllele(0).toString()));
} else if (vc.isSNP()) {
return new Pair<GenomeLoc, String>(context.getLocation(), vc.getAlternateAllele(0).toString());
}
if ( vc.isDeletion()) {
deletionBasesRemaining = vc.getReference().length();
// delete the next n bases, not this one
return new Pair<GenomeLoc, String>(context.getLocation(), refBase);
} else if ( vc.isInsertion()) {
return new Pair<GenomeLoc, String>(context.getLocation(), refBase.concat(vc.getAlternateAllele(0).toString()));
} else if (vc.isSNP()) {
return new Pair<GenomeLoc, String>(context.getLocation(), vc.getAlternateAllele(0).toString());
}
}

View File

@ -26,7 +26,9 @@
package org.broadinstitute.sting.gatk.walkers.filters;
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;
@ -46,9 +48,11 @@ import java.util.*;
/**
* Filters variant calls using a number of user-selectable, parameterizable criteria.
*/
@Requires(value={},referenceMetaData=@RMD(name="variant", type=VariantContext.class))
@Requires(value={})
@Reference(window=@Window(start=-50,stop=50))
public class VariantFiltrationWalker extends RodWalker<Integer, Integer> {
@Input(fullName="variant", shortName = "V", doc="Input VCF file", required=true)
public RodBinding<VariantContext> variants;
@Output(doc="File to which variants should be written", required=true)
protected VCFWriter writer = null;
@ -80,7 +84,6 @@ public class VariantFiltrationWalker extends RodWalker<Integer, Integer> {
List<VariantContextUtils.JexlVCMatchExp> filterExps;
List<VariantContextUtils.JexlVCMatchExp> genotypeFilterExps;
public static final String INPUT_VARIANT_ROD_BINDING_NAME = "variant";
public static final String CLUSTERED_SNP_FILTER_NAME = "SnpCluster";
private ClusteredSnps clusteredSNPs = null;
private GenomeLoc previousMaskPosition = null;
@ -92,8 +95,7 @@ public class VariantFiltrationWalker extends RodWalker<Integer, Integer> {
private void initializeVcfWriter() {
final ArrayList<String> inputNames = new ArrayList<String>();
inputNames.add( INPUT_VARIANT_ROD_BINDING_NAME );
final List<String> inputNames = Arrays.asList(variants.getVariableName());
// setup the header fields
Set<VCFHeaderLine> hInfo = new HashSet<VCFHeaderLine>();
@ -149,7 +151,7 @@ public class VariantFiltrationWalker extends RodWalker<Integer, Integer> {
if ( tracker == null )
return 0;
Collection<VariantContext> VCs = tracker.getValues(VariantContext.class, INPUT_VARIANT_ROD_BINDING_NAME, context.getLocation());
Collection<VariantContext> VCs = tracker.getValues(variants, context.getLocation());
// is there a SNP mask present?
boolean hasMask = tracker.getValues("mask").size() > 0;

View File

@ -8,6 +8,8 @@ import org.broadinstitute.sting.gatk.walkers.varianteval.util.NewEvaluationConte
import org.broadinstitute.sting.gatk.walkers.varianteval.util.StateKey;
import org.broadinstitute.sting.utils.variantcontext.VariantContext;
import java.util.Collection;
public abstract class VariantEvaluator {
public void initialize(VariantEvalWalker walker) {}
@ -17,25 +19,18 @@ public abstract class VariantEvaluator {
public abstract int getComparisonOrder();
// called at all sites, regardless of eval context itself; useful for counting processed bases
public void update0(RefMetaDataTracker tracker, ReferenceContext ref, AlignmentContext context) { }
public void update0(RefMetaDataTracker tracker, ReferenceContext ref, AlignmentContext context) {
public String update1(VariantContext vc1, RefMetaDataTracker tracker, ReferenceContext ref, AlignmentContext context) {
}
public String update1(VariantContext eval, RefMetaDataTracker tracker, ReferenceContext ref, AlignmentContext context) {
return null;
}
public String update1(VariantContext vc1, RefMetaDataTracker tracker, ReferenceContext ref, AlignmentContext context, NewEvaluationContext group) {
return update1(vc1, tracker, ref, context);
}
public String update2(VariantContext vc1, VariantContext vc2, RefMetaDataTracker tracker, ReferenceContext ref, AlignmentContext context) {
public String update2(VariantContext eval, VariantContext comp, RefMetaDataTracker tracker, ReferenceContext ref, AlignmentContext context) {
return null;
}
public String update2(VariantContext vc1, VariantContext vc2, RefMetaDataTracker tracker, ReferenceContext ref, AlignmentContext context, NewEvaluationContext group) {
return update2(vc1, vc2, tracker, ref, context);
}
public void finalizeEvaluation() {}
protected double rate(long n, long d) {

View File

@ -330,9 +330,7 @@ public class VariantEvalUtils {
* to do this)
* @return a mapping of track names to a list of VariantContext objects
*/
public HashMap<String, HashMap<String, VariantContext>> bindVariantContexts(RefMetaDataTracker tracker, ReferenceContext ref, Set<String> trackNames, EnumSet<VariantContext.Type> allowableTypes, boolean byFilter, boolean subsetBySample, boolean trackPerSample) {
HashMap<String, HashMap<String, VariantContext>> bindings = new HashMap<String, HashMap<String, VariantContext>>();
protected void bindVariantContexts(HashMap<String, HashMap<String, VariantContext>> bindings, RefMetaDataTracker tracker, ReferenceContext ref, Set<String> trackNames, EnumSet<VariantContext.Type> allowableTypes, boolean byFilter, boolean subsetBySample, boolean trackPerSample) {
for (String trackName : trackNames) {
HashMap<String, VariantContext> vcs = new HashMap<String, VariantContext>();
@ -364,8 +362,6 @@ public class VariantEvalUtils {
bindings.put(trackName, vcs);
}
}
return bindings;
}
/**
@ -393,11 +389,8 @@ public class VariantEvalUtils {
}
}
HashMap<String, HashMap<String, VariantContext>> evalBindings = bindVariantContexts(tracker, ref, evalNames, allowableTypes, byFilter, true, perSampleIsEnabled);
HashMap<String, HashMap<String, VariantContext>> compBindings = bindVariantContexts(tracker, ref, compNames, allowableTypes, byFilter, false, false);
vcs.putAll(compBindings);
vcs.putAll(evalBindings);
bindVariantContexts(vcs, tracker, ref, evalNames, allowableTypes, byFilter, true, perSampleIsEnabled);
bindVariantContexts(vcs, tracker, ref, compNames, allowableTypes, byFilter, false, false);
return vcs;
}

View File

@ -54,7 +54,6 @@ import java.util.*;
@Reference(window=@Window(start=-50,stop=50))
@Requires(value={})
public class CombineVariants extends RodWalker<Integer, Integer> {
@Output(doc="File to which variants should be written",required=true)
protected VCFWriter vcfWriter = null;

View File

@ -24,7 +24,9 @@
package org.broadinstitute.sting.gatk.walkers.variantutils;
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.refdata.RefMetaDataTracker;
@ -44,8 +46,10 @@ import java.util.Set;
* Filters a lifted-over VCF file for ref bases that have been changed.
*/
@Reference(window=@Window(start=0,stop=100))
@Requires(value={},referenceMetaData=@RMD(name="variant",type= VariantContext.class))
@Requires(value={})
public class FilterLiftedVariants extends RodWalker<Integer, Integer> {
@Input(fullName="variant", shortName = "V", doc="Input VCF file", required=true)
public RodBinding<VariantContext> variants;
private static final int MAX_VARIANT_SIZE = 100;
@ -55,10 +59,10 @@ public class FilterLiftedVariants extends RodWalker<Integer, Integer> {
private long failedLocs = 0, totalLocs = 0;
public void initialize() {
Set<String> samples = SampleUtils.getSampleListWithVCFHeader(getToolkit(), Arrays.asList("variant"));
Map<String, VCFHeader> vcfHeaders = VCFUtils.getVCFHeadersFromRods(getToolkit(), Arrays.asList("variant"));
Set<String> samples = SampleUtils.getSampleListWithVCFHeader(getToolkit(), Arrays.asList(variants.getVariableName()));
Map<String, VCFHeader> vcfHeaders = VCFUtils.getVCFHeadersFromRods(getToolkit(), Arrays.asList(variants.getVariableName()));
final VCFHeader vcfHeader = new VCFHeader(vcfHeaders.containsKey("variant") ? vcfHeaders.get("variant").getMetaData() : null, samples);
final VCFHeader vcfHeader = new VCFHeader(vcfHeaders.containsKey(variants.getVariableName()) ? vcfHeaders.get(variants.getVariableName()).getMetaData() : null, samples);
writer.writeHeader(vcfHeader);
}
@ -85,7 +89,7 @@ public class FilterLiftedVariants extends RodWalker<Integer, Integer> {
if ( tracker == null )
return 0;
Collection<VariantContext> VCs = tracker.getValues(VariantContext.class, "variant", context.getLocation());
Collection<VariantContext> VCs = tracker.getValues(variants, context.getLocation());
for ( VariantContext vc : VCs )
filterAndWrite(ref.getBases(), vc);

View File

@ -28,7 +28,9 @@ package org.broadinstitute.sting.gatk.walkers.variantutils;
import net.sf.samtools.Cigar;
import net.sf.samtools.CigarElement;
import net.sf.samtools.CigarOperator;
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.refdata.RefMetaDataTracker;
@ -46,8 +48,10 @@ import java.util.*;
* Left-aligns indels from a variants file.
*/
@Reference(window=@Window(start=-200,stop=200))
@Requires(value={},referenceMetaData=@RMD(name="variant", type=VariantContext.class))
@Requires(value={})
public class LeftAlignVariants extends RodWalker<Integer, Integer> {
@Input(fullName="variant", shortName = "V", doc="Input VCF file", required=true)
public RodBinding<VariantContext> variants;
@Output(doc="File to which variants should be written",required=true)
protected VCFWriter baseWriter = null;
@ -55,10 +59,10 @@ public class LeftAlignVariants extends RodWalker<Integer, Integer> {
private SortingVCFWriter writer;
public void initialize() {
Set<String> samples = SampleUtils.getSampleListWithVCFHeader(getToolkit(), Arrays.asList("variant"));
Map<String, VCFHeader> vcfHeaders = VCFUtils.getVCFHeadersFromRods(getToolkit(), Arrays.asList("variant"));
Set<String> samples = SampleUtils.getSampleListWithVCFHeader(getToolkit(), Arrays.asList(variants.getVariableName()));
Map<String, VCFHeader> vcfHeaders = VCFUtils.getVCFHeadersFromRods(getToolkit(), Arrays.asList(variants.getVariableName()));
Set<VCFHeaderLine> headerLines = vcfHeaders.get("variant").getMetaData();
Set<VCFHeaderLine> headerLines = vcfHeaders.get(variants.getVariableName()).getMetaData();
baseWriter.writeHeader(new VCFHeader(headerLines, samples));
writer = new SortingVCFWriter(baseWriter, 200);
@ -68,7 +72,7 @@ public class LeftAlignVariants extends RodWalker<Integer, Integer> {
if ( tracker == null )
return 0;
Collection<VariantContext> VCs = tracker.getValues(VariantContext.class, "variant", context.getLocation());
Collection<VariantContext> VCs = tracker.getValues(variants, context.getLocation());
int changedSites = 0;
for ( VariantContext vc : VCs )

View File

@ -30,7 +30,9 @@ import net.sf.picard.util.Interval;
import net.sf.samtools.SAMFileHeader;
import net.sf.samtools.SAMFileReader;
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.refdata.RefMetaDataTracker;
@ -49,8 +51,10 @@ import java.util.*;
/**
* Lifts a VCF file over from one build to another. Note that the resulting VCF could be mis-sorted.
*/
@Requires(value={},referenceMetaData=@RMD(name="variant", type=VariantContext.class))
@Requires(value={})
public class LiftoverVariants extends RodWalker<Integer, Integer> {
@Input(fullName="variant", shortName = "V", doc="Input VCF file", required=true)
public RodBinding<VariantContext> variants;
@Output(doc="File to which variants should be written",required=true)
protected File file = null;
@ -85,12 +89,12 @@ public class LiftoverVariants extends RodWalker<Integer, Integer> {
throw new UserException.BadInput("the chain file you are using is not compatible with the reference you are trying to lift over to; please use the appropriate chain file for the given reference");
}
Set<String> samples = SampleUtils.getSampleListWithVCFHeader(getToolkit(), Arrays.asList("variant"));
Map<String, VCFHeader> vcfHeaders = VCFUtils.getVCFHeadersFromRods(getToolkit(), Arrays.asList("variant"));
Set<String> samples = SampleUtils.getSampleListWithVCFHeader(getToolkit(), Arrays.asList(variants.getVariableName()));
Map<String, VCFHeader> vcfHeaders = VCFUtils.getVCFHeadersFromRods(getToolkit(), Arrays.asList(variants.getVariableName()));
Set<VCFHeaderLine> metaData = new HashSet<VCFHeaderLine>();
if ( vcfHeaders.containsKey("variant") )
metaData.addAll(vcfHeaders.get("variant").getMetaData());
if ( vcfHeaders.containsKey(variants.getVariableName()) )
metaData.addAll(vcfHeaders.get(variants.getVariableName()).getMetaData());
if ( RECORD_ORIGINAL_LOCATION ) {
metaData.add(new VCFInfoHeaderLine("OriginalChr", 1, VCFHeaderLineType.String, "Original contig name for the record"));
metaData.add(new VCFInfoHeaderLine("OriginalStart", 1, VCFHeaderLineType.Integer, "Original start position for the record"));
@ -143,7 +147,7 @@ public class LiftoverVariants extends RodWalker<Integer, Integer> {
if ( tracker == null )
return 0;
Collection<VariantContext> VCs = tracker.getValues(VariantContext.class, "variant", context.getLocation());
Collection<VariantContext> VCs = tracker.getValues(variants, context.getLocation());
for ( VariantContext vc : VCs )
convertAndWrite(vc, ref);

View File

@ -25,7 +25,9 @@
package org.broadinstitute.sting.gatk.walkers.variantutils;
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.GenomeAnalysisEngine;
import org.broadinstitute.sting.gatk.contexts.AlignmentContext;
import org.broadinstitute.sting.gatk.contexts.ReferenceContext;
@ -39,16 +41,15 @@ import org.broadinstitute.sting.utils.exceptions.UserException;
import org.broadinstitute.sting.utils.variantcontext.VariantContext;
import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import java.util.*;
/**
* Takes a VCF file, randomly splits variants into two different sets, and outputs 2 new VCFs with the results.
*/
@Requires(value={},referenceMetaData=@RMD(name="variant", type=VariantContext.class))
@Requires(value={})
public class RandomlySplitVariants extends RodWalker<Integer, Integer> {
@Input(fullName="variant", shortName = "V", doc="Input VCF file", required=true)
public RodBinding<VariantContext> variants;
@Output(fullName="out1", shortName="o1", doc="File #1 to which variants should be written", required=true)
protected VCFWriter vcfWriter1 = null;
@ -61,8 +62,6 @@ public class RandomlySplitVariants extends RodWalker<Integer, Integer> {
@Argument(fullName="fractionToOut1", shortName="fraction", doc="Fraction of records to be placed in out1 (must be 0 >= fraction <= 1); all other records are placed in out2", required=false)
protected double fraction = 0.5;
protected static final String INPUT_VARIANT_ROD_BINDING_NAME = "variant";
protected int iFraction;
/**
@ -74,8 +73,7 @@ public class RandomlySplitVariants extends RodWalker<Integer, Integer> {
iFraction = (int)(fraction * 1000.0);
// setup the header info
final ArrayList<String> inputNames = new ArrayList<String>();
inputNames.add( INPUT_VARIANT_ROD_BINDING_NAME );
final List<String> inputNames = Arrays.asList(variants.getVariableName());
Set<String> samples = SampleUtils.getUniqueSamplesFromRods(getToolkit(), inputNames);
Set<VCFHeaderLine> hInfo = new HashSet<VCFHeaderLine>();
hInfo.addAll(VCFUtils.getHeaderFields(getToolkit(), inputNames));
@ -97,7 +95,7 @@ public class RandomlySplitVariants extends RodWalker<Integer, Integer> {
if ( tracker == null )
return 0;
Collection<VariantContext> vcs = tracker.getValues(VariantContext.class, INPUT_VARIANT_ROD_BINDING_NAME, context.getLocation());
Collection<VariantContext> vcs = tracker.getValues(variants, context.getLocation());
for ( VariantContext vc : vcs ) {
int random = GenomeAnalysisEngine.getRandomGenerator().nextInt(1000);
if ( random < iFraction )

View File

@ -24,7 +24,7 @@
package org.broadinstitute.sting.gatk.walkers.variantutils;
import org.broadinstitute.sting.commandline.Hidden;
import org.broadinstitute.sting.commandline.*;
import org.broadinstitute.sting.utils.MathUtils;
import org.broadinstitute.sting.utils.codecs.vcf.*;
import org.broadinstitute.sting.utils.exceptions.UserException;
@ -32,8 +32,6 @@ import org.broadinstitute.sting.utils.text.XReadLines;
import org.broadinstitute.sting.gatk.GenomeAnalysisEngine;
import org.broadinstitute.sting.utils.MendelianViolation;
import org.broadinstitute.sting.utils.variantcontext.VariantContext;
import org.broadinstitute.sting.commandline.Argument;
import org.broadinstitute.sting.commandline.Output;
import org.broadinstitute.sting.gatk.contexts.AlignmentContext;
import org.broadinstitute.sting.gatk.contexts.ReferenceContext;
import org.broadinstitute.sting.gatk.refdata.RefMetaDataTracker;
@ -54,8 +52,10 @@ import java.util.*;
* Takes a VCF file, selects variants based on sample(s) in which it was found and/or on various annotation criteria,
* recompute the value of certain annotations based on the new sample set, and output a new VCF with the results.
*/
@Requires(value={},referenceMetaData=@RMD(name="variant", type=VariantContext.class))
@Requires(value={})
public class SelectVariants extends RodWalker<Integer, Integer> {
@Input(fullName="variant", shortName = "V", doc="Input VCF file", required=true)
public RodBinding<VariantContext> variants;
@Output(doc="File to which variants should be written",required=true)
protected VCFWriter vcfWriter = null;
@ -156,9 +156,6 @@ public class SelectVariants extends RodWalker<Integer, Integer> {
private Set<MendelianViolation> mvSet = new HashSet<MendelianViolation>();
/* default name for the variant dataset (VCF) */
private final String variantRodName = "variant";
/* variables used by the SELECT RANDOM modules */
private boolean SELECT_RANDOM_NUMBER = false;
@ -183,8 +180,7 @@ public class SelectVariants extends RodWalker<Integer, Integer> {
*/
public void initialize() {
// Get list of samples to include in the output
ArrayList<String> rodNames = new ArrayList<String>();
rodNames.add(variantRodName);
List<String> rodNames = Arrays.asList(variants.getVariableName());
Map<String, VCFHeader> vcfRods = VCFUtils.getVCFHeadersFromRods(getToolkit(), rodNames);
TreeSet<String> vcfSamples = new TreeSet<String>(SampleUtils.getSampleList(vcfRods, VariantContextUtils.GenotypeMergeType.REQUIRE_UNIQUE));
@ -308,7 +304,7 @@ public class SelectVariants extends RodWalker<Integer, Integer> {
if ( tracker == null )
return 0;
Collection<VariantContext> vcs = tracker.getValues(VariantContext.class, variantRodName, context.getLocation());
Collection<VariantContext> vcs = tracker.getValues(variants, context.getLocation());
if ( vcs == null || vcs.size() == 0) {
return 0;

View File

@ -29,6 +29,8 @@ import org.broad.tribble.TribbleException;
import org.broad.tribble.dbsnp.DbSNPFeature;
import org.broadinstitute.sting.commandline.Argument;
import org.broadinstitute.sting.commandline.Hidden;
import org.broadinstitute.sting.commandline.Input;
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;
@ -50,10 +52,10 @@ import java.util.Set;
* Validates a variants file.
*/
@Reference(window=@Window(start=0,stop=100))
@Requires(value={},referenceMetaData=@RMD(name=ValidateVariants.TARGET_ROD_NAME, type=VariantContext.class))
@Requires(value={})
public class ValidateVariants extends RodWalker<Integer, Integer> {
protected static final String TARGET_ROD_NAME = "variant";
@Input(fullName="variant", shortName = "V", doc="Input VCF file", required=true)
public RodBinding<VariantContext> variants;
public enum ValidationType {
ALL, REF, IDS, ALLELES, CHR_COUNTS
@ -74,19 +76,14 @@ public class ValidateVariants extends RodWalker<Integer, Integer> {
private File file = null;
public void initialize() {
for ( ReferenceOrderedDataSource source : getToolkit().getRodDataSources() ) {
if ( source.getName().equals(TARGET_ROD_NAME) ) {
file = source.getFile();
break;
}
}
file = new File(variants.getSource());
}
public Integer map(RefMetaDataTracker tracker, ReferenceContext ref, AlignmentContext context) {
if ( tracker == null )
return 0;
Collection<VariantContext> VCs = tracker.getValues(VariantContext.class, "variant", context.getLocation());
Collection<VariantContext> VCs = tracker.getValues(variants, context.getLocation());
for ( VariantContext vc : VCs )
validate(vc, tracker, ref);

View File

@ -26,7 +26,9 @@
package org.broadinstitute.sting.gatk.walkers.variantutils;
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.refdata.RefMetaDataTracker;
@ -45,10 +47,10 @@ import java.util.*;
* Converts Sequenom files to a VCF annotated with QC metrics (HW-equilibrium, % failed probes)
*/
@Reference(window=@Window(start=0,stop=40))
@Requires(value={},referenceMetaData=@RMD(name=VariantValidationAssessor.INPUT_VARIANT_ROD_BINDING_NAME, type=VariantContext.class))
@Requires(value={})
public class VariantValidationAssessor extends RodWalker<Pair<VariantContext, Byte>,Integer> {
public static final String INPUT_VARIANT_ROD_BINDING_NAME = "variant";
@Input(fullName="variant", shortName = "V", doc="Input VCF file", required=true)
public RodBinding<VariantContext> variants;
@Output(doc="File to which variants should be written",required=true)
protected VCFWriter vcfwriter = null;
@ -93,7 +95,7 @@ public class VariantValidationAssessor extends RodWalker<Pair<VariantContext, By
if ( tracker == null )
return null;
VariantContext vc = tracker.getFirstValue(VariantContext.class, INPUT_VARIANT_ROD_BINDING_NAME, ref.getLocus());
VariantContext vc = tracker.getFirstValue(variants, ref.getLocus());
// ignore places where we don't have a variant
if ( vc == null )
return null;
@ -113,8 +115,7 @@ public class VariantValidationAssessor extends RodWalker<Pair<VariantContext, By
}
public void onTraversalDone(Integer finalReduce) {
final ArrayList<String> inputNames = new ArrayList<String>();
inputNames.add( INPUT_VARIANT_ROD_BINDING_NAME );
final List<String> inputNames = Arrays.asList(variants.getVariableName());
// setup the header fields
Set<VCFHeaderLine> hInfo = new HashSet<VCFHeaderLine>();

View File

@ -24,6 +24,8 @@
package org.broadinstitute.sting.gatk.walkers.variantutils;
import org.broadinstitute.sting.commandline.Input;
import org.broadinstitute.sting.commandline.RodBinding;
import org.broadinstitute.sting.utils.MathUtils;
import org.broadinstitute.sting.utils.variantcontext.VariantContext;
import org.broadinstitute.sting.commandline.Argument;
@ -45,6 +47,9 @@ import java.util.*;
*/
@Requires(value={})
public class VariantsToTable extends RodWalker<Integer, Integer> {
@Input(fullName="variant", shortName = "V", doc="Input VCF file", required=true)
public RodBinding<VariantContext> variants;
@Output(doc="File to which results should be written",required=true)
protected PrintStream out;
@ -132,8 +137,7 @@ public class VariantsToTable extends RodWalker<Integer, Integer> {
return 0;
if ( ++nRecords < MAX_RECORDS || MAX_RECORDS == -1 ) {
Collection<VariantContext> vcs = tracker.getValues(VariantContext.class, context.getLocation());
for ( VariantContext vc : vcs) {
for ( VariantContext vc : tracker.getValues(variants, context.getLocation())) {
if ( (keepMultiAllelic || vc.isBiallelic()) && ( showFiltered || vc.isNotFiltered() ) ) {
List<String> vals = extractFields(vc, fieldsToTake, ALLOW_MISSING_DATA);
out.println(Utils.join("\t", vals));

View File

@ -29,7 +29,9 @@ import net.sf.samtools.util.CloseableIterator;
import org.broad.tribble.dbsnp.DbSNPCodec;
import org.broad.tribble.dbsnp.DbSNPFeature;
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;
@ -54,7 +56,7 @@ import java.util.*;
/**
* Converts variants from other file formats to VCF format.
*/
@Requires(value={},referenceMetaData=@RMD(name=VariantsToVCF.INPUT_ROD_NAME, type=VariantContext.class))
@Requires(value={})
@Reference(window=@Window(start=-40,stop=40))
public class VariantsToVCF extends RodWalker<Integer, Integer> {
@ -62,7 +64,8 @@ public class VariantsToVCF extends RodWalker<Integer, Integer> {
protected VCFWriter baseWriter = null;
private SortingVCFWriter vcfwriter; // needed because hapmap indel records move
public static final String INPUT_ROD_NAME = "variant";
@Input(fullName="variant", shortName = "V", doc="Input VCF file", required=true)
public RodBinding<VariantContext> variants;
@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;
@ -98,8 +101,8 @@ public class VariantsToVCF extends RodWalker<Integer, Integer> {
}
// set the appropriate sample name if necessary
if ( sampleName != null && vc.hasGenotypes() && vc.hasGenotype(INPUT_ROD_NAME) ) {
Genotype g = Genotype.modifyName(vc.getGenotype(INPUT_ROD_NAME), sampleName);
if ( sampleName != null && vc.hasGenotypes() && vc.hasGenotype(variants.getVariableName()) ) {
Genotype g = Genotype.modifyName(vc.getGenotype(variants.getVariableName()), sampleName);
Map<String, Genotype> genotypes = new HashMap<String, Genotype>();
genotypes.put(sampleName, g);
vc = VariantContext.modifyGenotypes(vc, genotypes);
@ -114,7 +117,7 @@ public class VariantsToVCF extends RodWalker<Integer, Integer> {
private Collection<VariantContext> getVariantContexts(RefMetaDataTracker tracker, ReferenceContext ref) {
// we need to special case the HapMap format because indels aren't handled correctly
List<Object> features = tracker.getValues(INPUT_ROD_NAME);
List<Object> features = tracker.getValues(variants.getVariableName());
if ( features.size() > 0 && features.get(0) instanceof HapMapFeature ) {
ArrayList<VariantContext> hapmapVCs = new ArrayList<VariantContext>(features.size());
for ( Object feature : features ) {
@ -148,7 +151,7 @@ public class VariantsToVCF extends RodWalker<Integer, Integer> {
}
refBase = ref.getBases()[hapmap.getStart() - ref.getWindow().getStart()];
}
VariantContext vc = VariantContextAdaptors.toVariantContext(INPUT_ROD_NAME, hapmap, ref);
VariantContext vc = VariantContextAdaptors.toVariantContext(variants.getVariableName(), hapmap, ref);
if ( vc != null ) {
if ( refBase != null ) {
Map<String, Object> attrs = new HashMap<String, Object>(vc.getAttributes());
@ -162,7 +165,7 @@ public class VariantsToVCF extends RodWalker<Integer, Integer> {
}
// for everything else, we can just convert to VariantContext
return tracker.getValues(VariantContext.class, INPUT_ROD_NAME, ref.getLocus());
return tracker.getValues(variants, ref.getLocus());
}
private DbSNPFeature getDbsnpFeature(String rsID) {
@ -216,10 +219,10 @@ public class VariantsToVCF extends RodWalker<Integer, Integer> {
samples.add(sampleName);
} else {
// try VCF first
samples = SampleUtils.getSampleListWithVCFHeader(getToolkit(), Arrays.asList(INPUT_ROD_NAME));
samples = SampleUtils.getSampleListWithVCFHeader(getToolkit(), Arrays.asList(variants.getVariableName()));
if ( samples.isEmpty() ) {
List<Object> rods = tracker.getValues(INPUT_ROD_NAME);
List<Object> rods = tracker.getValues(variants.getVariableName());
if ( rods.size() == 0 )
throw new IllegalStateException("No rod data is present");

View File

@ -93,7 +93,8 @@ public class ListFileUtils {
* @param RODBindings a text equivale
* @return a list of expanded, bound RODs.
*/
public static Collection<RMDTriplet> unpackRODBindings(final Collection<String> RODBindings, final String dbSNPFile, final ParsingEngine parser) {
@Deprecated
public static Collection<RMDTriplet> unpackRODBindingsOldStyle(final Collection<String> RODBindings, final ParsingEngine parser) {
// todo -- this is a strange home for this code. Move into ROD system
Collection<RMDTriplet> rodBindings = new ArrayList<RMDTriplet>();
@ -122,17 +123,6 @@ public class ListFileUtils {
rodBindings.add(new RMDTriplet(name,type,fileName,storageType,tags));
}
if (dbSNPFile != null) {
if(dbSNPFile.toLowerCase().contains("vcf"))
throw new UserException("--DBSNP (-D) argument currently does not support VCF. To use dbSNP in VCF format, please use -B:dbsnp,vcf <filename>.");
final Tags tags = parser.getTags(dbSNPFile);
String fileName = expandFileName(dbSNPFile);
RMDTriplet.RMDStorageType storageType = fileName.toLowerCase().endsWith("stdin") ? RMDTriplet.RMDStorageType.STREAM : RMDTriplet.RMDStorageType.FILE;
rodBindings.add(new RMDTriplet(DbSNPHelper.STANDARD_DBSNP_TRACK_NAME,"dbsnp",fileName,storageType,tags));
}
return rodBindings;
}

View File

@ -64,9 +64,7 @@ public abstract class BaseTest {
public static final String b37Refseq = refseqAnnotationLocation + "refGene-big-table-b37.txt";
public static final String dbsnpDataLocation = GATKDataLocation;
public static final String hg18dbSNP129 = dbsnpDataLocation + "dbsnp_129_hg18.rod";
public static final String b36dbSNP129 = dbsnpDataLocation + "dbsnp_129_b36.rod";
public static final String b37dbSNP129 = dbsnpDataLocation + "dbsnp_129_b37.rod";
public static final String b37dbSNP129 = dbsnpDataLocation + "dbsnp_132.b36.excluding_sites_after_129.vcf";
public static final String b37dbSNP132 = dbsnpDataLocation + "dbsnp_132_b37.vcf";
public static final String hapmapDataLocation = comparisonDataLocation + "Validated/HapMap/3.3/";

View File

@ -81,7 +81,6 @@ public class GATKArgumentCollectionUnitTest extends BaseTest {
collect.samFiles = input;
collect.strictnessLevel = SAMFileReader.ValidationStringency.STRICT;
collect.referenceFile = new File("referenceFile".toLowerCase());
collect.DBSNPFile = "DBSNPFile".toLowerCase();
collect.unsafe = ValidationExclusion.TYPE.ALL;
collect.downsampleFraction = null;
collect.downsampleCoverage = null;

View File

@ -94,7 +94,7 @@ public class VariantAnnotatorIntegrationTest extends WalkerTest {
@Test
public void testDBTagWithDbsnp() {
WalkerTestSpec spec = new WalkerTestSpec(
baseTestString() + " -D " + GATKDataLocation + "dbsnp_129_b36.rod -G \"Standard\" -B:variant,VCF3 " + validationDataLocation + "vcfexample3empty.vcf -BTI variant", 1,
baseTestString() + " -B:dbsnp,vcf " + GATKDataLocation + "dbsnp_132.b36.excluding_sites_after_129.vcf -G \"Standard\" -B:variant,VCF3 " + validationDataLocation + "vcfexample3empty.vcf -BTI variant", 1,
Arrays.asList("3da8ca2b6bdaf6e92d94a8c77a71313d"));
executeTest("getting DB tag with dbSNP", spec);
}

View File

@ -29,10 +29,11 @@ public class FastaAlternateReferenceIntegrationTest extends WalkerTest {
Arrays.asList("3a48986c3832a768b478c3e95f994b0f"));
executeTest("testFastaAlternateReferenceIndels", spec2);
WalkerTestSpec spec3 = new WalkerTestSpec(
"-T FastaAlternateReferenceMaker -R " + b36KGReference + " -B:snps,GeliText " + validationDataLocation + "NA12878.chr1_10mb_11mb.slx.geli.calls -B:snpmask,dbsnp " + GATKDataLocation + "dbsnp_129_b36.rod -L 1:10,023,400-10,023,500;1:10,029,200-10,029,500 -o %s",
1,
Arrays.asList("82705a88f6fc25880dd2331183531d9a"));
executeTest("testFastaAlternateReferenceSnps", spec3);
// TODO : Eric, update with new DBSNP
// WalkerTestSpec spec3 = new WalkerTestSpec(
// "-T FastaAlternateReferenceMaker -R " + b36KGReference + " -B:snps,GeliText " + validationDataLocation + "NA12878.chr1_10mb_11mb.slx.geli.calls -B:snpmask,dbsnp " + GATKDataLocation + "dbsnp_129_b36.rod -L 1:10,023,400-10,023,500;1:10,029,200-10,029,500 -o %s",
// 1,
// Arrays.asList("82705a88f6fc25880dd2331183531d9a"));
// executeTest("testFastaAlternateReferenceSnps", spec3);
}
}

View File

@ -15,7 +15,7 @@ public class UnifiedGenotyperPerformanceTest extends WalkerTest {
" -glm BOTH" +
" -I " + evaluationDataLocation + "NA12878.GAII.chr1.50MB.bam" +
" -L chr1:1-50,000,000" +
" -D " + GATKDataLocation + "dbsnp_129_hg18.rod" +
" -B:dbsnp,VCF " + GATKDataLocation + "dbsnp_132.b36.excluding_sites_after_129.vcf" +
" -o /dev/null",
0,
new ArrayList<String>(0));
@ -30,7 +30,7 @@ public class UnifiedGenotyperPerformanceTest extends WalkerTest {
" -glm BOTH" +
" -I " + evaluationDataLocation + "NA12878.ESP.WEx.chr1.bam" +
" -L " + evaluationDataLocation + "whole_exome_agilent_designed_120.targets.chr1.interval_list" +
" -D " + GATKDataLocation + "dbsnp_129_hg18.rod" +
" -B:dbsnp,vcf " + GATKDataLocation + "dbsnp_132.b36.excluding_sites_after_129.vcf" +
" -o /dev/null",
0,
new ArrayList<String>(0));
@ -46,7 +46,7 @@ public class UnifiedGenotyperPerformanceTest extends WalkerTest {
" -glm BOTH" +
" -L chr1:1-50,000,000" +
" -nt 10" +
" -D " + GATKDataLocation + "dbsnp_129_hg18.rod" +
" -B:dbsnp,vcf " + GATKDataLocation + "dbsnp_132.b36.excluding_sites_after_129.vcf" +
" -o /dev/null",
0,
new ArrayList<String>(0));

View File

@ -34,7 +34,7 @@ public class IndelRealignerIntegrationTest extends WalkerTest {
executeTest("test realigner defaults with VCF", spec2);
WalkerTestSpec spec3 = new WalkerTestSpec(
baseCommand + "-D " + GATKDataLocation + "dbsnp_129_b36.rod",
baseCommand + "-B:dbsnp,vcf " + GATKDataLocation + "dbsnp_132.b36.excluding_sites_after_129.vcf",
1,
Arrays.asList(base_md5));
executeTest("realigner defaults with dbsnp", spec3);
@ -50,7 +50,7 @@ public class IndelRealignerIntegrationTest extends WalkerTest {
executeTest("realigner known indels only from VCF", spec1);
WalkerTestSpec spec2 = new WalkerTestSpec(
baseCommand + "--consensusDeterminationModel KNOWNS_ONLY -D " + GATKDataLocation + "dbsnp_129_b36.rod",
baseCommand + "--consensusDeterminationModel KNOWNS_ONLY -B:dbsnp,vcf " + GATKDataLocation + "dbsnp_132.b36.excluding_sites_after_129.vcf",
1,
Arrays.asList("05a114623c126b0398fbc1703437461e"));
executeTest("realigner known indels only from dbsnp", spec2);
@ -65,7 +65,7 @@ public class IndelRealignerIntegrationTest extends WalkerTest {
executeTest("realigner use SW from VCF", spec1);
WalkerTestSpec spec2 = new WalkerTestSpec(
baseCommand + "--consensusDeterminationModel USE_SW -D " + GATKDataLocation + "dbsnp_129_b36.rod",
baseCommand + "--consensusDeterminationModel USE_SW -B:dbsnp,vcf " + GATKDataLocation + "dbsnp_132.b36.excluding_sites_after_129.vcf",
1,
Arrays.asList(base_md5_with_SW_or_VCF));
executeTest("realigner use SW from dbsnp", spec2);

View File

@ -30,7 +30,7 @@ public class IndelRealignerPerformanceTest extends WalkerTest {
" -LOD 5" +
" -maxConsensuses 100" +
" -greedy 100" +
" -D /humgen/gsa-hpprojects/GATK/data/dbsnp_129_hg18.rod" +
" -B:dbsnp,VCF " + GATKDataLocation + "dbsnp_132.b36.excluding_sites_after_129.vcf" +
" -o /dev/null" +
" -I " + evaluationDataLocation + "NA12878.GAII.chr1.50MB.bam" +
" -L chr1:1-5,650,000" +

View File

@ -52,7 +52,7 @@ public class RecalibrationWalkersIntegrationTest extends WalkerTest {
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
"-R " + b36KGReference +
" --DBSNP " + GATKDataLocation + "dbsnp_132_b37.vcf" +
" -B:dbsnp,vcf " + GATKDataLocation + "dbsnp_132.b36.excluding_sites_after_129.vcf" +
" -T CountCovariates" +
" -I " + bam +
( bam.equals( validationDataLocation + "NA12878.1kg.p2.chr1_10mb_11_mb.allTechs.bam" )
@ -129,7 +129,7 @@ public class RecalibrationWalkersIntegrationTest extends WalkerTest {
" -standard" +
" -OQ" +
" -recalFile %s" +
" --DBSNP " + GATKDataLocation + "dbsnp_132_b37.vcf",
" -B:dbsnp,vcf " + GATKDataLocation + "dbsnp_132.b36.excluding_sites_after_129.vcf",
1, // just one output file
Arrays.asList(md5));
executeTest("testCountCovariatesUseOriginalQuals", spec);
@ -176,7 +176,7 @@ public class RecalibrationWalkersIntegrationTest extends WalkerTest {
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
"-R " + b36KGReference +
" --DBSNP " + GATKDataLocation + "dbsnp_132_b37.vcf" +
" -B:dbsnp,vcf " + GATKDataLocation + "dbsnp_132.b36.excluding_sites_after_129.vcf" +
" -T CountCovariates" +
" -I " + bam +
" -standard" +
@ -281,7 +281,7 @@ public class RecalibrationWalkersIntegrationTest extends WalkerTest {
" -B:anyNameABCD,VCF3 " + validationDataLocation + "vcfexample3.vcf" +
" -T CountCovariates" +
" -I " + bam +
" --DBSNP " + GATKDataLocation + "dbsnp_132_b37.vcf" +
" -B:dbsnp,vcf " + GATKDataLocation + "dbsnp_132.b36.excluding_sites_after_129.vcf" +
" -L 1:10,000,000-10,200,000" +
" -cov ReadGroupCovariate" +
" -cov QualityScoreCovariate" +
@ -306,7 +306,7 @@ public class RecalibrationWalkersIntegrationTest extends WalkerTest {
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
"-R " + b36KGReference +
" --DBSNP " + GATKDataLocation + "dbsnp_132_b37.vcf" +
" -B:dbsnp,vcf " + GATKDataLocation + "dbsnp_132.b36.excluding_sites_after_129.vcf" +
" -T CountCovariates" +
" -I " + bam +
" -cov ReadGroupCovariate" +

View File

@ -16,7 +16,7 @@ public class RecalibrationWalkersPerformanceTest extends WalkerTest {
" -L chr1:1-50,000,000" +
" -standard" +
" -OQ" +
" --DBSNP " + GATKDataLocation + "dbsnp_129_hg18.rod" +
" -B:dbsnp,vcf " + GATKDataLocation + "dbsnp_132.b36.excluding_sites_after_129.vcf" +
" -recalFile /dev/null" + moreArgs,
0,
new ArrayList<String>(0));
@ -31,7 +31,7 @@ public class RecalibrationWalkersPerformanceTest extends WalkerTest {
" -L " + evaluationDataLocation + "whole_exome_agilent_designed_120.targets.chr1.interval_list" +
" -standard" +
" -OQ" +
" --DBSNP " + GATKDataLocation + "dbsnp_129_hg18.rod" +
" -B:dbsnp,vcf " + GATKDataLocation + "dbsnp_132.b36.excluding_sites_after_129.vcf" +
" -recalFile /dev/null" + moreArgs,
0,
new ArrayList<String>(0));

View File

@ -36,7 +36,7 @@ public class VariantEvalIntegrationTest extends WalkerTest {
buildCommandLine(
"-T VariantEval",
"-R " + b37KGReference,
"-D " + b37dbSNP129,
"-B:dbsnp,VCF " + GATKDataLocation + "dbsnp_132_b37.vcf",
"-B:eval,VCF " + fundamentalTestVCF,
"-noEV",
"-EV CountVariants",
@ -56,7 +56,7 @@ public class VariantEvalIntegrationTest extends WalkerTest {
buildCommandLine(
"-T VariantEval",
"-R " + b37KGReference,
"-D " + b37dbSNP129,
"-B:dbsnp,VCF " + GATKDataLocation + "dbsnp_132_b37.vcf",
"-B:eval,VCF " + fundamentalTestVCF,
"-noEV",
"-EV CountVariants",
@ -77,7 +77,7 @@ public class VariantEvalIntegrationTest extends WalkerTest {
buildCommandLine(
"-T VariantEval",
"-R " + b37KGReference,
"-D " + b37dbSNP129,
"-B:dbsnp,VCF " + GATKDataLocation + "dbsnp_132_b37.vcf",
"-B:eval,VCF " + fundamentalTestVCF,
"-noEV",
"-EV CountVariants",
@ -99,7 +99,7 @@ public class VariantEvalIntegrationTest extends WalkerTest {
buildCommandLine(
"-T VariantEval",
"-R " + b37KGReference,
"-D " + b37dbSNP129,
"-B:dbsnp,VCF " + GATKDataLocation + "dbsnp_132_b37.vcf",
"-B:eval,VCF " + fundamentalTestVCF,
"-noEV",
"-EV CountVariants",
@ -120,7 +120,7 @@ public class VariantEvalIntegrationTest extends WalkerTest {
buildCommandLine(
"-T VariantEval",
"-R " + b37KGReference,
"-D " + b37dbSNP129,
"-B:dbsnp,VCF " + GATKDataLocation + "dbsnp_132_b37.vcf",
"-B:eval,VCF " + fundamentalTestVCF,
"-noEV",
"-EV CountVariants",
@ -141,7 +141,7 @@ public class VariantEvalIntegrationTest extends WalkerTest {
buildCommandLine(
"-T VariantEval",
"-R " + b37KGReference,
"-D " + b37dbSNP129,
"-B:dbsnp,VCF " + GATKDataLocation + "dbsnp_132_b37.vcf",
"-B:eval,VCF " + fundamentalTestVCF,
"-noEV",
"-EV CountVariants",
@ -162,7 +162,7 @@ public class VariantEvalIntegrationTest extends WalkerTest {
buildCommandLine(
"-T VariantEval",
"-R " + b37KGReference,
"-D " + b37dbSNP129,
"-B:dbsnp,VCF " + GATKDataLocation + "dbsnp_132_b37.vcf",
"-B:eval,VCF " + fundamentalTestVCF,
"-noEV",
"-EV CountVariants",
@ -183,7 +183,7 @@ public class VariantEvalIntegrationTest extends WalkerTest {
buildCommandLine(
"-T VariantEval",
"-R " + b37KGReference,
"-D " + b37dbSNP129,
"-B:dbsnp,VCF " + GATKDataLocation + "dbsnp_132_b37.vcf",
"-B:eval,VCF " + fundamentalTestVCF,
"-noEV",
"-EV CountVariants",
@ -206,7 +206,7 @@ public class VariantEvalIntegrationTest extends WalkerTest {
buildCommandLine(
"-T VariantEval",
"-R " + b37KGReference,
"-D " + b37dbSNP129,
"-B:dbsnp,VCF " + GATKDataLocation + "dbsnp_132_b37.vcf",
"-B:eval,VCF " + fundamentalTestVCF,
"-noEV",
"-EV CountVariants",
@ -342,7 +342,7 @@ public class VariantEvalIntegrationTest extends WalkerTest {
buildCommandLine(
"-T VariantEval",
"-R " + b37KGReference,
"-D " + b37dbSNP129,
"-B:dbsnp,VCF " + GATKDataLocation + "dbsnp_132_b37.vcf",
"-B:eval,VCF " + fundamentalTestSNPsVCF,
"-noEV",
"-EV CompOverlap",
@ -360,7 +360,7 @@ public class VariantEvalIntegrationTest extends WalkerTest {
buildCommandLine(
"-T VariantEval",
"-R " + b37KGReference,
"-D " + b37dbSNP129,
"-B:dbsnp,VCF " + GATKDataLocation + "dbsnp_132_b37.vcf",
"-B:eval,VCF " + fundamentalTestSNPsOneSampleVCF,
"-noEV",
"-EV CompOverlap",
@ -381,7 +381,7 @@ public class VariantEvalIntegrationTest extends WalkerTest {
buildCommandLine(
"-T VariantEval",
"-R " + b37KGReference,
"-D " + b37dbSNP129,
"-B:dbsnp,VCF " + GATKDataLocation + "dbsnp_132_b37.vcf",
"-B:eval,VCF " + fundamentalTestSNPsVCF,
"-noEV",
"-EV CountVariants",

View File

@ -15,7 +15,7 @@ public class VariantContextIntegrationTest extends WalkerTest {
" -R " + b36KGReference;
private static String root = cmdRoot +
" -D " + GATKDataLocation + "dbsnp_129_b36.rod" +
" -L 1:1-1,000,000 -B:dbsnp,vcf " + GATKDataLocation + "dbsnp_132.b36.excluding_sites_after_129.vcf" +
" -B:vcf,VCF3 " + validationDataLocation + "yri.trio.gatk_glftrio.intersection.annotated.filtered.chr1.vcf";
private static final class VCITTest extends TestDataProvider {
@ -30,17 +30,15 @@ public class VariantContextIntegrationTest extends WalkerTest {
@DataProvider(name = "VCITTestData")
public Object[][] createVCITTestData() {
new VCITTest("-L 1:1-10000 --printPerLocus", "e4ee2eaa3114888e918a1c82df7a027a");
new VCITTest("-L 1:1-10000 --printPerLocus --onlyContextsOfType SNP", "2097e32988d603d3b353b50218c86d3b");
new VCITTest("-L 1:1-10000 --printPerLocus --onlyContextsOfType INDEL", "033bd952fca048fe1a4f6422b57ab2ed");
new VCITTest("-L 1:1-10000 --printPerLocus --onlyContextsOfType MIXED", "e5a00766f8c1ff9cf92310bafdec3126");
new VCITTest("-L 1:1-10000 --printPerLocus --onlyContextsOfType NO_VARIATION", "39335acdb34c8a2af433dc50d619bcbc");
// TODO : Eric, these are bad because the conversion fails
//new VCITTest("-L 1:1-10000 --printPerLocus --takeFirstOnly", "5b5635e4877d82e8a27d70dac24bda2f");
//new VCITTest("-L 1:1-10000 --printPerLocus --onlyContextsOfType INDEL --onlyContextsStartinAtCurrentPosition", "5e40980c02797f90821317874426a87a");
//new VCITTest("-L 1:1-10000 --printPerLocus --onlyContextsStartinAtCurrentPosition", "ceced3f270b4fe407ee83bc9028becde");
//new VCITTest("-L 1:1-10000 --printPerLocus --takeFirstOnly --onlyContextsStartinAtCurrentPosition", "9a9b9e283553c28bf58de1cafa38fe92");
new VCITTest("--printPerLocus", "f36b81b8bcd210c0e3a1058d791b78ec");
new VCITTest("--printPerLocus --onlyContextsOfType SNP", "a77492ba003a1fca8d8e0227fa642f34");
new VCITTest("--printPerLocus --onlyContextsOfType INDEL", "9e0375a1b680d7df0971dbf256944d7a");
new VCITTest("--printPerLocus --onlyContextsOfType MIXED", "93628cbba30033398e7e680b92cb3680");
new VCITTest("--printPerLocus --onlyContextsOfType NO_VARIATION", "39335acdb34c8a2af433dc50d619bcbc");
new VCITTest("--printPerLocus --takeFirstOnly", "c4a3d7545d26880635e0e5e4e69952e2");
new VCITTest("--printPerLocus --onlyContextsOfType INDEL --onlyContextsStartinAtCurrentPosition", "22a7bb9e63d5f2950322c26397670e5c");
new VCITTest("--printPerLocus --onlyContextsStartinAtCurrentPosition", "6387c1a400d1872ae4394d01e533c296");
new VCITTest("--printPerLocus --takeFirstOnly --onlyContextsStartinAtCurrentPosition", "dde3a3db4d9c57f5042e0dfe03380987");
return VCITTest.getTests(VCITTest.class);
}
@ -53,7 +51,7 @@ public class VariantContextIntegrationTest extends WalkerTest {
WalkerTestSpec spec = new WalkerTestSpec( root + " " + extraArgs + " -o %s",
1, // just one output file
Arrays.asList(md5));
executeTest("testDbSNPAndVCFConversions", spec);
executeTest("testSelectors", spec);
}
@Test
@ -65,13 +63,4 @@ public class VariantContextIntegrationTest extends WalkerTest {
Arrays.asList("e3c35d0c4b5d4935c84a270f9df0951f", "ff91731213fd0bbdc200ab6fd1c93e63"));
executeTest("testToVCF", spec);
}
@Test
public void testLargeScaleConversion() {
// this really just tests that we are seeing the same number of objects over all of chr1
WalkerTestSpec spec = new WalkerTestSpec( root + " -L 1" + " -o %s",
1, // just one output file
Arrays.asList("529f936aa6c303658b23caf4e527782f"));
executeTest("testLargeScaleConversion", spec);
}
}