Package htsjdk.samtools.cram.structure
Enum Class EncodingID
- All Implemented Interfaces:
Serializable
,Comparable<EncodingID>
,Constable
Encoding ID as specified by Section 3 of the CRAM spec. These are basically ways to serialize a data series.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionBinary coding with sufficient leading 0 bits to store each value with the same lengthA byte array serialized as [length][elements]A byte array serialized as [elements][stop]Shove the data into a byte array for compressing later with a generic compressor like GZIP.http://en.wikipedia.org/wiki/Elias_gamma_codingEXPERIMENTAL: This encoding is untested and scheduled for removal from the CRAM spec.EXPERIMENTAL: This encoding is untested and scheduled for removal from the CRAM spec.http://en.wikipedia.org/wiki/Huffman_coding"Do nothing" encoding.Subexponential codes. -
Method Summary
Modifier and TypeMethodDescriptionint
getId()
boolean
Return true if this encoding can be used in an external block.static EncodingID
Returns the enum constant of this class with the specified name.static EncodingID[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NULL
"Do nothing" encoding. Should throw an exception when trying reading or writing with this encoding. -
EXTERNAL
Shove the data into a byte array for compressing later with a generic compressor like GZIP. -
GOLOMB
EXPERIMENTAL: This encoding is untested and scheduled for removal from the CRAM spec. http://en.wikipedia.org/wiki/Golomb_coding -
HUFFMAN
http://en.wikipedia.org/wiki/Huffman_coding -
BYTE_ARRAY_LEN
A byte array serialized as [length][elements] -
BYTE_ARRAY_STOP
A byte array serialized as [elements][stop] -
BETA
Binary coding with sufficient leading 0 bits to store each value with the same length -
SUBEXPONENTIAL
Subexponential codes. http://www.ittc.ku.edu/~jsv/Papers/HoV94.progressive_FELICS.pdf -
GOLOMB_RICE
EXPERIMENTAL: This encoding is untested and scheduled for removal from the CRAM spec. A variant of GOLOMB encoding: http://en.wikipedia.org/wiki/Golomb_coding -
GAMMA
http://en.wikipedia.org/wiki/Elias_gamma_coding
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getId
public int getId()- Returns:
- the number assigned to each encoding in the CRAM spec
-
isExternalEncoding
public boolean isExternalEncoding()Return true if this encoding can be used in an external block. This returns true even for BYTE_ARRAY_LEN, even though BYTE_ARRAY_LEN is not entirely restricted to external, since it can use a core encoding for the array length sub-encoding.- Returns:
- true if the encoding is EXTERNAL, BYTE_ARRAY_STOP, or BYTE_ARRAY_LEN.
-