Class AbstractFeature<S extends AbstractSequence<C>,C extends Compound>
java.lang.Object
org.biojava.nbio.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
FieldsModifier and TypeFieldDescriptionstatic final Comparator<FeatureInterface<?, ?>> Sort features by length.static final Comparator<FeatureInterface<?, ?>> Sort features by start position and then longest length.static final Comparator<FeatureInterface<?, ?>> Sort features by type -
Constructor Summary
ConstructorsConstructorDescriptionAbstractFeature(String type, String source) A feature has a type and a source -
Method Summary
Modifier and TypeMethodDescriptionvoidaddQualifier(String key, Qualifier qualifier) Add a qualifierGet 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 qualifiers for this featureGet the short description that can be used to describe the featureThe feature sourcegetType()The feature typevoidsetChildrenFeatures(List<FeatureInterface<S, C>> features) Set the children featuresvoidsetDescription(String description) Set the description that can be used to describe the featurevoidA feature could be a single sequence position like a mutation or a post translational modification of an amino acid.voidsetParentFeature(FeatureInterface<S, C> feature) A feature can be the child or contained by a parent feature.voidsetQualifiers(Map<String, List<Qualifier>> qualifiers) Set the qualifiersvoidsetShortDescription(String shortDescription) Set the short description that can be used to describe the featurevoidSet the feature sourcevoidSet the feature typevoidsetUserObject(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 -
TYPE
Sort features by type
-
-
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 segment.- Specified by:
getLocationsin 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 segment.- Specified by:
setLocationin interfaceFeatureInterface<S extends AbstractSequence<C>,C extends Compound> - Parameters:
loc-
-
getType
The feature type- Specified by:
getTypein interfaceFeatureInterface<S extends AbstractSequence<C>,C extends Compound> - Returns:
-
setType
Set the feature type- Specified by:
setTypein interfaceFeatureInterface<S extends AbstractSequence<C>,C extends Compound> - Parameters:
type-
-
getSource
The feature source- Specified by:
getSourcein interfaceFeatureInterface<S extends AbstractSequence<C>,C extends Compound> - Returns:
-
setSource
Set the feature source- Specified by:
setSourcein 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:
setParentFeaturein interfaceFeatureInterface<S extends AbstractSequence<C>,C extends Compound> - Parameters:
feature-
-
getParentFeature
Get the parent Feature- Specified by:
getParentFeaturein interfaceFeatureInterface<S extends AbstractSequence<C>,C extends Compound> - Returns:
-
getChildrenFeatures
Get the children features- Specified by:
getChildrenFeaturesin interfaceFeatureInterface<S extends AbstractSequence<C>,C extends Compound> - Returns:
-
setChildrenFeatures
Set the children features- Specified by:
setChildrenFeaturesin interfaceFeatureInterface<S extends AbstractSequence<C>,C extends Compound> - Parameters:
features-
-
getDescription
Description copied from interface:FeatureInterfaceGet the description that can be used to describe the feature- Specified by:
getDescriptionin interfaceFeatureInterface<S extends AbstractSequence<C>,C extends Compound> - Returns:
- the description
-
setDescription
Description copied from interface:FeatureInterfaceSet the description that can be used to describe the feature- Specified by:
setDescriptionin interfaceFeatureInterface<S extends AbstractSequence<C>,C extends Compound> - Parameters:
description- the description to set
-
getShortDescription
Description copied from interface:FeatureInterfaceGet the short description that can be used to describe the feature- Specified by:
getShortDescriptionin interfaceFeatureInterface<S extends AbstractSequence<C>,C extends Compound> - Returns:
- the shortDescription
-
setShortDescription
Description copied from interface:FeatureInterfaceSet the short description that can be used to describe the feature- Specified by:
setShortDescriptionin interfaceFeatureInterface<S extends AbstractSequence<C>,C extends Compound> - Parameters:
shortDescription- the shortDescription to set
-
getUserObject
- Specified by:
getUserObjectin 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:
setUserObjectin interfaceFeatureInterface<S extends AbstractSequence<C>,C extends Compound> - Parameters:
userObject- the userObject to set
-
getQualifiers
Description copied from interface:FeatureInterfaceGet the qualifiers for this feature- Specified by:
getQualifiersin interfaceFeatureInterface<S extends AbstractSequence<C>,C extends Compound> - Returns:
-
setQualifiers
Description copied from interface:FeatureInterfaceSet the qualifiers- Specified by:
setQualifiersin interfaceFeatureInterface<S extends AbstractSequence<C>,C extends Compound> - Parameters:
qualifiers-
-
addQualifier
Description copied from interface:FeatureInterfaceAdd a qualifier- Specified by:
addQualifierin interfaceFeatureInterface<S extends AbstractSequence<C>,C extends Compound> - Parameters:
qualifier-
-