Class LocationHelper
java.lang.Object
org.biojava3.core.sequence.location.LocationHelper
Helper methods for use with the Location classes. Taking its inspiration from the
RichSequence.Tools class from the old BioJava
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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 boolean
consistentAccessions
(List<Location> subLocations) Scans a list of locations and returns true if all the given locations are linked to the same sequence.static boolean
detectCicular
(List<Location> subLocations) Loops through the given list of locations and returns true if it looks like they represent a circular location.static Point
This will attempt to find what the last point is and returns that position.static Point
detectStart
(List<Location> subLocations) Assumes that the first element is the start & clones itstatic Strand
detectStrand
(List<Location> subLocations) Loops through the given list of locations and returns the consensus Strand class.static Location
Scans through a list of locations to find the Location with the highest endstatic Location
Scans through a list of locations to find the Location with the lowest startstatic Location
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
Used as a thin wrapper to thelocation(java.util.List, java.lang.String)
method to bring the given location list together as a join (the default type)static Location
Builds a location from a List of locations; this can be circular or linear joins.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.
-
Constructor Details
-
LocationHelper
public LocationHelper()
-
-
Method Details
-
location
Used as a thin wrapper to thelocation(java.util.List, java.lang.String)
method to bring the given location list together as a join (the default type) -
location
Builds a location from a List of locations; this can be circular or linear joins. The code expects that these locations are in a sensible format.- Parameters:
subLocations
- The list of locations to use to build the location. If given a list of size 1 we will return that location.type
- The type of join for this location; defaults to join- Returns:
-
location
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
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
Scans through a list of locations to find the Location with the lowest start -
getMax
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. -
detectCicular
Loops through the given list of locations and returns true if it looks like they represent a circular location. Detection cannot happen if we do not have consistent accessions -
consistentAccessions
Scans a list of locations and returns true if all the given locations are linked to the same sequence. A list of null accessioned locations is the same as a list where the accession is the same- Parameters:
subLocations
- The locations to scan- Returns:
- Returns a boolean indicating if this is consistently accessioned
-
detectStrand
Loops through the given list of locations and returns the consensus Strand class. If the class switches then we will return an undefined strand -
detectStart
Assumes that the first element is the start & clones it -
detectEnd
This will attempt to find what the last point is and returns that position. If the location is circular this will return the total length of the location and does not mean the maximum point on the Sequence we may find the locations on
-