Package org.biojavax.bio.seq
Interface RichLocation
- All Superinterfaces:
Annotatable
,Changeable
,Comparable
,Location
,RichAnnotatable
- All Known Implementing Classes:
CompoundRichLocation
,EmptyRichLocation
,MultiSourceCompoundRichLocation
,SimpleRichLocation
Describes locations, and adds the concepts of circularity, fuzziness,
annotations, and cross-references to other databases. Also includes strands.
- Since:
- 1.5
- Author:
- Richard Holland, George Waldon - bug fix
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
This class represents a strand on which a location may lie.static class
Some useful tools for working with Locations.Nested classes/interfaces inherited from interface org.biojava.bio.Annotatable
Annotatable.AnnotationForwarder
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ChangeType
static final RichLocation
The empty location matches nothing.static final ChangeType
static final ChangeType
static final ChangeType
static final ChangeType
Fields inherited from interface org.biojava.bio.Annotatable
ANNOTATION
Fields inherited from interface org.biojava.bio.symbol.Location
empty, full, naturalOrder
-
Method Summary
Modifier and TypeMethodDescriptionint
Retrieves the circular length of this location.Retrieves the crossref associated with this location.Retrieves the feature this location is associated with.Retrieves the end position of this location.Retrieves the start position of this location.int
getRank()
Retrieves the rank associated with this location.Retrieves the strand associated with this location.getTerm()
Retrieves the term associated with this location.void
setCircularLength
(int sourceSeqLength) Sets the circular length of this location.void
Sets the cross ref resolver to use when retrieving remote symbols.void
setFeature
(RichFeature feature) Sets the feature this location is associated with.void
Sets the resolver to use when working out actual base coordinates from fuzzy positions.void
setRank
(int rank) Sets the rank for this location.void
setTerm
(ComparableTerm term) Sets the term for this location.void
sort()
Sorts the member locations of a compound location.Methods inherited from interface org.biojava.bio.Annotatable
getAnnotation
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.symbol.Location
blockIterator, contains, contains, equals, getDecorator, getMax, getMin, intersection, isContiguous, newInstance, overlaps, symbols, translate, union
Methods inherited from interface org.biojavax.RichAnnotatable
getNoteSet, getRichAnnotation, setNoteSet
-
Field Details
-
NOTE
-
TERM
-
RANK
-
CIRCULAR
-
FEATURE
-
EMPTY_LOCATION
The empty location matches nothing.
-
-
Method Details
-
sort
void sort()Sorts the member locations of a compound location. Does nothing for non-compound locations. Sorting depends on the compareTo() method of the member locations - usually they will be sorted by their start position. This might be useful when used with the location returned by a union or intersection, or when setting the term of a compound location to ORDER_TERM. -
getFeature
Retrieves the feature this location is associated with. May be null.- Returns:
- the feature.
-
setFeature
Sets the feature this location is associated with. If null, that's fine, but you won't be able to persist it to the database until you give it a not-null value.- Parameters:
feature
- the feature.- Throws:
ChangeVetoException
-
getCrossRef
Retrieves the crossref associated with this location.- Returns:
- the crossref.
-
getTerm
Retrieves the term associated with this location.- Returns:
- the term.
-
setTerm
Sets the term for this location.- Parameters:
term
- the term this location should adopt.- Throws:
ChangeVetoException
- in case of error.
-
getStrand
Retrieves the strand associated with this location.- Returns:
- the strand.
-
getRank
int getRank()Retrieves the rank associated with this location.- Returns:
- the rank.
-
setRank
Sets the rank for this location.- Parameters:
rank
- the rank this location should adopt.- Throws:
ChangeVetoException
- in case of error.
-
getMinPosition
Retrieves the start position of this location.- Returns:
- the position.
-
getMaxPosition
Retrieves the end position of this location.- Returns:
- the position.
-
setPositionResolver
Sets the resolver to use when working out actual base coordinates from fuzzy positions.- Parameters:
p
- the position resolver to use.
-
getCircularLength
int getCircularLength()Retrieves the circular length of this location. If it is 0, the location is not circular. If it is not zero, then the number refers to the wrapping length of the location. eg. 100 would signify that a position of 112 would actually be a position of 112-100 = 12.- Returns:
- the position.
-
setCircularLength
Sets the circular length of this location. If it is 0, the location is not circular. If it is not zero, then the number refers to the wrapping length of the location. eg. 100 would signify that a position of 112 would actually be a position of 112-100 = 12.- Parameters:
sourceSeqLength
- the circular length of this location- Throws:
ChangeVetoException
- if it doesn't want to change.
-
setCrossRefResolver
Sets the cross ref resolver to use when retrieving remote symbols. If none is given, then the default from RichObjectFactory.getDefaultCrossRefResolver() is used.- Parameters:
r
- the resolver to use.
-