Package htsjdk.samtools.cram.structure
Class CramHeader
- java.lang.Object
-
- htsjdk.samtools.cram.structure.CramHeader
-
public final class CramHeader extends Object
A starting object when dealing with CRAM files. ACramHeaderholds 2 things: 1. File format definition, including content id and version information 2. SAM file header
-
-
Field Summary
Fields Modifier and Type Field Description static byte[]MAGIC
-
Constructor Summary
Constructors Constructor Description CramHeader(Version version, String id, SAMFileHeader samFileHeader)Create a newCramHeaderobject with the specified version, id and SAM file header.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CramHeaderclone()Copy the CRAM header into a newCramHeaderobject.booleanequals(Object o)byte[]getId()SAMFileHeadergetSamFileHeader()Get theSAMFileHeaderobject associated with this CRAM file header.VersiongetVersion()inthashCode()voidsetID(String stringID)Set the id of the header.voidsetVersion(Version version)
-
-
-
Constructor Detail
-
CramHeader
public CramHeader(Version version, String id, SAMFileHeader samFileHeader)
Create a newCramHeaderobject with the specified version, id and SAM file header. The id field by default is guaranteed to be byte[20].- Parameters:
version- the CRAM version to assumeid- an identifier of the content associated with this headersamFileHeader- the SAM file header
-
-
Method Detail
-
setID
public void setID(String stringID)
Set the id of the header. A typical use is for example file name to be used when streaming or a checksum of the data contained in the file.- Parameters:
stringID- a new id; only first 20 bytes from byte representation of javaStringwill be used.
-
clone
public CramHeader clone()
Copy the CRAM header into a newCramHeaderobject.
-
getSamFileHeader
public SAMFileHeader getSamFileHeader()
Get theSAMFileHeaderobject associated with this CRAM file header.- Returns:
- the SAM file header
-
getId
public byte[] getId()
-
getVersion
public Version getVersion()
-
setVersion
public void setVersion(Version version)
-
-