Constructor and Description |
---|
Interval(java.lang.String sequence,
int start,
int end)
Constructs an interval with the supplied sequence and start and end.
|
Interval(java.lang.String sequence,
int start,
int end,
boolean negative,
java.lang.String name)
Constructs an interval with the supplied sequence and start, end, strand and name.
|
Modifier and Type | Method and Description |
---|---|
boolean |
abuts(Interval other)
Returns true if this interval overlaps the other interval, otherwise false.
|
Interval |
clone() |
int |
compareTo(Interval that)
Sort based on sequence.compareTo, then start pos, then end pos
with null objects coming lexically last
|
static long |
countBases(java.util.Collection<Interval> intervals)
Counts the total number of bases a collection of intervals.
|
boolean |
equals(java.lang.Object other)
Equals method that agrees with
compareTo(Interval) . |
java.lang.String |
getContig()
Gets the contig name for the contig this is mapped to.
|
int |
getEnd() |
int |
getIntersectionLength(Interval other) |
java.lang.String |
getName()
Returns the name of the interval, possibly null.
|
java.lang.String |
getSequence()
Deprecated.
use getContig() instead
|
int |
getStart() |
int |
hashCode() |
Interval |
intersect(Interval that)
Returns a new Interval that represents the intersection between the two intervals.
|
boolean |
intersects(Interval other)
Returns true if this interval overlaps the other interval, otherwise false.
|
boolean |
isNegativeStrand()
Returns true if the interval is on the negative strand, otherwise false.
|
boolean |
isPositiveStrand()
Returns true if the interval is on the positive strand, otherwise false.
|
int |
length()
Gets the length of this interval.
|
Interval |
pad(int left,
int right)
Returns a new interval that is padded by the amount of bases specified on either side.
|
java.lang.String |
toString() |
public Interval(java.lang.String sequence, int start, int end)
sequence
- the name of the sequencestart
- the start position of the interval on the sequenceend
- the end position of the interval on the sequencepublic Interval(java.lang.String sequence, int start, int end, boolean negative, java.lang.String name)
sequence
- the name of the sequencestart
- the start position of the interval on the sequenceend
- the end position of the interval on the sequencenegative
- true to indicate negative strand, false otherwisename
- the name (possibly null) of the interval@Deprecated public java.lang.String getSequence()
public boolean isNegativeStrand()
public boolean isPositiveStrand()
public java.lang.String getName()
public boolean intersects(Interval other)
public int getIntersectionLength(Interval other)
public Interval intersect(Interval that)
public boolean abuts(Interval other)
public int length()
public Interval pad(int left, int right)
public static long countBases(java.util.Collection<Interval> intervals)
public int compareTo(Interval that)
compareTo
in interface java.lang.Comparable<Interval>
public boolean equals(java.lang.Object other)
compareTo(Interval)
.equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public Interval clone()
clone
in class java.lang.Object
public java.lang.String getContig()
Locatable
public int getStart()