public class Container
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
int |
alignmentSpan |
int |
alignmentStart |
long |
bases |
int |
blockCount |
Block[] |
blocks
Container data
|
long |
byteOffset |
int |
checksum |
CompressionHeader |
compressionHeader |
int |
containerBlocksByteSize
The total length of all blocks in this container, of all types.
|
long |
globalRecordCounter |
int[] |
landmarks
Slice byte boundaries as offsets within this container,
counted after the container header.
|
int |
nofRecords |
Constructor and Description |
---|
Container(ReferenceContext refContext)
Construct this Container by providing its
ReferenceContext |
Modifier and Type | Method and Description |
---|---|
void |
distributeIndexingParametersToSlices()
Populate the indexing parameters of this Container's slices
Requires: valid landmarks and containerBlocksByteSize
|
java.util.List<CRAIEntry> |
getCRAIEntries()
Retrieve the list of CRAI Index entries corresponding to this Container
|
ReferenceContext |
getReferenceContext() |
Slice[] |
getSlices() |
java.util.Map<ReferenceContext,AlignmentSpan> |
getSpans(ValidationStringency validationStringency)
Iterate through all of this container's
Slice s to derive a map of reference sequence IDs
to AlignmentSpan s. |
static Container |
initializeFromSlices(java.util.List<Slice> containerSlices,
CompressionHeader compressionHeader,
long containerByteOffset)
Derive the container's
ReferenceContext from its Slice s. |
boolean |
isEOF() |
java.lang.String |
toString() |
public int containerBlocksByteSize
BlockContentType
public int alignmentStart
public int alignmentSpan
public int nofRecords
public long globalRecordCounter
public long bases
public int blockCount
public int[] landmarks
Slice.byteOffsetFromCompressionHeaderStart
.
As an example, suppose we have:
- landmarks[0] = 9000
- landmarks[1] = 109000
- containerBlocksByteSize = 123456
We therefore know:
- the compression header size = 9000
- Slice 0 has offset 9000 and size 100000 (109000 - 9000)
- Slice 1 has offset 109000 and size 14456 (123456 - 109000)public int checksum
public Block[] blocks
public CompressionHeader compressionHeader
public long byteOffset
public Container(ReferenceContext refContext)
ReferenceContext
refContext
- the reference context associated with this containerpublic Slice[] getSlices()
public ReferenceContext getReferenceContext()
public static Container initializeFromSlices(java.util.List<Slice> containerSlices, CompressionHeader compressionHeader, long containerByteOffset)
ReferenceContext
from its Slice
s.
A Single Reference Container contains only Single Reference Slices mapped to the same reference.
- set the Container's ReferenceContext to be the same as those slices
- set the Container's Alignment Start and Span to cover all slices
A Multiple Reference Container contains only Multiple Reference Slices.
- set the Container's ReferenceContext to MULTIPLE_REFERENCE_CONTEXT
- unset the Container's Alignment Start and Span
An Unmapped Container contains only Unmapped Slices.
- set the Container's ReferenceContext to UNMAPPED_UNPLACED_CONTEXT
- unset the Container's Alignment Start and Span
Any other combination is invalid.
TODO for general Container refactoring: make this part of constructioncontainerSlices
- the constituent Slices of the ContainercompressionHeader
- the CRAM CompressionHeader
to assign to the ContainercontainerByteOffset
- the Container's byte offset from the start of the streamCRAMException
- for invalid Container statespublic void distributeIndexingParametersToSlices()
CRAMException
- when the Container is in an invalid statepublic java.util.List<CRAIEntry> getCRAIEntries()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isEOF()
public java.util.Map<ReferenceContext,AlignmentSpan> getSpans(ValidationStringency validationStringency)
Slice
s to derive a map of reference sequence IDs
to AlignmentSpan
s. Used to create BAI Indexes.validationStringency
- stringency for validating records, passed to
Slice.getMultiRefAlignmentSpans(CompressionHeader, ValidationStringency)