|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object htsjdk.samtools.util.Interval
public class Interval
Represents a simple interval on a sequence. Coordinates are 1-based closed ended.
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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) . |
int |
getEnd()
Gets the 1-based closed-ended end position of the interval on the sequence. |
int |
getIntersectionLength(Interval other)
|
java.lang.String |
getName()
Returns the name of the interval, possibly null. |
java.lang.String |
getSequence()
Gets the name of the sequence on which the interval resides. |
int |
getStart()
Gets the 1-based start position of the interval on the sequence. |
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()
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
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 intervalMethod Detail |
---|
public java.lang.String getSequence()
public int getStart()
public int getEnd()
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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |