bpp-seq-omics  2.4.1
bpp::SequenceFeature Class Referenceabstract

The base interface for sequence features. More...

#include <Bpp/Seq/Feature/SequenceFeature.h>

+ Inheritance diagram for bpp::SequenceFeature:
+ Collaboration diagram for bpp::SequenceFeature:

Public Member Functions

virtual SequenceFeatureclone () const =0
 
virtual const std::string & getId () const =0
 
virtual void setId (const std::string &id)=0
 
virtual const std::string & getSequenceId () const =0
 
virtual void setSequenceId (const std::string &id)=0
 
virtual const std::string & getSource () const =0
 
virtual void setSource (const std::string &source)=0
 
virtual const std::string & getType () const =0
 
virtual void setType (const std::string &type)=0
 
virtual const size_t getStart () const =0
 
virtual const size_t getEnd () const =0
 
virtual const size_t size () const
 
virtual bool isStranded () const =0
 
virtual bool isNegativeStrand () const =0
 
virtual void invert ()=0
 
virtual SeqRange getRange () const =0
 
virtual bool isEmpty () const
 
virtual bool isPoint () const
 
virtual bool overlap (const SequenceFeature &feat) const =0
 
virtual bool overlap (const SeqRange &range) const =0
 
virtual bool includes (const SeqRange &range) const =0
 
virtual bool isIncludedIn (const SeqRange &range) const =0
 
virtual const double & getScore () const =0
 
virtual void setScore (double score)=0
 
virtual const std::string & getAttribute (const std::string &attribute) const =0
 
virtual std::string & getAttribute (const std::string &attribute)=0
 
virtual std::set< std::string > getAttributeList () const =0
 
virtual void setAttribute (const std::string &attribute, const std::string &value)=0
 Set the value of an attribute. More...
 
virtual void removeAttribute (const std::string &attribute)=0
 

Static Public Attributes

static const std::string NO_ATTRIBUTE_SET = ""
 

Detailed Description

The base interface for sequence features.

This interface provides the most generic information common to all features, that is:

  • sequence reference
  • procedure used to generate the information
  • start and end positions. Coordinates are 0-based, of type [a,b[, so that if a==b, the annotation is considered empty. A one-character annotation is then noted as start=12(included),end=13(excluded) for instance.

Subclasses inheriting this interface provide specialisations for various types of annotations. Depending on the file format of annotations, not all types of annotations may be supported.

Author
Julien Dutheil

Definition at line 136 of file SequenceFeature.h.

Member Function Documentation

◆ clone()

virtual SequenceFeature* bpp::SequenceFeature::clone ( ) const
pure virtual

◆ getAttribute() [1/2]

virtual const std::string& bpp::SequenceFeature::getAttribute ( const std::string &  attribute) const
pure virtual
Parameters
attributeThe name of the attribute to retrieve.
Returns
The attribute with specified name (read only).

Implemented in bpp::BasicSequenceFeature.

Referenced by bpp::BedGraphFeatureReader::toString(), and bpp::GffFeatureReader::toString().

◆ getAttribute() [2/2]

virtual std::string& bpp::SequenceFeature::getAttribute ( const std::string &  attribute)
pure virtual
Parameters
attributeThe name of the attribute to retrieve.
Returns
The attribute with specified name.

Implemented in bpp::BasicSequenceFeature.

◆ getAttributeList()

virtual std::set< std::string > bpp::SequenceFeature::getAttributeList ( ) const
pure virtual
Returns
The list of all attributes available.

Implemented in bpp::BasicSequenceFeature.

Referenced by bpp::GffFeatureReader::toString().

◆ getEnd()

virtual const size_t bpp::SequenceFeature::getEnd ( ) const
pure virtual
Returns
The ending position of the feature, 0-based, excluded.

Implemented in bpp::BasicSequenceFeature.

Referenced by size(), bpp::BedGraphFeatureReader::toString(), and bpp::GffFeatureReader::toString().

◆ getId()

virtual const std::string& bpp::SequenceFeature::getId ( ) const
pure virtual
Returns
The id of this feature.

Implemented in bpp::BasicSequenceFeature.

Referenced by bpp::GffFeatureReader::toString().

◆ getRange()

virtual SeqRange bpp::SequenceFeature::getRange ( ) const
pure virtual
Returns
Coordinates as a Range object.

Implemented in bpp::BasicSequenceFeature.

Referenced by bpp::BasicSequenceFeature::overlap().

◆ getScore()

virtual const double& bpp::SequenceFeature::getScore ( ) const
pure virtual
Returns
The score associated to the feature (eg, an E-value or a P-value).

Implemented in bpp::BasicSequenceFeature.

Referenced by bpp::GffFeatureReader::toString().

◆ getSequenceId()

virtual const std::string& bpp::SequenceFeature::getSequenceId ( ) const
pure virtual
Returns
The id of the sequence on which this feature is based.

Implemented in bpp::BasicSequenceFeature.

Referenced by bpp::BasicSequenceFeature::overlap(), bpp::BedGraphFeatureReader::toString(), and bpp::GffFeatureReader::toString().

◆ getSource()

virtual const std::string& bpp::SequenceFeature::getSource ( ) const
pure virtual
Returns
A text intended to describe the algorithm or procedure used to generate the feature.

Implemented in bpp::BasicSequenceFeature.

Referenced by bpp::GffFeatureReader::toString().

◆ getStart()

virtual const size_t bpp::SequenceFeature::getStart ( ) const
pure virtual
Returns
The starting position of the feature, 0-based, included.

Implemented in bpp::BasicSequenceFeature.

Referenced by size(), bpp::BedGraphFeatureReader::toString(), and bpp::GffFeatureReader::toString().

◆ getType()

virtual const std::string& bpp::SequenceFeature::getType ( ) const
pure virtual
Returns
A text describing the type of feature. Depending on the format, it can be restricted (for example, mRNA), or any text can be supplied (for example TFXX binding site).

Implemented in bpp::BasicSequenceFeature.

Referenced by bpp::GffFeatureReader::toString().

◆ includes()

virtual bool bpp::SequenceFeature::includes ( const SeqRange range) const
pure virtual
Returns
True if the feature fully contains the given range.

Implemented in bpp::BasicSequenceFeature.

◆ invert()

virtual void bpp::SequenceFeature::invert ( )
pure virtual

Change the orientation of the feature.

Implemented in bpp::BasicSequenceFeature.

◆ isEmpty()

virtual bool bpp::SequenceFeature::isEmpty ( ) const
inlinevirtual
Returns
Check if the feature is empty (start == end)

Definition at line 222 of file SequenceFeature.h.

References size().

◆ isIncludedIn()

virtual bool bpp::SequenceFeature::isIncludedIn ( const SeqRange range) const
pure virtual
Returns
True if the feature is fully contained in the given range.

Implemented in bpp::BasicSequenceFeature.

◆ isNegativeStrand()

virtual bool bpp::SequenceFeature::isNegativeStrand ( ) const
pure virtual
Returns
True if the sequence is coded on the negative strand. False if it is on the positive one or unknown.

Implemented in bpp::BasicSequenceFeature.

Referenced by bpp::GffFeatureReader::toString().

◆ isPoint()

virtual bool bpp::SequenceFeature::isPoint ( ) const
inlinevirtual
Returns
Check if the feature is a point annotation (start + 1 == end)

Definition at line 227 of file SequenceFeature.h.

References size().

◆ isStranded()

virtual bool bpp::SequenceFeature::isStranded ( ) const
pure virtual
Returns
True if the feature is stranded.

Implemented in bpp::BasicSequenceFeature.

Referenced by bpp::GffFeatureReader::toString().

◆ overlap() [1/2]

virtual bool bpp::SequenceFeature::overlap ( const SeqRange range) const
pure virtual
Returns
True if the feature overlap with the given range (non-null intersection).

Implemented in bpp::BasicSequenceFeature.

◆ overlap() [2/2]

virtual bool bpp::SequenceFeature::overlap ( const SequenceFeature feat) const
pure virtual
Returns
True if the features overlap.

Implemented in bpp::BasicSequenceFeature.

◆ removeAttribute()

virtual void bpp::SequenceFeature::removeAttribute ( const std::string &  attribute)
pure virtual
Parameters
attributeThe name of the attribute to be removed.

Implemented in bpp::BasicSequenceFeature.

◆ setAttribute()

virtual void bpp::SequenceFeature::setAttribute ( const std::string &  attribute,
const std::string &  value 
)
pure virtual

Set the value of an attribute.

Parameters
attributeThe name of the attribute to set.
valueThe value of the attribute to set.

Implemented in bpp::BasicSequenceFeature.

◆ setId()

virtual void bpp::SequenceFeature::setId ( const std::string &  id)
pure virtual
Parameters
idA std::string representing the id.

Implemented in bpp::BasicSequenceFeature.

◆ setScore()

virtual void bpp::SequenceFeature::setScore ( double  score)
pure virtual
Parameters
scoreA double representing the score of this feature.

Implemented in bpp::BasicSequenceFeature.

◆ setSequenceId()

virtual void bpp::SequenceFeature::setSequenceId ( const std::string &  id)
pure virtual
Parameters
idA std::string representing the id of the reference.

Implemented in bpp::BasicSequenceFeature.

◆ setSource()

virtual void bpp::SequenceFeature::setSource ( const std::string &  source)
pure virtual
Parameters
sourceA std::string representing the source of the feature.

Implemented in bpp::BasicSequenceFeature.

◆ setType()

virtual void bpp::SequenceFeature::setType ( const std::string &  type)
pure virtual
Parameters
typeA std::string representing the type of this feature.

Implemented in bpp::BasicSequenceFeature.

◆ size()

virtual const size_t bpp::SequenceFeature::size ( ) const
inlinevirtual
Returns
The size of the feature.

Definition at line 195 of file SequenceFeature.h.

References getEnd(), and getStart().

Referenced by isEmpty(), and isPoint().

Member Data Documentation

◆ NO_ATTRIBUTE_SET

const std::string SequenceFeature::NO_ATTRIBUTE_SET = ""
static

Definition at line 140 of file SequenceFeature.h.

Referenced by bpp::BasicSequenceFeature::getAttribute().


The documentation for this class was generated from the following files: