From bc2d4f554d36fb858b48fff70a4af7ce674d1bda Mon Sep 17 00:00:00 2001 From: Eric Banks Date: Tue, 9 Aug 2011 23:21:17 -0400 Subject: [PATCH] Bringing Indel Realigner up to speed with the new rod binding syntax; now use -known to specify the known indels track. --- .../sting/gatk/walkers/indels/IndelRealigner.java | 12 ++++++------ .../indels/IndelRealignerIntegrationTest.java | 6 +++--- .../indels/IndelRealignerPerformanceTest.java | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/public/java/src/org/broadinstitute/sting/gatk/walkers/indels/IndelRealigner.java b/public/java/src/org/broadinstitute/sting/gatk/walkers/indels/IndelRealigner.java index 61f21c488..cb7627888 100755 --- a/public/java/src/org/broadinstitute/sting/gatk/walkers/indels/IndelRealigner.java +++ b/public/java/src/org/broadinstitute/sting/gatk/walkers/indels/IndelRealigner.java @@ -30,10 +30,7 @@ import net.sf.samtools.*; import net.sf.samtools.util.RuntimeIOException; import net.sf.samtools.util.SequenceUtil; import net.sf.samtools.util.StringUtil; -import org.broadinstitute.sting.commandline.Argument; -import org.broadinstitute.sting.commandline.Hidden; -import org.broadinstitute.sting.commandline.Input; -import org.broadinstitute.sting.commandline.Output; +import org.broadinstitute.sting.commandline.*; import org.broadinstitute.sting.gatk.GenomeAnalysisEngine; import org.broadinstitute.sting.gatk.arguments.ValidationExclusion; import org.broadinstitute.sting.gatk.contexts.ReferenceContext; @@ -86,6 +83,9 @@ public class IndelRealigner extends ReadWalker { USE_SW } + @Input(fullName="known", shortName = "known", doc="Input VCF file with known indels", required=false) + public RodBinding known = RodBinding.makeUnbound(VariantContext.class); + @Input(fullName="targetIntervals", shortName="targetIntervals", doc="intervals file output from RealignerTargetCreator", required=true) protected String intervalsFile = null; @@ -558,8 +558,8 @@ public class IndelRealigner extends ReadWalker { if ( indelRodsSeen.contains(rod) ) continue; indelRodsSeen.add(rod); - if ( VariantContextAdaptors.canBeConvertedToVariantContext(rod)) - knownIndelsToTry.add(VariantContextAdaptors.toVariantContext("", rod, ref)); + if ( rod instanceof VariantContext ) + knownIndelsToTry.add((VariantContext)rod); } } } diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/indels/IndelRealignerIntegrationTest.java b/public/java/test/org/broadinstitute/sting/gatk/walkers/indels/IndelRealignerIntegrationTest.java index 19dc99682..28e5a15de 100755 --- a/public/java/test/org/broadinstitute/sting/gatk/walkers/indels/IndelRealignerIntegrationTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/walkers/indels/IndelRealignerIntegrationTest.java @@ -28,7 +28,7 @@ public class IndelRealignerIntegrationTest extends WalkerTest { executeTest("test realigner defaults", spec1); WalkerTestSpec spec2 = new WalkerTestSpec( - baseCommand + "-B:indels,vcf " + knownIndels, + baseCommand + "-known " + knownIndels, 1, Arrays.asList(base_md5_with_SW_or_VCF)); executeTest("test realigner defaults with VCF", spec2); @@ -37,7 +37,7 @@ public class IndelRealignerIntegrationTest extends WalkerTest { @Test public void testKnownsOnly() { WalkerTestSpec spec1 = new WalkerTestSpec( - baseCommand + "--consensusDeterminationModel KNOWNS_ONLY -B:indels,vcf " + knownIndels, + baseCommand + "--consensusDeterminationModel KNOWNS_ONLY -known " + knownIndels, 1, Arrays.asList("3dd5d2c9931b375455af0bff1a2c4888")); executeTest("realigner known indels only from VCF", spec1); @@ -46,7 +46,7 @@ public class IndelRealignerIntegrationTest extends WalkerTest { @Test public void testUseSW() { WalkerTestSpec spec1 = new WalkerTestSpec( - baseCommand + "--consensusDeterminationModel USE_SW -B:indels,vcf " + knownIndels, + baseCommand + "--consensusDeterminationModel USE_SW -known " + knownIndels, 1, Arrays.asList(base_md5_with_SW_or_VCF)); executeTest("realigner use SW from VCF", spec1); diff --git a/public/java/test/org/broadinstitute/sting/gatk/walkers/indels/IndelRealignerPerformanceTest.java b/public/java/test/org/broadinstitute/sting/gatk/walkers/indels/IndelRealignerPerformanceTest.java index 200b9b5a7..77675b0f4 100755 --- a/public/java/test/org/broadinstitute/sting/gatk/walkers/indels/IndelRealignerPerformanceTest.java +++ b/public/java/test/org/broadinstitute/sting/gatk/walkers/indels/IndelRealignerPerformanceTest.java @@ -30,7 +30,7 @@ public class IndelRealignerPerformanceTest extends WalkerTest { " -LOD 5" + " -maxConsensuses 100" + " -greedy 100" + - " -dbsnp:vcf " + GATKDataLocation + "dbsnp_132.hg18.vcf" + + " -known " + GATKDataLocation + "dbsnp_132.hg18.vcf" + " -o /dev/null" + " -I " + evaluationDataLocation + "NA12878.GAII.chr1.50MB.bam" + " -L chr1:1-5,650,000" + @@ -45,7 +45,7 @@ public class IndelRealignerPerformanceTest extends WalkerTest { " -LOD 5" + " -maxConsensuses 100" + " -greedy 100" + - " -dbsnp:vcf " + GATKDataLocation + "dbsnp_132.hg18.vcf" + + " -known " + GATKDataLocation + "dbsnp_132.hg18.vcf" + " -o /dev/null" + " -I " + evaluationDataLocation + "NA12878.ESP.WEx.chr1.bam" + " -L chr1:1-150,000,000" +