public class BAMCodecV1_0 extends BAMCodec
| Modifier and Type | Field and Description |
|---|---|
static HtsVersion |
VERSION_1 |
BAM_DEFAULT_VERSION| Constructor and Description |
|---|
BAMCodecV1_0() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canDecodeSignature(SignatureStream probingInputStream,
java.lang.String sourceName)
Determine if the codec can decode an input stream by inspecting a signature embedded
within the stream.
|
BAMDecoder |
getDecoder(Bundle inputBundle,
ReadsDecoderOptions decoderOptions)
Get an
HtsDecoder to decode the provided inputs. |
BAMEncoder |
getEncoder(Bundle outputBundle,
ReadsEncoderOptions encoderOptions)
Get an
HtsEncoder to encode to the provided outputs. |
int |
getSignatureLength()
Get the number of bytes in the format and version signature used by the file format supported
by this codec.
|
int |
getSignatureProbeLength()
Get the number of bytes of needed by this codec to probe an input stream for a format/version
signature, and determine if it can supply a decoder for the stream.
|
HtsVersion |
getVersion()
Get the version of the file format returned by
HtsCodec.getFileFormat() that is supported by this codec. |
boolean |
runVersionUpgrade(HtsVersion sourceCodecVersion,
HtsVersion targetCodecVersion) |
canDecodeURI, getFileFormatclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetContentTypegetDisplayName, ownsURIpublic static final HtsVersion VERSION_1
public HtsVersion getVersion()
HtsCodecHtsCodec.getFileFormat() that is supported by this codec.HtsVersion) supported by this codecpublic int getSignatureProbeLength()
HtsCodecHtsCodec.getSignatureLength() for codecs that support compressed or encrypted
streams, since they may require a larger and more semantically meaningful input fragment
(such as an entire encrypted or compressed block) in order to inspect the plaintext signature.
Therefore signatureProbeLength should be expressed in "compressed/encrypted" space rather
than "plaintext" space. The length returned from this method is used to determine the size of the
SignatureStream that is subsequently passed to
HtsCodec.canDecodeSignature(SignatureStream, String).
Note: Codecs that are custom URI handlers (those that return true for HtsCodec.ownsURI(IOPath)),
should always return 0 from this method when it is called.
Since this method is used during codec resolution, implementations should avoid calling methods that
may throw exceptions.
public int getSignatureLength()
HtsCodecHtsCodec.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.public boolean canDecodeSignature(SignatureStream probingInputStream, java.lang.String sourceName)
HtsCodec
HtsCodec.getSignatureProbeLength() HtsCodec.getSignatureProbeLength()
Codecs that handle custom URIs that reference remote resources (those that return true for HtsCodec.ownsURI(htsjdk.io.IOPath))
should generally not inspect the stream, and should return false from this method, since the method
will never be called with any resource for which HtsCodec.ownsURI(htsjdk.io.IOPath) returned true.
Since this method is used during codec resolution, implementations should avoid calling methods that
may throw exceptions.
probingInputStream - the stream to be inspect for the resource's embedded
signature and versionsourceName - a display name describing the source of the input stream, for use in error messagespublic BAMDecoder getDecoder(Bundle inputBundle, ReadsDecoderOptions decoderOptions)
HtsCodecHtsDecoder 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 an HtsCodecResolver obtained
from an HtsCodecRegistry.
The framework will never call thi* method unless either HtsCodec.ownsURI(IOPath), or
HtsCodec.canDecodeURI(IOPath) and HtsCodec.canDecodeSignature(SignatureStream, String) (IOPath)}
return true for inputBundle.
inputBundle - input to be decoded. To get a decoder for use with index queries that use
HtsQuery methods, the bundle must contain
an index resource.decoderOptions - options for the decoder to useHtsDecoder that can decode the provided inputspublic BAMEncoder getEncoder(Bundle outputBundle, ReadsEncoderOptions encoderOptions)
HtsCodecHtsEncoder 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 an HtsCodecResolver obtained from an
HtsCodecRegistry.
The framework will never call this method unless either HtsCodec.ownsURI(IOPath), or
HtsCodec.canDecodeURI(IOPath) returned true for outputBundle.outputBundle - target output for the encoderencoderOptions - encoder options to useHtsEncoder suitable for writing to the provided outputspublic boolean runVersionUpgrade(HtsVersion sourceCodecVersion, HtsVersion targetCodecVersion)