Interface ReferenceArgumentCollection
- All Known Implementing Classes:
CollectAlignmentSummaryMetrics.CollectAlignmentRefArgCollection
,CollectRrbsMetrics.CollectRrbsMetricsReferenceArgumentCollection
,CreateSequenceDictionary.CreateSeqDictReferenceArgumentCollection
,OptionalReferenceArgumentCollection
,RequiredReferenceArgumentCollection
,ScatterIntervalsByNs.ScatterIntervalsByNReferenceArgumentCollection
public interface ReferenceArgumentCollection
Base interface for a reference argument collection.
-
Method Summary
Modifier and TypeMethodDescriptionstatic File
getFileSafe
(PicardHtsPath picardPath, htsjdk.samtools.util.Log log) default PicardHtsPath
Returns a PicardHtsPath for the reference input.This method is retained for backward compatibility with legacy tools that have not been updated to support PicardHtsPath input files.default Path
This method first checks if the PicardHtsPath is null, thereby avoiding NPE that results from getHtsPath.toPath().
-
Method Details
-
getReferenceFile
File getReferenceFile()This method is retained for backward compatibility with legacy tools that have not been updated to support PicardHtsPath input files. The preferred methods for accessing the reference file provided on the command line is either getHtsPath() or getReferencePath(). TODO: update tools that call this method to use getHtsPath()- Returns:
- The reference provided by the user, or the default defined by
htsjdk.samtools.Defaults.REFERENCE_FASTA
. May be null.
-
getReferencePath
This method first checks if the PicardHtsPath is null, thereby avoiding NPE that results from getHtsPath.toPath(). Use this for providing input to methods that expect the Path to be null when the reference is absent e.g. SamReaderFactory.referenceSequence().- Returns:
- The reference provided by the user or the default as an nio Path. May be null.
-
getHtsPath
Returns a PicardHtsPath for the reference input. Maybe be null. Implementers of this interface should override with an appropriate implementation. This currently does not support remote paths set via HtsJdk.Defaults.REFERENCE_FASTA, since that uses a `File` object.- Returns:
- The reference provided by the user, if any, or the default, if any, as a PicardHtsPath. May be null.
-
getFileSafe
- Returns:
- A "safe" File object for any reference path. For files that reside on a local file system, this returns a valid File object. Files that reside on a non-local file system can't be accessed via a File object, so return a placeholder File object that will defer failure until the File object is actually accessed. This allows code paths that blindly propagate the value returned by calls to getReferenceFile to not get an NPE, and to fail gracefully downstream with an error message that includes the reference file specifier.
-