Package htsjdk.samtools
Class QueryInterval
java.lang.Object
htsjdk.samtools.QueryInterval
- All Implemented Interfaces:
Comparable<QueryInterval>
Interval relative to a reference, for querying a BAM file.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal int
1-based, inclusive.final int
Index of reference sequence, based on the sequence dictionary of the BAM file being queried.final int
1-based, inclusive -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
assertIntervalsOptimized
(QueryInterval[] intervals) int
compareTo
(QueryInterval other) boolean
endsAtStartOf
(QueryInterval other) boolean
int
hashCode()
static QueryInterval[]
optimizeIntervals
(QueryInterval[] inputIntervals) boolean
overlaps
(QueryInterval other) toString()
-
Field Details
-
referenceIndex
public final int referenceIndexIndex of reference sequence, based on the sequence dictionary of the BAM file being queried. -
start
public final int start1-based, inclusive -
end
public final int end1-based, inclusive. If <= 0, implies that the interval goes to the end of the reference sequence
-
-
Constructor Details
-
QueryInterval
public QueryInterval(int referenceIndex, int start, int end)
-
-
Method Details
-
compareTo
- Specified by:
compareTo
in interfaceComparable<QueryInterval>
-
endsAtStartOf
- Returns:
- true if both are on same reference, and other starts exactly before this ends.
-
overlaps
- Returns:
- true if both are on same reference, and the overlap.
-
toString
-
optimizeIntervals
- Parameters:
inputIntervals
- WARNING: This list is modified (sorted) by this method.- Returns:
- Ordered list of intervals in which abutting and overlapping intervals are merged.
-
assertIntervalsOptimized
- Throws:
IllegalArgumentException
- if the intervals are not optimized- See Also:
-
equals
-
hashCode
public int hashCode()
-