Package org.biojavax.bio.seq
Interface RichSequence
-
- All Superinterfaces:
Annotatable
,BioEntry
,Changeable
,Comparable
,FeatureHolder
,RankedCrossRefable
,RichAnnotatable
,Sequence
,SymbolList
- All Known Implementing Classes:
SimpleRichSequence
,ThinRichSequence
public interface RichSequence extends BioEntry, Sequence
A rich sequence is a combination of a org.biojavax.bio.Bioentry and a Sequence. It inherits and merges the methods of both. The RichSequence is based on the BioSQL model and provides a richer array of methods to access information than Sequence does. Whenever possible RichSequence should be used in preference to Sequence.- Since:
- 1.5
- Author:
- Mark Schreiber, Richard Holland, George Waldon
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
RichSequence.IOTools
A set of convenience methods for handling common file formats.static class
RichSequence.Terms
Stores a number of useful terms used across many sequence formats for consistency's sake.static class
RichSequence.Tools
Some useful tools for working with RichSequence objects.-
Nested classes/interfaces inherited from interface org.biojava.bio.Annotatable
Annotatable.AnnotationForwarder
-
Nested classes/interfaces inherited from interface org.biojava.bio.seq.FeatureHolder
FeatureHolder.EmptyFeatureHolder
-
-
Field Summary
Fields Modifier and Type Field Description static ChangeType
CIRCULAR
static ChangeType
SYMLISTVERSION
-
Fields inherited from interface org.biojava.bio.Annotatable
ANNOTATION
-
Fields inherited from interface org.biojavax.bio.BioEntry
COMMENT, DESCRIPTION, DIVISION, IDENTIFIER, RANKEDCROSSREF, RANKEDDOCREF, RELATIONS, SEQVERSION, TAXON
-
Fields inherited from interface org.biojava.bio.seq.FeatureHolder
EMPTY_FEATURE_HOLDER, FEATURES, SCHEMA
-
Fields inherited from interface org.biojava.bio.symbol.SymbolList
EDIT, EMPTY_LIST
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
getCircular()
Is the sequence circular?Set<Feature>
getFeatureSet()
The features for this sequence.SymbolList
getInternalSymbolList()
A special function that returns the SymbolList that this RichSequence is based around.Double
getSeqVersion()
The version of the associated symbol list.void
setCircular(boolean circular)
Circularises theSequence
.void
setFeatureSet(Set<Feature> features)
Sets the features of this sequence.void
setSeqVersion(Double seqVersion)
Sets the version of the associated symbol list.-
Methods inherited from interface org.biojava.bio.Annotatable
getAnnotation
-
Methods inherited from interface org.biojavax.bio.BioEntry
addComment, addRankedDocRef, addRelationship, getAccession, getComments, getDescription, getDivision, getIdentifier, getName, getNamespace, getRankedDocRefs, getRelationships, getTaxon, getVersion, removeComment, removeRankedDocRef, removeRelationship, setDescription, setDivision, setIdentifier, setTaxon
-
Methods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface org.biojava.bio.seq.FeatureHolder
containsFeature, countFeatures, createFeature, features, filter, filter, getSchema, removeFeature
-
Methods inherited from interface org.biojavax.RankedCrossRefable
addRankedCrossRef, getRankedCrossRefs, removeRankedCrossRef, setRankedCrossRefs
-
Methods inherited from interface org.biojavax.RichAnnotatable
getNoteSet, getRichAnnotation, setNoteSet
-
Methods inherited from interface org.biojava.bio.symbol.SymbolList
edit, getAlphabet, iterator, length, seqString, subList, subStr, symbolAt, toList
-
-
-
-
Field Detail
-
SYMLISTVERSION
static final ChangeType SYMLISTVERSION
-
CIRCULAR
static final ChangeType CIRCULAR
-
-
Method Detail
-
getSeqVersion
Double getSeqVersion()
The version of the associated symbol list. Note the use of an object for the value means that it can be nulled.- Returns:
- the version
-
setSeqVersion
void setSeqVersion(Double seqVersion) throws ChangeVetoException
Sets the version of the associated symbol list. Note the use of an object for the value means that it can be nulled.- Parameters:
seqVersion
- the version to set.- Throws:
ChangeVetoException
- if it doesn't want to change.
-
getFeatureSet
Set<Feature> getFeatureSet()
The features for this sequence.- Returns:
- a set of RichFeature objects.
-
setFeatureSet
void setFeatureSet(Set<Feature> features) throws ChangeVetoException
Sets the features of this sequence. Note that it is not checked to see if the features actually belong to this sequence, you'd best check that yourself and make changes using feature.setParent() if necessary.- Parameters:
features
- the features to assign to this sequence, replacing all others. Must be a set of RichFeature objects.- Throws:
ChangeVetoException
- if they could not be assigned.
-
setCircular
void setCircular(boolean circular) throws ChangeVetoException
Circularises theSequence
. The circular length can then be said to be the length of the sequence itself.- Parameters:
circular
- set to true if you want it to be circular- Throws:
ChangeVetoException
- if the change is blocked. Some implementations may choose not to support circularisation and should throw an exception here. Some implementations may only support this method for certain Alphabets.
-
getCircular
boolean getCircular()
Is the sequence circular? Circularity has implications for work with locations and any coordinate work eg symbolAt(int i). Classes that allow it should test this method when working with coordinates or locations / features.- Returns:
- true if the this is circular else false.
-
getInternalSymbolList
SymbolList getInternalSymbolList()
A special function that returns the SymbolList that this RichSequence is based around. This should _not_ be the RichSequence object itself, as this function is used to perform actions on the symbol list without referring to the RichSequence object directly.- Returns:
- the internal SymbolList of the RichSequence, NOT the RichSequence object itself.
-
-