Bug fix for type checking RodBindings
Now compares the feature class not the codec class. UnitTests improvements integrationtests on their way to actually running
This commit is contained in:
parent
b5e843f8f0
commit
2874835997
|
|
@ -142,6 +142,10 @@ public class RMDTrackBuilder extends PluginManager<FeatureCodec> {
|
|||
return getAvailableTrackNamesAndTypes().get(fileDescriptor.getType().toUpperCase());
|
||||
}
|
||||
|
||||
public Class getFeatureClass(RMDTriplet fileDescriptor) {
|
||||
return getAvailableTrackNamesAndRecordTypes().get(fileDescriptor.getType().toUpperCase());
|
||||
}
|
||||
|
||||
/**
|
||||
* create a RMDTrack of the specified type
|
||||
*
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ 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)
|
||||
@Argument(fullName="metadata",shortName="metadata",doc="Add these ROD bindings to the output Pileup", required=false)
|
||||
public List<RodBinding<Feature>> rods;
|
||||
|
||||
public void initialize() {
|
||||
|
|
|
|||
|
|
@ -25,9 +25,7 @@
|
|||
|
||||
package org.broadinstitute.sting.gatk.walkers.annotator;
|
||||
|
||||
import org.broadinstitute.sting.commandline.Argument;
|
||||
import org.broadinstitute.sting.commandline.Hidden;
|
||||
import org.broadinstitute.sting.commandline.Output;
|
||||
import org.broadinstitute.sting.commandline.*;
|
||||
import org.broadinstitute.sting.gatk.contexts.AlignmentContext;
|
||||
import org.broadinstitute.sting.gatk.contexts.AlignmentContextUtils;
|
||||
import org.broadinstitute.sting.gatk.contexts.ReferenceContext;
|
||||
|
|
@ -49,11 +47,13 @@ import java.util.*;
|
|||
/**
|
||||
* Annotates variant calls with context information. Users can specify which of the available annotations to use.
|
||||
*/
|
||||
@Requires(value={},referenceMetaData=@RMD(name="variant",type=VariantContext.class))
|
||||
@Requires(value={})
|
||||
@Allows(value={DataSource.READS, DataSource.REFERENCE})
|
||||
@Reference(window=@Window(start=-50,stop=50))
|
||||
@By(DataSource.REFERENCE)
|
||||
public class VariantAnnotator extends RodWalker<Integer, Integer> {
|
||||
@Input(fullName="variants", 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;
|
||||
|
|
@ -118,8 +118,7 @@ public class VariantAnnotator extends RodWalker<Integer, Integer> {
|
|||
listAnnotationsAndExit();
|
||||
|
||||
// get the list of all sample names from the variant VCF input rod, if applicable
|
||||
Set<String> rodName = new HashSet<String>();
|
||||
rodName.add("variant");
|
||||
List<String> rodName = Arrays.asList(variants.getName());
|
||||
Set<String> samples = SampleUtils.getUniqueSamplesFromRods(getToolkit(), rodName);
|
||||
|
||||
// add the non-VCF sample from the command-line, if applicable
|
||||
|
|
@ -143,7 +142,7 @@ public class VariantAnnotator extends RodWalker<Integer, Integer> {
|
|||
// note that if any of the definitions conflict with our new ones, then we want to overwrite the old ones
|
||||
Set<VCFHeaderLine> hInfo = new HashSet<VCFHeaderLine>();
|
||||
hInfo.addAll(engine.getVCFAnnotationDescriptions());
|
||||
for ( VCFHeaderLine line : VCFUtils.getHeaderFields(getToolkit(), Arrays.asList("variant")) ) {
|
||||
for ( VCFHeaderLine line : VCFUtils.getHeaderFields(getToolkit(), Arrays.asList(variants.getName())) ) {
|
||||
if ( isUniqueHeaderLine(line, hInfo) )
|
||||
hInfo.add(line);
|
||||
}
|
||||
|
|
@ -202,7 +201,7 @@ public class VariantAnnotator 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());
|
||||
if ( VCs.size() == 0 )
|
||||
return 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@ 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.beagle.BeagleFeature;
|
||||
import org.broadinstitute.sting.gatk.walkers.RMD;
|
||||
import org.broadinstitute.sting.gatk.walkers.Requires;
|
||||
import org.broadinstitute.sting.gatk.walkers.RodWalker;
|
||||
import org.broadinstitute.sting.utils.GenomeLoc;
|
||||
|
|
@ -107,7 +106,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.getVariableName())) {
|
||||
if (source.getName().equals(comp.getName())) {
|
||||
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"));
|
||||
|
|
@ -116,7 +115,7 @@ public class BeagleOutputToVCFWalker extends RodWalker<Integer, Integer> {
|
|||
|
||||
}
|
||||
|
||||
Set<String> samples = SampleUtils.getSampleListWithVCFHeader(getToolkit(), Arrays.asList(variants.getVariableName()));
|
||||
Set<String> samples = SampleUtils.getSampleListWithVCFHeader(getToolkit(), Arrays.asList(variants.getName()));
|
||||
|
||||
final VCFHeader vcfHeader = new VCFHeader(hInfo, samples);
|
||||
vcfWriter.writeHeader(vcfHeader);
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ 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.refdata.RefMetaDataTracker;
|
||||
import org.broadinstitute.sting.gatk.walkers.RMD;
|
||||
import org.broadinstitute.sting.gatk.walkers.Requires;
|
||||
import org.broadinstitute.sting.gatk.walkers.RodWalker;
|
||||
import org.broadinstitute.sting.gatk.walkers.variantrecalibration.VQSRCalibrationCurve;
|
||||
|
|
@ -99,7 +98,7 @@ public class ProduceBeagleInputWalker extends RodWalker<Integer, Integer> {
|
|||
|
||||
public void initialize() {
|
||||
|
||||
samples = SampleUtils.getSampleListWithVCFHeader(getToolkit(), Arrays.asList(variants.getVariableName()));
|
||||
samples = SampleUtils.getSampleListWithVCFHeader(getToolkit(), Arrays.asList(variants.getName()));
|
||||
|
||||
beagleWriter.print("marker alleleA alleleB");
|
||||
for ( String sample : samples )
|
||||
|
|
@ -303,7 +302,7 @@ public class ProduceBeagleInputWalker extends RodWalker<Integer, Integer> {
|
|||
}
|
||||
|
||||
private void initializeVcfWriter() {
|
||||
final List<String> inputNames = Arrays.asList(validation.getVariableName());
|
||||
final List<String> inputNames = Arrays.asList(validation.getName());
|
||||
|
||||
// setup the header fields
|
||||
Set<VCFHeaderLine> hInfo = new HashSet<VCFHeaderLine>();
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ 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.RMD;
|
||||
import org.broadinstitute.sting.gatk.walkers.Requires;
|
||||
import org.broadinstitute.sting.gatk.walkers.RodWalker;
|
||||
import org.broadinstitute.sting.utils.GenomeLoc;
|
||||
|
|
@ -78,7 +77,7 @@ public class VariantsToBeagleUnphasedWalker extends RodWalker<Integer, Integer>
|
|||
private int testSetSize = 0;
|
||||
|
||||
public void initialize() {
|
||||
samples = SampleUtils.getSampleListWithVCFHeader(getToolkit(), Arrays.asList(variants.getVariableName()));
|
||||
samples = SampleUtils.getSampleListWithVCFHeader(getToolkit(), Arrays.asList(variants.getName()));
|
||||
|
||||
beagleWriter.print("I marker alleleA alleleB");
|
||||
for ( String sample : samples )
|
||||
|
|
|
|||
|
|
@ -35,8 +35,6 @@ import org.broadinstitute.sting.utils.GenomeLoc;
|
|||
import org.broadinstitute.sting.utils.collections.Pair;
|
||||
import org.broadinstitute.sting.utils.variantcontext.VariantContext;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
|
||||
/**
|
||||
* Generates an alternative reference sequence over the specified interval. Given variant ROD tracks,
|
||||
|
|
@ -48,7 +46,7 @@ import java.util.Collection;
|
|||
@Requires(value={DataSource.REFERENCE})
|
||||
public class FastaAlternateReferenceWalker extends FastaReferenceWalker {
|
||||
@Input(fullName="snpmask", shortName = "snpmask", doc="SNP mask VCF file", required=false)
|
||||
public RodBinding<VariantContext> snpmask;
|
||||
public RodBinding<VariantContext> snpmask = RodBinding.makeUnbound(VariantContext.class);
|
||||
|
||||
private int deletionBasesRemaining = 0;
|
||||
|
||||
|
|
@ -63,7 +61,7 @@ public class FastaAlternateReferenceWalker extends FastaReferenceWalker {
|
|||
|
||||
// Check to see if we have a called snp
|
||||
for ( VariantContext vc : tracker.getValues(VariantContext.class) ) {
|
||||
if ( ! vc.getSource().equals(snpmask.getVariableName())) {
|
||||
if ( ! vc.getSource().equals(snpmask.getName())) {
|
||||
if ( vc.isDeletion()) {
|
||||
deletionBasesRemaining = vc.getReference().length();
|
||||
// delete the next n bases, not this one
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ public class VariantFiltrationWalker extends RodWalker<Integer, Integer> {
|
|||
|
||||
private void initializeVcfWriter() {
|
||||
|
||||
final List<String> inputNames = Arrays.asList(variants.getVariableName());
|
||||
final List<String> inputNames = Arrays.asList(variants.getName());
|
||||
|
||||
// setup the header fields
|
||||
Set<VCFHeaderLine> hInfo = new HashSet<VCFHeaderLine>();
|
||||
|
|
|
|||
|
|
@ -59,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(variants.getVariableName()));
|
||||
Map<String, VCFHeader> vcfHeaders = VCFUtils.getVCFHeadersFromRods(getToolkit(), Arrays.asList(variants.getVariableName()));
|
||||
Set<String> samples = SampleUtils.getSampleListWithVCFHeader(getToolkit(), Arrays.asList(variants.getName()));
|
||||
Map<String, VCFHeader> vcfHeaders = VCFUtils.getVCFHeadersFromRods(getToolkit(), Arrays.asList(variants.getName()));
|
||||
|
||||
final VCFHeader vcfHeader = new VCFHeader(vcfHeaders.containsKey(variants.getVariableName()) ? vcfHeaders.get(variants.getVariableName()).getMetaData() : null, samples);
|
||||
final VCFHeader vcfHeader = new VCFHeader(vcfHeaders.containsKey(variants.getName()) ? vcfHeaders.get(variants.getName()).getMetaData() : null, samples);
|
||||
writer.writeHeader(vcfHeader);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -59,10 +59,10 @@ public class LeftAlignVariants extends RodWalker<Integer, Integer> {
|
|||
private SortingVCFWriter writer;
|
||||
|
||||
public void initialize() {
|
||||
Set<String> samples = SampleUtils.getSampleListWithVCFHeader(getToolkit(), Arrays.asList(variants.getVariableName()));
|
||||
Map<String, VCFHeader> vcfHeaders = VCFUtils.getVCFHeadersFromRods(getToolkit(), Arrays.asList(variants.getVariableName()));
|
||||
Set<String> samples = SampleUtils.getSampleListWithVCFHeader(getToolkit(), Arrays.asList(variants.getName()));
|
||||
Map<String, VCFHeader> vcfHeaders = VCFUtils.getVCFHeadersFromRods(getToolkit(), Arrays.asList(variants.getName()));
|
||||
|
||||
Set<VCFHeaderLine> headerLines = vcfHeaders.get(variants.getVariableName()).getMetaData();
|
||||
Set<VCFHeaderLine> headerLines = vcfHeaders.get(variants.getName()).getMetaData();
|
||||
baseWriter.writeHeader(new VCFHeader(headerLines, samples));
|
||||
|
||||
writer = new SortingVCFWriter(baseWriter, 200);
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ 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.RMD;
|
||||
import org.broadinstitute.sting.gatk.walkers.Requires;
|
||||
import org.broadinstitute.sting.gatk.walkers.RodWalker;
|
||||
import org.broadinstitute.sting.utils.SampleUtils;
|
||||
|
|
@ -89,12 +88,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(variants.getVariableName()));
|
||||
Map<String, VCFHeader> vcfHeaders = VCFUtils.getVCFHeadersFromRods(getToolkit(), Arrays.asList(variants.getVariableName()));
|
||||
Set<String> samples = SampleUtils.getSampleListWithVCFHeader(getToolkit(), Arrays.asList(variants.getName()));
|
||||
Map<String, VCFHeader> vcfHeaders = VCFUtils.getVCFHeadersFromRods(getToolkit(), Arrays.asList(variants.getName()));
|
||||
|
||||
Set<VCFHeaderLine> metaData = new HashSet<VCFHeaderLine>();
|
||||
if ( vcfHeaders.containsKey(variants.getVariableName()) )
|
||||
metaData.addAll(vcfHeaders.get(variants.getVariableName()).getMetaData());
|
||||
if ( vcfHeaders.containsKey(variants.getName()) )
|
||||
metaData.addAll(vcfHeaders.get(variants.getName()).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"));
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ 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.refdata.RefMetaDataTracker;
|
||||
import org.broadinstitute.sting.gatk.walkers.RMD;
|
||||
import org.broadinstitute.sting.gatk.walkers.Requires;
|
||||
import org.broadinstitute.sting.gatk.walkers.RodWalker;
|
||||
import org.broadinstitute.sting.utils.SampleUtils;
|
||||
|
|
@ -73,7 +72,7 @@ public class RandomlySplitVariants extends RodWalker<Integer, Integer> {
|
|||
iFraction = (int)(fraction * 1000.0);
|
||||
|
||||
// setup the header info
|
||||
final List<String> inputNames = Arrays.asList(variants.getVariableName());
|
||||
final List<String> inputNames = Arrays.asList(variants.getName());
|
||||
Set<String> samples = SampleUtils.getUniqueSamplesFromRods(getToolkit(), inputNames);
|
||||
Set<VCFHeaderLine> hInfo = new HashSet<VCFHeaderLine>();
|
||||
hInfo.addAll(VCFUtils.getHeaderFields(getToolkit(), inputNames));
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ import org.broadinstitute.sting.utils.variantcontext.VariantContext;
|
|||
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.RMD;
|
||||
import org.broadinstitute.sting.gatk.walkers.Requires;
|
||||
import org.broadinstitute.sting.gatk.walkers.RodWalker;
|
||||
import org.broadinstitute.sting.utils.SampleUtils;
|
||||
|
|
@ -176,7 +175,7 @@ public class SelectVariants extends RodWalker<Integer, Integer> {
|
|||
*/
|
||||
public void initialize() {
|
||||
// Get list of samples to include in the output
|
||||
List<String> rodNames = Arrays.asList(variants.getVariableName());
|
||||
List<String> rodNames = Arrays.asList(variants.getName());
|
||||
|
||||
Map<String, VCFHeader> vcfRods = VCFUtils.getVCFHeadersFromRods(getToolkit(), rodNames);
|
||||
TreeSet<String> vcfSamples = new TreeSet<String>(SampleUtils.getSampleList(vcfRods, VariantContextUtils.GenotypeMergeType.REQUIRE_UNIQUE));
|
||||
|
|
@ -219,10 +218,10 @@ public class SelectVariants extends RodWalker<Integer, Integer> {
|
|||
|
||||
// Look at the parameters to decide which analysis to perform
|
||||
DISCORDANCE_ONLY = discordanceTrack.isBound();
|
||||
if (DISCORDANCE_ONLY) logger.info("Selecting only variants discordant with the track: " + discordanceTrack.getVariableName());
|
||||
if (DISCORDANCE_ONLY) logger.info("Selecting only variants discordant with the track: " + discordanceTrack.getName());
|
||||
|
||||
CONCORDANCE_ONLY = concordanceTrack.isBound();
|
||||
if (CONCORDANCE_ONLY) logger.info("Selecting only variants concordant with the track: " + concordanceTrack.getVariableName());
|
||||
if (CONCORDANCE_ONLY) logger.info("Selecting only variants concordant with the track: " + concordanceTrack.getName());
|
||||
|
||||
if (MENDELIAN_VIOLATIONS) {
|
||||
if ( FAMILY_STRUCTURE_FILE != null) {
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ import java.util.*;
|
|||
/**
|
||||
* Emits specific fields as dictated by the user from one or more VCF files.
|
||||
*/
|
||||
public class VariantsToTableNewRodStyle extends RodWalker<Integer, Integer> {
|
||||
public class TestRodBindings extends RodWalker<Integer, Integer> {
|
||||
@Output(doc="File to which results should be written",required=true)
|
||||
protected PrintStream out;
|
||||
|
||||
|
|
@ -115,7 +115,7 @@ public class VariantValidationAssessor extends RodWalker<Pair<VariantContext, By
|
|||
}
|
||||
|
||||
public void onTraversalDone(Integer finalReduce) {
|
||||
final List<String> inputNames = Arrays.asList(variants.getVariableName());
|
||||
final List<String> inputNames = Arrays.asList(variants.getName());
|
||||
|
||||
// setup the header fields
|
||||
Set<VCFHeaderLine> hInfo = new HashSet<VCFHeaderLine>();
|
||||
|
|
|
|||
|
|
@ -101,8 +101,8 @@ public class VariantsToVCF extends RodWalker<Integer, Integer> {
|
|||
}
|
||||
|
||||
// set the appropriate sample name if necessary
|
||||
if ( sampleName != null && vc.hasGenotypes() && vc.hasGenotype(variants.getVariableName()) ) {
|
||||
Genotype g = Genotype.modifyName(vc.getGenotype(variants.getVariableName()), sampleName);
|
||||
if ( sampleName != null && vc.hasGenotypes() && vc.hasGenotype(variants.getName()) ) {
|
||||
Genotype g = Genotype.modifyName(vc.getGenotype(variants.getName()), sampleName);
|
||||
Map<String, Genotype> genotypes = new HashMap<String, Genotype>();
|
||||
genotypes.put(sampleName, g);
|
||||
vc = VariantContext.modifyGenotypes(vc, genotypes);
|
||||
|
|
@ -117,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(variants.getVariableName());
|
||||
List<Object> features = tracker.getValues(variants.getName());
|
||||
if ( features.size() > 0 && features.get(0) instanceof HapMapFeature ) {
|
||||
ArrayList<VariantContext> hapmapVCs = new ArrayList<VariantContext>(features.size());
|
||||
for ( Object feature : features ) {
|
||||
|
|
@ -151,7 +151,7 @@ public class VariantsToVCF extends RodWalker<Integer, Integer> {
|
|||
}
|
||||
refBase = ref.getBases()[hapmap.getStart() - ref.getWindow().getStart()];
|
||||
}
|
||||
VariantContext vc = VariantContextAdaptors.toVariantContext(variants.getVariableName(), hapmap, ref);
|
||||
VariantContext vc = VariantContextAdaptors.toVariantContext(variants.getName(), hapmap, ref);
|
||||
if ( vc != null ) {
|
||||
if ( refBase != null ) {
|
||||
Map<String, Object> attrs = new HashMap<String, Object>(vc.getAttributes());
|
||||
|
|
@ -219,10 +219,10 @@ public class VariantsToVCF extends RodWalker<Integer, Integer> {
|
|||
samples.add(sampleName);
|
||||
} else {
|
||||
// try VCF first
|
||||
samples = SampleUtils.getSampleListWithVCFHeader(getToolkit(), Arrays.asList(variants.getVariableName()));
|
||||
samples = SampleUtils.getSampleListWithVCFHeader(getToolkit(), Arrays.asList(variants.getName()));
|
||||
|
||||
if ( samples.isEmpty() ) {
|
||||
List<Object> rods = tracker.getValues(variants.getVariableName());
|
||||
List<Object> rods = tracker.getValues(variants.getName());
|
||||
if ( rods.size() == 0 )
|
||||
throw new IllegalStateException("No rod data is present");
|
||||
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ public class ListFileUtils {
|
|||
RMDTriplet triplet = new RMDTriplet(name,type,fileName,storageType,rodBinding.getTags());
|
||||
|
||||
// validate triplet type
|
||||
Class typeFromTribble = builderForValidation.getFeatureCodecClass(triplet);
|
||||
Class typeFromTribble = builderForValidation.getFeatureClass(triplet);
|
||||
if ( typeFromTribble != null && ! rodBinding.getType().isAssignableFrom(typeFromTribble) )
|
||||
throw new UserException.BadArgumentValue(rodBinding.getName(),
|
||||
String.format("Field %s expected type %s, but the type of the input file provided on the command line was %s",
|
||||
|
|
|
|||
|
|
@ -717,6 +717,23 @@ public class ParsingEngineUnitTest extends BaseTest {
|
|||
Assert.assertEquals(argProvider.binding.getTags().getPositionalTags().size(), 1, "Tags aren't correctly set");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void variantContextBindingArgumentTestVCF3() {
|
||||
final String[] commandLine = new String[] {"-V:vcf3","foo.vcf"};
|
||||
|
||||
parsingEngine.addArgumentSource( VariantContextRodBindingArgProvider.class );
|
||||
parsingEngine.parse( commandLine );
|
||||
parsingEngine.validate();
|
||||
|
||||
VariantContextRodBindingArgProvider argProvider = new VariantContextRodBindingArgProvider();
|
||||
parsingEngine.loadArgumentsIntoObject( argProvider );
|
||||
|
||||
Assert.assertEquals(argProvider.binding.getName(), "binding", "Name isn't set properly");
|
||||
Assert.assertEquals(argProvider.binding.getSource(), "foo.vcf", "Source isn't set to its expected value");
|
||||
Assert.assertEquals(argProvider.binding.getType(), VariantContext.class, "Type isn't set to its expected value");
|
||||
Assert.assertEquals(argProvider.binding.getTags().getPositionalTags().size(), 1, "Tags aren't correctly set");
|
||||
}
|
||||
|
||||
private class ListRodBindingArgProvider {
|
||||
@Input(shortName="V", required=false)
|
||||
public List<RodBinding<Feature>> bindings;
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ public class SelectVariantsIntegrationTest extends WalkerTest {
|
|||
String testFile = validationDataLocation + "NA12878.hg19.example1.vcf";
|
||||
|
||||
WalkerTestSpec spec = new WalkerTestSpec(
|
||||
"-T SelectVariants -R " + hg19Reference + " -sn NA12878 -L 20:1012700-1020000 --variant:VCF " + b37hapmapGenotypes + " -disc:VCF " + testFile + " -o %s -NO_HEADER",
|
||||
"-T SelectVariants -R " + hg19Reference + " -sn NA12878 -L 20:1012700-1020000 --variants:VCF " + b37hapmapGenotypes + " -disc:VCF " + testFile + " -o %s -NO_HEADER",
|
||||
1,
|
||||
Arrays.asList("78e6842325f1f1bc9ab30d5e7737ee6e")
|
||||
);
|
||||
|
|
@ -55,7 +55,7 @@ public class SelectVariantsIntegrationTest extends WalkerTest {
|
|||
String testFile = validationDataLocation + "NA12878.hg19.example1.vcf";
|
||||
|
||||
WalkerTestSpec spec = new WalkerTestSpec(
|
||||
"-T SelectVariants -R " + hg19Reference + " -sn NA12878 -L 20:1012700-1020000 -conc:VCF " + b37hapmapGenotypes + " --variant:VCF " + testFile + " -o %s -NO_HEADER",
|
||||
"-T SelectVariants -R " + hg19Reference + " -sn NA12878 -L 20:1012700-1020000 -conc:VCF " + b37hapmapGenotypes + " --variants:VCF " + testFile + " -o %s -NO_HEADER",
|
||||
1,
|
||||
Arrays.asList("d2ba3ea30a810f6f0fbfb1b643292b6a")
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue