Class AbstractFeature<S extends AbstractSequence<C>,C extends Compound>
java.lang.Object
org.biojava3.core.sequence.features.AbstractFeature<S,C>
- All Implemented Interfaces:
FeatureInterface<S,
C>
- Direct Known Subclasses:
QualityFeature
,QuantityFeature
,TextFeature
public abstract class AbstractFeature<S extends AbstractSequence<C>,C extends Compound>
extends Object
implements FeatureInterface<S,C>
A feature is currently any descriptive item that can be associated with a sequence position(s) A
feature has a type and a source which is currently a string to allow flexibility for the user
Ideally well defined features should have a class to describe attributes of that feature
- Author:
- Scooter Willis
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Comparator<FeatureInterface<?,
?>> Sort features by length.static final Comparator<FeatureInterface<?,
?>> Sort features by start position and then longest length. -
Constructor Summary
ConstructorDescriptionAbstractFeature
(String type, String source) A feature has a type and a source -
Method Summary
Modifier and TypeMethodDescriptionGet the children featuresGet the description that can be used to describe the featureA feature could be a single sequence position like a mutation or a post translational modification of an amino acid.Get the parent FeatureGet the short description that can be used to describe the featureThe feature sourcegetType()
The feature typevoid
setChildrenFeatures
(List<FeatureInterface<S, C>> features) Set the children featuresvoid
setDescription
(String description) Set the description that can be used to describe the featurevoid
setLocation
(SequenceLocation<S, C> loc) A feature could be a single sequence position like a mutation or a post translational modification of an amino acid.void
setParentFeature
(FeatureInterface<S, C> feature) A feature can be the child or contained by a parent feature.void
setShortDescription
(String shortDescription) Set the short description that can be used to describe the featurevoid
Set the feature sourcevoid
Set the feature typevoid
setUserObject
(Object userObject) Allow the user to associate an object with the feature.
-
Field Details
-
LOCATION_LENGTH
Sort features by start position and then longest length. When features are added having them sorted by start position and then longest length helps on the layout of overlapping features so they are delivered in a proper order. -
LENGTH
Sort features by length. //TODO need to handle cases where features have multiple locations, strand etc
-
-
Constructor Details
-
AbstractFeature
A feature has a type and a source- Parameters:
type
-source
-
-
-
Method Details
-
getLocations
A feature could be a single sequence position like a mutation or a post translational modification of an amino acid. It could also be the docking interface of N number of amino acids on the surface. The location wold then be a collection of sequence positions instead of a single sequence position or the begin and end of a sequence seqment.- Specified by:
getLocations
in interfaceFeatureInterface<S extends AbstractSequence<C>,
C extends Compound> - Returns:
-
setLocation
A feature could be a single sequence position like a mutation or a post translational modification of an amino acid. It could also be the docking interface of N number of amino acids on the surface. The location wold then be a collection of sequence positions instead of a single sequence position or the begin and end of a sequence seqment.- Specified by:
setLocation
in interfaceFeatureInterface<S extends AbstractSequence<C>,
C extends Compound> - Parameters:
loc
-
-
getType
The feature type- Specified by:
getType
in interfaceFeatureInterface<S extends AbstractSequence<C>,
C extends Compound> - Returns:
-
setType
Set the feature type- Specified by:
setType
in interfaceFeatureInterface<S extends AbstractSequence<C>,
C extends Compound> - Parameters:
type
-
-
getSource
The feature source- Specified by:
getSource
in interfaceFeatureInterface<S extends AbstractSequence<C>,
C extends Compound> - Returns:
-
setSource
Set the feature source- Specified by:
setSource
in interfaceFeatureInterface<S extends AbstractSequence<C>,
C extends Compound> - Parameters:
source
-
-
setParentFeature
A feature can be the child or contained by a parent feature. An example is a Helix feature could contain children features. A PFAM domain could contain secondary structures.- Specified by:
setParentFeature
in interfaceFeatureInterface<S extends AbstractSequence<C>,
C extends Compound> - Parameters:
feature
-
-
getParentFeature
Get the parent Feature- Specified by:
getParentFeature
in interfaceFeatureInterface<S extends AbstractSequence<C>,
C extends Compound> - Returns:
-
getChildrenFeatures
Get the children features- Specified by:
getChildrenFeatures
in interfaceFeatureInterface<S extends AbstractSequence<C>,
C extends Compound> - Returns:
-
setChildrenFeatures
Set the children features- Specified by:
setChildrenFeatures
in interfaceFeatureInterface<S extends AbstractSequence<C>,
C extends Compound> - Parameters:
features
-
-
getDescription
Description copied from interface:FeatureInterface
Get the description that can be used to describe the feature- Specified by:
getDescription
in interfaceFeatureInterface<S extends AbstractSequence<C>,
C extends Compound> - Returns:
- the description
-
setDescription
Description copied from interface:FeatureInterface
Set the description that can be used to describe the feature- Specified by:
setDescription
in interfaceFeatureInterface<S extends AbstractSequence<C>,
C extends Compound> - Parameters:
description
- the description to set
-
getShortDescription
Description copied from interface:FeatureInterface
Get the short description that can be used to describe the feature- Specified by:
getShortDescription
in interfaceFeatureInterface<S extends AbstractSequence<C>,
C extends Compound> - Returns:
- the shortDescription
-
setShortDescription
Description copied from interface:FeatureInterface
Set the short description that can be used to describe the feature- Specified by:
setShortDescription
in interfaceFeatureInterface<S extends AbstractSequence<C>,
C extends Compound> - Parameters:
shortDescription
- the shortDescription to set
-
getUserObject
- Specified by:
getUserObject
in interfaceFeatureInterface<S extends AbstractSequence<C>,
C extends Compound> - Returns:
- the userObject
-
setUserObject
Allow the user to associate an object with the feature. This way if a feature which is displayed in a GUI is clicked on the application can then get a user defined object associated with the feature.- Specified by:
setUserObject
in interfaceFeatureInterface<S extends AbstractSequence<C>,
C extends Compound> - Parameters:
userObject
- the userObject to set
-