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
This commit is contained in:
hanna 2011-01-26 23:48:04 +00:00
parent 466f8f8a3c
commit 4a33cdacde
3 changed files with 28 additions and 16 deletions

View File

@ -247,4 +247,11 @@ public class WalkerTest extends BaseTest {
}
}
}
protected File createTempFileFromBase(String name) {
File fl = new File(name);
fl.deleteOnExit();
return fl;
}
}

View File

@ -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;
}
}

View File

@ -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.<String>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.<String>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);
}