2 unrelated changes: 1) fix the variant context adaptor for dbsnp; conversion of deletions was totally broken. 2) stop using paths that include gsa-scr1 in integration tests.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@6070 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
droazen 2011-06-22 22:56:07 +00:00
parent d92055d1f9
commit 658e65d26c
8 changed files with 34 additions and 22 deletions

View File

@ -13,8 +13,11 @@ import org.broadinstitute.sting.gatk.contexts.ReferenceContext;
import org.broadinstitute.sting.gatk.contexts.variantcontext.VariantContextUtils;
import org.broadinstitute.sting.gatk.refdata.utils.helpers.DbSNPHelper;
import org.broadinstitute.sting.utils.classloader.PluginManager;
import org.broadinstitute.sting.utils.exceptions.ReviewedStingException;
import javax.xml.stream.events.Attribute;
import java.util.*;
import java.util.jar.Attributes;
/**
* A terrible but temporary approach to converting objects to VariantContexts. If you want to add a converter,
@ -123,10 +126,16 @@ public class VariantContextAdaptors {
alleles.add(Allele.create(alt, false));
}
Map<String, String> attributes = new HashMap<String, String>();
Map<String, Object> attributes = new HashMap<String, Object>();
attributes.put(VariantContext.ID_KEY, dbsnp.getRsID());
if ( DbSNPHelper.isDeletion(dbsnp) ) {
int index = ref.getLocus().getStart() - ref.getWindow().getStart() - 1;
if ( index < 0 )
throw new ReviewedStingException("DbSNP conversion requested using a reference context with no window; we will fail to convert deletions");
attributes.put(VariantContext.REFERENCE_BASE_FOR_INDEL_KEY, new Byte(ref.getBases()[index]));
}
Collection<Genotype> genotypes = null;
VariantContext vc = new VariantContext(name, dbsnp.getChr(),dbsnp.getStart(),dbsnp.getEnd(), alleles, genotypes, VariantContext.NO_NEG_LOG_10PERROR, null, attributes);
VariantContext vc = new VariantContext(name, dbsnp.getChr(),dbsnp.getStart() - (DbSNPHelper.isDeletion(dbsnp) ? 1 : 0),dbsnp.getEnd(), alleles, genotypes, VariantContext.NO_NEG_LOG_10PERROR, null, attributes);
return vc;
} else
return null; // can't handle anything else

View File

@ -42,7 +42,7 @@ import java.util.Collection;
* allows for a "snpmask" ROD to set overlapping bases to 'N'.
*/
@WalkerName("FastaAlternateReferenceMaker")
@Reference(window=@Window(start=0,stop=50))
@Reference(window=@Window(start=-1,stop=50))
@Requires(value={DataSource.REFERENCE})
public class FastaAlternateReferenceWalker extends FastaReferenceWalker {

View File

@ -31,9 +31,11 @@ import org.broad.tribble.vcf.VCFWriter;
import org.broadinstitute.sting.gatk.contexts.AlignmentContext;
import org.broadinstitute.sting.gatk.contexts.ReferenceContext;
import org.broadinstitute.sting.gatk.refdata.*;
import org.broadinstitute.sting.gatk.walkers.Reference;
import org.broadinstitute.sting.gatk.walkers.RodWalker;
import org.broadinstitute.sting.commandline.Argument;
import org.broadinstitute.sting.commandline.Output;
import org.broadinstitute.sting.gatk.walkers.Window;
import java.util.EnumSet;
import java.io.File;
@ -42,6 +44,7 @@ import java.io.PrintStream;
/**
* Test routine for new VariantContext object
*/
@Reference(window=@Window(start=-1,stop=1))
public class TestVariantContextWalker extends RodWalker<Integer, Integer> {
@Output
PrintStream out;
@ -55,7 +58,7 @@ public class TestVariantContextWalker extends RodWalker<Integer, Integer> {
@Argument(fullName="onlyContextsStartinAtCurrentPosition", doc="Only take variant contexts at actually start at the current position, excluding those at span to the current location but start earlier", required=false)
boolean onlyContextsStartinAtCurrentPosition = false;
@Argument(fullName="printPerLocus", doc="If true, we'll psetenv LD_LIBRARY_PATH .:/util/gcc-4.3.0/lib64:/util/gcc-4.3.0/lib/gcc/x86_64-unknown-linux-gnu/4.3.0:/util/gcc-4.3.0/lib/:/util/lib:/broad/tools/Linux/x86_64/pkgs/boost_1.38.0/lib:/humgen/gsa-scr1/GATK_Data/bwarint the variant contexts, in addition to counts", required=false)
@Argument(fullName="printPerLocus", doc="If true, we'll print the variant contexts, in addition to counts", required=false)
boolean printContexts = false;
@Argument(fullName="outputVCF", doc="If provided, we'll convert the first input context into a VCF", required=false)

View File

@ -16,7 +16,7 @@ public class AlignerIntegrationTest extends WalkerTest {
public void testBasicAlignment() {
String md5 = "34eb4323742999d6d250a0aaa803c6d5";
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
"-R /humgen/gsa-scr1/GATK_Data/bwa/human_b36_both.fasta" +
"-R " + GATKDataLocation + "bwa/human_b36_both.fasta" +
" -T Align" +
" -I " + validationDataLocation + "NA12878_Pilot1_20.trimmed.unmapped.bam" +
" -o %s",

View File

@ -14,18 +14,18 @@ public class VariantContextIntegrationTest extends WalkerTest {
" -R " + b36KGReference;
private static String root = cmdRoot +
" -D /humgen/gsa-scr1/GATK_Data/dbsnp_129_b36.rod" +
" -D " + GATKDataLocation + "dbsnp_129_b36.rod" +
" -B:vcf,VCF3 " + validationDataLocation + "yri.trio.gatk_glftrio.intersection.annotated.filtered.chr1.vcf";
static HashMap<String, String> expectations = new HashMap<String, String>();
static {
expectations.put("-L 1:1-10000 --printPerLocus", "26ad6d6695a45c45e8451477fd9476a6");
expectations.put("-L 1:1-10000 --printPerLocus --takeFirstOnly", "47772be91e4392d68aba901438aecdf2");
expectations.put("-L 1:1-10000 --printPerLocus --onlyContextsStartinAtCurrentPosition", "e34688fa2450b0898ce55d0a5323db9a");
expectations.put("-L 1:1-10000 --printPerLocus --takeFirstOnly --onlyContextsStartinAtCurrentPosition", "06505d1b90680862613ad374218b0d25");
expectations.put("-L 1:1-10000 --printPerLocus", "493bf9bcde93c08c8c46f72c8e98cf2f");
expectations.put("-L 1:1-10000 --printPerLocus --takeFirstOnly", "bd9e062b23c2c48fef8c299dc1d294d5");
expectations.put("-L 1:1-10000 --printPerLocus --onlyContextsStartinAtCurrentPosition", "ceced3f270b4fe407ee83bc9028becde");
expectations.put("-L 1:1-10000 --printPerLocus --takeFirstOnly --onlyContextsStartinAtCurrentPosition", "9a9b9e283553c28bf58de1cafa38fe92");
expectations.put("-L 1:1-10000 --printPerLocus --onlyContextsOfType SNP", "2097e32988d603d3b353b50218c86d3b");
expectations.put("-L 1:1-10000 --printPerLocus --onlyContextsOfType INDEL", "8559d91b3f347c059d829fca1ada439e");
expectations.put("-L 1:1-10000 --printPerLocus --onlyContextsOfType INDEL --onlyContextsStartinAtCurrentPosition", "358330e2b373a38269abdf6e65180c0a");
expectations.put("-L 1:1-10000 --printPerLocus --onlyContextsOfType INDEL", "91c6a9489256d9ce77c8fedf7221a961");
expectations.put("-L 1:1-10000 --printPerLocus --onlyContextsOfType INDEL --onlyContextsStartinAtCurrentPosition", "5e40980c02797f90821317874426a87a");
expectations.put("-L 1:1-10000 --printPerLocus --onlyContextsOfType MIXED", "e5a00766f8c1ff9cf92310bafdec3126");
expectations.put("-L 1:1-10000 --printPerLocus --onlyContextsOfType NO_VARIATION", "39335acdb34c8a2af433dc50d619bcbc");
}

View File

@ -24,13 +24,13 @@ 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,dbsnp /humgen/gsa-scr1/GATK_Data/dbsnp_129_b36.rod -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 -B:snpmask,dbsnp " + GATKDataLocation + "dbsnp_129_b36.rod -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);
WalkerTestSpec spec3 = new WalkerTestSpec(
"-T FastaAlternateReferenceMaker -R " + b36KGReference + " -B:snps,GeliText " + validationDataLocation + "NA12878.chr1_10mb_11mb.slx.geli.calls -B:snpmask,dbsnp /humgen/gsa-scr1/GATK_Data/dbsnp_129_b36.rod -L 1:10,023,400-10,023,500;1:10,029,200-10,029,500 -o %s",
"-T FastaAlternateReferenceMaker -R " + b36KGReference + " -B:snps,GeliText " + validationDataLocation + "NA12878.chr1_10mb_11mb.slx.geli.calls -B:snpmask,dbsnp " + GATKDataLocation + "dbsnp_129_b36.rod -L 1:10,023,400-10,023,500;1:10,029,200-10,029,500 -o %s",
1,
Arrays.asList("82705a88f6fc25880dd2331183531d9a"));
executeTest("testFastaAlternateReferenceSnps", spec3);

View File

@ -30,7 +30,7 @@ public class RecalibrationWalkersIntegrationTest extends WalkerTest {
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
"-R " + b36KGReference +
" --DBSNP /humgen/gsa-scr1/GATK_Data/dbsnp_129_b36.rod" +
" --DBSNP " + GATKDataLocation + "dbsnp_129_b36.rod" +
" -T CountCovariates" +
" -I " + bam +
( bam.equals( validationDataLocation + "NA12878.1kg.p2.chr1_10mb_11_mb.allTechs.bam" )
@ -97,7 +97,7 @@ public class RecalibrationWalkersIntegrationTest extends WalkerTest {
" -standard" +
" -OQ" +
" -recalFile %s" +
" --DBSNP /humgen/gsa-scr1/GATK_Data/dbsnp_129_b36.rod",
" --DBSNP " + GATKDataLocation + "dbsnp_129_b36.rod",
1, // just one output file
Arrays.asList(md5));
executeTest("testCountCovariatesUseOriginalQuals", spec);
@ -146,7 +146,7 @@ public class RecalibrationWalkersIntegrationTest extends WalkerTest {
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
"-R " + b36KGReference +
" --DBSNP /humgen/gsa-scr1/GATK_Data/dbsnp_129_b36.rod" +
" --DBSNP " + GATKDataLocation + "dbsnp_129_b36.rod" +
" -T CountCovariates" +
" -I " + bam +
" -standard" +
@ -254,7 +254,7 @@ public class RecalibrationWalkersIntegrationTest extends WalkerTest {
" -B:anyNameABCD,VCF3 " + validationDataLocation + "vcfexample3.vcf" +
" -T CountCovariates" +
" -I " + bam +
" --DBSNP /humgen/gsa-scr1/GATK_Data/dbsnp_129_b36.rod" +
" --DBSNP " + GATKDataLocation + "dbsnp_129_b36.rod" +
" -L 1:10,000,000-10,200,000" +
" -cov ReadGroupCovariate" +
" -cov QualityScoreCovariate" +
@ -279,7 +279,7 @@ public class RecalibrationWalkersIntegrationTest extends WalkerTest {
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
"-R " + b36KGReference +
" --DBSNP /humgen/gsa-scr1/GATK_Data/dbsnp_129_b36.rod" +
" --DBSNP " + GATKDataLocation + "dbsnp_129_b36.rod" +
" -T CountCovariates" +
" -I " + bam +
" -L 1:10,000,000-10,200,000" +
@ -338,7 +338,7 @@ public class RecalibrationWalkersIntegrationTest extends WalkerTest {
WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
"-R " + b36KGReference +
" --DBSNP /humgen/gsa-scr1/GATK_Data/dbsnp_129_b36.rod" +
" --DBSNP " + GATKDataLocation + "dbsnp_129_b36.rod" +
" -T CountCovariates" +
" -I " + bam +
" -cov ReadGroupCovariate" +

View File

@ -16,7 +16,7 @@ public class RecalibrationWalkersPerformanceTest extends WalkerTest {
" -L chr1:1-50,000,000" +
" -standard" +
" -OQ" +
" --DBSNP /humgen/gsa-scr1/GATK_Data/dbsnp_129_hg18.rod" +
" --DBSNP " + GATKDataLocation + "dbsnp_129_hg18.rod" +
" -recalFile /dev/null" + moreArgs,
0,
new ArrayList<String>(0));
@ -31,7 +31,7 @@ public class RecalibrationWalkersPerformanceTest extends WalkerTest {
" -L " + evaluationDataLocation + "whole_exome_agilent_designed_120.targets.chr1.interval_list" +
" -standard" +
" -OQ" +
" --DBSNP /humgen/gsa-scr1/GATK_Data/dbsnp_129_hg18.rod" +
" --DBSNP " + GATKDataLocation + "dbsnp_129_hg18.rod" +
" -recalFile /dev/null" + moreArgs,
0,
new ArrayList<String>(0));