From 1412ae4d660dcdf6a26bc42f44c9fc0cd6dc251d Mon Sep 17 00:00:00 2001 From: Chris Norman Date: Tue, 16 Jan 2024 17:23:08 -0500 Subject: [PATCH] Fix setting of CommandLineProgram REFERENCE_SEQUENCE. --- src/main/java/picard/cmdline/CommandLineProgram.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/picard/cmdline/CommandLineProgram.java b/src/main/java/picard/cmdline/CommandLineProgram.java index fcc7cbbd25..50ae238abd 100644 --- a/src/main/java/picard/cmdline/CommandLineProgram.java +++ b/src/main/java/picard/cmdline/CommandLineProgram.java @@ -341,10 +341,8 @@ protected boolean parseArgs(final String[] argv) { // object created by this code path won't be valid - but we still have to set it here in case // the tool tries to access REFERENCE_SEQUENCE directly (such tools will subsequently fail given // a non-local file anyway, but this prevents them from immediately throwing an NPE). - final PicardHtsPath picardHtsPath = referenceSequence.getHtsPath(); - REFERENCE_SEQUENCE = picardHtsPath == null ? - null : - new File(picardHtsPath.getURI().getPath()); // Must remove the "file://" prefix + final PicardHtsPath refHtsPath = referenceSequence.getHtsPath(); + REFERENCE_SEQUENCE = ReferenceArgumentCollection.getFileSafe(refHtsPath, Log.getInstance(this.getClass())); // The TMP_DIR setting section below was moved from instanceMain() to here due to timing issues // related to checking whether R is installed. Certain programs, such as CollectInsertSizeMetrics