Package picard.cmdline.argumentcollections

# Class RequiredReferenceArgumentCollection

java.lang.Object
picard.cmdline.argumentcollections.RequiredReferenceArgumentCollection

All Implemented Interfaces:
  `ReferenceArgumentCollection`

public class RequiredReferenceArgumentCollection extends Object implements ReferenceArgumentCollection
Argument collection for references that are required (and not common).

## Field Summary

Fields
Modifier and Type
Field
Description
`PicardHtsPath`
`REFERENCE_SEQUENCE`

## Constructor Summary

Constructors
Constructor
Description
`RequiredReferenceArgumentCollection()`

## Method Summary

Modifier and Type
Method
Description
`PicardHtsPath`
`getHtsPath()`
Returns a PicardHtsPath for the reference input.
`File`
`getReferenceFile()`
This method is retained for backward compatibility with legacy tools that have not been updated to support PicardHtsPath input files.
`Path`
`getReferencePath()`
This method first checks if the PicardHtsPath is null, thereby avoiding NPE that results from getHtsPath.toPath().

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### REFERENCE_SEQUENCE

@Argument(shortName="R", doc="Reference sequence file.") public PicardHtsPath REFERENCE_SEQUENCE

## Constructor Details

### RequiredReferenceArgumentCollection

public RequiredReferenceArgumentCollection()

## Method Details

### getReferenceFile

public File getReferenceFile()
Description copied from interface: `ReferenceArgumentCollection`
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()

Specified by:
  `getReferenceFile` in interface `ReferenceArgumentCollection`
Returns:
  The reference provided by the user, or the default defined by `htsjdk.samtools.Defaults.REFERENCE_FASTA`. May be null.

### getReferencePath

public Path getReferencePath()
Description copied from interface: `ReferenceArgumentCollection`
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().

Specified by:
  `getReferencePath` in interface `ReferenceArgumentCollection`
Returns:
  The reference provided by the user or the default as an nio Path. May be null.

### getHtsPath

public PicardHtsPath getHtsPath()
Description copied from interface: `ReferenceArgumentCollection`
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.

Specified by:
  `getHtsPath` in interface `ReferenceArgumentCollection`
Returns:
  The reference provided by the user, if any, or the default, if any, as a PicardHtsPath. May be null.