Class Location.Tools
- java.lang.Object
-
- org.biojava.nbio.core.sequence.location.template.Location.Tools
-
- Enclosing interface:
- Location
public static class Location.Tools extends Object
Helper methods for use with the Location classes. Taking its inspiration from the RichSequence.Tools class from the old BioJava
-
-
Constructor Summary
Constructors Constructor Description Tools()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Location
circularLocation(int start, int end, Strand strand, int length)
Converts a location which defines the outer bounds of a circular location and splits it into the required portions.static int
completeCircularPasses(int index, int seqLength)
Works in a similar way to modulateCircularLocation but returns the number of complete passes over a Sequence length a circular location makes i.e. if we have a sequence of length 10 and the location 3..52 we make 4 complete passes through the genome to go from position 3 to position 52.static Location
getMax(List<Location> locations)
Scans through a list of locations to find the Location with the highest endstatic Location
getMin(List<Location> locations)
Scans through a list of locations to find the Location with the lowest startstatic Location
location(int start, int end, Strand strand, int length)
Returns a location object which unlike the location constructors allows you to input reverse coordinates and will convert these into the right location on the positive strand.static Location
location(List<Location> locations, Integer sequenceLength, String type)
Used for building a location from a series of sub-locationsstatic int
modulateCircularIndex(int index, int seqLength)
Takes a point on a circular location and moves it left until it falls at the earliest possible point that represents the same base.
-
-
-
Constructor Detail
-
Tools
public Tools()
-
-
Method Detail
-
location
public static Location location(List<Location> locations, Integer sequenceLength, String type)
Used for building a location from a series of sub-locations
-
location
public static Location location(int start, int end, Strand strand, int length)
Returns a location object which unlike the location constructors allows you to input reverse coordinates and will convert these into the right location on the positive strand.
-
circularLocation
public static Location circularLocation(int start, int end, Strand strand, int length)
Converts a location which defines the outer bounds of a circular location and splits it into the required portions. Unlike any other location builder this allows you to express your input location on the reverse strand- Parameters:
location
- The location which currently expresses the outer bounds of a circular location.length
- The length of the circular genomic unit- Returns:
- The circular location; can optionally return a normal non circular location if the one you give is within the bounds of the length
-
getMin
public static Location getMin(List<Location> locations)
Scans through a list of locations to find the Location with the lowest start
-
getMax
public static Location getMax(List<Location> locations)
Scans through a list of locations to find the Location with the highest end
-
modulateCircularIndex
public static int modulateCircularIndex(int index, int seqLength)
Takes a point on a circular location and moves it left until it falls at the earliest possible point that represents the same base.- Parameters:
index
- Index of the position to work withseqLength
- Length of the Sequence- Returns:
- The shifted point
-
completeCircularPasses
public static int completeCircularPasses(int index, int seqLength)
Works in a similar way to modulateCircularLocation but returns the number of complete passes over a Sequence length a circular location makes i.e. if we have a sequence of length 10 and the location 3..52 we make 4 complete passes through the genome to go from position 3 to position 52.
-
-