## org.biojava.bio.seq
Interface Feature

All Known Subinterfaces:
  StrandedFeature

All Known Implementing Classes:
  FeatureAdapter

public interface Feature
extends FeatureHolder, Annotatable

A feature within a sequence, or nested within another feature.

Features contain annotation and a location. The type of the feature is something like 'Repeat' or 'BetaStrand'. The source of the feature is something like 'genscan', 'repeatmasker' or 'made-up'.

Features are always contained by a parent `FeatureHolder`, which may either be a `Sequence` or another `Feature`. Feature instances should never be constructed directly by client code, and the BioJava core does not contain any publically accessible implementations of the `Feature` interface. Instead, you should create a suitable `Feature.Template`, then pass this to the `createFeature` method of a `Sequence` or `Feature`.

We may need some standardisation for what the fields mean. In particular, we should be compliant where sensible with GFF.

Author:
  Matthew Pocock, Thomas Down

Inner Class Summary
`static class` `Feature.Template` Template class for a plain feature.

Inner classes inherited from class org.biojava.bio.seq.FeatureHolder
`FeatureHolder.EmptyFeatureHolder`

Fields inherited from interface org.biojava.bio.seq.FeatureHolder
`EMPTY_FEATURE_HOLDER`

Method Summary
`Location` `getLocation()` The location of this feature.
`FeatureHolder` `getParent()` Return the `FeatureHolder` to which this feature has been attached.
`Sequence` `getSequence()` Return the `Sequence` object to which this feature is (ultimately) attached.
`java.lang.String` `getSource()` The source of the feature.
`SymbolList` `getSymbols()` Return a list of symbols that are contained in this feature.
`java.lang.String` `getType()` The type of the feature.

Methods inherited from interface org.biojava.bio.seq.FeatureHolder
`countFeatures, createFeature, features, filter, removeFeature`

Methods inherited from interface org.biojava.bio.Annotatable
`getAnnotation`

Method Detail

### getLocation

    public Location getLocation()

  The location of this feature.

  The location may be complicated, or simply a range. The annotation is assumed to apply to all the region contained within the location.

### getType

    public java.lang.String getType()

  The type of the feature.
  Returns:
    the type of this sequence

### getSource

    public java.lang.String getSource()

  The source of the feature. This may be a program or process.
  Returns:
    the source, or generator

### getSymbols

    public SymbolList getSymbols()

  Return a list of symbols that are contained in this feature.

  The symbols may not be contiguous in the original sequence, but they will be concatinated together in the resulting SymbolList.

  The order of the Symbols within the resulting symbol list will be according to the concept of ordering within the location object.

  Returns:
    a SymbolList containing each symbol of the parent sequence contained within this feature in the order they appear in the parent

### getParent

    public FeatureHolder getParent()

  Return the `FeatureHolder` to which this feature has been attached. This will be a `Sequence` object for top level features, and a `Feature` object for features further down the tree.

### getSequence

    public Sequence getSequence()

  Return the `Sequence` object to which this feature is (ultimately) attached. For top level features, this will be equal to the `FeatureHolder` returned by `getParent`.