Package htsjdk.samtools.cram
Class BAIEntry
java.lang.Object
htsjdk.samtools.cram.BAIEntry
- All Implemented Interfaces:
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 Summary
ConstructorDescriptionCreate a BAIEntry from a CRAIEntry (used to read a .crai as a .bai).BAIEntry
(ReferenceContext referenceContext, AlignmentSpan alignmentSpan, long containerStartByteOffset, long sliceHeaderBlockByteOffset, int landmarkIndex) -
Method Summary
Modifier and TypeMethodDescriptionint
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 offsetint
int
long
int
int
long
int
int
-
Constructor Details
-
BAIEntry
public BAIEntry(ReferenceContext referenceContext, AlignmentSpan alignmentSpan, long containerStartByteOffset, long sliceHeaderBlockByteOffset, int landmarkIndex) -
BAIEntry
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
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 interfaceComparable<BAIEntry>
- Parameters:
other
- the CRAIEntry to compare against- Returns:
- int representing the comparison result, suitable for ordering
-
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()
-