Package htsjdk.samtools.util
Class CoordMath
- java.lang.Object
-
- htsjdk.samtools.util.CoordMath
-
public class CoordMath extends Object
Static methods that encapsulate the standard SAM way of storing ranges: one-based, with both ends inclusive.
-
-
Constructor Summary
Constructors Constructor Description CoordMath()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanencloses(int outerStart, int outerEnd, int innerStart, int innerEnd)Returns true if the "inner" coords and totally enclosed by the "outer" coords.static intgetCycle(boolean isNegativeStrand, int readLength, int readBaseIndex)Determines the read cycle number for the basestatic intgetEnd(int start, int length)static intgetLength(int start, int end)static intgetOverlap(int start, int end, int start2, int end2)Determines the amount of overlap between two coordinate ranges.static intgetStart(int end, int length)static booleanoverlaps(int start, int end, int start2, int end2)Checks to see if the two sets of coordinates have any overlap.
-
-
-
Method Detail
-
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
-
-