Moved parallel tests from SelectVariants to separate SelectVariantsParallelIntegrationTest

-- Enabled previous tests -- all now working
-- Added modern test against new VCF as well
This commit is contained in:
Mark DePristo 2012-07-02 11:40:28 -04:00
parent bcd2e13d8b
commit 602729c09d
2 changed files with 59 additions and 30 deletions

View File

@ -167,36 +167,6 @@ public class SelectVariantsIntegrationTest extends WalkerTest {
executeTest("testNoGTs--" + testFile, spec);
}
@Test(enabled = false)
public void testParallelization2() {
String testfile = validationDataLocation + "test.filtered.maf_annotated.vcf";
String samplesFile = validationDataLocation + "SelectVariants.samples.txt";
WalkerTestSpec spec;
spec = new WalkerTestSpec(
baseTestString(" -sn A -se '[CDH]' -sf " + samplesFile + " -env -ef -select 'DP < 250' --variant " + testfile + " -nt 2"),
1,
Arrays.asList("433eccaf1ac6e6be500ef0984a5d8d8b")
);
spec.disableShadowBCF();
executeTest("testParallelization (2 threads)--" + testfile, spec);
}
@Test(enabled = false)
public void testParallelization4() {
String testfile = validationDataLocation + "test.filtered.maf_annotated.vcf";
String samplesFile = validationDataLocation + "SelectVariants.samples.txt";
WalkerTestSpec spec;
spec = new WalkerTestSpec(
baseTestString(" -sn A -se '[CDH]' -sf " + samplesFile + " -env -ef -select 'DP < 250' --variant " + testfile + " -nt 4"),
1,
Arrays.asList("433eccaf1ac6e6be500ef0984a5d8d8b")
);
spec.disableShadowBCF();
executeTest("testParallelization (4 threads)--" + testfile, spec);
}
@Test
public void testSelectFromMultiAllelic() {
String testfile = privateTestDir + "multi-allelic.bi-allelicInGIH.vcf";

View File

@ -0,0 +1,59 @@
package org.broadinstitute.sting.gatk.walkers.variantutils;
import org.broadinstitute.sting.WalkerTest;
import org.broadinstitute.sting.utils.exceptions.UserException;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import java.util.Arrays;
public class SelectVariantsParallelIntegrationTest extends WalkerTest {
private class ParallelSelectTestProvider extends TestDataProvider {
final String reference;
final String args;
final String md5;
final int nt;
private ParallelSelectTestProvider(final String reference, final String args, final String md5, final int nt) {
super(ParallelSelectTestProvider.class);
this.reference = reference;
this.args = args;
this.md5 = md5;
this.nt = nt;
}
public final String getCmdLine() {
return "-T SelectVariants -R " + reference + " -o %s -L 1 --no_cmdline_in_header -nt " + nt + " " + args;
}
public String toString() {
return String.format("ParallelSelectVariants nt=%d args=%s", nt, args);
}
}
@DataProvider(name = "ParallelSelectTest")
public Object[][] makeParallelSelectTestProvider() {
for ( int nt : Arrays.asList(1, 2, 4) ) {
{ // original MAF test
String testfile = validationDataLocation + "test.filtered.maf_annotated.vcf";
String samplesFile = validationDataLocation + "SelectVariants.samples.txt";
String args = " -sn A -se '[CDH]' -sf " + samplesFile + " -env -ef -select 'DP < 250' --variant " + testfile;
new ParallelSelectTestProvider(b36KGReference, args, "4386fbb258dcef4437495a37f5a83c53", nt);
}
{ // new tests on b37 using testdir VCF
final String testfile = privateTestDir + "NA12878.hg19.example1.vcf";
final String args = "-select 'DP > 30' -V " + testfile;
new ParallelSelectTestProvider(b37KGReference, args, "c64b45a14d41b1e5cddbe036b47e7519", nt);
}
}
return ParallelSelectTestProvider.getTests(ParallelSelectTestProvider.class);
}
@Test(dataProvider = "ParallelSelectTest")
public void testParallelSelectTestProvider(final ParallelSelectTestProvider cfg) {
final WalkerTestSpec spec = new WalkerTestSpec( cfg.getCmdLine(), 1, Arrays.asList(cfg.md5) );
executeTest(cfg.toString(), spec);
}
}