Class BAIEntry

java.lang.Object
htsjdk.samtools.cram.BAIEntry
All Implemented Interfaces:
Comparable<BAIEntry>

public class BAIEntry extends Object implements Comparable<BAIEntry>
Class used to construct a BAI index for a CRAM file. Each BAIEntry represents a Slice or a subset of a Slice (since MULTI_REF slices can contain records for more than one reference context), as these need to be separated for BAI index creation).
  • Constructor Details

    • BAIEntry

      public BAIEntry(ReferenceContext referenceContext, AlignmentSpan alignmentSpan, long containerStartByteOffset, long sliceHeaderBlockByteOffset, int landmarkIndex)
    • BAIEntry

      public BAIEntry(CRAIEntry craiEntry)
      Create a BAIEntry from a CRAIEntry (used to read a .crai as a .bai). Note that there are no mapped/unmapped/unplaced counts present in the crai, which makes BAIEntries created this way less full featured (i.e., wrong), but that is inherent in the idea of converting a CRAi to a BAI to satisfy an index query). HTSJDK needs a native implementation satisfying queries using a CRAI directly. see https://github.com/samtools/htsjdk/issues/851
      Parameters:
      craiEntry -
  • Method Details

    • compareTo

      public int compareTo(BAIEntry other)
      Sort by numerical order of reference sequence ID, except that unmapped-unplaced reads come last For valid reference sequence ID (placed reads): - sort by alignment start - if alignment start is equal, sort by container offset - if alignment start and container offset are equal, sort by slice offset For unmapped-unplaced reads: - ignore (invalid) alignment start value - sort by container offset - if container offset is equal, sort by slice offset
      Specified by:
      compareTo in interface Comparable<BAIEntry>
      Parameters:
      other - the CRAIEntry to compare against
      Returns:
      int representing the comparison result, suitable for ordering
    • getReferenceContext

      public ReferenceContext getReferenceContext()
    • getAlignmentStart

      public int getAlignmentStart()
    • getAlignmentSpan

      public int getAlignmentSpan()
    • getMappedReadsCount

      public int getMappedReadsCount()
    • getUnmappedReadsCount

      public int getUnmappedReadsCount()
    • getUnmappedUnplacedReadsCount

      public int getUnmappedUnplacedReadsCount()
    • getContainerStartByteOffset

      public long getContainerStartByteOffset()
    • getSliceByteOffsetFromCompressionHeaderStart

      public long getSliceByteOffsetFromCompressionHeaderStart()
    • getLandmarkIndex

      public int getLandmarkIndex()