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. ACramHeader
holds 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 newCramHeader
object with the specified version, id and SAM file header.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CramHeader
clone()
Copy the CRAM header into a newCramHeader
object.boolean
equals(Object o)
byte[]
getId()
SAMFileHeader
getSamFileHeader()
Get theSAMFileHeader
object associated with this CRAM file header.Version
getVersion()
int
hashCode()
void
setID(String stringID)
Set the id of the header.void
setVersion(Version version)
-
-
-
Constructor Detail
-
CramHeader
public CramHeader(Version version, String id, SAMFileHeader samFileHeader)
Create a newCramHeader
object 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 javaString
will be used.
-
clone
public CramHeader clone()
Copy the CRAM header into a newCramHeader
object.
-
getSamFileHeader
public SAMFileHeader getSamFileHeader()
Get theSAMFileHeader
object 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)
-
-