Class RevCompSequence

  • All Implemented Interfaces:
    java.io.Serializable, Annotatable, FeatureHolder, RealizingFeatureHolder, Sequence, SymbolList, Changeable

    public class RevCompSequence
    extends SimpleSequence
    A reverse complement view onto Sequence interface.

    All features of the underlying sequence are reflected onto the RevCompSequence using a ProjectedFeatureHolder

    calling createFeature() on a RevCompSequence creates a feature on the underlying sequence. Non-Stranded features will return the reverse compemented view of the sequence when getSymbols() is called that is to say if you get what you expect as if your RevCompSequence was a regular Sequence.
    Author:
    David Waring, Thomas Down
    See Also:
    Serialized Form
    • Field Detail

    • Method Detail

      • edit

        public void edit​(Edit e)
                  throws ChangeVetoException,
                         java.lang.IndexOutOfBoundsException
        edit() will try to edit the underlying Sequence. So if it is editable this will be too

        Since I have not seen and editable Sequence I have not tested this

        Specified by:
        edit in interface SymbolList
        Overrides:
        edit in class SimpleSequence
        Parameters:
        e - the Edit to perform
        Throws:
        ChangeVetoException - if either the SymboList does not support the edit, or if the change was vetoed
        java.lang.IndexOutOfBoundsException - if the edit does not lie within the SymbolList
      • filter

        public FeatureHolder filter​(FeatureFilter ff,
                                    boolean recurse)
        Description copied from interface: FeatureHolder
        Return a new FeatureHolder that contains all of the children of this one that passed the filter fc. This method is scheduled for deprecation. Use the 1-arg filter instead.
        Specified by:
        filter in interface FeatureHolder
        Overrides:
        filter in class SimpleSequence
        Parameters:
        ff - the FeatureFilter to apply
        recurse - true if all features-of-features should be scanned, and a single flat collection of features returned, or false if just immediate children should be filtered.
      • containsFeature

        public boolean containsFeature​(Feature f)
        containsFeature() will return true if this seq contains the feature in question, or if if the original (non reverse complement) sequence contains the feature;
        Specified by:
        containsFeature in interface FeatureHolder
        Overrides:
        containsFeature in class SimpleSequence
        Parameters:
        f - the Feature to check
        Returns:
        true if f is in this set
      • getFeatureFromOriginal

        public Feature getFeatureFromOriginal​(Feature f)
        getFeatureFromOriginal() Since you can not create a feature on a projectedFeature at this time, I am including this method so that you can get the corresponding feature from the original sequence. (which is not projected) and do something with that such as createFeature().
      • clone

        public java.lang.Object clone()
        clone() should make a complete copy of the Sequence with all features (and children) and return a SimpleSequence that is unconnected from the original sequence.
        Overrides:
        clone in class java.lang.Object