public class TranslateFlipContext extends ReparentContext
Use this to 'reverse complement' a feature hierachy, or just to shift it sideways a bit.
If the flipping mode is dissabled, then all translated features are projected as having locations equivalent to feat.getLocation().translate(translation). If the flipping mode is enabled, then all features are flipped arround translation so that translation-i becomes translation+i.
Constructor and Description |
---|
TranslateFlipContext(FeatureHolder parent,
FeatureHolder wrapped,
int translation)
Create a new TranslateFlipContext with translation only.
|
TranslateFlipContext(FeatureHolder parent,
FeatureHolder wrapped,
int translate,
boolean oppositeStrand)
Create a new TranslateFlipContext with explicit translation and flip.
|
TranslateFlipContext(FeatureHolder parent,
FeatureHolder wrapped,
int min,
int max)
Create a new TranslateFlipContext that flips all featurs arround min and
max.
|
Modifier and Type | Method and Description |
---|---|
protected FilterUtils.FilterTransformer |
getReverter() |
protected FilterUtils.FilterTransformer |
getTransformer() |
int |
getTranslation() |
boolean |
isOppositeStrand() |
Location |
projectLocation(Location oldLoc) |
StrandedFeature.Strand |
projectStrand(StrandedFeature.Strand strand) |
Location |
revertLocation(Location oldLoc) |
StrandedFeature.Strand |
revertStrand(StrandedFeature.Strand strand) |
addChangeListener, createFeature, createFeature, getParent, getParent, getSchema, getSequence, getUnprojectedFeatures, projectChildFeatures, projectFeature, projectFeatures, projectFilter, removeChangeListener, removeFeature, removeFeature, revertFeature, revertFilter
public TranslateFlipContext(FeatureHolder parent, FeatureHolder wrapped, int translate, boolean oppositeStrand)
Locations will be mapped according to the rules in @link ProjectionUtils.
parent
- the parent to graft all projected features ontowrapped
- the featurs to projecttranslate
- the translationoppositeStrand
- wether or not to flippublic TranslateFlipContext(FeatureHolder parent, FeatureHolder wrapped, int min, int max)
A Location at exactly min will become one at max, and a Location at exactly max will become one at min.
This is equivalent to
TranslateFlipContext(parent, wrapped, min + max, true)
and is
provided to make client code more readable.
parent
- the parent to graft all projected features ontwrapped
- the features to projectmin
- the lower positionmax
- the higher positionpublic TranslateFlipContext(FeatureHolder parent, FeatureHolder wrapped, int translation)
This is equivalent to
TranslateFlipContext(parent, wrapped, translation, false)
and
is provided to make client code more readable.
parent
- the parent to graft all projected features ontowrapped
- the featurs to projecttranslation
- the translationpublic final int getTranslation()
public final boolean isOppositeStrand()
public Location projectLocation(Location oldLoc)
public final Location revertLocation(Location oldLoc)
public final StrandedFeature.Strand projectStrand(StrandedFeature.Strand strand)
public final StrandedFeature.Strand revertStrand(StrandedFeature.Strand strand)
protected FilterUtils.FilterTransformer getTransformer()
getTransformer
in class ReparentContext
protected FilterUtils.FilterTransformer getReverter()
getReverter
in class ReparentContext
Copyright © 2014 BioJava. All rights reserved.