Package htsjdk.beta.plugin.registry

# Class HaploidReferenceResolver

java.lang.Object
htsjdk.beta.plugin.registry.HtsCodecResolver<HaploidReferenceCodec>
htsjdk.beta.plugin.registry.HaploidReferenceResolver

public class HaploidReferenceResolver extends HtsCodecResolver<HaploidReferenceCodec>
Class with methods for resolving inputs and outputs to haploid reference encoders and decoders.

Provides a typesafe layer over the `HtsCodecResolver` used by an `HtsCodecRegistry` to manage `HaploidReferenceCodec`s (see `HtsCodecRegistry.getHaploidReferenceResolver()`).

Provides typesafe conversion of argument and return types to types that conform to those used by `HaploidReferenceCodec`s, such as `HaploidReferenceDecoder` and `HaploidReferenceEncoder`.

## Constructor Summary

Constructors
Constructor
Description
`HaploidReferenceResolver()`
Create a new HaploidReferenceResolver.

## Method Summary

Modifier and Type
Method
Description
`HaploidReferenceDecoder`
`getHaploidReferenceDecoder(Bundle inputBundle)`
Get a `HaploidReferenceDecoder` for the given input Bundle.
`HaploidReferenceDecoder`
`getHaploidReferenceDecoder(Bundle inputBundle, HaploidReferenceDecoderOptions HaploidReferenceDecoderOptions)`
Get a `HaploidReferenceDecoder` suitable for decoding `inputBundle` using options in `HaploidReferenceDecoderOptions`.
`HaploidReferenceDecoder`
`getHaploidReferenceDecoder(IOPath inputPath)`
Get a `HaploidReferenceDecoder` for the given inputPath.
`HaploidReferenceDecoder`
`getHaploidReferenceDecoder(IOPath inputPath, HaploidReferenceDecoderOptions HaploidReferenceDecoderOptions)`
Get a `HaploidReferenceDecoder` suitable for decoding `inputPath` using options in `HaploidReferenceDecoderOptions`.
`static <T extends IOPath>
Bundle`
`referenceBundleFromFastaPath(IOPath fastaPath, Function<String,T> ioPathConstructor)`
Create a reference bundle given only a fasta path, including an index and a dictionary file if they are present and located in the same directory as the fasta.

### Methods inherited from class htsjdk.beta.plugin.registry.HtsCodecResolver

`filterByVersion, getCodecs, registerCodec, resolveForDecoding, resolveForEncoding, resolveForEncoding, resolveForFormat, resolveFormatAndVersion`

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

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

## Constructor Details

### HaploidReferenceResolver

public HaploidReferenceResolver()
Create a new HaploidReferenceResolver.

## Method Details

### getHaploidReferenceDecoder

public HaploidReferenceDecoder getHaploidReferenceDecoder(IOPath inputPath)
Get a `HaploidReferenceDecoder` for the given inputPath.

Parameters:
  `inputPath` - the path to the resource to be decoded
Returns:
  a HaploidReferenceDecoder for the given inputPath
Throws:
  `HtsjdkException` - if no registered codecs can handle the resource
  `HtsjdkPluginException` - if more than one codec claims to handle the resource. this usually indicates that the registry contains an incorrectly written codec.

### getHaploidReferenceDecoder

public HaploidReferenceDecoder getHaploidReferenceDecoder(IOPath inputPath, HaploidReferenceDecoderOptions HaploidReferenceDecoderOptions)
Get a `HaploidReferenceDecoder` suitable for decoding `inputPath` using options in `HaploidReferenceDecoderOptions`. The `inputPath` is inspected to determine the appropriate file format/version. The index is automatically resolved. To bypass index resolution, use `getHaploidReferenceDecoder(htsjdk.io.IOPath)`.

Parameters:
  `inputPath` - the IOPath to be decoded
  `HaploidReferenceDecoderOptions` - options to use
Returns:
  a `HaploidReferenceDecoder` suitable for decoding `inputPath`
Throws:
  `HtsjdkException` - if no registered codecs can handle the resource
  `HtsjdkPluginException` - if more than one codec claims to handle the resource. this usually indicates that the registry contains an incorrectly written codec.

### getHaploidReferenceDecoder

public HaploidReferenceDecoder getHaploidReferenceDecoder(Bundle inputBundle)
Get a `HaploidReferenceDecoder` for the given input Bundle.

Parameters:
  `inputBundle` - the path to the bundle containing the resource to be decoded
Returns:
  a HaploidReferenceDecoder for the given inputPath
Throws:
  `HtsjdkException` - if no registered codecs can handle the resource
  `HtsjdkPluginException` - if more than one codec claims to handle the resource. this usually indicates that the registry contains an incorrectly written codec.

### getHaploidReferenceDecoder

public HaploidReferenceDecoder getHaploidReferenceDecoder(Bundle inputBundle, HaploidReferenceDecoderOptions HaploidReferenceDecoderOptions)
Get a `HaploidReferenceDecoder` suitable for decoding `inputBundle` using options in `HaploidReferenceDecoderOptions`. The `inputBundle` is inspected to determine the appropriate file format/version.

Parameters:
  `inputBundle` - the bundle to be decoded
  `HaploidReferenceDecoderOptions` - `HaploidReferenceDecoderOptions` options to be used by the decoder
Returns:
  a `HaploidReferenceDecoder` suitable for decoding `inputBundle`
Throws:
  `HtsjdkException` - if no registered codecs can handle the resource
  `HtsjdkPluginException` - if more than one codec claims to handle the resource. this usually indicates that the registry contains an incorrectly written codec.

### referenceBundleFromFastaPath

public static <T extends IOPath> Bundle referenceBundleFromFastaPath(IOPath fastaPath, Function<String,T> ioPathConstructor)
Create a reference bundle given only a fasta path, including an index and a dictionary file if they are present and located in the same directory as the fasta.

Type Parameters:
  `T` -
Parameters:
  `fastaPath` - location of the fasta
  `ioPathConstructor` - a constructor used to create IOPath-derived objects for the bundle
Returns:
  a reference Bundle