Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update htsjdk to 3.0.1 #1831

Merged
merged 2 commits into from
Oct 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def ensureBuildPrerequisites(buildPrerequisitesMessage) {

ensureBuildPrerequisites(buildPrerequisitesMessage)

final htsjdkVersion = System.getProperty('htsjdk.version', '3.0.0')
final htsjdkVersion = System.getProperty('htsjdk.version', '3.0.1')
final googleNio = 'com.google.cloud:google-cloud-nio:0.123.25'

// Get the jdk files we need to run javaDoc. We need to use these during compile, testCompile,
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/picard/util/SequenceDictionaryUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public static void encodeDictionary(final BufferedWriter writer, Iterator<SAMSeq
}

public static SortingCollection<String> makeSortingCollection() {
final File tmpDir = IOUtil.createTempDir("SamDictionaryNames", null);
final File tmpDir = IOUtil.createTempDir("SamDictionaryNames").toFile();
tmpDir.deleteOnExit();
// 256 byte for one name, and 1/10 part of all memory for this, rough estimate
long maxNamesInRam = Runtime.getRuntime().maxMemory() / 256 / 10;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public String getCommandLineProgramName() {

@BeforeTest
public void setUp() throws IOException {
globalTempOutputDir = IOUtil.createTempDir("artifactMetrics.", ".tmp");
globalTempOutputDir = IOUtil.createTempDir("artifactMetrics.tmp").toFile();
}

@AfterTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public void testHsMetricsHandlesIndelsAppropriately() throws IOException {
}

// Write things out to file
final File dir = IOUtil.createTempDir("hsmetrics.", ".test");
final File dir = IOUtil.createTempDir("hsmetrics.test").toFile();
final File bs = new File(dir, "baits.interval_list").getAbsoluteFile();
final File ts = new File(dir, "targets.interval_list").getAbsoluteFile();
baits.write(bs);
Expand Down Expand Up @@ -235,7 +235,7 @@ public void testHsMetricsHighTargetCoverage() throws IOException {
}

// Write things out to file
final File dir = IOUtil.createTempDir("hsmetrics.", ".test");
final File dir = IOUtil.createTempDir("hsmetrics.test").toFile();
final File bs = new File(dir, "baits.interval_list").getAbsoluteFile();
final File ts = new File(dir, "targets.interval_list").getAbsoluteFile();
baits.write(bs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/
public class CollectIndependentReplicatesMetricTest {
private final static File testdir = new File("testdata/picard/independent_replicates");
private final static File bamOutDir = IOUtil.createTempDir("convertSamToBam", "dir");
private final static File bamOutDir = IOUtil.createTempDir("convertSamToBamDir").toFile();

private final static Map<String, String> sams = new ImmutableMap.Builder<String, String>()
.put("twoPairs", "twopairs.sam")
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/picard/fastq/BamToBfqTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static Object[][] inputs() throws IOException {
@Test(dataProvider = "inputs")
public void testBamToBfq(final File input, final boolean isPairedRun,
final String outputFilePrefix) throws IOException {
final File analysisDir = IOUtil.createTempDir("BamToBfqTest", ".dir");
final File analysisDir = IOUtil.createTempDir("BamToBfqTestDir").toFile();
try {
final String[] args = new String[] {
"INPUT=" + input.getAbsolutePath(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public String getCommandLineProgramName() {

@BeforeMethod
private void setUp() throws Exception {
illuminaDir = IOUtil.createTempDir("ift_test", "IlluminaDir");
illuminaDir = IOUtil.createTempDir("ift_test.IlluminaDir").toFile();

interopDir = new File(illuminaDir, "InterOp");
if (!interopDir.exists() && !interopDir.mkdir()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ private static File buildOutputFile(final File directory, final String prefix, f
public void testWriteLaneMetrics(final String testRun) {
for (final boolean useReadStructure : Arrays.asList(true, false)) {
final CollectIlluminaLaneMetrics clp = new CollectIlluminaLaneMetrics();
clp.OUTPUT_DIRECTORY = IOUtil.createTempDir("illuminaLaneMetricsCollectorTest", null);
clp.OUTPUT_DIRECTORY = IOUtil.createTempDir("illuminaLaneMetricsCollectorTest").toFile();
clp.RUN_DIRECTORY = new File(TEST_DIRECTORY, testRun);
clp.OUTPUT_PREFIX = "test";
if (useReadStructure) clp.READ_STRUCTURE = new ReadStructure("101T8B101T");
Expand Down Expand Up @@ -54,7 +54,7 @@ public void testCollectIlluminaLaneMetrics(final String testRun, final ReadStruc
for (final boolean useReadStructure : Arrays.asList(true, false)) {
final File runDirectory = new File(TILE_RUN_DIRECTORY, testRun);
final CollectIlluminaLaneMetrics clp = new CollectIlluminaLaneMetrics();
clp.OUTPUT_DIRECTORY = IOUtil.createTempDir("illuminaLaneMetricsCollectorTest", null);
clp.OUTPUT_DIRECTORY = IOUtil.createTempDir("illuminaLaneMetricsCollectorTest").toFile();
clp.RUN_DIRECTORY = runDirectory;
clp.OUTPUT_PREFIX = "test";
if (useReadStructure) clp.READ_STRUCTURE = readStructure;
Expand Down Expand Up @@ -90,7 +90,7 @@ public void testMissingPhasingValuesStrict() {
for (final boolean useReadStructure : Arrays.asList(true, false)) {
final File runDirectory = TEST_MISSING_PHASING_DIRECTORY;
final CollectIlluminaLaneMetrics clp = new CollectIlluminaLaneMetrics();
clp.OUTPUT_DIRECTORY = IOUtil.createTempDir("illuminaLaneMetricsCollectorTest", null);
clp.OUTPUT_DIRECTORY = IOUtil.createTempDir("illuminaLaneMetricsCollectorTest").toFile();
clp.RUN_DIRECTORY = runDirectory;
clp.OUTPUT_PREFIX = "test";
clp.VALIDATION_STRINGENCY = ValidationStringency.STRICT;
Expand All @@ -115,7 +115,7 @@ public void testMissingPhasingValuesSilent() {
for (final boolean useReadStructure : Arrays.asList(true, false)) {
final File runDirectory = TEST_MISSING_PHASING_DIRECTORY;
final CollectIlluminaLaneMetrics clp = new CollectIlluminaLaneMetrics();
clp.OUTPUT_DIRECTORY = IOUtil.createTempDir("illuminaLaneMetricsCollectorTest", null);
clp.OUTPUT_DIRECTORY = IOUtil.createTempDir("illuminaLaneMetricsCollectorTest").toFile();
clp.RUN_DIRECTORY = runDirectory;
clp.OUTPUT_PREFIX = "test";
clp.VALIDATION_STRINGENCY = ValidationStringency.SILENT;
Expand All @@ -141,7 +141,7 @@ public void testMismatchedMetricsVersions() {
final ReadStructure readStructure = new ReadStructure("151T8B8B151T");
for (final boolean useReadStructure : Arrays.asList(true, false)) {
final CollectIlluminaLaneMetrics clp = new CollectIlluminaLaneMetrics();
clp.OUTPUT_DIRECTORY = IOUtil.createTempDir("illuminaLaneMetricsCollectorTest", null);
clp.OUTPUT_DIRECTORY = IOUtil.createTempDir("illuminaLaneMetricsCollectorTest").toFile();
clp.RUN_DIRECTORY = TEST_MISMATCHED_VERSIONS;
clp.OUTPUT_PREFIX = "test";
if (useReadStructure) clp.READ_STRUCTURE = readStructure;
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/picard/illumina/parser/BclParserTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public void fullBclParserTestWBadDeletedSkips(final int[] tiles, final int size,
}

public void fullBclParserTestWDeletedSkipsImpl(final int[] tiles, final int size, final int seekAfter, final int newTileIndex, final int orderedTileIndex, final String readStructure) {
final File basecallDir = IOUtil.createTempDir("bclParserTest", "BaseCalls");
final File basecallDir = IOUtil.createTempDir("bclParserTest.BaseCalls").toFile();

Exception exc = null;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class IlluminaFileUtilTest {

@BeforeMethod
private void setUp() throws Exception {
intensityDir = IOUtil.createTempDir("ift_test", "Intensities");
intensityDir = IOUtil.createTempDir("ift_test.Intensities").toFile();
basecallDir = new File(intensityDir, "BaseCalls");
if (!basecallDir.mkdir()) {
throw new RuntimeException("Couldn't make basecalls dir " + basecallDir.getAbsolutePath());
Expand Down Expand Up @@ -517,7 +517,7 @@ public void testHasCbcls(final int lane,
final boolean createCbcl,
final boolean expectedResult) throws IOException {

final File basecallsDir = IOUtil.createTempDir("basecalls", "");
final File basecallsDir = IOUtil.createTempDir("basecalls").toFile();
basecallsDir.deleteOnExit();

if (0 < lane) {
Expand Down
14 changes: 8 additions & 6 deletions src/test/java/picard/sam/CramCompatibilityTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import picard.cmdline.CommandLineProgram;

import java.io.*;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
Expand Down Expand Up @@ -38,11 +40,11 @@ public class CramCompatibilityTest {
public static final String MBA_UNMAPPED_CRAM = "testdata/picard/sam/MergeBamAlignment/cliptest.unmapped.cram";
public static final String MBA_REFERENCE = "testdata/picard/sam/MergeBamAlignment/cliptest.fasta";

private static final File outputDir = IOUtil.createTempDir("testdata/picard/sam/CramCompatibilityTest", ".tmp");
private static final Path outputDir = IOUtil.createTempDir("CramCompatibilityTest.tmp");

@AfterTest
public void tearDown() {
IOUtil.recursiveDelete(outputDir.toPath());
IOUtil.recursiveDelete(outputDir);
}

@DataProvider(name = "programArgsForCRAMWithReference")
Expand Down Expand Up @@ -112,7 +114,7 @@ public void testShouldWriteCRAMWhenCRAMWithReference(String program,
launchProgram(program, cramFile, outputFile.getAbsolutePath(), parameters, reference);
assertCRAM(outputFile);
} else {
final File tmpDir = IOUtil.createTempDir(outputDir.getAbsolutePath(), program);
final File tmpDir = Files.createTempDirectory(outputDir, program).toFile();
launchProgram(program, cramFile, tmpDir.getAbsolutePath(), parameters, reference);
assertCRAMs(tmpDir);
}
Expand Down Expand Up @@ -164,7 +166,7 @@ public void testShouldFailWhenCRAMWithoutReference(String program,
launchProgram(program, cramFile, outputFile.getAbsolutePath(), parameters, null);
assertCRAM(outputFile);
} else {
final File tmpDir = IOUtil.createTempDir(outputDir.getAbsolutePath(), program);
final File tmpDir = Files.createTempDirectory(outputDir, program).toFile();
launchProgram(program, cramFile, tmpDir.getAbsolutePath(), parameters, null);
assertCRAMs(tmpDir);
}
Expand Down Expand Up @@ -214,7 +216,7 @@ public void testShouldWriteCRAMWhenUnmappedCRAMWithoutReference(String program,
launchProgram(program, cramFile, outputFile.getAbsolutePath(), parameters, null);
assertCRAM(outputFile);
} else {
final File tmpDir = IOUtil.createTempDir(outputDir.getAbsolutePath(), program);
final File tmpDir = Files.createTempDirectory(outputDir, program).toFile();
launchProgram(program, cramFile, tmpDir.getAbsolutePath(), parameters, null);
assertCRAMs(tmpDir);
}
Expand All @@ -227,7 +229,7 @@ private File createTempCram(String name) throws IOException {
private static File createTempFile(String name, String extension) {
File file = null;
try {
file = File.createTempFile(name, extension, outputDir);
file = File.createTempFile(name, extension, outputDir.toFile());
file.deleteOnExit();
} catch (IOException e) {
e.printStackTrace();
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/picard/sam/DownsampleSamTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void setupBuilder() throws IOException {
setBuilder.addPair(readName, 1, 1, 100);
}

tempDir = IOUtil.createTempDir("ds_test", "Downsampling");
tempDir = IOUtil.createTempDir("ds_test_Downsampling").toFile();
tempSamFile = File.createTempFile("DownsampleSam", ".bam", tempDir);

BufferedLineReader bufferedLineReader = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void setupBuilder() throws IOException {
setBuilder.addPair(readName, 1, 1, 100);
}

tempDir = IOUtil.createTempDir("pds_test", "PositionalDownsampling");
tempDir = IOUtil.createTempDir("pds_test_PositionalDownsampling").toFile();
tempSamFile = File.createTempFile("PositionalDownsampleSam", ".bam", tempDir);

BufferedLineReader bufferedLineReader = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void samMetricsProvider() {
throw new PicardException("This should only be called once!");
}

OUTPUT_DATA_PATH = IOUtil.createTempDir("CollectSamErrorMetricsTest", null);
OUTPUT_DATA_PATH = IOUtil.createTempDir("CollectSamErrorMetricsTest.tmp").toFile();

for (final File file : files) {
final File vcf = new File(TEST_DIR, "NIST.selected.vcf");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public void testTwoMappedPairsWithSoftClippingFirstOfPairOnly() {
@Test(dataProvider = "pgRecordChainingTest")
public void pgRecordChainingTest(final boolean suppressPg,
final Map<String, List<ExpectedPnAndVn>> expectedPnVnByReadName) {
final File outputDir = IOUtil.createTempDir(TEST_BASE_NAME + ".", ".tmp");
final File outputDir = IOUtil.createTempDir(TEST_BASE_NAME + ".tmp").toFile();
outputDir.deleteOnExit();
try {
// Run MarkDuplicates, merging the 3 input files, and either enabling or suppressing PG header
Expand Down Expand Up @@ -177,7 +177,7 @@ public Object[][] pgRecordChainingTestDataProvider() {

@Test(dataProvider = "testOpticalDuplicateDetectionDataProvider")
public void testOpticalDuplicateDetection(final File sam, final long expectedNumOpticalDuplicates) {
final File outputDir = IOUtil.createTempDir(TEST_BASE_NAME + ".", ".tmp");
final File outputDir = IOUtil.createTempDir(TEST_BASE_NAME + ".tmp").toFile();
outputDir.deleteOnExit();
final File outputSam = new File(outputDir, TEST_BASE_NAME + ".sam");
outputSam.deleteOnExit();
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/picard/sam/testers/SamFileTester.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public File getOutputDir() {
}

private void setOutputDir() {
this.outputDir = IOUtil.createTempDir(this.getClass().getSimpleName() + ".", ".tmp");
this.outputDir = IOUtil.createTempDir(this.getClass().getSimpleName() + ".tmp").toFile();
if (deleteOnExit) {
outputDir.deleteOnExit();
}
Expand Down Expand Up @@ -387,7 +387,7 @@ private File createInputFile(final String extension) throws IOException {
if (extension.equals(".cram")) {
final Path fasta = fastaFiles.computeIfAbsent(samRecordSetBuilder.getHeader(), h -> {

final Path fastaDir = IOUtil.createTempDir("SamFileTester", "").toPath();
final Path fastaDir = IOUtil.createTempDir("SamFileTester");
IOUtil.deleteOnExit(fastaDir);
final Path newFasta = fastaDir.resolve("input.fasta");
IOUtil.deleteOnExit(newFasta);
Expand Down
6 changes: 3 additions & 3 deletions src/test/java/picard/util/IntervalListToolsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ public void testScatter(final IntervalListScattererTest.Testcase tc) throws IOEx

args.add("SUBDIVISION_MODE=" + tc.mode);

final File ilOutDir = IOUtil.createTempDir("IntervalListTools", "lists");
final File ilOutDir = IOUtil.createTempDir("IntervalListTools_lists").toFile();
dirsToDelete.add(ilOutDir);

if (tc.scatterWidth == 1) {
Expand Down Expand Up @@ -397,7 +397,7 @@ public void testScatterByContent(final IntervalListScattererTest.Testcase tc) th

args.add("SUBDIVISION_MODE=" + tc.mode);

final File ilOutDir = IOUtil.createTempDir("IntervalListTools", "lists");
final File ilOutDir = IOUtil.createTempDir("IntervalListTools_lists").toFile();
dirsToDelete.add(ilOutDir);

if (tc.scatterWidth == 1) {
Expand Down Expand Up @@ -432,7 +432,7 @@ public void testScatterByContent(final IntervalListScattererTest.Testcase tc) th
@Test(timeOut = 40_000)
public void testLargeScatters() throws IOException {
final int scatterCount=1_000;
final File ilOutDir = IOUtil.createTempDir("IntervalListTools", "lists");
final File ilOutDir = IOUtil.createTempDir("IntervalListTools_lists").toFile();
dirsToDelete.add(ilOutDir);

//scatter
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/picard/util/LiftoverVcfTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class LiftoverVcfTest extends CommandLineProgramTest {
private static final File REFERENCE_FILE = new File(TEST_DATA_PATH, "dummy.reference.fasta");
private static final File TWO_INTERVALS_REFERENCE_FILE = new File(TEST_DATA_PATH, "dummy.two.block.reference.fasta");

private static final File OUTPUT_DATA_PATH = IOUtil.createTempDir("LiftoverVcfsTest", null);
private static final File OUTPUT_DATA_PATH = IOUtil.createTempDir("LiftoverVcfsTest.tmp").toFile();

private final int CHAIN_SIZE = 540; // the length of the single chain in CHAIN_FILE

Expand Down
2 changes: 1 addition & 1 deletion src/test/java/picard/vcf/GenotypeConcordanceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

public class GenotypeConcordanceTest {

private static final File OUTPUT_DATA_PATH = IOUtil.createTempDir("GenotypeConcordanceTest", null);
private static final File OUTPUT_DATA_PATH = IOUtil.createTempDir("GenotypeConcordanceTest.tmp").toFile();
private static final Path TEST_DATA_PATH = new File("testdata/picard/vcf/").toPath();
private static final String TEST_DATA_PATH_STRING = TEST_DATA_PATH.toString();

Expand Down
2 changes: 1 addition & 1 deletion src/test/java/picard/vcf/SplitVcfsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

public class SplitVcfsTest extends CommandLineProgramTest {

private static final File OUTPUT_DATA_PATH = IOUtil.createTempDir("SplitVcfsTest", null);
private static final File OUTPUT_DATA_PATH = IOUtil.createTempDir("SplitVcfsTest.tmp").toFile();
private static final File TEST_DATA_PATH = new File("testdata/picard/vcf/");

public String getCommandLineProgramName() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class UpdateVcfSequenceDictionaryTest {
// vcfFormatTest.bad_dict.vcf is a vcf with two (2) ##contig lines deleted
private final File SAM_SEQUENCE_DICTIONARY_VCF = new File(TEST_DATA_PATH, "vcfFormatTest.bad_dict.vcf");

private static final File OUTPUT_DATA_PATH = IOUtil.createTempDir("UpdateVcfSequenceDictionaryTest", null);
private static final File OUTPUT_DATA_PATH = IOUtil.createTempDir("UpdateVcfSequenceDictionaryTest.tmp").toFile();
private static final File STD_OUT_FILE = new File(OUTPUT_DATA_PATH, "stdout.vcf");
private static final String STD_OUT_NAME = "/dev/stdout";

Expand Down
2 changes: 1 addition & 1 deletion testdata/picard/sam/smallIntervals.interval_list
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@HD VN:1.0
@SQ SN:chrM LN:16903 UR:chrM.reference.fasta
@SQ SN:chrM LN:16571 UR:chrM.reference.fasta
chrM 1 1000 + foo