Package htsjdk.samtools.util
Class CoordMath
java.lang.Object
htsjdk.samtools.util.CoordMath
Static methods that encapsulate the standard SAM way of storing ranges: one-based, with both ends
inclusive.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
encloses
(int outerStart, int outerEnd, int innerStart, int innerEnd) Returns true if the "inner" coords and totally enclosed by the "outer" coords.static int
getCycle
(boolean isNegativeStrand, int readLength, int readBaseIndex) Determines the read cycle number for the basestatic int
getEnd
(int start, int length) static int
getLength
(int start, int end) static int
getOverlap
(int start, int end, int start2, int end2) Determines the amount of overlap between two coordinate ranges.static int
getStart
(int end, int length) static boolean
overlaps
(int start, int end, int start2, int end2) Checks to see if the two sets of coordinates have any overlap.
-
Constructor Details
-
CoordMath
public CoordMath()
-
-
Method Details
-
getLength
public static int getLength(int start, int end) -
getStart
public static int getStart(int end, int length) -
getEnd
public static int getEnd(int start, int length) -
overlaps
public static boolean overlaps(int start, int end, int start2, int end2) Checks to see if the two sets of coordinates have any overlap. -
encloses
public static boolean encloses(int outerStart, int outerEnd, int innerStart, int innerEnd) Returns true if the "inner" coords and totally enclosed by the "outer" coords. -
getOverlap
public static int getOverlap(int start, int end, int start2, int end2) Determines the amount of overlap between two coordinate ranges. Assumes that the two ranges actually do overlap and therefore may produce strange results when they do not! -
getCycle
public static int getCycle(boolean isNegativeStrand, int readLength, int readBaseIndex) Determines the read cycle number for the base- Parameters:
isNegativeStrand
- true if the read is negative strandreadLength
-readBaseIndex
- the 0-based index of the read base in question
-