Moving VQSR v2 to core.
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5740 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
44a717f63a
commit
23cd3a7a5d
|
|
@ -23,7 +23,7 @@
|
||||||
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.broadinstitute.sting.playground.gatk.walkers.variantrecalibration;
|
package org.broadinstitute.sting.gatk.walkers.variantrecalibration;
|
||||||
|
|
||||||
import org.broad.tribble.util.variantcontext.VariantContext;
|
import org.broad.tribble.util.variantcontext.VariantContext;
|
||||||
import org.broad.tribble.vcf.*;
|
import org.broad.tribble.vcf.*;
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package org.broadinstitute.sting.playground.gatk.walkers.variantrecalibration;
|
package org.broadinstitute.sting.gatk.walkers.variantrecalibration;
|
||||||
|
|
||||||
import Jama.Matrix;
|
import Jama.Matrix;
|
||||||
import cern.jet.random.Normal;
|
import cern.jet.random.Normal;
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package org.broadinstitute.sting.playground.gatk.walkers.variantrecalibration;
|
package org.broadinstitute.sting.gatk.walkers.variantrecalibration;
|
||||||
|
|
||||||
import Jama.Matrix;
|
import Jama.Matrix;
|
||||||
import org.apache.commons.math.special.Gamma;
|
import org.apache.commons.math.special.Gamma;
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package org.broadinstitute.sting.playground.gatk.walkers.variantrecalibration;
|
package org.broadinstitute.sting.gatk.walkers.variantrecalibration;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.broadinstitute.sting.commandline.Tags;
|
import org.broadinstitute.sting.commandline.Tags;
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.broadinstitute.sting.playground.gatk.walkers.variantrecalibration;
|
package org.broadinstitute.sting.gatk.walkers.variantrecalibration;
|
||||||
|
|
||||||
import org.broadinstitute.sting.utils.exceptions.UserException;
|
import org.broadinstitute.sting.utils.exceptions.UserException;
|
||||||
import org.broadinstitute.sting.utils.exceptions.ReviewedStingException;
|
import org.broadinstitute.sting.utils.exceptions.ReviewedStingException;
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package org.broadinstitute.sting.playground.gatk.walkers.variantrecalibration;
|
package org.broadinstitute.sting.gatk.walkers.variantrecalibration;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.broadinstitute.sting.utils.exceptions.UserException;
|
import org.broadinstitute.sting.utils.exceptions.UserException;
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package org.broadinstitute.sting.playground.gatk.walkers.variantrecalibration;
|
package org.broadinstitute.sting.gatk.walkers.variantrecalibration;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
import org.broad.tribble.util.variantcontext.VariantContext;
|
import org.broad.tribble.util.variantcontext.VariantContext;
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package org.broadinstitute.sting.playground.gatk.walkers.variantrecalibration;
|
package org.broadinstitute.sting.gatk.walkers.variantrecalibration;
|
||||||
|
|
||||||
import cern.jet.random.Normal;
|
import cern.jet.random.Normal;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package org.broadinstitute.sting.playground.gatk.walkers.variantrecalibration;
|
package org.broadinstitute.sting.gatk.walkers.variantrecalibration;
|
||||||
|
|
||||||
import org.broadinstitute.sting.utils.GenomeLoc;
|
import org.broadinstitute.sting.utils.GenomeLoc;
|
||||||
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.broadinstitute.sting.playground.gatk.walkers.variantrecalibration;
|
package org.broadinstitute.sting.gatk.walkers.variantrecalibration;
|
||||||
|
|
||||||
import org.broad.tribble.util.variantcontext.VariantContext;
|
import org.broad.tribble.util.variantcontext.VariantContext;
|
||||||
import org.broadinstitute.sting.commandline.Argument;
|
import org.broadinstitute.sting.commandline.Argument;
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package org.broadinstitute.sting.playground.gatk.walkers.variantrecalibration;
|
package org.broadinstitute.sting.gatk.walkers.variantrecalibration;
|
||||||
|
|
||||||
import org.broadinstitute.sting.commandline.Argument;
|
import org.broadinstitute.sting.commandline.Argument;
|
||||||
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package org.broadinstitute.sting.playground.gatk.walkers.variantrecalibration;
|
package org.broadinstitute.sting.gatk.walkers.variantrecalibration;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
|
@ -1,12 +1,10 @@
|
||||||
package org.broadinstitute.sting.gatk.walkers.variantrecalibration;
|
package org.broadinstitute.sting.gatk.walkers.variantrecalibration;
|
||||||
|
|
||||||
import org.broadinstitute.sting.WalkerTest;
|
import org.broadinstitute.sting.WalkerTest;
|
||||||
import org.broadinstitute.sting.utils.exceptions.UserException;
|
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
import org.testng.annotations.DataProvider;
|
import org.testng.annotations.DataProvider;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
public class VariantRecalibrationWalkersIntegrationTest extends WalkerTest {
|
public class VariantRecalibrationWalkersIntegrationTest extends WalkerTest {
|
||||||
static HashMap<String, String> clusterFiles = new HashMap<String, String>();
|
static HashMap<String, String> clusterFiles = new HashMap<String, String>();
|
||||||
|
|
@ -15,111 +13,61 @@ public class VariantRecalibrationWalkersIntegrationTest extends WalkerTest {
|
||||||
|
|
||||||
private static class VRTest {
|
private static class VRTest {
|
||||||
String inVCF;
|
String inVCF;
|
||||||
String clusterMD5;
|
|
||||||
String tranchesMD5;
|
String tranchesMD5;
|
||||||
String recalVCFMD5;
|
String recalMD5;
|
||||||
String cutVCFMD5;
|
String cutVCFMD5;
|
||||||
public VRTest(String inVCF, String clusterMD5, String tranchesMD5, String recalVCFMD5, String cutVCFMD5) {
|
public VRTest(String inVCF, String tranchesMD5, String recalMD5, String cutVCFMD5) {
|
||||||
this.inVCF = validationDataLocation + inVCF;
|
this.inVCF = validationDataLocation + inVCF;
|
||||||
this.clusterMD5 = clusterMD5;
|
|
||||||
this.tranchesMD5 = tranchesMD5;
|
this.tranchesMD5 = tranchesMD5;
|
||||||
this.recalVCFMD5 = recalVCFMD5;
|
this.recalMD5 = recalMD5;
|
||||||
this.cutVCFMD5 = cutVCFMD5;
|
this.cutVCFMD5 = cutVCFMD5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VRTest yriTrio = new VRTest("yri.trio.gatk_glftrio.intersection.annotated.filtered.chr1.vcf",
|
VRTest lowPass = new VRTest("phase1.projectConsensus.chr20.raw.snps.vcf",
|
||||||
"f65c27ee40053adc72dd0bfbb628e4d7", // cluster file
|
"920b12d7765eb4f6f4a1bab045679b31", // tranches
|
||||||
"dce581b880ffb6ea39cbada1ecc95915", // tranches
|
"41bbc5f07c8a9573d5bb638f01808bba", // recal file
|
||||||
"c3e8a2f43656eab7d847dbf850f844a6", // recalVCF
|
"d9aa7a0f8fb886df4394f1636605adca"); // cut VCF
|
||||||
"50f752a72643db9ad0aa94b3fc4e23d6"); // cut VCF
|
|
||||||
|
|
||||||
VRTest lowPass = new VRTest("lowpass.N3.chr1.raw.vcf",
|
|
||||||
"bda8f17cfc19d23e7e51f99e547f4b3d", // cluster file
|
|
||||||
"66edae83c50f4e8601fef7fafba774af", // tranches
|
|
||||||
"0123537e373657386068a534c0f5c91b", // recalVCF
|
|
||||||
"2172368e8585841e5ad96c95d0827c4b"); // cut VCF
|
|
||||||
|
|
||||||
@DataProvider(name = "VRTest")
|
@DataProvider(name = "VRTest")
|
||||||
public Object[][] createData1() {
|
public Object[][] createData1() {
|
||||||
return new Object[][]{ {yriTrio}, {lowPass} };
|
return new Object[][]{ {lowPass} };
|
||||||
|
//return new Object[][]{ {yriTrio}, {lowPass} }; // Add hg19 chr20 trio calls here
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(dataProvider = "VRTest", enabled = true)
|
@Test(dataProvider = "VRTest")
|
||||||
public void testGenerateVariantClusters(VRTest params) {
|
|
||||||
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
|
|
||||||
"-R " + b36KGReference +
|
|
||||||
" -NO_HEADER" +
|
|
||||||
" --DBSNP " + GATKDataLocation + "dbsnp_129_b36.rod" +
|
|
||||||
" -B:hapmap,VCF " + comparisonDataLocation + "Validated/HapMap/3.2/sites_r27_nr.b36_fwd.vcf" +
|
|
||||||
" -weightDBSNP 1.0 -weightHapMap 1.0" +
|
|
||||||
" -T GenerateVariantClusters" +
|
|
||||||
" -B:input,VCF " + params.inVCF +
|
|
||||||
" -L 1:50,000,000-200,000,000" +
|
|
||||||
" -qual 50.0" +
|
|
||||||
" --ignore_filter GATK_STANDARD" +
|
|
||||||
" -an QD -an MQ -an SB" +
|
|
||||||
" -clusterFile %s",
|
|
||||||
Arrays.asList(params.clusterMD5));
|
|
||||||
executeTest("testGenerateVariantClusters-"+params.inVCF, spec).getFirst();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test(dataProvider = "VRTest",dependsOnMethods="testGenerateVariantClusters")
|
|
||||||
public void testVariantRecalibrator(VRTest params) {
|
public void testVariantRecalibrator(VRTest params) {
|
||||||
//System.out.printf("PARAMS FOR %s is %s%n", vcf, clusterFile);
|
//System.out.printf("PARAMS FOR %s is %s%n", vcf, clusterFile);
|
||||||
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
|
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
|
||||||
"-R " + b36KGReference +
|
"-R " + b37KGReference +
|
||||||
" -NO_HEADER" +
|
" -B:dbsnp,VCF,known=true,training=false,truth=false,prior=10.0 " + GATKDataLocation + "dbsnp_132_b37.leftAligned.vcf" +
|
||||||
" --DBSNP " + GATKDataLocation + "dbsnp_129_b36.rod" +
|
" -B:hapmap,VCF,known=false,training=true,truth=true,prior=15.0 " + comparisonDataLocation + "Validated/HapMap/3.3/sites_r27_nr.b37_fwd.vcf" +
|
||||||
" -B:hapmap,VCF " + comparisonDataLocation + "Validated/HapMap/3.2/sites_r27_nr.b36_fwd.vcf" +
|
" -B:omni,VCF,known=false,training=true,truth=true,prior=12.0 " + comparisonDataLocation + "Validated/Omni2.5_chip/Omni25_sites_1525_samples.b37.vcf" +
|
||||||
" -B:truthHapmap,VCF " + comparisonDataLocation + "Validated/HapMap/3.2/sites_r27_nr.b36_fwd.vcf" +
|
|
||||||
" -T VariantRecalibrator" +
|
" -T VariantRecalibrator" +
|
||||||
" -B:input,VCF " + params.inVCF +
|
" -B:input,VCF " + params.inVCF +
|
||||||
" -L 1:20,000,000-100,000,000" +
|
" -L 20:1,000,000-40,000,000" +
|
||||||
" --ignore_filter GATK_STANDARD" +
|
" -an QD -an HaplotypeScore -an HRun" +
|
||||||
" --ignore_filter HARD_TO_VALIDATE" +
|
" -percentBad 0.07" +
|
||||||
" -clusterFile " + getFileForMD5(params.clusterMD5) +
|
" --trustAllPolymorphic" + // for speed
|
||||||
" -sm TRUTH_SENSITIVITY" +
|
" -recalFile %s" +
|
||||||
" -o %s" +
|
|
||||||
" -tranchesFile %s",
|
" -tranchesFile %s",
|
||||||
Arrays.asList(params.recalVCFMD5, params.tranchesMD5));
|
Arrays.asList(params.recalMD5, params.tranchesMD5));
|
||||||
executeTest("testVariantRecalibrator-"+params.inVCF, spec).getFirst();
|
executeTest("testVariantRecalibrator-"+params.inVCF, spec).getFirst();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(dataProvider = "VRTest",dependsOnMethods="testVariantRecalibrator")
|
@Test(dataProvider = "VRTest",dependsOnMethods="testVariantRecalibrator")
|
||||||
public void testApplyVariantCuts(VRTest params) {
|
public void testApplyRecalibration(VRTest params) {
|
||||||
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
|
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
|
||||||
"-R " + b36KGReference +
|
"-R " + b37KGReference +
|
||||||
|
" -T ApplyRecalibration" +
|
||||||
|
" -L 20:12,000,000-30,000,000" +
|
||||||
" -NO_HEADER" +
|
" -NO_HEADER" +
|
||||||
" --DBSNP " + GATKDataLocation + "dbsnp_129_b36.rod" +
|
" -B:input,VCF " + params.inVCF +
|
||||||
" -T ApplyVariantCuts" +
|
|
||||||
" -L 1:20,000,000-100,000,000" +
|
|
||||||
" -B:input,VCF " + getFileForMD5(params.recalVCFMD5) +
|
|
||||||
" -o %s" +
|
" -o %s" +
|
||||||
" -tranchesFile " + getFileForMD5(params.tranchesMD5),
|
" -tranchesFile " + getFileForMD5(params.tranchesMD5) +
|
||||||
|
" -recalFile " + getFileForMD5(params.recalMD5),
|
||||||
Arrays.asList(params.cutVCFMD5));
|
Arrays.asList(params.cutVCFMD5));
|
||||||
executeTest("testApplyVariantCuts-"+params.inVCF, spec);
|
executeTest("testApplyRecalibration-"+params.inVCF, spec);
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Test()
|
|
||||||
public void testFailWithBadAnnotation() {
|
|
||||||
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
|
|
||||||
"-R " + b36KGReference +
|
|
||||||
" -NO_HEADER" +
|
|
||||||
" --DBSNP " + GATKDataLocation + "dbsnp_129_b36.rod" +
|
|
||||||
" -B:hapmap,VCF " + comparisonDataLocation + "Validated/HapMap/3.2/sites_r27_nr.b36_fwd.vcf" +
|
|
||||||
" -weightDBSNP 0.2 -weightHapMap 1.0" +
|
|
||||||
" -T GenerateVariantClusters" +
|
|
||||||
" -B:input,VCF " + lowPass.inVCF +
|
|
||||||
" -L 1:50,000,000-200,000,000" +
|
|
||||||
" -qual 50.0" +
|
|
||||||
" --ignore_filter GATK_STANDARD" +
|
|
||||||
" -an QD -an HRun -an ThisAnnotationIsBAD" + // There is a bad annotation here
|
|
||||||
" -clusterFile %s",
|
|
||||||
1, // just one output file
|
|
||||||
UserException.MalformedFile.class);
|
|
||||||
executeTest("testFailWithBadAnnotation", spec);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,73 +0,0 @@
|
||||||
package org.broadinstitute.sting.playground.gatk.walkers.variantrecalibration;
|
|
||||||
|
|
||||||
import org.broadinstitute.sting.WalkerTest;
|
|
||||||
import org.testng.annotations.Test;
|
|
||||||
import org.testng.annotations.DataProvider;
|
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
public class VariantRecalibrationWalkersV2IntegrationTest extends WalkerTest {
|
|
||||||
static HashMap<String, String> clusterFiles = new HashMap<String, String>();
|
|
||||||
static HashMap<String, String> tranchesFiles = new HashMap<String, String>();
|
|
||||||
static HashMap<String, String> inputVCFFiles = new HashMap<String, String>();
|
|
||||||
|
|
||||||
private static class VRTest {
|
|
||||||
String inVCF;
|
|
||||||
String tranchesMD5;
|
|
||||||
String recalMD5;
|
|
||||||
String cutVCFMD5;
|
|
||||||
public VRTest(String inVCF, String tranchesMD5, String recalMD5, String cutVCFMD5) {
|
|
||||||
this.inVCF = validationDataLocation + inVCF;
|
|
||||||
this.tranchesMD5 = tranchesMD5;
|
|
||||||
this.recalMD5 = recalMD5;
|
|
||||||
this.cutVCFMD5 = cutVCFMD5;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
VRTest lowPass = new VRTest("phase1.projectConsensus.chr20.raw.snps.vcf",
|
|
||||||
"920b12d7765eb4f6f4a1bab045679b31", // tranches
|
|
||||||
"41bbc5f07c8a9573d5bb638f01808bba", // recal file
|
|
||||||
"d9aa7a0f8fb886df4394f1636605adca"); // cut VCF
|
|
||||||
|
|
||||||
@DataProvider(name = "VRTest")
|
|
||||||
public Object[][] createData1() {
|
|
||||||
return new Object[][]{ {lowPass} };
|
|
||||||
//return new Object[][]{ {yriTrio}, {lowPass} }; // Add hg19 chr20 trio calls here
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test(dataProvider = "VRTest")
|
|
||||||
public void testVariantRecalibrator(VRTest params) {
|
|
||||||
//System.out.printf("PARAMS FOR %s is %s%n", vcf, clusterFile);
|
|
||||||
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
|
|
||||||
"-R " + b37KGReference +
|
|
||||||
" -B:dbsnp,VCF,known=true,training=false,truth=false,prior=10.0 " + GATKDataLocation + "dbsnp_132_b37.leftAligned.vcf" +
|
|
||||||
" -B:hapmap,VCF,known=false,training=true,truth=true,prior=15.0 " + comparisonDataLocation + "Validated/HapMap/3.3/sites_r27_nr.b37_fwd.vcf" +
|
|
||||||
" -B:omni,VCF,known=false,training=true,truth=true,prior=12.0 " + comparisonDataLocation + "Validated/Omni2.5_chip/Omni25_sites_1525_samples.b37.vcf" +
|
|
||||||
" -T VariantRecalibrator" +
|
|
||||||
" -B:input,VCF " + params.inVCF +
|
|
||||||
" -L 20:1,000,000-40,000,000" +
|
|
||||||
" -an QD -an HaplotypeScore -an HRun" +
|
|
||||||
" -percentBad 0.07" +
|
|
||||||
" --trustAllPolymorphic" + // for speed
|
|
||||||
" -recalFile %s" +
|
|
||||||
" -tranchesFile %s",
|
|
||||||
Arrays.asList(params.recalMD5, params.tranchesMD5));
|
|
||||||
executeTest("testVariantRecalibrator-"+params.inVCF, spec).getFirst();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test(dataProvider = "VRTest",dependsOnMethods="testVariantRecalibrator")
|
|
||||||
public void testApplyRecalibration(VRTest params) {
|
|
||||||
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
|
|
||||||
"-R " + b37KGReference +
|
|
||||||
" -T ApplyRecalibration" +
|
|
||||||
" -L 20:12,000,000-30,000,000" +
|
|
||||||
" -NO_HEADER" +
|
|
||||||
" -B:input,VCF " + params.inVCF +
|
|
||||||
" -o %s" +
|
|
||||||
" -tranchesFile " + getFileForMD5(params.tranchesMD5) +
|
|
||||||
" -recalFile " + getFileForMD5(params.recalMD5),
|
|
||||||
Arrays.asList(params.cutVCFMD5));
|
|
||||||
executeTest("testApplyRecalibration-"+params.inVCF, spec);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Loading…
Reference in New Issue