--variants throughout integrationtests

This commit is contained in:
Mark DePristo 2011-08-02 20:28:47 -04:00
parent 3a27a25cfc
commit 83891271b5
27 changed files with 173 additions and 157 deletions

View File

@ -39,14 +39,18 @@ import java.util.List;
* There is no constraint on the type of the ROD bound.
*/
public class RodBinding<T extends Feature> {
public final static <T extends Feature> RodBinding<T> makeUnbound(Class<T> type) {
return new RodBinding<T>(type);
}
final private String variableName;
final private String source;
final private Tags tags;
final private Class<T> type;
final private boolean bound;
public boolean isBound() {
// todo : implement me
return source != null;
return bound;
}
public RodBinding(Class<T> type, final String variableName, final String source, final Tags tags) {
@ -54,6 +58,19 @@ public class RodBinding<T extends Feature> {
this.variableName = variableName;
this.source = source;
this.tags = tags;
this.bound = true;
}
/**
* Make an unbound RodBinding<T>
* @param type
*/
private RodBinding(Class<T> type) {
this.type = type;
this.variableName = ""; // special value can never be found in RefMetaDataTracker
this.source = "";
this.tags = new Tags();
this.bound = false;
}
public String getVariableName() {

View File

@ -55,7 +55,7 @@ import static java.lang.Math.log10;
*/
@Requires(value={})
public class BeagleOutputToVCFWalker extends RodWalker<Integer, Integer> {
@Input(fullName="variant", shortName = "V", doc="Input VCF file", required=true)
@Input(fullName="variants", shortName = "V", doc="Input VCF file", required=true)
public RodBinding<VariantContext> variants;
@Input(fullName="comp", shortName = "comp", doc="Comparison VCF file", required=false)

View File

@ -53,7 +53,7 @@ import java.util.*;
*/
@Requires(value={})
public class ProduceBeagleInputWalker extends RodWalker<Integer, Integer> {
@Input(fullName="variant", shortName = "V", doc="Input VCF file", required=true)
@Input(fullName="variants", shortName = "V", doc="Input VCF file", required=true)
public RodBinding<VariantContext> variants;
@Input(fullName="validation", shortName = "validation", doc="Input VCF file", required=false)

View File

@ -58,7 +58,7 @@ import java.util.Set;
*/
@Requires(value={})
public class VariantsToBeagleUnphasedWalker extends RodWalker<Integer, Integer> {
@Input(fullName="variant", shortName = "V", doc="Input VCF file", required=true)
@Input(fullName="variants", 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)

View File

@ -47,7 +47,7 @@ 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)
@Input(fullName="snpmask", shortName = "snpmask", doc="SNP mask VCF file", required=false)
public RodBinding<VariantContext> snpmask;
private int deletionBasesRemaining = 0;
@ -61,24 +61,24 @@ public class FastaAlternateReferenceWalker extends FastaReferenceWalker {
String refBase = String.valueOf((char)ref.getBase());
Collection<VariantContext> vcs = tracker.getValues(snpmask);
// Check to see if we have a called snp
for ( VariantContext vc : vcs ) {
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());
for ( VariantContext vc : tracker.getValues(VariantContext.class) ) {
if ( ! vc.getSource().equals(snpmask.getVariableName())) {
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 we don't have a called site, and we have a mask at this site, mask it
for ( VariantContext vc : vcs ) {
if ( vc.getSource().startsWith("snpmask") && vc.isSNP()) {
for ( VariantContext vc : tracker.getValues(snpmask) ) {
if ( vc.isSNP()) {
return new Pair<GenomeLoc, String>(context.getLocation(), "N");
}
}

View File

@ -25,6 +25,7 @@
package org.broadinstitute.sting.gatk.walkers.filters;
import org.broad.tribble.Feature;
import org.broadinstitute.sting.commandline.Argument;
import org.broadinstitute.sting.commandline.Input;
import org.broadinstitute.sting.commandline.Output;
@ -51,7 +52,7 @@ import java.util.*;
@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)
@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)
@ -76,6 +77,8 @@ public class VariantFiltrationWalker extends RodWalker<Integer, Integer> {
protected Integer MASK_EXTEND = 0;
@Argument(fullName="maskName", shortName="mask", doc="The text to put in the FILTER field if a 'mask' rod is provided and overlaps with a variant call; [default:'Mask']", required=false)
protected String MASK_NAME = "Mask";
@Input(fullName="mask", doc="Input ROD mask", required=false)
public RodBinding<Feature> mask;
@Argument(fullName="missingValuesInExpressionsShouldEvaluateAsFailing", doc="When evaluating the JEXL expressions, should missing values be considered failing the expression (by default they are considered passing)?", required=false)
protected Boolean FAIL_MISSING_VALUES = false;
@ -154,7 +157,7 @@ public class VariantFiltrationWalker extends RodWalker<Integer, Integer> {
Collection<VariantContext> VCs = tracker.getValues(variants, context.getLocation());
// is there a SNP mask present?
boolean hasMask = tracker.getValues("mask").size() > 0;
boolean hasMask = tracker.hasValues(mask);
if ( hasMask )
previousMaskPosition = ref.getLocus(); // multi-base masks will get triggered over all bases of the mask

View File

@ -48,7 +48,7 @@ import java.util.Set;
@Reference(window=@Window(start=0,stop=100))
@Requires(value={})
public class FilterLiftedVariants extends RodWalker<Integer, Integer> {
@Input(fullName="variant", shortName = "V", doc="Input VCF file", required=true)
@Input(fullName="variants", shortName = "V", doc="Input VCF file", required=true)
public RodBinding<VariantContext> variants;
private static final int MAX_VARIANT_SIZE = 100;

View File

@ -50,7 +50,7 @@ import java.util.*;
@Reference(window=@Window(start=-200,stop=200))
@Requires(value={})
public class LeftAlignVariants extends RodWalker<Integer, Integer> {
@Input(fullName="variant", shortName = "V", doc="Input VCF file", required=true)
@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)

View File

@ -53,7 +53,7 @@ import java.util.*;
*/
@Requires(value={})
public class LiftoverVariants extends RodWalker<Integer, Integer> {
@Input(fullName="variant", shortName = "V", doc="Input VCF file", required=true)
@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)

View File

@ -48,7 +48,7 @@ import java.util.*;
*/
@Requires(value={})
public class RandomlySplitVariants extends RodWalker<Integer, Integer> {
@Input(fullName="variant", shortName = "V", doc="Input VCF file", required=true)
@Input(fullName="variants", 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)

View File

@ -54,7 +54,7 @@ import java.util.*;
*/
@Requires(value={})
public class SelectVariants extends RodWalker<Integer, Integer> {
@Input(fullName="variant", shortName = "V", doc="Input VCF file", required=true)
@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)
@ -81,15 +81,11 @@ public class SelectVariants extends RodWalker<Integer, Integer> {
@Argument(fullName="keepOriginalAC", shortName="keepOriginalAC", doc="Don't include filtered loci.", required=false)
private boolean KEEP_ORIGINAL_CHR_COUNTS = false;
@Argument(fullName="discordance", shortName = "disc", doc="Output variants that were not called on a ROD comparison track. Use -disc ROD_NAME", required=false)
private String discordanceRodName = "";
@Argument(fullName="discordance", shortName = "disc", doc="Output variants that were not called on a ROD comparison track", required=false)
private RodBinding<VariantContext> discordanceTrack = RodBinding.makeUnbound(VariantContext.class);
@Argument(fullName="concordance", shortName = "conc", doc="Output variants that were also called on a ROD comparison track. Use -conc ROD_NAME", required=false)
private String concordanceRodName = "";
@Hidden
@Argument(fullName="inputAF", shortName = "inputAF", doc="", required=false)
private String inputAFRodName = "";
@Argument(fullName="concordance", shortName = "conc", doc="Output variants that were also called on a ROD comparison track", required=false)
private RodBinding<VariantContext> concordanceTrack = RodBinding.makeUnbound(VariantContext.class);
@Hidden
@Argument(fullName="keepAFSpectrum", shortName="keepAF", doc="Don't include loci found to be non-variant after the subsetting procedure.", required=false)
@ -222,11 +218,11 @@ public class SelectVariants extends RodWalker<Integer, Integer> {
jexls = VariantContextUtils.initializeMatchExps(selectNames, SELECT_EXPRESSIONS);
// Look at the parameters to decide which analysis to perform
DISCORDANCE_ONLY = discordanceRodName.length() > 0;
if (DISCORDANCE_ONLY) logger.info("Selecting only variants discordant with the track: " + discordanceRodName);
DISCORDANCE_ONLY = discordanceTrack.isBound();
if (DISCORDANCE_ONLY) logger.info("Selecting only variants discordant with the track: " + discordanceTrack.getVariableName());
CONCORDANCE_ONLY = concordanceRodName.length() > 0;
if (CONCORDANCE_ONLY) logger.info("Selecting only variants concordant with the track: " + concordanceRodName);
CONCORDANCE_ONLY = concordanceTrack.isBound();
if (CONCORDANCE_ONLY) logger.info("Selecting only variants concordant with the track: " + concordanceTrack.getVariableName());
if (MENDELIAN_VIOLATIONS) {
if ( FAMILY_STRUCTURE_FILE != null) {
@ -332,12 +328,12 @@ public class SelectVariants extends RodWalker<Integer, Integer> {
break;
}
if (DISCORDANCE_ONLY) {
Collection<VariantContext> compVCs = tracker.getValues(VariantContext.class, discordanceRodName, context.getLocation());
Collection<VariantContext> compVCs = tracker.getValues(discordanceTrack, context.getLocation());
if (!isDiscordant(vc, compVCs))
return 0;
}
if (CONCORDANCE_ONLY) {
Collection<VariantContext> compVCs = tracker.getValues(VariantContext.class, concordanceRodName, context.getLocation());
Collection<VariantContext> compVCs = tracker.getValues(concordanceTrack, context.getLocation());
if (!isConcordant(vc, compVCs))
return 0;
}

View File

@ -54,7 +54,7 @@ import java.util.Set;
@Reference(window=@Window(start=0,stop=100))
@Requires(value={})
public class ValidateVariants extends RodWalker<Integer, Integer> {
@Input(fullName="variant", shortName = "V", doc="Input VCF file", required=true)
@Input(fullName="variants", shortName = "V", doc="Input VCF file", required=true)
public RodBinding<VariantContext> variants;
public enum ValidationType {
@ -145,6 +145,8 @@ public class ValidateVariants extends RodWalker<Integer, Integer> {
for ( Object d : dbsnpList ) {
if (d instanceof DbSNPFeature )
rsIDs.add(((DbSNPFeature)d).getRsID());
else if (d instanceof VariantContext )
rsIDs.add(((VariantContext)d).getID());
}
}

View File

@ -49,7 +49,7 @@ import java.util.*;
@Reference(window=@Window(start=0,stop=40))
@Requires(value={})
public class VariantValidationAssessor extends RodWalker<Pair<VariantContext, Byte>,Integer> {
@Input(fullName="variant", shortName = "V", doc="Input VCF file", required=true)
@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)

View File

@ -47,7 +47,7 @@ import java.util.*;
*/
@Requires(value={})
public class VariantsToTable extends RodWalker<Integer, Integer> {
@Input(fullName="variant", shortName = "V", doc="Input VCF file", required=true)
@Input(fullName="variants", shortName = "V", doc="Input VCF file", required=true)
public RodBinding<VariantContext> variants;
@Output(doc="File to which results should be written",required=true)

View File

@ -64,7 +64,7 @@ public class VariantsToVCF extends RodWalker<Integer, Integer> {
protected VCFWriter baseWriter = null;
private SortingVCFWriter vcfwriter; // needed because hapmap indel records move
@Input(fullName="variant", shortName = "V", doc="Input VCF file", required=true)
@Input(fullName="variants", 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)

View File

@ -91,6 +91,11 @@ public class RefMetaDataTrackerUnitTest {
this.BValues = BValues == null ? null : makeRODRecord("B", BValues);
}
@Override
public String toString() {
return String.format("A=%s, B=%s", AValues, BValues);
}
private final RODRecordList makeRODRecord(String name, List<? extends Feature> features) {
List<GATKFeature> x = new ArrayList<GATKFeature>();
for ( Feature f : features )
@ -135,12 +140,6 @@ public class RefMetaDataTrackerUnitTest {
}
}
private class MyTestAdaptors extends MyTest {
private MyTestAdaptors(final List<? extends Feature> AValues) {
super(MyTestAdaptors.class, AValues, null);
}
}
private final TableFeature makeSpan(int start, int stop) {
return new TableFeature(genomeLocParser.createGenomeLoc("chr1", start, stop),
Collections.<String>emptyList(), Collections.<String>emptyList());

View File

@ -37,10 +37,10 @@ public class BeagleIntegrationTest extends WalkerTest {
public void testBeagleOutput() {
WalkerTestSpec spec = new WalkerTestSpec(
"-T BeagleOutputToVCF -R " + hg19Reference + " " +
"-B:variant,VCF3 " + beagleValidationDataLocation + "inttestbgl.input.vcf " +
"-B:beagleR2,BEAGLE " + beagleValidationDataLocation + "inttestbgl.r2 " +
"-B:beagleProbs,BEAGLE " + beagleValidationDataLocation + "inttestbgl.gprobs " +
"-B:beaglePhased,BEAGLE " + beagleValidationDataLocation + "inttestbgl.phased " +
"--variants:VCF3 " + beagleValidationDataLocation + "inttestbgl.input.vcf " +
"--beagleR2:BEAGLE " + beagleValidationDataLocation + "inttestbgl.r2 " +
"--beagleProbs:BEAGLE " + beagleValidationDataLocation + "inttestbgl.gprobs " +
"--beaglePhased:BEAGLE " + beagleValidationDataLocation + "inttestbgl.phased " +
"-o %s -NO_HEADER", 1, Arrays.asList("3531451e84208264104040993889aaf4"));
executeTest("test BeagleOutputToVCF", spec);
}
@ -49,7 +49,7 @@ public class BeagleIntegrationTest extends WalkerTest {
public void testBeagleInput() {
WalkerTestSpec spec = new WalkerTestSpec(
"-T ProduceBeagleInput -R " + hg19Reference + " " +
"-B:variant,VCF3 " + beagleValidationDataLocation + "inttestbgl.input.vcf " +
"--variants:VCF3 " + beagleValidationDataLocation + "inttestbgl.input.vcf " +
"-o %s", 1, Arrays.asList("a01c704246f3dd1b9c65774007e51e69"));
executeTest("test BeagleInput", spec);
}
@ -57,8 +57,8 @@ public class BeagleIntegrationTest extends WalkerTest {
@Test
public void testBeagleInput2() {
WalkerTestSpec spec = new WalkerTestSpec(
"-T ProduceBeagleInput -B:variant,VCF /humgen/gsa-hpprojects/GATK/data/Validation_Data/NA12878_HSQ_chr22_14-16m.vcf "+
"-B:validation,VCF /humgen/gsa-hpprojects/GATK/data/Validation_Data/NA12878_OMNI_chr22_14-16m.vcf "+
"-T ProduceBeagleInput --variants:VCF /humgen/gsa-hpprojects/GATK/data/Validation_Data/NA12878_HSQ_chr22_14-16m.vcf "+
"--validation:VCF /humgen/gsa-hpprojects/GATK/data/Validation_Data/NA12878_OMNI_chr22_14-16m.vcf "+
"-L 22:14000000-16000000 -o %s -bvcf %s -bs 0.8 -valp 0.98 -R /humgen/1kg/reference/human_g1k_v37.fasta -NO_HEADER ",2,
Arrays.asList("660986891b30cdc937e0f2a3a5743faa","e96ddd51da9f4a797b2aa8c20e404166"));
executeTest("test BeagleInputWithBootstrap",spec);
@ -68,10 +68,10 @@ public class BeagleIntegrationTest extends WalkerTest {
public void testBeagleOutput2() {
WalkerTestSpec spec = new WalkerTestSpec(
"-T BeagleOutputToVCF -R "+hg19Reference+" "+
"-B:variant,VCF /humgen/gsa-hpprojects/GATK/data/Validation_Data/EUR_beagle_in_test.vcf "+
"-B:beagleR2,beagle /humgen/gsa-hpprojects/GATK/data/Validation_Data/EUR_beagle_in_test.r2 "+
"-B:beagleProbs,beagle /humgen/gsa-hpprojects/GATK/data/Validation_Data/EUR_beagle_in_test.gprobs.bgl "+
"-B:beaglePhased,beagle /humgen/gsa-hpprojects/GATK/data/Validation_Data/EUR_beagle_in_test.phased.bgl "+
"--variants:VCF /humgen/gsa-hpprojects/GATK/data/Validation_Data/EUR_beagle_in_test.vcf "+
"--beagleR2:beagle /humgen/gsa-hpprojects/GATK/data/Validation_Data/EUR_beagle_in_test.r2 "+
"--beagleProbs:beagle /humgen/gsa-hpprojects/GATK/data/Validation_Data/EUR_beagle_in_test.gprobs.bgl "+
"--beaglePhased:beagle /humgen/gsa-hpprojects/GATK/data/Validation_Data/EUR_beagle_in_test.phased.bgl "+
"-L 20:1-70000 -o %s -NO_HEADER ",1,Arrays.asList("8dd6ec53994fb46c5c22af8535d22965"));
executeTest("testBeagleChangesSitesToRef",spec);

View File

@ -24,7 +24,7 @@ public class FastaAlternateReferenceIntegrationTest extends WalkerTest {
executeTest("testFastaReference", spec1b);
WalkerTestSpec spec2 = new WalkerTestSpec(
"-T FastaAlternateReferenceMaker -R " + b36KGReference + " -B:indels,VCF " + validationDataLocation + "NA12878.chr1_10mb_11mb.slx.indels.vcf4 -B:snpmask,vcf " + GATKDataLocation + "dbsnp_132.b36.excluding_sites_after_129.vcf -L 1:10,075,000-10,075,380;1:10,093,447-10,093,847;1:10,271,252-10,271,452 -o %s",
"-T FastaAlternateReferenceMaker -R " + b36KGReference + " -B:indels,VCF " + validationDataLocation + "NA12878.chr1_10mb_11mb.slx.indels.vcf4 --snpmask:vcf " + GATKDataLocation + "dbsnp_132.b36.excluding_sites_after_129.vcf -L 1:10,075,000-10,075,380;1:10,093,447-10,093,847;1:10,271,252-10,271,452 -o %s",
1,
Arrays.asList("3a48986c3832a768b478c3e95f994b0f"));
executeTest("testFastaAlternateReferenceIndels", spec2);

View File

@ -15,7 +15,7 @@ public class VariantFiltrationIntegrationTest extends WalkerTest {
@Test
public void testNoAction() {
WalkerTestSpec spec = new WalkerTestSpec(
baseTestString() + " -B:variant,VCF3 " + validationDataLocation + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1,
baseTestString() + " --variants:VCF3 " + validationDataLocation + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1,
Arrays.asList("8a105fa5eebdfffe7326bc5b3d8ffd1c"));
executeTest("test no action", spec);
}
@ -23,7 +23,7 @@ public class VariantFiltrationIntegrationTest extends WalkerTest {
@Test
public void testClusteredSnps() {
WalkerTestSpec spec = new WalkerTestSpec(
baseTestString() + " -window 10 -B:variant,VCF3 " + validationDataLocation + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1,
baseTestString() + " -window 10 --variants:VCF3 " + validationDataLocation + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1,
Arrays.asList("27b13f179bb4920615dff3a32730d845"));
executeTest("test clustered SNPs", spec);
}
@ -31,17 +31,17 @@ public class VariantFiltrationIntegrationTest extends WalkerTest {
@Test
public void testMasks() {
WalkerTestSpec spec1 = new WalkerTestSpec(
baseTestString() + " -mask foo -B:mask,VCF3 " + validationDataLocation + "vcfexample2.vcf -B:variant,VCF3 " + validationDataLocation + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1,
baseTestString() + " -mask foo --mask:VCF3 " + validationDataLocation + "vcfexample2.vcf --variants:VCF3 " + validationDataLocation + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1,
Arrays.asList("578f9e774784c25871678e6464fd212b"));
executeTest("test mask all", spec1);
WalkerTestSpec spec2 = new WalkerTestSpec(
baseTestString() + " -mask foo -B:mask,VCF " + validationDataLocation + "vcfMask.vcf -B:variant,VCF3 " + validationDataLocation + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1,
baseTestString() + " -mask foo --mask:VCF " + validationDataLocation + "vcfMask.vcf --variants:VCF3 " + validationDataLocation + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1,
Arrays.asList("bfa86a674aefca1b13d341cb14ab3c4f"));
executeTest("test mask some", spec2);
WalkerTestSpec spec3 = new WalkerTestSpec(
baseTestString() + " -mask foo -maskExtend 10 -B:mask,VCF " + validationDataLocation + "vcfMask.vcf -B:variant,VCF3 " + validationDataLocation + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1,
baseTestString() + " -mask foo -maskExtend 10 --mask:VCF " + validationDataLocation + "vcfMask.vcf --variants:VCF3 " + validationDataLocation + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1,
Arrays.asList("5939f80d14b32d88587373532d7b90e5"));
executeTest("test mask extend", spec3);
}
@ -49,7 +49,7 @@ public class VariantFiltrationIntegrationTest extends WalkerTest {
@Test
public void testFilter1() {
WalkerTestSpec spec = new WalkerTestSpec(
baseTestString() + " -filter 'DoC < 20 || FisherStrand > 20.0' -filterName foo -B:variant,VCF3 " + validationDataLocation + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1,
baseTestString() + " -filter 'DoC < 20 || FisherStrand > 20.0' -filterName foo --variants:VCF3 " + validationDataLocation + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1,
Arrays.asList("45219dbcfb6f81bba2ea0c35f5bfd368"));
executeTest("test filter #1", spec);
}
@ -57,7 +57,7 @@ public class VariantFiltrationIntegrationTest extends WalkerTest {
@Test
public void testFilter2() {
WalkerTestSpec spec = new WalkerTestSpec(
baseTestString() + " -filter 'AlleleBalance < 70.0 && FisherStrand == 1.4' -filterName bar -B:variant,VCF3 " + validationDataLocation + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1,
baseTestString() + " -filter 'AlleleBalance < 70.0 && FisherStrand == 1.4' -filterName bar --variants:VCF3 " + validationDataLocation + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1,
Arrays.asList("c95845e817da7352b9b72bc9794f18fb"));
executeTest("test filter #2", spec);
}
@ -65,7 +65,7 @@ public class VariantFiltrationIntegrationTest extends WalkerTest {
@Test
public void testFilterWithSeparateNames() {
WalkerTestSpec spec = new WalkerTestSpec(
baseTestString() + " --filterName ABF -filter 'AlleleBalance < 0.7' --filterName FSF -filter 'FisherStrand == 1.4' -B:variant,VCF3 " + validationDataLocation + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1,
baseTestString() + " --filterName ABF -filter 'AlleleBalance < 0.7' --filterName FSF -filter 'FisherStrand == 1.4' --variants:VCF3 " + validationDataLocation + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1,
Arrays.asList("b8cdd7f44ff1a395e0a9b06a87e1e530"));
executeTest("test filter with separate names #2", spec);
}
@ -73,12 +73,12 @@ public class VariantFiltrationIntegrationTest extends WalkerTest {
@Test
public void testGenotypeFilters() {
WalkerTestSpec spec1 = new WalkerTestSpec(
baseTestString() + " -G_filter 'GQ == 0.60' -G_filterName foo -B:variant,VCF3 " + validationDataLocation + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1,
baseTestString() + " -G_filter 'GQ == 0.60' -G_filterName foo --variants:VCF3 " + validationDataLocation + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1,
Arrays.asList("96b61e4543a73fe725e433f007260039"));
executeTest("test genotype filter #1", spec1);
WalkerTestSpec spec2 = new WalkerTestSpec(
baseTestString() + " -G_filter 'AF == 0.04 && isHomVar == 1' -G_filterName foo -B:variant,VCF3 " + validationDataLocation + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1,
baseTestString() + " -G_filter 'AF == 0.04 && isHomVar == 1' -G_filterName foo --variants:VCF3 " + validationDataLocation + "vcfexample2.vcf -L 1:10,020,000-10,021,000", 1,
Arrays.asList("6c8112ab17ce39c8022c891ae73bf38e"));
executeTest("test genotype filter #2", spec2);
}
@ -86,7 +86,7 @@ public class VariantFiltrationIntegrationTest extends WalkerTest {
@Test
public void testDeletions() {
WalkerTestSpec spec = new WalkerTestSpec(
baseTestString() + " --filterExpression 'QUAL < 100' --filterName foo -B:variant,VCF " + validationDataLocation + "twoDeletions.vcf", 1,
baseTestString() + " --filterExpression 'QUAL < 100' --filterName foo --variants:VCF3 " + validationDataLocation + "twoDeletions.vcf", 1,
Arrays.asList("569546fd798afa0e65c5b61b440d07ac"));
executeTest("test deletions", spec);
}

View File

@ -56,7 +56,7 @@ public class DictionaryConsistencyIntegrationTest extends WalkerTest {
}
private WalkerTest.WalkerTestSpec testVCF(String ref, String vcf, Class c) {
return new WalkerTest.WalkerTestSpec("-T VariantsToTable -M 10 -B:two,vcf "
return new WalkerTest.WalkerTestSpec("-T VariantsToTable -M 10 --variants:vcf "
+ vcf + " -F POS,CHROM -R "
+ ref + " -o %s",
1, c);

View File

@ -38,7 +38,7 @@ public class LiftoverVariantsIntegrationTest extends WalkerTest {
@Test
public void testb36Tohg19() {
WalkerTestSpec spec = new WalkerTestSpec(
"-T LiftoverVariants -o %s -R " + b36KGReference + " -B:variant,vcf3 " + validationDataLocation + "yri.trio.gatk_glftrio.intersection.annotated.filtered.chr1.500.noheader.vcf -chain " + validationDataLocation + "b36ToHg19.broad.over.chain -dict /seq/references/Homo_sapiens_assembly19/v0/Homo_sapiens_assembly19.dict",
"-T LiftoverVariants -o %s -R " + b36KGReference + " --variants:vcf3 " + validationDataLocation + "yri.trio.gatk_glftrio.intersection.annotated.filtered.chr1.500.noheader.vcf -chain " + validationDataLocation + "b36ToHg19.broad.over.chain -dict /seq/references/Homo_sapiens_assembly19/v0/Homo_sapiens_assembly19.dict",
1,
Arrays.asList("70aeaca5b74cc7ba8e2da7b71ff0fbfd"));
executeTest("test b36 to hg19", spec);
@ -47,7 +47,7 @@ public class LiftoverVariantsIntegrationTest extends WalkerTest {
@Test
public void testb36Tohg19UnsortedSamples() {
WalkerTestSpec spec = new WalkerTestSpec(
"-T LiftoverVariants -o %s -R " + b36KGReference + " -B:variant,vcf3 " + validationDataLocation + "yri.trio.gatk_glftrio.intersection.annotated.filtered.chr1.500.noheader.unsortedSamples.vcf -chain " + validationDataLocation + "b36ToHg19.broad.over.chain -dict /seq/references/Homo_sapiens_assembly19/v0/Homo_sapiens_assembly19.dict",
"-T LiftoverVariants -o %s -R " + b36KGReference + " --variants:vcf3 " + validationDataLocation + "yri.trio.gatk_glftrio.intersection.annotated.filtered.chr1.500.noheader.unsortedSamples.vcf -chain " + validationDataLocation + "b36ToHg19.broad.over.chain -dict /seq/references/Homo_sapiens_assembly19/v0/Homo_sapiens_assembly19.dict",
1,
Arrays.asList("3fd7ec2dc4064ef410786276b0dc9d08"));
executeTest("test b36 to hg19, unsorted samples", spec);
@ -56,7 +56,7 @@ public class LiftoverVariantsIntegrationTest extends WalkerTest {
@Test
public void testhg18Tohg19Unsorted() {
WalkerTestSpec spec = new WalkerTestSpec(
"-T LiftoverVariants -o %s -R " + hg18Reference + " -B:variant,vcf " + validationDataLocation + "liftover_test.vcf -chain " + validationDataLocation + "hg18ToHg19.broad.over.chain -dict /seq/references/Homo_sapiens_assembly19/v0/Homo_sapiens_assembly19.dict",
"-T LiftoverVariants -o %s -R " + hg18Reference + " --variants:vcf " + validationDataLocation + "liftover_test.vcf -chain " + validationDataLocation + "hg18ToHg19.broad.over.chain -dict /seq/references/Homo_sapiens_assembly19/v0/Homo_sapiens_assembly19.dict",
1,
Arrays.asList("ab2c6254225d7e2ecf52eee604d5673b"));
executeTest("test hg18 to hg19, unsorted", spec);

View File

@ -16,7 +16,7 @@ public class SelectVariantsIntegrationTest extends WalkerTest {
String samplesFile = validationDataLocation + "SelectVariants.samples.txt";
WalkerTestSpec spec = new WalkerTestSpec(
baseTestString(" -sn A -se '[CDH]' -sf " + samplesFile + " -env -ef -select 'DP < 250' -B:variant,VCF3 " + testfile + " -NO_HEADER"),
baseTestString(" -sn A -se '[CDH]' -sf " + samplesFile + " -env -ef -select 'DP < 250' --variants:VCF3 " + testfile + " -NO_HEADER"),
1,
Arrays.asList("d18516c1963802e92cb9e425c0b75fd6")
);
@ -29,7 +29,7 @@ public class SelectVariantsIntegrationTest extends WalkerTest {
String testfile = validationDataLocation + "test.dup.vcf";
WalkerTestSpec spec = new WalkerTestSpec(
baseTestString(" -sn A -sn B -sn C -B:variant,VCF3 " + testfile + " -NO_HEADER"),
baseTestString(" -sn A -sn B -sn C --variants:VCF3 " + testfile + " -NO_HEADER"),
1,
Arrays.asList("b74038779fe6485dbb8734ae48178356")
);
@ -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 -disc myvar -L 20:1012700-1020000 -B:variant,VCF " + b37hapmapGenotypes + " -B:myvar,VCF " + testFile + " -o %s -NO_HEADER",
"-T SelectVariants -R " + hg19Reference + " -sn NA12878 -L 20:1012700-1020000 --variant: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 -conc hapmap -L 20:1012700-1020000 -B:hapmap,VCF " + b37hapmapGenotypes + " -B:variant,VCF " + testFile + " -o %s -NO_HEADER",
"-T SelectVariants -R " + hg19Reference + " -sn NA12878 -L 20:1012700-1020000 -conc:VCF " + b37hapmapGenotypes + " --variant:VCF " + testFile + " -o %s -NO_HEADER",
1,
Arrays.asList("d2ba3ea30a810f6f0fbfb1b643292b6a")
);

View File

@ -56,7 +56,7 @@ public class VCFStreamingIntegrationTest extends WalkerTest {
WalkerTestSpec spec = new WalkerTestSpec(
"-T SelectVariants" +
" -R " + b36KGReference +
" -B:variant,vcf3,storage=STREAM " + tmpFifo.getAbsolutePath() +
" --variants:vcf3,storage=STREAM " + tmpFifo.getAbsolutePath() +
" --NO_HEADER" +
" -o %s",
1,
@ -80,7 +80,7 @@ public class VCFStreamingIntegrationTest extends WalkerTest {
WalkerTestSpec selectTestSpec = new WalkerTestSpec(
"-T SelectVariants" +
" -R " + b36KGReference +
" -B:variant,vcf3,storage=STREAM " + testFile +
" --variants:vcf3,storage=STREAM " + testFile +
" --NO_HEADER" +
" -select 'QD > 2.0'" +
" -o " + tmpFifo.getAbsolutePath(),

View File

@ -34,7 +34,7 @@ import java.util.Arrays;
public class ValidateVariantsIntegrationTest extends WalkerTest {
public static String baseTestString(String file, String type) {
return "-T ValidateVariants -R " + b36KGReference + " -L 1:10001292-10001303 -B:variant,VCF " + validationDataLocation + file + " --validationType " + type;
return "-T ValidateVariants -R " + b36KGReference + " -L 1:10001292-10001303 --variants:vcf " + validationDataLocation + file + " --validationType " + type;
}
@Test

View File

@ -35,7 +35,7 @@ import java.io.File;
public class VariantsToTableIntegrationTest extends WalkerTest {
private String variantsToTableCmd(String moreArgs) {
return "-R " + hg18Reference +
" -B:eval,vcf " + validationDataLocation + "/soap_gatk_annotated.vcf" +
" --variants:vcf " + validationDataLocation + "/soap_gatk_annotated.vcf" +
" -T VariantsToTable" +
" -F CHROM -F POS -F ID -F REF -F ALT -F QUAL -F FILTER -F TRANSITION -F DP -F SB -F set -F RankSumP -F refseq.functionalClass*" +
" -L chr1 -KMA -o %s" + moreArgs;

View File

@ -15,74 +15,73 @@ import java.util.ArrayList;
* test(s) for the VariantsToVCF walker.
*/
public class VariantsToVCFIntegrationTest extends WalkerTest {
@Test
public void testVariantsToVCFUsingGeliInput() {
List<String> md5 = new ArrayList<String>();
md5.add("4accae035d271b35ee2ec58f403c68c6");
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
"-R " + b36KGReference +
" -B:variant,GeliText " + validationDataLocation + "NA12878.1kg.p2.chr1_10mb_11_mb.SLX.lod5.variants.geli.calls" +
" -T VariantsToVCF" +
" -L 1:10,000,000-11,000,000" +
" -sample NA123AB" +
" -o %s" +
" -NO_HEADER",
1, // just one output file
md5);
executeTest("testVariantsToVCFUsingGeliInput #1", spec).getFirst();
}
@Test
public void testGenotypesToVCFUsingGeliInput() {
List<String> md5 = new ArrayList<String>();
md5.add("71e8c98d7c3a73b6287ecc339086fe03");
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
"-R " + b36KGReference +
" -B:variant,GeliText " + validationDataLocation + "NA12878.1kg.p2.chr1_10mb_11_mb.SLX.lod5.genotypes.geli.calls" +
" -T VariantsToVCF" +
" -L 1:10,000,000-11,000,000" +
" -sample NA123AB" +
" -o %s" +
" -NO_HEADER",
1, // just one output file
md5);
executeTest("testVariantsToVCFUsingGeliInput #2", spec).getFirst();
}
@Test
public void testGenotypesToVCFUsingHapMapInput() {
List<String> md5 = new ArrayList<String>();
md5.add("f343085305e80c7a2493422e4eaad983");
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
"-R " + b36KGReference +
" -B:variant,HapMap " + validationDataLocation + "rawHapMap.yri.chr1.txt" +
" -T VariantsToVCF" +
" -L 1:1-1,000,000" +
" -o %s" +
" -NO_HEADER",
1, // just one output file
md5);
executeTest("testVariantsToVCFUsingHapMapInput", spec).getFirst();
}
@Test
public void testGenotypesToVCFUsingVCFInput() {
List<String> md5 = new ArrayList<String>();
md5.add("86f02e2e764ba35854cff2aa05a1fdd8");
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
"-R " + b36KGReference +
" -B:variant,VCF " + validationDataLocation + "complexExample.vcf4" +
" -T VariantsToVCF" +
" -o %s" +
" -NO_HEADER",
1, // just one output file
md5);
executeTest("testVariantsToVCFUsingVCFInput", spec).getFirst();
}
// TODO -- eric, fix me
// @Test
// public void testVariantsToVCFUsingGeliInput() {
// List<String> md5 = new ArrayList<String>();
// md5.add("4accae035d271b35ee2ec58f403c68c6");
//
// WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
// "-R " + b36KGReference +
// " -B:variant,GeliText " + validationDataLocation + "NA12878.1kg.p2.chr1_10mb_11_mb.SLX.lod5.variants.geli.calls" +
// " -T VariantsToVCF" +
// " -L 1:10,000,000-11,000,000" +
// " -sample NA123AB" +
// " -o %s" +
// " -NO_HEADER",
// 1, // just one output file
// md5);
// executeTest("testVariantsToVCFUsingGeliInput #1", spec).getFirst();
// }
//
// @Test
// public void testGenotypesToVCFUsingGeliInput() {
// List<String> md5 = new ArrayList<String>();
// md5.add("71e8c98d7c3a73b6287ecc339086fe03");
//
// WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
// "-R " + b36KGReference +
// " -B:variant,GeliText " + validationDataLocation + "NA12878.1kg.p2.chr1_10mb_11_mb.SLX.lod5.genotypes.geli.calls" +
// " -T VariantsToVCF" +
// " -L 1:10,000,000-11,000,000" +
// " -sample NA123AB" +
// " -o %s" +
// " -NO_HEADER",
// 1, // just one output file
// md5);
// executeTest("testVariantsToVCFUsingGeliInput #2", spec).getFirst();
// }
//
// @Test
// public void testGenotypesToVCFUsingHapMapInput() {
// List<String> md5 = new ArrayList<String>();
// md5.add("f343085305e80c7a2493422e4eaad983");
//
// WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
// "-R " + b36KGReference +
// " -B:variant,HapMap " + validationDataLocation + "rawHapMap.yri.chr1.txt" +
// " -T VariantsToVCF" +
// " -L 1:1-1,000,000" +
// " -o %s" +
// " -NO_HEADER",
// 1, // just one output file
// md5);
// executeTest("testVariantsToVCFUsingHapMapInput", spec).getFirst();
// }
//
// @Test
// public void testGenotypesToVCFUsingVCFInput() {
// List<String> md5 = new ArrayList<String>();
// md5.add("86f02e2e764ba35854cff2aa05a1fdd8");
//
// WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
// "-R " + b36KGReference +
// " -B:variant,VCF " + validationDataLocation + "complexExample.vcf4" +
// " -T VariantsToVCF" +
// " -o %s" +
// " -NO_HEADER",
// 1, // just one output file
// md5);
// executeTest("testVariantsToVCFUsingVCFInput", spec).getFirst();
// }
}

View File

@ -17,11 +17,11 @@ public class VCFIntegrationTest extends WalkerTest {
String baseCommand = "-R " + b37KGReference + " -NO_HEADER -o %s ";
String test1 = baseCommand + "-T VariantAnnotator -BTI variant -B:variant,vcf " + testVCF;
String test1 = baseCommand + "-T VariantAnnotator -BTI variant --variants:vcf " + testVCF;
WalkerTestSpec spec1 = new WalkerTestSpec(test1, 1, Arrays.asList(md5ofInputVCF));
List<File> result = executeTest("Test Variant Annotator with no changes", spec1).getFirst();
String test2 = baseCommand + "-T VariantsToVCF -B:variant,vcf " + result.get(0).getAbsolutePath();
String test2 = baseCommand + "-T VariantsToVCF --variants:vcf " + result.get(0).getAbsolutePath();
WalkerTestSpec spec2 = new WalkerTestSpec(test2, 1, Arrays.asList(md5ofInputVCF));
executeTest("Test Variants To VCF from new output", spec2);
}