Package htsjdk.beta.plugin.registry
Class ReadsResolver
Class with methods for resolving inputs and outputs to reads encoders and decoders.
Provides a convenient typesafe layer over the HtsCodecResolver
used by an
HtsCodecRegistry
to manage ReadsCodec
s
(see HtsCodecRegistry.getHaploidReferenceResolver()
).
Provides typesafe conversion of argument and return types to types that conform to those used with
ReadsCodec
s, such as ReadsDecoder
, ReadsEncoder
,
ReadsDecoderOptions
.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetReadsDecoder
(Bundle inputBundle) Get aReadsDecoder
suitable for decodinginputBundle
.getReadsDecoder
(Bundle inputBundle, ReadsDecoderOptions readsDecoderOptions) getReadsDecoder
(IOPath inputPath) Get aReadsDecoder
suitable for decodinginputPath
.getReadsDecoder
(IOPath inputPath, ReadsDecoderOptions readsDecoderOptions) getReadsEncoder
(Bundle outputBundle, ReadsEncoderOptions readsEncoderOptions) getReadsEncoder
(Bundle outputBundle, ReadsEncoderOptions readsEncoderOptions, String readsFormat, HtsVersion formatVersion) Get aReadsEncoder
suitable for encoding tooutputBundle
, using the options inreadsEncoderOptions
, and the file format and version specified in readsFormat and formatVersion.getReadsEncoder
(IOPath outputPath) Get aReadsEncoder
suitable for encoding tooutputPath
.getReadsEncoder
(IOPath outputPath, ReadsEncoderOptions readsEncoderOptions) Methods inherited from class htsjdk.beta.plugin.registry.HtsCodecResolver
getCodecs, registerCodec, resolveForDecoding, resolveForEncoding, resolveForEncoding, resolveForFormat, resolveFormatAndVersion
-
Constructor Details
-
ReadsResolver
public ReadsResolver()Create a ReadsResolver.
-
-
Method Details
-
getReadsDecoder
Get aReadsDecoder
suitable for decodinginputPath
. TheinputPath
is inspected to determine the appropriate file format/version. The index is automatically resolved. To bypass index resolution, usegetReadsDecoder(htsjdk.io.IOPath)
.- Parameters:
inputPath
- the IOPath to be decoded- Returns:
- a
ReadsDecoder
suitable for decodinginputPath
- Throws:
HtsjdkException
- if no registered codecs can handle the resourceHtsjdkPluginException
- if more than one codec claims to handle the resource. this usually indicates that the registry contains an incorrectly written codec.
-
getReadsDecoder
Grt aReadsDecoder
suitable for decodinginputPath
using options inreadsDecoderOptions
. TheinputPath
is inspected to determine the appropriate file format/version. The index is automatically resolved. To bypass index resolution, usegetReadsDecoder(htsjdk.io.IOPath)
.- Parameters:
inputPath
- the IOPath to be decodedreadsDecoderOptions
- options to use- Returns:
- a
ReadsDecoder
suitable for decodinginputPath
- Throws:
HtsjdkException
- if no registered codecs can handle the resourceHtsjdkPluginException
- if more than one codec claims to handle the resource. this usually indicates that the registry contains an incorrectly written codec.
-
getReadsDecoder
Get aReadsDecoder
suitable for decodinginputBundle
. TheinputBundle
is inspected to determine the appropriate file format/version.- Parameters:
inputBundle
- the bundle to be decoded- Returns:
- a
ReadsDecoder
suitable for decodinginputBundle
- Throws:
HtsjdkException
- if no registered codecs can handle the resourceHtsjdkPluginException
- if more than one codec claims to handle the resource. this usually indicates that the registry contains an incorrectly written codec.
-
getReadsDecoder
Get aReadsDecoder
suitable for decodinginputBundle
using options inreadsDecoderOptions
. TheinputBundle
is inspected to determine the appropriate file format/version.- Parameters:
inputBundle
- the bundle to be decodedreadsDecoderOptions
-ReadsDecoderOptions
options to be used by the decoder- Returns:
- a
ReadsDecoder
suitable for decodinginputBundle
- Throws:
HtsjdkException
- if no registered codecs can handle the resourceHtsjdkPluginException
- if more than one codec claims to handle the resource. this usually indicates that the registry contains an incorrectly written codec.
-
getReadsEncoder
Get aReadsEncoder
suitable for encoding tooutputPath
. The path must include a file extension suitable for determining the appropriate file format to use; the newest version of the file format available will be used. To request a specific file format and/or version, usegetReadsEncoder(Bundle, ReadsEncoderOptions, String, HtsVersion)
.- Parameters:
outputPath
- the IOPath target for encoding- Returns:
- a
ReadsEncoder
suitable for encoding tooutputPath
- Throws:
HtsjdkException
- if no registered codecs can handle the resourceHtsjdkPluginException
- if more than one codec claims to handle the resource. this usually indicates that the registry contains an incorrectly written codec.
-
getReadsEncoder
Get aReadsEncoder
suitable for encoding tooutputPath
, using the options inreadsEncoderOptions
. The path must include a file extension suitable for determining the appropriate file format to use; the newest version of the file format available will be used. To request a specific file format and/or version, usegetReadsEncoder(Bundle, ReadsEncoderOptions, String, HtsVersion)
.- Parameters:
outputPath
- target path to encodereadsEncoderOptions
-ReadsEncoderOptions
options to be used by the encoder- Returns:
ReadsEncoder
suitable for encoding tooutputPath
- Throws:
HtsjdkException
- if no registered codecs can handle the resourceHtsjdkPluginException
- if more than one codec claims to handle the resource. this usually indicates that the registry contains an incorrectly written codec.
-
getReadsEncoder
Get aReadsEncoder
suitable for encoding tooutputBundle
, using the options inreadsEncoderOptions
. The outputBundle must include a primary resource with a file extension suitable for determining the appropriate file format to use; or the resource must include a format. The newest version of the selected file format available will be used. To request a specific file format and/or version, usegetReadsEncoder(Bundle, ReadsEncoderOptions, String, HtsVersion)
.- Parameters:
outputBundle
- target output to encode toreadsEncoderOptions
-ReadsEncoderOptions
to be used by the encoder- Returns:
ReadsEncoder
suitable for encoding tooutputPath
- Throws:
HtsjdkException
- if no registered codecs can handle the resourceHtsjdkPluginException
- if more than one codec claims to handle the resource. this usually indicates that the registry contains an incorrectly written codec.
-
getReadsEncoder
public ReadsEncoder getReadsEncoder(Bundle outputBundle, ReadsEncoderOptions readsEncoderOptions, String readsFormat, HtsVersion formatVersion) Get aReadsEncoder
suitable for encoding tooutputBundle
, using the options inreadsEncoderOptions
, and the file format and version specified in readsFormat and formatVersion.- Parameters:
outputBundle
- target output bundlereadsEncoderOptions
- encode options to be used by the encoderreadsFormat
- target file formatformatVersion
- target file format version- Returns:
ReadsEncoder
suitable for encoding tooutputBundle
- Throws:
HtsjdkException
- if no registered codecs can handle the resourceHtsjdkPluginException
- if more than one codec claims to handle the resource. this usually indicates that the registry contains an incorrectly written codec.
-