Package htsjdk.samtools
Class QueryInterval
- java.lang.Object
-
- htsjdk.samtools.QueryInterval
-
- All Implemented Interfaces:
Comparable<QueryInterval>
public class QueryInterval extends Object implements Comparable<QueryInterval>
Interval relative to a reference, for querying a BAM file.
-
-
Field Summary
Fields Modifier and Type Field Description int
end
1-based, inclusive.int
referenceIndex
Index of reference sequence, based on the sequence dictionary of the BAM file being queried.int
start
1-based, inclusive
-
Constructor Summary
Constructors Constructor Description QueryInterval(int referenceIndex, int start, int end)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(QueryInterval other)
boolean
endsAtStartOf(QueryInterval other)
boolean
equals(Object o)
int
hashCode()
static QueryInterval[]
optimizeIntervals(QueryInterval[] inputIntervals)
boolean
overlaps(QueryInterval other)
String
toString()
-
-
-
Field Detail
-
referenceIndex
public final int referenceIndex
Index of reference sequence, based on the sequence dictionary of the BAM file being queried.
-
start
public final int start
1-based, inclusive
-
end
public final int end
1-based, inclusive. If <= 0, implies that the interval goes to the end of the reference sequence
-
-
Method Detail
-
compareTo
public int compareTo(QueryInterval other)
- Specified by:
compareTo
in interfaceComparable<QueryInterval>
-
endsAtStartOf
public boolean endsAtStartOf(QueryInterval other)
- Returns:
- true if both are on same reference, and other starts exactly before this ends.
-
overlaps
public boolean overlaps(QueryInterval other)
- Returns:
- true if both are on same reference, and the overlap.
-
optimizeIntervals
public static QueryInterval[] optimizeIntervals(QueryInterval[] inputIntervals)
- Parameters:
inputIntervals
- WARNING: This list is modified (sorted) by this method.- Returns:
- Ordered list of intervals in which abutting and overlapping intervals are merged.
-
-