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 ReadsCodecs
(see HtsCodecRegistry.getHaploidReferenceResolver()).
Provides typesafe conversion of argument and return types to types that conform to those used with
ReadsCodecs, such as ReadsDecoder, ReadsEncoder,
ReadsDecoderOptions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List<ReadsCodec> filterByVersion(List<ReadsCodec> candidateCodecs, HtsVersion htsVersion) Temporarily override to remove the CRAM 3.1 codec from the list of candidate codecs when the request is for the newest version, since it has no write implementation yet.getReadsDecoder(Bundle inputBundle) Get aReadsDecodersuitable for decodinginputBundle.getReadsDecoder(Bundle inputBundle, ReadsDecoderOptions readsDecoderOptions) getReadsDecoder(IOPath inputPath) Get aReadsDecodersuitable for decodinginputPath.getReadsDecoder(IOPath inputPath, ReadsDecoderOptions readsDecoderOptions) getReadsEncoder(Bundle outputBundle, ReadsEncoderOptions readsEncoderOptions) getReadsEncoder(Bundle outputBundle, ReadsEncoderOptions readsEncoderOptions, String readsFormat, HtsVersion formatVersion) Get aReadsEncodersuitable for encoding tooutputBundle, using the options inreadsEncoderOptions, and the file format and version specified in readsFormat and formatVersion.getReadsEncoder(IOPath outputPath) Get aReadsEncodersuitable 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 aReadsDecodersuitable for decodinginputPath. TheinputPathis 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
ReadsDecodersuitable 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 aReadsDecodersuitable for decodinginputPathusing options inreadsDecoderOptions. TheinputPathis 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
ReadsDecodersuitable 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 aReadsDecodersuitable for decodinginputBundle. TheinputBundleis inspected to determine the appropriate file format/version.- Parameters:
inputBundle- the bundle to be decoded- Returns:
- a
ReadsDecodersuitable 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 aReadsDecodersuitable for decodinginputBundleusing options inreadsDecoderOptions. TheinputBundleis inspected to determine the appropriate file format/version.- Parameters:
inputBundle- the bundle to be decodedreadsDecoderOptions-ReadsDecoderOptionsoptions to be used by the decoder- Returns:
- a
ReadsDecodersuitable 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 aReadsEncodersuitable 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
ReadsEncodersuitable 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 aReadsEncodersuitable 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-ReadsEncoderOptionsoptions to be used by the encoder- Returns:
ReadsEncodersuitable 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 aReadsEncodersuitable 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-ReadsEncoderOptionsto be used by the encoder- Returns:
ReadsEncodersuitable 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 aReadsEncodersuitable 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:
ReadsEncodersuitable 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.
-
filterByVersion
Temporarily override to remove the CRAM 3.1 codec from the list of candidate codecs when the request is for the newest version, since it has no write implementation yet.- Overrides:
filterByVersionin classHtsCodecResolver<ReadsCodec>
-