Class MultiSourceCompoundRichLocation

All Implemented Interfaces:
Comparable, Annotatable, Location, Changeable, RichLocation, RichAnnotatable

An implementation of RichLocation which possibly covers multiple locations, on different strands, different circular lengths, or different sequences.
Since:
1.5
Author:
Richard Holland, Mark Schreiber
  • Constructor Details

    • MultiSourceCompoundRichLocation

      Constructs a MultiSourceCompoundRichLocation from the given set of members, with the default term of "join". Note that you really shouldn't use this if you are unsure if your members set contains overlapping members. Use RichLocation.Tools.construct() instead. The members collection must only contain Location instances. Any that are not RichLocations will be converted using RichLocation.Tools.enrich().
      Parameters:
      members - the members to put into the compound location.
      See Also:
    • MultiSourceCompoundRichLocation

      Constructs a MultiSourceCompoundRichLocation from the given set of members. Note that you really shouldn't use this if you are unsure if your members set contains overlapping members. Use RichLocation.Tools.construct(members) instead. The members collection must only contain Location instances. Any that are not RichLocations will be converted using RichLocation.Tools.enrich().
      Parameters:
      term - the term to use when describing the group of members.
      members - the members to put into the compound location.
      See Also:
  • Method Details

    • getCrossRef

      Retrieves the crossref associated with this location. ALWAYS RETURNS NULL
      Specified by:
      getCrossRef in interface RichLocation
      Overrides:
      getCrossRef in class SimpleRichLocation
      Returns:
      the crossref.
    • getCircularLength

      public int getCircularLength()
      Retrieves the circular length of this location. If it is 0, the location is not circular. If it is not zero, then the number refers to the wrapping length of the location. eg. 100 would signify that a position of 112 would actually be a position of 112-100 = 12. ALWAYS RETURNS ZERO
      Specified by:
      getCircularLength in interface RichLocation
      Overrides:
      getCircularLength in class SimpleRichLocation
      Returns:
      the position.
    • setCircularLength

      public void setCircularLength(int sourceSeqLength) throws ChangeVetoException
      Sets the circular length of this location. If it is 0, the location is not circular. If it is not zero, then the number refers to the wrapping length of the location. eg. 100 would signify that a position of 112 would actually be a position of 112-100 = 12. RECURSIVELY APPLIES CALL TO ALL MEMBERS NOT IMPLEMENTED
      Specified by:
      setCircularLength in interface RichLocation
      Overrides:
      setCircularLength in class CompoundRichLocation
      Parameters:
      sourceSeqLength - the circular length of this location
      Throws:
      ChangeVetoException - ALWAYS
    • getStrand

      Retrieves the strand associated with this location.
      Specified by:
      getStrand in interface RichLocation
      Overrides:
      getStrand in class SimpleRichLocation
      Returns:
      the strand.
    • getMin

      public int getMin()
      The minimum position contained.

      WARNING: The location will not contain every point between getMin() and getMax() if isContiguous() is false. If isContiguous() does return false you should use the Iterator returned by blockIterator() to iterate over the minimum set of contiguous blocks that make up this Location ALWAYS RETURNS ONE

      Specified by:
      getMin in interface Location
      Overrides:
      getMin in class SimpleRichLocation
      Returns:
      the minimum position contained
    • getMax

      public int getMax()
      The maximum position contained.

      WARNING: The location will not contain every point between getMin() and getMax() if isContiguous() is false. If isContiguous() does return false you should use the Iterator returned by blockIterator() to iterate over the minimum set of contiguous blocks that make up this Location ALWAYS RETURNS COMBINED LENGTH OF MEMBERS

      Specified by:
      getMax in interface Location
      Overrides:
      getMax in class SimpleRichLocation
      Returns:
      the maximum position contained
    • getMinPosition

      Retrieves the start position of this location. ALWAYS RETURNS A POINT POSITION AT POINT 1
      Specified by:
      getMinPosition in interface RichLocation
      Overrides:
      getMinPosition in class SimpleRichLocation
      Returns:
      the position.
    • getMaxPosition

      Retrieves the end position of this location. ALWAYS RETURNS A POINT POSITION AT POINT EQUIVALENT TO COMBINED LENGTH OF MEMBERS
      Specified by:
      getMaxPosition in interface RichLocation
      Overrides:
      getMaxPosition in class SimpleRichLocation
      Returns:
      the position.
    • translate

      public Location translate(int dist)
      Create a location that is a translation of this location. Recursively translates all members of this location. Recursively translates all members of this location.
      Specified by:
      translate in interface Location
      Overrides:
      translate in class CompoundRichLocation
      Parameters:
      dist - the distance to translate (to the right)