Class ProjectionUtils

java.lang.Object
org.biojava.bio.seq.projection.ProjectionUtils

public class ProjectionUtils extends Object
Some common things you want to do while projecting features.
Since:
1.3
Author:
Thomas Down, Matthew Pocock
  • Constructor Details

  • Method Details

    • transformLocation

      public static Location transformLocation(Location oldLoc, int translation, boolean oppositeStrand)
      Transform a location, translating and flipping as required.

      If oppositeStrand is false, this is equivalent to translating the location. If it is true, this is equivalent to flipping it.

      Parameters:
      oldLoc - the Location to transform
      translation - the translation to apply
      oppositeStrand - wether or not this is a flip
      Returns:
      the transformed location
    • revertLocation

      public static Location revertLocation(Location oldLoc, int translation, boolean oppositeStrand)
      Revert a location, translating and flipping as required.

      If oppositeStrand is false, this is equivalent to un-translating the location. If it is true, this is equivalent to (un)flipping it.

      Parameters:
      oldLoc - the Location to revert
      translation - the translation to unapply
      oppositeStrand - wether or not this is a flip
      Returns:
      the reverted location
    • flipLocation

      public static Location flipLocation(Location oldLoc, int translation)
      Flip a location.

      All points p map to translation - p. Clearly, this mapping is its own inverse. If you wish to flip all locations between 1 and length, you should use a translation of length + 1. In general, if you wish to flip all features between x and y, you should use a translation of x + y.

      Parameters:
      oldLoc - the Location to flip
      translation - the translation to use
      Returns:
      the flipped Location
    • flipStrand