Package htsjdk.samtools.cram.structure
Class CompressionHeader
java.lang.Object
htsjdk.samtools.cram.structure.CompressionHeader
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a CompressionHeader using the defaultCRAMEncodingStrategy
CompressionHeader
(CRAMVersion cramVersion, InputStream blockStream) Read a COMPRESSION_HEADER Block from an InputStream and return its contents as a CompressionHeader.CompressionHeader
(CompressionHeaderEncodingMap encodingMap) Create a compression header using the givenCompressionHeaderEncodingMap
.CompressionHeader
(CompressionHeaderEncodingMap encodingMap, boolean isAPDelta, boolean isPreserveReadNames, boolean isReferenceRequired) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addTagEncoding
(int tagId, ExternalCompressor compressor, EncodingDescriptor params) Get theCompressionHeaderEncodingMap
for this compression header.byte[][][]
boolean
Return true if the header has APDelta set.boolean
boolean
void
setSubstitutionMatrix
(SubstitutionMatrix substitutionMatrix) void
setTagIdDictionary
(byte[][][] dictionary) void
write
(CRAMVersion cramVersion, OutputStream blockStream) Write this CompressionHeader out to an internal OutputStream, wrap it in a Block, and write that Block out to the passed-in OutputStream.
-
Constructor Details
-
CompressionHeader
public CompressionHeader()Create a CompressionHeader using the defaultCRAMEncodingStrategy
-
CompressionHeader
public CompressionHeader(CompressionHeaderEncodingMap encodingMap, boolean isAPDelta, boolean isPreserveReadNames, boolean isReferenceRequired) -
CompressionHeader
Create a compression header using the givenCompressionHeaderEncodingMap
.- Parameters:
encodingMap
- the encoding map to use for this compression header
-
CompressionHeader
Read a COMPRESSION_HEADER Block from an InputStream and return its contents as a CompressionHeader.- Parameters:
cramVersion
- the CRAM versionblockStream
- the stream to read from
-
-
Method Details
-
getEncodingMap
Get theCompressionHeaderEncodingMap
for this compression header.- Returns:
CompressionHeaderEncodingMap
for thisCompressionHeader
-
write
Write this CompressionHeader out to an internal OutputStream, wrap it in a Block, and write that Block out to the passed-in OutputStream.- Parameters:
cramVersion
- the CRAM versionblockStream
- the stream to write to
-
isAPDelta
public boolean isAPDelta()Return true if the header has APDelta set. Coordinate sorted input will use APDelta=true, but it is also permitted for other sort orders to use APDelta=true.- Returns:
- the value of the APDelta flag
-
isPreserveReadNames
public boolean isPreserveReadNames() -
getTagEncodingMap
-
getSubstitutionMatrix
-
getTagIDDictionary
public byte[][][] getTagIDDictionary() -
setTagIdDictionary
public void setTagIdDictionary(byte[][][] dictionary) -
setSubstitutionMatrix
-
isReferenceRequired
public boolean isReferenceRequired()- Returns:
- true if RR is set on this compression header
-
addTagEncoding
-