|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.biojava.bio.seq.projection.ProjectionUtils
public class ProjectionUtils
Some common things you want to do while projecting features.
Constructor Summary | |
---|---|
ProjectionUtils()
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ProjectionUtils()
Method Detail |
---|
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 flip
public 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 flip
public 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 use
public static StrandedFeature.Strand flipStrand(StrandedFeature.Strand s)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |