From 8aca2c5050a29b62e06dd6708632a7d94053e427 Mon Sep 17 00:00:00 2001 From: Dan Moran Date: Thu, 15 Jun 2017 15:22:05 -0400 Subject: [PATCH 1/8] Enable the Intel Inflater / Deflater by default. --- .gitignore | 1 + build.gradle | 1 + .../java/picard/cmdline/CommandLineProgram.java | 38 +++++++++++++++------- 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 59a855917..e8638e3db 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ report jacoco.data .gradle build +*.bai diff --git a/build.gradle b/build.gradle index 216423f40..fcee826dd 100644 --- a/build.gradle +++ b/build.gradle @@ -50,6 +50,7 @@ jacoco { final htsjdkVersion = System.getProperty('htsjdk.version', '2.10.1') dependencies { + compile 'com.intel.gkl:gkl:0.5.2' compile 'com.google.guava:guava:15.0' compile 'com.github.samtools:htsjdk:' + htsjdkVersion //tools dependency for doclet requires sdk devel diff --git a/src/main/java/picard/cmdline/CommandLineProgram.java b/src/main/java/picard/cmdline/CommandLineProgram.java index 317aa561e..e6bc81d43 100644 --- a/src/main/java/picard/cmdline/CommandLineProgram.java +++ b/src/main/java/picard/cmdline/CommandLineProgram.java @@ -23,6 +23,8 @@ */ package picard.cmdline; +import com.intel.gkl.compression.IntelDeflaterFactory; +import com.intel.gkl.compression.IntelInflaterFactory; import htsjdk.samtools.Defaults; import htsjdk.samtools.SAMFileWriterFactory; import htsjdk.samtools.SAMFileWriterImpl; @@ -32,10 +34,7 @@ import htsjdk.samtools.metrics.MetricBase; import htsjdk.samtools.metrics.MetricsFile; import htsjdk.samtools.metrics.StringHeader; -import htsjdk.samtools.util.BlockCompressedOutputStream; -import htsjdk.samtools.util.BlockCompressedStreamConstants; -import htsjdk.samtools.util.IOUtil; -import htsjdk.samtools.util.Log; +import htsjdk.samtools.util.*; import htsjdk.variant.variantcontext.writer.Options; import htsjdk.variant.variantcontext.writer.VariantContextWriterBuilder; @@ -102,6 +101,12 @@ @Option(doc="Google Genomics API client_secrets.json file path.", common = true) public String GA4GH_CLIENT_SECRETS="client_secrets.json"; + + @Option(shortName = "jdk_deflater", doc = "Use the JDK Deflater instead of the IntelDeflater for writing BAMs", common = true) + public Boolean USE_JDK_DEFLATER = false; + + @Option(shortName = "jdk_inflater", doc = "Use the JDK Inflater instead of the IntelInflater for reading BAMs", common = true) + public Boolean USE_JDK_INFLATER = false; private final String standardUsagePreamble = CommandLineParser.getStandardUsagePreamble(getClass()); @@ -164,18 +169,27 @@ public int instanceMain(final String[] argv) { } SamReaderFactory.setDefaultValidationStringency(VALIDATION_STRINGENCY); BlockCompressedOutputStream.setDefaultCompressionLevel(COMPRESSION_LEVEL); + if (VALIDATION_STRINGENCY != ValidationStringency.STRICT) VariantContextWriterBuilder.setDefaultOption(Options.ALLOW_MISSING_FIELDS_IN_HEADER); if (MAX_RECORDS_IN_RAM != null) { SAMFileWriterImpl.setDefaultMaxRecordsInRam(MAX_RECORDS_IN_RAM); } - if (CREATE_INDEX){ + if (CREATE_INDEX) { SAMFileWriterFactory.setDefaultCreateIndexWhileWriting(true); } SAMFileWriterFactory.setDefaultCreateMd5File(CREATE_MD5_FILE); + if (!USE_JDK_DEFLATER) { + BlockCompressedOutputStream.setDefaultDeflaterFactory(new IntelDeflaterFactory()); + } + + if (!USE_JDK_INFLATER) { + BlockGunzipper.setDefaultInflaterFactory(new IntelInflaterFactory()); + } + for (final File f : TMP_DIR) { // Intentionally not checking the return values, because it may be that the program does not // need a tmp_dir. If this fails, the problem will be discovered downstream. @@ -190,12 +204,14 @@ public int instanceMain(final String[] argv) { // Output a one liner about who/where and what software/os we're running on try { - System.err.println("[" + new Date() + "] Executing as " + - System.getProperty("user.name") + "@" + InetAddress.getLocalHost().getHostName() + - " on " + System.getProperty("os.name") + " " + System.getProperty("os.version") + - " " + System.getProperty("os.arch") + "; " + System.getProperty("java.vm.name") + - " " + System.getProperty("java.runtime.version") + - "; Picard version: " + commandLineParser.getVersion()); + final String msg = String.format( + "[%s] Executing as %s@%s on %s %s %s; %s %s; Deflater: %s; Inflater: %s; Picard version: %s", + new Date(), System.getProperty("user.name"), InetAddress.getLocalHost().getHostName(), + System.getProperty("os.name"), System.getProperty("os.version"), System.getProperty("os.arch"), + System.getProperty("java.vm.name"), System.getProperty("java.runtime.version"), + USE_JDK_DEFLATER ? "JdkDeflater" : "IntelDeflater", USE_JDK_INFLATER ? "JdkInflater" : "IntelInflater", + commandLineParser.getVersion()); + System.err.println(msg); } catch (Exception e) { /* Unpossible! */ } } From 1e99fa163b4a7daec13db984e9847ada896f5fe8 Mon Sep 17 00:00:00 2001 From: Dan Moran Date: Fri, 16 Jun 2017 14:09:10 -0400 Subject: [PATCH 2/8] Set default compression level to 1. --- src/main/java/picard/cmdline/CommandLineProgram.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/picard/cmdline/CommandLineProgram.java b/src/main/java/picard/cmdline/CommandLineProgram.java index e6bc81d43..1eebc3053 100644 --- a/src/main/java/picard/cmdline/CommandLineProgram.java +++ b/src/main/java/picard/cmdline/CommandLineProgram.java @@ -85,7 +85,7 @@ public ValidationStringency VALIDATION_STRINGENCY = ValidationStringency.DEFAULT_STRINGENCY; @Option(doc = "Compression level for all compressed files created (e.g. BAM and GELI).", common=true) - public int COMPRESSION_LEVEL = BlockCompressedStreamConstants.DEFAULT_COMPRESSION_LEVEL; + public int COMPRESSION_LEVEL = 1; // The default IntelDeflater is slow at levels > 1 @Option(doc = "When writing SAM files that need to be sorted, this will specify the number of records stored in RAM before spilling to disk. Increasing this number reduces the number of file handles needed to sort a SAM file, and increases the amount of RAM needed.", optional=true, common=true) public Integer MAX_RECORDS_IN_RAM = SAMFileWriterImpl.getDefaultMaxRecordsInRam(); From de2473872964d5ad70ee93ebe10fd0061704b944 Mon Sep 17 00:00:00 2001 From: Dan Moran Date: Mon, 19 Jun 2017 12:59:05 -0400 Subject: [PATCH 3/8] Cleanup new deflater logic. --- src/main/java/picard/cmdline/CommandLineProgram.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/java/picard/cmdline/CommandLineProgram.java b/src/main/java/picard/cmdline/CommandLineProgram.java index 1eebc3053..be0c9dde6 100644 --- a/src/main/java/picard/cmdline/CommandLineProgram.java +++ b/src/main/java/picard/cmdline/CommandLineProgram.java @@ -34,7 +34,10 @@ import htsjdk.samtools.metrics.MetricBase; import htsjdk.samtools.metrics.MetricsFile; import htsjdk.samtools.metrics.StringHeader; -import htsjdk.samtools.util.*; +import htsjdk.samtools.util.BlockCompressedOutputStream; +import htsjdk.samtools.util.BlockGunzipper; +import htsjdk.samtools.util.IOUtil; +import htsjdk.samtools.util.Log; import htsjdk.variant.variantcontext.writer.Options; import htsjdk.variant.variantcontext.writer.VariantContextWriterBuilder; @@ -85,7 +88,8 @@ public ValidationStringency VALIDATION_STRINGENCY = ValidationStringency.DEFAULT_STRINGENCY; @Option(doc = "Compression level for all compressed files created (e.g. BAM and GELI).", common=true) - public int COMPRESSION_LEVEL = 1; // The default IntelDeflater is slow at levels > 1 + // The default IntelDeflater is slow at levels > 1 + public int COMPRESSION_LEVEL = 1; @Option(doc = "When writing SAM files that need to be sorted, this will specify the number of records stored in RAM before spilling to disk. Increasing this number reduces the number of file handles needed to sort a SAM file, and increases the amount of RAM needed.", optional=true, common=true) public Integer MAX_RECORDS_IN_RAM = SAMFileWriterImpl.getDefaultMaxRecordsInRam(); @@ -102,10 +106,10 @@ @Option(doc="Google Genomics API client_secrets.json file path.", common = true) public String GA4GH_CLIENT_SECRETS="client_secrets.json"; - @Option(shortName = "jdk_deflater", doc = "Use the JDK Deflater instead of the IntelDeflater for writing BAMs", common = true) + @Option(shortName = "use_jdk_deflater", doc = "Use the JDK Deflater instead of the IntelDeflater for writing BAMs", common = true) public Boolean USE_JDK_DEFLATER = false; - @Option(shortName = "jdk_inflater", doc = "Use the JDK Inflater instead of the IntelInflater for reading BAMs", common = true) + @Option(shortName = "use_jdk_inflater", doc = "Use the JDK Inflater instead of the IntelInflater for reading BAMs", common = true) public Boolean USE_JDK_INFLATER = false; private final String standardUsagePreamble = CommandLineParser.getStandardUsagePreamble(getClass()); @@ -209,7 +213,7 @@ public int instanceMain(final String[] argv) { new Date(), System.getProperty("user.name"), InetAddress.getLocalHost().getHostName(), System.getProperty("os.name"), System.getProperty("os.version"), System.getProperty("os.arch"), System.getProperty("java.vm.name"), System.getProperty("java.runtime.version"), - USE_JDK_DEFLATER ? "JdkDeflater" : "IntelDeflater", USE_JDK_INFLATER ? "JdkInflater" : "IntelInflater", + USE_JDK_DEFLATER ? "Jdk" : "Intel", USE_JDK_INFLATER ? "Jdk" : "Intel", commandLineParser.getVersion()); System.err.println(msg); } From aaa842b9f3b655168d6d93cb29912b60dbc58662 Mon Sep 17 00:00:00 2001 From: Dan Moran Date: Sat, 1 Jul 2017 11:15:20 -0400 Subject: [PATCH 4/8] Make sure index files are cleaned up after tests. --- .gitignore | 1 - src/test/java/picard/analysis/CollectMultipleMetricsTest.java | 2 ++ src/test/java/picard/analysis/CollectWgsMetricsTest.java | 2 ++ src/test/java/picard/sam/FilterSamReadsTest.java | 3 ++- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index e8638e3db..59a855917 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,3 @@ report jacoco.data .gradle build -*.bai diff --git a/src/test/java/picard/analysis/CollectMultipleMetricsTest.java b/src/test/java/picard/analysis/CollectMultipleMetricsTest.java index d99cf77fa..9406f034a 100644 --- a/src/test/java/picard/analysis/CollectMultipleMetricsTest.java +++ b/src/test/java/picard/analysis/CollectMultipleMetricsTest.java @@ -335,8 +335,10 @@ void setupBuilder() throws IOException { final String flowCellBarcode = "TESTBARCODE"; tempSamFile = File.createTempFile("CollectGcBias", ".bam", TEST_DIR); + final File tempSamIndex = new File(tempSamFile.getAbsolutePath().replace("bam", "bai")); final File tempSamFileUnsorted = File.createTempFile("CollectGcBias", ".bam", TEST_DIR); tempSamFileUnsorted.deleteOnExit(); + tempSamIndex.deleteOnExit(); tempSamFile.deleteOnExit(); BufferedLineReader bufferedLineReader = null; diff --git a/src/test/java/picard/analysis/CollectWgsMetricsTest.java b/src/test/java/picard/analysis/CollectWgsMetricsTest.java index ab5a4304c..6c5259b1d 100644 --- a/src/test/java/picard/analysis/CollectWgsMetricsTest.java +++ b/src/test/java/picard/analysis/CollectWgsMetricsTest.java @@ -136,8 +136,10 @@ void setupBuilder() throws IOException { //Create Sam Files tempSamFile = File.createTempFile("CollectWgsMetrics", ".bam", TEST_DIR); + final File tempSamIndex = new File(tempSamFile.getAbsolutePath().replace("bam", "bai")); final File tempSamFileUnsorted = File.createTempFile("CollectWgsMetrics", ".bam", TEST_DIR); tempSamFileUnsorted.deleteOnExit(); + tempSamIndex.deleteOnExit(); tempSamFile.deleteOnExit(); final File sortedSamIdx = new File(TEST_DIR, tempSamFile.getName() + ".idx"); sortedSamIdx.deleteOnExit(); diff --git a/src/test/java/picard/sam/FilterSamReadsTest.java b/src/test/java/picard/sam/FilterSamReadsTest.java index 35e49b810..76af6dac7 100644 --- a/src/test/java/picard/sam/FilterSamReadsTest.java +++ b/src/test/java/picard/sam/FilterSamReadsTest.java @@ -95,7 +95,7 @@ public void testPairedIntervalFilter(final String intervalFilename, final int ex // Build a sam file for testing final File inputSam = File.createTempFile("testSam", ".sam", TEST_DIR); inputSam.deleteOnExit(); - final File sortedSamIdx = new File(TEST_DIR, inputSam.getName() + ".idx"); + final File sortedSamIdx = new File(TEST_DIR, inputSam.getName() + ".bai"); sortedSamIdx.deleteOnExit(); final SAMFileWriter writer = new SAMFileWriterFactory() @@ -109,6 +109,7 @@ public void testPairedIntervalFilter(final String intervalFilename, final int ex final File intervalFile = new File(intervalFilename); FilterSamReads filterTest = setupProgram(intervalFile, inputSam, FilterSamReads.Filter.includePairedIntervals); + Assert.assertEquals(filterTest.doWork(),0); long count = getReadCount(filterTest); From 5977118c03d5c12f914e6f8cfb741f2680da92d7 Mon Sep 17 00:00:00 2001 From: Dan Moran Date: Sat, 1 Jul 2017 14:05:13 -0400 Subject: [PATCH 5/8] Make sure the GKL isn't evicting our htsjdk version. --- build.gradle | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index fcee826dd..cac37f50e 100644 --- a/build.gradle +++ b/build.gradle @@ -50,7 +50,9 @@ jacoco { final htsjdkVersion = System.getProperty('htsjdk.version', '2.10.1') dependencies { - compile 'com.intel.gkl:gkl:0.5.2' + compile('com.intel.gkl:gkl:0.5.2') { + exclude module: 'htsjdk' + } compile 'com.google.guava:guava:15.0' compile 'com.github.samtools:htsjdk:' + htsjdkVersion //tools dependency for doclet requires sdk devel @@ -58,6 +60,13 @@ dependencies { testCompile 'org.testng:testng:6.9.10' } +configurations.all { + resolutionStrategy { + // force the htsjdk version so we don't get a different one transitively + force 'com.github.samtools:htsjdk:' + htsjdkVersion + } +} + sourceCompatibility = 1.8 targetCompatibility = 1.8 From af16545e21b14c81a70a0c8aa8d602f816dcd425 Mon Sep 17 00:00:00 2001 From: Dan Moran Date: Sat, 1 Jul 2017 14:29:15 -0400 Subject: [PATCH 6/8] Fix / clean cmdline program changes. --- src/main/java/picard/cmdline/CommandLineProgram.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/picard/cmdline/CommandLineProgram.java b/src/main/java/picard/cmdline/CommandLineProgram.java index be0c9dde6..3075673e7 100644 --- a/src/main/java/picard/cmdline/CommandLineProgram.java +++ b/src/main/java/picard/cmdline/CommandLineProgram.java @@ -88,7 +88,8 @@ public ValidationStringency VALIDATION_STRINGENCY = ValidationStringency.DEFAULT_STRINGENCY; @Option(doc = "Compression level for all compressed files created (e.g. BAM and GELI).", common=true) - // The default IntelDeflater is slow at levels > 1 + // Reading from a file compressed by the default IntelDeflater at level 1 is ~3x faster than reading from a file + // compressed at level 5 (the htsjdk default), and level 1 files are only slightly larger. public int COMPRESSION_LEVEL = 1; @Option(doc = "When writing SAM files that need to be sorted, this will specify the number of records stored in RAM before spilling to disk. Increasing this number reduces the number of file handles needed to sort a SAM file, and increases the amount of RAM needed.", optional=true, common=true) @@ -106,10 +107,10 @@ @Option(doc="Google Genomics API client_secrets.json file path.", common = true) public String GA4GH_CLIENT_SECRETS="client_secrets.json"; - @Option(shortName = "use_jdk_deflater", doc = "Use the JDK Deflater instead of the IntelDeflater for writing BAMs", common = true) + @Option(shortName = "use_jdk_deflater", doc = "Use the JDK Deflater instead of the Intel Deflater for writing with BlockCompressedOutputStreams", common = true) public Boolean USE_JDK_DEFLATER = false; - @Option(shortName = "use_jdk_inflater", doc = "Use the JDK Inflater instead of the IntelInflater for reading BAMs", common = true) + @Option(shortName = "use_jdk_inflater", doc = "Use the JDK Inflater instead of the Intel Inflater for reading with BlockGunzippers", common = true) public Boolean USE_JDK_INFLATER = false; private final String standardUsagePreamble = CommandLineParser.getStandardUsagePreamble(getClass()); @@ -208,12 +209,16 @@ public int instanceMain(final String[] argv) { // Output a one liner about who/where and what software/os we're running on try { + final boolean usingIntelDeflater = (BlockCompressedOutputStream.getDefaultDeflaterFactory() instanceof IntelDeflaterFactory && + ((IntelDeflaterFactory)BlockCompressedOutputStream.getDefaultDeflaterFactory()).usingIntelDeflater()); + final boolean usingIntelInflater = (BlockGunzipper.getDefaultInflaterFactory() instanceof IntelInflaterFactory && + ((IntelInflaterFactory)BlockGunzipper.getDefaultInflaterFactory()).usingIntelInflater()); final String msg = String.format( "[%s] Executing as %s@%s on %s %s %s; %s %s; Deflater: %s; Inflater: %s; Picard version: %s", new Date(), System.getProperty("user.name"), InetAddress.getLocalHost().getHostName(), System.getProperty("os.name"), System.getProperty("os.version"), System.getProperty("os.arch"), System.getProperty("java.vm.name"), System.getProperty("java.runtime.version"), - USE_JDK_DEFLATER ? "Jdk" : "Intel", USE_JDK_INFLATER ? "Jdk" : "Intel", + usingIntelDeflater ? "Jdk" : "Intel", usingIntelInflater ? "Jdk" : "Intel", commandLineParser.getVersion()); System.err.println(msg); } From bcf2c44cb6f6027cd7b5c32eb1d01cc3f3a32238 Mon Sep 17 00:00:00 2001 From: Dan Moran Date: Sat, 1 Jul 2017 14:56:11 -0400 Subject: [PATCH 7/8] Add test verifying Intel Inflater/Deflater can be loaded. --- build.gradle | 1 + .../java/picard/IntelInflaterDeflaterLoadTest.java | 37 ++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 src/test/java/picard/IntelInflaterDeflaterLoadTest.java diff --git a/build.gradle b/build.gradle index cac37f50e..f17c8b146 100644 --- a/build.gradle +++ b/build.gradle @@ -58,6 +58,7 @@ dependencies { //tools dependency for doclet requires sdk devel compile(files(((URLClassLoader) ToolProvider.getSystemToolClassLoader()).getURLs())) testCompile 'org.testng:testng:6.9.10' + testCompile 'org.apache.commons:commons-lang3:3.6' } configurations.all { diff --git a/src/test/java/picard/IntelInflaterDeflaterLoadTest.java b/src/test/java/picard/IntelInflaterDeflaterLoadTest.java new file mode 100644 index 000000000..8875c966c --- /dev/null +++ b/src/test/java/picard/IntelInflaterDeflaterLoadTest.java @@ -0,0 +1,37 @@ +package picard; + +import com.intel.gkl.compression.IntelDeflater; +import com.intel.gkl.compression.IntelInflater; +import org.apache.commons.lang3.SystemUtils; +import org.testng.Assert; +import org.testng.SkipException; +import org.testng.annotations.Test; + +/** + * Test that the Intel Inflater and Deflater can be loaded successfully. + */ +public class IntelInflaterDeflaterLoadTest { + @Test + public void testIntelInflaterIsAvailable() { + checkIntelSupported("IntelInflater"); + Assert.assertTrue(new IntelInflater().load(null), + "Intel shared library was not loaded. This could be due to a configuration error, or your system might not support it."); + } + + @Test + public void testIntelDeflaterIsAvailable() { + checkIntelSupported("IntelDeflater"); + Assert.assertTrue(new IntelDeflater().load(null), + "Intel shared library was not loaded. This could be due to a configuration error, or your system might not support it."); + } + + private void checkIntelSupported(final String componentName) { + if (!SystemUtils.IS_OS_LINUX && !SystemUtils.IS_OS_MAC) { + throw new SkipException(componentName + " is not available on this platform"); + } + + if (SystemUtils.OS_ARCH != null && SystemUtils.OS_ARCH.equals("ppc64le")) { + throw new SkipException(componentName + " is not available for this architecture"); + } + } +} From cbe368db56957c7045e733f32d9affd5e45310f2 Mon Sep 17 00:00:00 2001 From: Dan Moran Date: Fri, 7 Jul 2017 16:43:35 -0400 Subject: [PATCH 8/8] Fix logging / docs. --- src/main/java/picard/cmdline/CommandLineProgram.java | 6 +++--- src/test/java/picard/sam/FilterSamReadsTest.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/picard/cmdline/CommandLineProgram.java b/src/main/java/picard/cmdline/CommandLineProgram.java index 3075673e7..81f2194c8 100644 --- a/src/main/java/picard/cmdline/CommandLineProgram.java +++ b/src/main/java/picard/cmdline/CommandLineProgram.java @@ -107,10 +107,10 @@ @Option(doc="Google Genomics API client_secrets.json file path.", common = true) public String GA4GH_CLIENT_SECRETS="client_secrets.json"; - @Option(shortName = "use_jdk_deflater", doc = "Use the JDK Deflater instead of the Intel Deflater for writing with BlockCompressedOutputStreams", common = true) + @Option(shortName = "use_jdk_deflater", doc = "Use the JDK Deflater instead of the Intel Deflater for writing compressed output", common = true) public Boolean USE_JDK_DEFLATER = false; - @Option(shortName = "use_jdk_inflater", doc = "Use the JDK Inflater instead of the Intel Inflater for reading with BlockGunzippers", common = true) + @Option(shortName = "use_jdk_inflater", doc = "Use the JDK Inflater instead of the Intel Inflater for reading compressed input", common = true) public Boolean USE_JDK_INFLATER = false; private final String standardUsagePreamble = CommandLineParser.getStandardUsagePreamble(getClass()); @@ -218,7 +218,7 @@ public int instanceMain(final String[] argv) { new Date(), System.getProperty("user.name"), InetAddress.getLocalHost().getHostName(), System.getProperty("os.name"), System.getProperty("os.version"), System.getProperty("os.arch"), System.getProperty("java.vm.name"), System.getProperty("java.runtime.version"), - usingIntelDeflater ? "Jdk" : "Intel", usingIntelInflater ? "Jdk" : "Intel", + usingIntelDeflater ? "Intel" : "Jdk", usingIntelInflater ? "Intel" : "Jdk", commandLineParser.getVersion()); System.err.println(msg); } diff --git a/src/test/java/picard/sam/FilterSamReadsTest.java b/src/test/java/picard/sam/FilterSamReadsTest.java index 76af6dac7..3ddf41e3a 100644 --- a/src/test/java/picard/sam/FilterSamReadsTest.java +++ b/src/test/java/picard/sam/FilterSamReadsTest.java @@ -95,11 +95,11 @@ public void testPairedIntervalFilter(final String intervalFilename, final int ex // Build a sam file for testing final File inputSam = File.createTempFile("testSam", ".sam", TEST_DIR); inputSam.deleteOnExit(); - final File sortedSamIdx = new File(TEST_DIR, inputSam.getName() + ".bai"); + final File sortedSamIdx = new File(TEST_DIR, inputSam.getName() + ".idx"); sortedSamIdx.deleteOnExit(); final SAMFileWriter writer = new SAMFileWriterFactory() - .setCreateIndex(true).makeBAMWriter(builder.getHeader(), false, inputSam); + .setCreateIndex(true).makeSAMWriter(builder.getHeader(), false, inputSam); for (final SAMRecord record : builder) { writer.addAlignment(record);