public class ProjectionUtils extends Object
Constructor and Description |
---|
ProjectionUtils() |
Modifier and Type | Method and Description |
---|---|
static Location |
flipLocation(Location oldLoc,
int translation)
Flip a location.
|
static StrandedFeature.Strand |
flipStrand(StrandedFeature.Strand s) |
static Location |
revertLocation(Location oldLoc,
int translation,
boolean oppositeStrand)
Revert a location, translating and flipping as required.
|
static Location |
transformLocation(Location oldLoc,
int translation,
boolean oppositeStrand)
Transform a location, translating and flipping as required.
|
public ProjectionUtils()
public static Location transformLocation(Location oldLoc, int translation, boolean oppositeStrand)
If oppositeStrand is false, this is equivalent to translating the location. If it is true, this is equivalent to flipping it.
oldLoc
- the Location to transformtranslation
- the translation to applyoppositeStrand
- wether or not this is a flippublic static Location revertLocation(Location oldLoc, int translation, boolean oppositeStrand)
If oppositeStrand is false, this is equivalent to un-translating the location. If it is true, this is equivalent to (un)flipping it.
oldLoc
- the Location to reverttranslation
- the translation to unapplyoppositeStrand
- wether or not this is a flippublic static Location flipLocation(Location oldLoc, int translation)
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.
oldLoc
- the Location to fliptranslation
- the translation to usepublic static StrandedFeature.Strand flipStrand(StrandedFeature.Strand s)
Copyright © 2014 BioJava. All rights reserved.