Class TranslateFlipContext
- All Implemented Interfaces:
Serializable
,ProjectionContext
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.
- Author:
- Matthew Pocock
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTranslateFlipContext
(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. -
Method Summary
Modifier and TypeMethodDescriptionprotected FilterUtils.FilterTransformer
protected FilterUtils.FilterTransformer
final int
final boolean
projectLocation
(Location oldLoc) final StrandedFeature.Strand
projectStrand
(StrandedFeature.Strand strand) final Location
revertLocation
(Location oldLoc) final StrandedFeature.Strand
revertStrand
(StrandedFeature.Strand strand) Methods inherited from class org.biojava.bio.seq.projection.ReparentContext
addChangeListener, createFeature, createFeature, getParent, getParent, getSchema, getSequence, getUnprojectedFeatures, projectChildFeatures, projectFeature, projectFeatures, projectFilter, removeChangeListener, removeFeature, removeFeature, revertFeature, revertFilter
-
Constructor Details
-
TranslateFlipContext
public TranslateFlipContext(FeatureHolder parent, FeatureHolder wrapped, int translate, boolean oppositeStrand) Create a new TranslateFlipContext with explicit translation and flip.Locations will be mapped according to the rules in @link ProjectionUtils.
- Parameters:
parent
- the parent to graft all projected features ontowrapped
- the featurs to projecttranslate
- the translationoppositeStrand
- wether or not to flip
-
TranslateFlipContext
Create a new TranslateFlipContext that flips all featurs arround min and 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.- Parameters:
parent
- the parent to graft all projected features ontwrapped
- the features to projectmin
- the lower positionmax
- the higher position
-
TranslateFlipContext
Create a new TranslateFlipContext with translation only.This is equivalent to
TranslateFlipContext(parent, wrapped, translation, false)
and is provided to make client code more readable.- Parameters:
parent
- the parent to graft all projected features ontowrapped
- the featurs to projecttranslation
- the translation
-
-
Method Details
-
getTranslation
-
isOppositeStrand
-
projectLocation
-
revertLocation
-
projectStrand
-
revertStrand
-
getTransformer
- Overrides:
getTransformer
in classReparentContext
-
getReverter
- Overrides:
getReverter
in classReparentContext
-