diff --git a/src/main/java/picard/cmdline/argumentcollections/OptionalReferenceArgumentCollection.java b/src/main/java/picard/cmdline/argumentcollections/OptionalReferenceArgumentCollection.java index 0719f2a668..2c8c11c1d6 100644 --- a/src/main/java/picard/cmdline/argumentcollections/OptionalReferenceArgumentCollection.java +++ b/src/main/java/picard/cmdline/argumentcollections/OptionalReferenceArgumentCollection.java @@ -51,11 +51,12 @@ public File getReferenceFile() { return null; } else if (!REFERENCE_SEQUENCE.getScheme().equals("file")) { log.warn(String.format( - "This tool cannot be used with non-local reference files: %s", + "the reference specified by %s cannot be used as a local file object", REFERENCE_SEQUENCE.getRawInputString())); - return null; + return new File(REFERENCE_SEQUENCE.getRawInputString()); + } else { + return REFERENCE_SEQUENCE == null ? null : REFERENCE_SEQUENCE.toPath().toFile(); } - return REFERENCE_SEQUENCE == null ? null : REFERENCE_SEQUENCE.toPath().toFile(); } @Override diff --git a/src/main/java/picard/cmdline/argumentcollections/RequiredReferenceArgumentCollection.java b/src/main/java/picard/cmdline/argumentcollections/RequiredReferenceArgumentCollection.java index 613374218f..c8f0140142 100644 --- a/src/main/java/picard/cmdline/argumentcollections/RequiredReferenceArgumentCollection.java +++ b/src/main/java/picard/cmdline/argumentcollections/RequiredReferenceArgumentCollection.java @@ -48,11 +48,13 @@ public File getReferenceFile() { if (REFERENCE_SEQUENCE == null) { return null; } else if (!REFERENCE_SEQUENCE.getScheme().equals("file")) { - log.warn(String.format( - "%s cannot bs used as a Java File object", - REFERENCE_SEQUENCE.getRawInputString())); + log.warn(String.format( + "the reference specified by %s cannot be used as a local file object", + REFERENCE_SEQUENCE.getRawInputString())); + return new File(REFERENCE_SEQUENCE.getRawInputString()); + } else { + return REFERENCE_SEQUENCE == null ? null : REFERENCE_SEQUENCE.toPath().toFile(); } - return REFERENCE_SEQUENCE == null ? null : REFERENCE_SEQUENCE.toPath().toFile(); } /** diff --git a/src/test/java/picard/sam/AbstractAlignmentMergerTest.java b/src/test/java/picard/sam/AbstractAlignmentMergerTest.java index 57412e49a5..bc48e1940e 100644 --- a/src/test/java/picard/sam/AbstractAlignmentMergerTest.java +++ b/src/test/java/picard/sam/AbstractAlignmentMergerTest.java @@ -706,7 +706,7 @@ public void testUnmapBacterialContamination() throws IOException { //yuck! final RequiredReferenceArgumentCollection requiredReferenceArgumentCollection = new RequiredReferenceArgumentCollection(); - requiredReferenceArgumentCollection.REFERENCE_SEQUENCE = new HtsPath(reference.getAbsolutePath()); + requiredReferenceArgumentCollection.REFERENCE_SEQUENCE = new PicardHtsPath(reference.getAbsolutePath()); mergeBamAlignment.referenceSequence = requiredReferenceArgumentCollection; final File fileMerged = newTempSamFile("merged");