Class CRAMCodecV2_1
java.lang.Object
htsjdk.beta.codecs.reads.cram.CRAMCodec
htsjdk.beta.codecs.reads.cram.cramV2_1.CRAMCodecV2_1
- All Implemented Interfaces:
HtsCodec<ReadsDecoderOptions,
,ReadsEncoderOptions> ReadsCodec
,Upgradeable
CRAM v2.1 codec
-
Field Summary
Fields inherited from class htsjdk.beta.codecs.reads.cram.CRAMCodec
extensionMap
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetDecoder
(Bundle inputBundle, ReadsDecoderOptions readsDecoderOptions) Get anHtsDecoder
to decode the provided inputs.getEncoder
(Bundle outputBundle, ReadsEncoderOptions readsEncoderOptions) Get anHtsEncoder
to encode to the provided outputs.int
Get the number of bytes in the format and version signature used by the file format supported by this codec.protected String
Get the signature string for this codec.Get the version of the file format returned byHtsCodec.getFileFormat()
that is supported by this codec.Methods inherited from class htsjdk.beta.codecs.reads.cram.CRAMCodec
canDecodeSignature, canDecodeURI, getFileFormat, runVersionUpgrade
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface htsjdk.beta.plugin.HtsCodec
getDisplayName, getSignatureProbeLength, ownsURI
Methods inherited from interface htsjdk.beta.plugin.reads.ReadsCodec
getContentType
-
Field Details
-
VERSION_2_1
-
-
Constructor Details
-
CRAMCodecV2_1
public CRAMCodecV2_1()
-
-
Method Details
-
getVersion
Description copied from interface:HtsCodec
Get the version of the file format returned byHtsCodec.getFileFormat()
that is supported by this codec.- Returns:
- the file format version (
HtsVersion
) supported by this codec
-
getSignatureLength
public int getSignatureLength()Description copied from interface:HtsCodec
Get the number of bytes in the format and version signature used by the file format supported by this codec.- Returns:
- if the file format supported by this codecs is not remote, and is accessible via a local file
or stream, the size of the unique signature/version for this file format. otherwise 0.
Note: Codecs that are custom URI handlers (those that return true for
HtsCodec.ownsURI(htsjdk.io.IOPath)
), should always return 0 from this method. Since this method is used during codec resolution, implementations should avoid calling methods that may throw exceptions.
-
getDecoder
Description copied from interface:HtsCodec
Get anHtsDecoder
to decode the provided inputs. The input bundle must contain resources of the type required by this codec. To find a codec appropriate for decoding a given resource, use anHtsCodecResolver
obtained from anHtsCodecRegistry
.The framework will never call thi* method unless either
HtsCodec.ownsURI(IOPath)
, orHtsCodec.canDecodeURI(IOPath)
andHtsCodec.canDecodeSignature(SignatureStream, String)
(IOPath)} return true forinputBundle
.- Parameters:
inputBundle
- input to be decoded. To get a decoder for use with index queries that useHtsQuery
methods, the bundle must contain an index resource.readsDecoderOptions
- options for the decoder to use- Returns:
- an
HtsDecoder
that can decode the provided inputs
-
getEncoder
Description copied from interface:HtsCodec
Get anHtsEncoder
to encode to the provided outputs. The output bundle must contain resources of the type required by this codec. To find a codec appropriate for encoding a given resource, use anHtsCodecResolver
obtained from anHtsCodecRegistry
. The framework will never call this method unless eitherHtsCodec.ownsURI(IOPath)
, orHtsCodec.canDecodeURI(IOPath)
returned true foroutputBundle
.- Parameters:
outputBundle
- target output for the encoderreadsEncoderOptions
- encoder options to use- Returns:
- an
HtsEncoder
suitable for writing to the provided outputs
-
getSignatureString
Description copied from class:CRAMCodec
Get the signature string for this codec.- Specified by:
getSignatureString
in classCRAMCodec
- Returns:
- the signature string for this codec
-