From 4a33cdacde638d28a2baedb9a0caadae878587d1 Mon Sep 17 00:00:00 2001 From: hanna Date: Wed, 26 Jan 2011 23:48:04 +0000 Subject: [PATCH] Some basic integration tests detecting breakage in OTF BAM index generation. Doing it manually for the moment so that there's at least something testing this capability; will followup eventually with Mark to see whether we can shape the VCF index generation code in such a way that it supports BAM index testing as well. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5093 348d0f76-0448-11de-a6fe-93d51630548a --- .../org/broadinstitute/sting/WalkerTest.java | 7 +++++ .../DepthOfCoverageIntegrationTest.java | 6 ---- .../interval/IntervalIntegrationTest.java | 31 +++++++++++++------ 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/java/test/org/broadinstitute/sting/WalkerTest.java b/java/test/org/broadinstitute/sting/WalkerTest.java index 70307230f..eebddae1d 100755 --- a/java/test/org/broadinstitute/sting/WalkerTest.java +++ b/java/test/org/broadinstitute/sting/WalkerTest.java @@ -247,4 +247,11 @@ public class WalkerTest extends BaseTest { } } } + + + protected File createTempFileFromBase(String name) { + File fl = new File(name); + fl.deleteOnExit(); + return fl; + } } diff --git a/java/test/org/broadinstitute/sting/gatk/walkers/coverage/DepthOfCoverageIntegrationTest.java b/java/test/org/broadinstitute/sting/gatk/walkers/coverage/DepthOfCoverageIntegrationTest.java index 69281fdad..74c990c44 100644 --- a/java/test/org/broadinstitute/sting/gatk/walkers/coverage/DepthOfCoverageIntegrationTest.java +++ b/java/test/org/broadinstitute/sting/gatk/walkers/coverage/DepthOfCoverageIntegrationTest.java @@ -94,10 +94,4 @@ public class DepthOfCoverageIntegrationTest extends WalkerTest { execute("testNoCoverageDueToFiltering",spec); } - - public File createTempFileFromBase(String name) { - File fl = new File(name); - fl.deleteOnExit(); - return fl; - } } diff --git a/java/test/org/broadinstitute/sting/utils/interval/IntervalIntegrationTest.java b/java/test/org/broadinstitute/sting/utils/interval/IntervalIntegrationTest.java index 638710ad4..1013417cc 100644 --- a/java/test/org/broadinstitute/sting/utils/interval/IntervalIntegrationTest.java +++ b/java/test/org/broadinstitute/sting/utils/interval/IntervalIntegrationTest.java @@ -27,6 +27,7 @@ package org.broadinstitute.sting.utils.interval; import org.broadinstitute.sting.WalkerTest; import org.testng.annotations.Test; +import java.io.File; import java.util.Arrays; import java.util.Collections; @@ -63,31 +64,41 @@ public class IntervalIntegrationTest extends WalkerTest { @Test public void testUnmappedReadInclusion() { - String md5 = "fcd11cfa8474472c617d400623a30fcd"; WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( "-T PrintReads" + " -I " + validationDataLocation + "MV1994.bam" + " -R " + validationDataLocation + "Escherichia_coli_K12_MG1655.fasta" + " -L unmapped" + - " -o %s" + - " -U", - 1, // just one output file - Arrays.asList(md5)); + " -U --index_output_bam_on_the_fly", + 0, // two output files + Collections.emptyList()); + + // our base file + File baseOutputFile = createTempFile("testUnmappedReadInclusion",".bam"); + this.setOutputFileLocation(baseOutputFile); + spec.addAuxFile("fcd11cfa8474472c617d400623a30fcd",createTempFileFromBase(baseOutputFile.getAbsolutePath())); + spec.addAuxFile("3d1f077727e6b68e20a2095d034e56d7", createTempFileFromBase(baseOutputFile.getAbsolutePath().substring(0,baseOutputFile.getAbsolutePath().indexOf(".bam"))+".bai")); + executeTest("testUnmappedReadInclusion",spec); } @Test(enabled = true) public void testUnmappedReadExclusion() { - String md5 = "3153593c9f9ff80a8551fff5655e65ec"; WalkerTest.WalkerTestSpec spec = new WalkerTest.WalkerTestSpec( "-T PrintReads" + " -I " + validationDataLocation + "MV1994.bam" + " -R " + validationDataLocation + "Escherichia_coli_K12_MG1655.fasta" + " -XL unmapped" + - " -o %s" + - " -U", - 1, // just one output file - Arrays.asList(md5)); + " -U --index_output_bam_on_the_fly", + 0, // two output files + Collections.emptyList()); + + // our base file + File baseOutputFile = createTempFile("testUnmappedReadExclusion",".bam"); + this.setOutputFileLocation(baseOutputFile); + spec.addAuxFile("3153593c9f9ff80a8551fff5655e65ec",createTempFileFromBase(baseOutputFile.getAbsolutePath())); + spec.addAuxFile("7fc574ac72211623e4df74d9f75a4e48", createTempFileFromBase(baseOutputFile.getAbsolutePath().substring(0,baseOutputFile.getAbsolutePath().indexOf(".bam"))+".bai")); + executeTest("testUnmappedReadExclusion",spec); }