Class Slice


  • public class Slice
    extends Object
    CRAM slice is a logical union of blocks into for example alignment slices.
    • Field Detail

      • sequenceId

        public int sequenceId
      • alignmentStart

        public int alignmentStart
      • alignmentSpan

        public int alignmentSpan
      • nofRecords

        public int nofRecords
      • globalRecordCounter

        public long globalRecordCounter
      • nofBlocks

        public int nofBlocks
      • contentIDs

        public int[] contentIDs
      • embeddedRefBlockContentID

        public int embeddedRefBlockContentID
      • refMD5

        public byte[] refMD5
      • headerBlock

        public Block headerBlock
      • coreBlock

        public Block coreBlock
      • embeddedRefBlock

        public Block embeddedRefBlock
      • offset

        public int offset
      • containerOffset

        public long containerOffset
      • size

        public int size
      • index

        public int index
      • bases

        public long bases
    • Constructor Detail

      • Slice

        public Slice()
    • Method Detail

      • validateRefMD5

        public boolean validateRefMD5​(byte[] ref)
      • setRefMD5

        public void setRefMD5​(byte[] ref)
      • getAttribute

        public Object getAttribute​(short tag)
        Get tag value attached to the slice.
        Parameters:
        tag - tag ID as a short integer as returned by SAMTag.makeBinaryTag(String)
        Returns:
        a value of the tag
      • setAttribute

        public void setAttribute​(String tag,
                                 Object value)
        Set a value for the tag.
        Parameters:
        tag - tag ID as a short integer as returned by SAMTag.makeBinaryTag(String)
        value - tag value
      • setUnsignedArrayAttribute

        public void setUnsignedArrayAttribute​(String tag,
                                              Object value)
      • isMapped

        public boolean isMapped()
      • isMultiref

        public boolean isMultiref()
      • createCramRecordReader

        public CramRecordReader createCramRecordReader​(CompressionHeader header,
                                                       ValidationStringency validationStringency)
        Initialize a Cram Record Reader from a Slice
        Parameters:
        header - the associated Cram Compression Header
        validationStringency - how strict to be when reading this CRAM record
      • getMultiRefAlignmentSpans

        public Map<Integer,​AlignmentSpan> getMultiRefAlignmentSpans​(CompressionHeader header,
                                                                          ValidationStringency validationStringency)
        Uses a Multiple Reference Slice Alignment Reader to determine the Reference Spans of a Slice. The intended use is for CRAI indexing.
        Parameters:
        header - the associated Cram Compression Header
        validationStringency - how strict to be when reading CRAM records