Fixing PrintRODs. Now has input and only prints out one copy of each record

This commit is contained in:
Ryan Poplin 2011-09-08 08:58:37 -04:00
parent 29c968ab60
commit e0020b2b29
2 changed files with 13 additions and 31 deletions

View File

@ -26,21 +26,23 @@
package org.broadinstitute.sting.gatk.walkers;
import org.broad.tribble.Feature;
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.refdata.RefMetaDataTracker;
import org.broadinstitute.sting.gatk.refdata.VariantContextAdaptors;
import org.broadinstitute.sting.gatk.refdata.utils.GATKFeature;
import java.io.PrintStream;
import java.util.Iterator;
/**
* Prints out all of the RODs in the input data set. Data is rendered using the toString() method
* of the given ROD.
*/
public class PrintRODsWalker extends RodWalker<Integer, Integer> {
@Input(fullName="input", shortName = "input", doc="The input ROD which should be printed out.", required=true)
public RodBinding<Feature> input;
@Output
PrintStream out;
@ -62,7 +64,7 @@ public class PrintRODsWalker extends RodWalker<Integer, Integer> {
if ( tracker == null )
return 0;
for ( Feature feature : tracker.getValues(Feature.class) ) {
for ( Feature feature : tracker.getValues(Feature.class, context.getLocation()) ) {
out.println(feature.toString());
}

View File

@ -32,24 +32,6 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest {
executeTest("test MultiSample Pilot1", spec);
}
// @Test
// todo - currently not working because when calling indels, using GENOTYPE_GIVEN_ALLELES yields a different result than in normal mode. To be fixed when extended events are removed.
public void testMultiSamplePilot2AndRecallingWithAlleles() {
String md5 = "b45636b29891f9df573ad2af6f507ee0";
WalkerTest.WalkerTestSpec spec1 = new WalkerTest.WalkerTestSpec(
baseCommand + " -I " + validationDataLocation + "pilot2_daughters.chr20.10k-11k.bam -o %s -L 20:10,000,000-10,050,000", 1,
Arrays.asList(md5));
List<File> result = executeTest("test MultiSample Pilot2", spec1).getFirst();
GenomeAnalysisEngine.resetRandomGenerator();
WalkerTest.WalkerTestSpec spec2 = new WalkerTest.WalkerTestSpec(
baseCommand + " --genotyping_mode GENOTYPE_GIVEN_ALLELES -alleles " + result.get(0).getAbsolutePath() + " -I " + validationDataLocation + "pilot2_daughters.chr20.10k-11k.bam -o %s -L 20:10,000,000-10,050,000", 1,
Arrays.asList(md5));
executeTest("test MultiSample Pilot2 with alleles passed in", spec2);
}
@Test
public void testWithAllelesPassedIn() {
WalkerTest.WalkerTestSpec spec1 = new WalkerTest.WalkerTestSpec(
@ -87,15 +69,6 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest {
executeTest("test compressed output", spec);
}
// todo -- fixme
// @Test
// public void testCompressedOutputParallel() {
// WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec(
// baseCommand + " -I " + validationDataLocation + "NA12878.1kg.p2.chr1_10mb_11_mb.SLX.bam -o %s -L 1:10,000,000-10,100,000 -nt 4", 1,
// Arrays.asList("gz"), Arrays.asList(COMPRESSED_OUTPUT_MD5));
// executeTest("testCompressedOutput-nt4", spec);
// }
// --------------------------------------------------------------------------------------------------------------
//
// testing parallelization
@ -296,6 +269,13 @@ public class UnifiedGenotyperIntegrationTest extends WalkerTest {
"pilot2_daughters.chr20.10k-11k.bam -o %s -L 20:10,000,000-10,100,000", 1,
Arrays.asList("94977d6e42e764280e9deaf4e3ac8c80"));
executeTest("test MultiSample Pilot2 indels with alleles passed in and emitting all sites", spec2);
WalkerTest.WalkerTestSpec spec3 = new WalkerTest.WalkerTestSpec(
baseCommandIndels + " --genotyping_mode GENOTYPE_GIVEN_ALLELES -alleles " + validationDataLocation + "indelAllelesForUG.vcf -I " + validationDataLocation +
"pilot2_daughters.chr20.10k-11k.bam -o %s -L 20:10,000,000-10,100,000", 1,
Arrays.asList("408d3aba4d094c067fc00a43992c2292"));
executeTest("test MultiSample Pilot2 indels with complicated records", spec3);
}