More tools moved over. Fixed the VariantContextIntegrationTest which was not useful because the md5s were all removed. In the future, instead of removing md5s (putting it in 'parameterization' mode), you should instead use @Test{enabled=false} since it's easier to track.

This commit is contained in:
Eric Banks 2011-08-10 14:24:40 -04:00
parent 8d14d32a62
commit 07ad8c78a9
6 changed files with 34 additions and 30 deletions

View File

@ -25,7 +25,9 @@
package org.broadinstitute.sting.gatk.walkers.genotyper;
import org.broadinstitute.sting.commandline.ArgumentCollection;
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,6 +53,9 @@ public class UGCallVariants extends RodWalker<VariantCallContext, Integer> {
@ArgumentCollection
private UnifiedArgumentCollection UAC = new UnifiedArgumentCollection();
@Input(fullName="variant", shortName = "V", doc="Input VCF file", required=true)
public List<RodBinding<VariantContext>> variants;
// control the output
@Output(doc="File to which variants should be written",required=true)
protected VCFWriter writer = null;
@ -63,13 +68,8 @@ public class UGCallVariants extends RodWalker<VariantCallContext, Integer> {
public void initialize() {
for ( ReferenceOrderedDataSource d : getToolkit().getRodDataSources() ) {
if ( d.getName().startsWith("variant") )
trackNames.add(d.getName());
}
if ( trackNames.size() == 0 )
throw new UserException("At least one track bound to a name beginning with 'variant' must be provided.");
for ( RodBinding<VariantContext> rb : variants )
trackNames.add(rb.getName());
Set<String> samples = SampleUtils.getSampleListWithVCFHeader(getToolkit(), trackNames);
UG_engine = new UnifiedGenotyperEngine(getToolkit(), UAC, logger, null, null, samples);
@ -93,11 +93,7 @@ public class UGCallVariants extends RodWalker<VariantCallContext, Integer> {
if ( tracker == null )
return null;
List<VariantContext> VCs = new ArrayList<VariantContext>();
for ( String name : trackNames ) {
VariantContext vc = tracker.getFirstValue(VariantContext.class, name, context.getLocation());
VCs.add(vc);
}
List<VariantContext> VCs = tracker.getValues(variants, context.getLocation());
VariantContext mergedVC = mergeVCsWithGLs(VCs);
if ( mergedVC == null )

View File

@ -25,7 +25,9 @@
package org.broadinstitute.sting.gatk.walkers.qc;
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,6 +56,9 @@ public class RodSystemValidationWalker extends RodWalker<Integer,Integer> {
// the divider to use in some of the text output
private static final String DIVIDER = ",";
@Input(fullName="eval", shortName = "eval", doc="Input VCF eval file", required=true)
public List<RodBinding<VariantContext>> eval;
@Output
public PrintStream out;
@ -108,7 +113,7 @@ public class RodSystemValidationWalker extends RodWalker<Integer,Integer> {
// if the argument was set, check for equivalence
if (allRecordsVariantContextEquivalent && tracker != null) {
Collection<VariantContext> col = tracker.getValues(VariantContext.class);
Collection<VariantContext> col = tracker.getValues(eval);
VariantContext con = null;
for (VariantContext contextInList : col)
if (con == null) con = contextInList;

View File

@ -29,6 +29,7 @@ import org.broad.tribble.Feature;
import org.broad.tribble.TribbleException;
import org.broad.tribble.dbsnp.DbSNPFeature;
import org.broadinstitute.sting.commandline.*;
import org.broadinstitute.sting.gatk.arguments.DbsnpArgumentCollection;
import org.broadinstitute.sting.gatk.arguments.StandardVariantContextInputArgumentCollection;
import org.broadinstitute.sting.gatk.contexts.AlignmentContext;
import org.broadinstitute.sting.gatk.contexts.ReferenceContext;
@ -55,6 +56,9 @@ public class ValidateVariants extends RodWalker<Integer, Integer> {
@ArgumentCollection
protected StandardVariantContextInputArgumentCollection variantCollection = new StandardVariantContextInputArgumentCollection();
@ArgumentCollection
protected DbsnpArgumentCollection dbsnp = new DbsnpArgumentCollection();
public enum ValidationType {
ALL, REF, IDS, ALLELES, CHR_COUNTS
}
@ -137,8 +141,8 @@ public class ValidateVariants extends RodWalker<Integer, Integer> {
// get the RS IDs
Set<String> rsIDs = null;
if ( tracker.hasValues(DbSNPHelper.STANDARD_DBSNP_TRACK_NAME) ) {
List<Feature> dbsnpList = tracker.getValues(Feature.class, DbSNPHelper.STANDARD_DBSNP_TRACK_NAME);
if ( tracker.hasValues(dbsnp.dbsnp) ) {
List<VariantContext> dbsnpList = tracker.getValues(dbsnp.dbsnp, ref.getLocus());
rsIDs = new HashSet<String>();
for ( Object d : dbsnpList ) {
if (d instanceof DbSNPFeature )

View File

@ -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 + " --variant " + testFile + " -o %s -NO_HEADER",
1,
Arrays.asList("d2ba3ea30a810f6f0fbfb1b643292b6a")
);
@ -68,7 +68,7 @@ public class SelectVariantsIntegrationTest extends WalkerTest {
String testFile = validationDataLocation + "combine.3.vcf";
WalkerTestSpec spec = new WalkerTestSpec(
"-T SelectVariants -R " + b36KGReference + " -sn NA12892 -B:variant,VCF " + testFile + " -o %s -NO_HEADER",
"-T SelectVariants -R " + b36KGReference + " -sn NA12892 --variant " + testFile + " -o %s -NO_HEADER",
1,
Arrays.asList("")
);

View File

@ -95,7 +95,7 @@ public class ValidateVariantsIntegrationTest extends WalkerTest {
@Test
public void testBadID() {
WalkerTestSpec spec = new WalkerTestSpec(
baseTestString("validationExampleBad.vcf", "IDS") + " -B:dbsnp,vcf " + b36dbSNP129,
baseTestString("validationExampleBad.vcf", "IDS") + " --dbsnp " + b36dbSNP129,
0,
UserException.MalformedFile.class
);

View File

@ -15,8 +15,7 @@ public class VariantContextIntegrationTest extends WalkerTest {
" -R " + b36KGReference;
private static String root = cmdRoot +
" -L 1:1-1,000,000 -B:dbsnp,vcf " + b36dbSNP129 +
" -B:vcf,VCF3 " + validationDataLocation + "yri.trio.gatk_glftrio.intersection.annotated.filtered.chr1.vcf";
" -L 1:1-1,000,000 -V " + b36dbSNP129;
private static final class VCITTest extends TestDataProvider {
String args, md5;
@ -30,15 +29,15 @@ public class VariantContextIntegrationTest extends WalkerTest {
@DataProvider(name = "VCITTestData")
public Object[][] createVCITTestData() {
new VCITTest("--printPerLocus", "");
new VCITTest("--printPerLocus --onlyContextsOfType SNP", "");
new VCITTest("--printPerLocus --onlyContextsOfType INDEL", "");
new VCITTest("--printPerLocus --onlyContextsOfType MIXED", "");
new VCITTest("--printPerLocus --onlyContextsOfType NO_VARIATION", "");
new VCITTest("--printPerLocus --takeFirstOnly", "");
new VCITTest("--printPerLocus --onlyContextsOfType INDEL --onlyContextsStartinAtCurrentPosition", "");
new VCITTest("--printPerLocus --onlyContextsStartinAtCurrentPosition", "");
new VCITTest("--printPerLocus --takeFirstOnly --onlyContextsStartinAtCurrentPosition", "");
new VCITTest("--printPerLocus", "e9d0f1fe80659bb55b40aa6c3a2e921e");
new VCITTest("--printPerLocus --onlyContextsOfType SNP", "0e620db3e45771df42c54a9c0ae4a29f");
new VCITTest("--printPerLocus --onlyContextsOfType INDEL", "b725c204fefe3814644d50e7c20f9dfe");
new VCITTest("--printPerLocus --onlyContextsOfType MIXED", "3ccc33f496a1718df55722d11cc14334");
new VCITTest("--printPerLocus --onlyContextsOfType NO_VARIATION", "39335acdb34c8a2af433dc50d619bcbc");
new VCITTest("--printPerLocus --takeFirstOnly", "3a45561da042b2b44b6a679744f16103");
new VCITTest("--printPerLocus --onlyContextsOfType INDEL --onlyContextsStartinAtCurrentPosition", "4746f269ecc377103f83eb61cc162c39");
new VCITTest("--printPerLocus --onlyContextsStartinAtCurrentPosition", "2749e3fae458650a85a2317e346dc44c");
new VCITTest("--printPerLocus --takeFirstOnly --onlyContextsStartinAtCurrentPosition", "9bd48c2a40813023e29ffaa23d59d382");
return VCITTest.getTests(VCITTest.class);
}
@ -58,7 +57,7 @@ public class VariantContextIntegrationTest extends WalkerTest {
public void testToVCF() {
// this really just tests that we are seeing the same number of objects over all of chr1
WalkerTestSpec spec = new WalkerTestSpec( cmdRoot + " -NO_HEADER -B:vcf,VCF3 " + validationDataLocation + "yri.trio.gatk_glftrio.intersection.annotated.filtered.chr1.500.vcf -L 1:1-1000000 -o %s --outputVCF %s",
WalkerTestSpec spec = new WalkerTestSpec( cmdRoot + " -NO_HEADER -V:VCF3 " + validationDataLocation + "yri.trio.gatk_glftrio.intersection.annotated.filtered.chr1.500.vcf -L 1:1-1000000 -o %s --outputVCF %s",
2, // just one output file
Arrays.asList("e3c35d0c4b5d4935c84a270f9df0951f", "ff91731213fd0bbdc200ab6fd1c93e63"));
executeTest("testToVCF", spec);