bpp::BasicSequenceFeature Class Reference

A very simple implementation of the SequenceFeature class. More...

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

Inheritance diagram for bpp::BasicSequenceFeature:
Inheritance graph
[legend]
Collaboration diagram for bpp::BasicSequenceFeature:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 BasicSequenceFeature (const std::string &id, const std::string &seqId, const std::string &source, const std::string &type, unsigned int start, unsigned int end, bool negStrand, double score=-1)
virtual BasicSequenceFeatureclone () const
const std::string & getId () const
const std::string & getSequenceId () const
const std::string & getSource () const
const std::string & getType () const
const unsigned int & getStart () const
const unsigned int & getEnd () const
bool isNegativeStrand () const
const double & getScore () const
const std::string & getAttribute (const std::string &attribute) const
std::string & getAttribute (const std::string &attribute)
void setAttribute (const std::string &attribute, const std::string &value)
 Set the value of an attribute.
SeqRange getRange () const

Static Public Attributes

static const std::string NO_ATTRIBUTE_SET = ""

Protected Attributes

std::string id_
std::string sequenceId_
std::string source_
std::string type_
unsigned int start_
unsigned int end_
bool negStrand_
double score_
std::map< std::string,
std::string > 
attributes_

Detailed Description

A very simple implementation of the SequenceFeature class.

It uses a hash map for storing attributes.

Definition at line 181 of file SequenceFeature.h.


Constructor & Destructor Documentation

bpp::BasicSequenceFeature::BasicSequenceFeature ( const std::string &  id,
const std::string &  seqId,
const std::string &  source,
const std::string &  type,
unsigned int  start,
unsigned int  end,
bool  negStrand,
double  score = -1 
) [inline]

Definition at line 196 of file SequenceFeature.h.

Referenced by clone().


Member Function Documentation

virtual BasicSequenceFeature* bpp::BasicSequenceFeature::clone (  )  const [inline, virtual]

Implements bpp::SequenceFeature.

Definition at line 210 of file SequenceFeature.h.

References BasicSequenceFeature().

std::string& bpp::BasicSequenceFeature::getAttribute ( const std::string &  attribute  )  [inline, virtual]
Parameters:
attribute The name of the attribute to retrieve.
Returns:
The attribute with specified name.

Implements bpp::SequenceFeature.

Definition at line 230 of file SequenceFeature.h.

References attributes_.

const std::string& bpp::BasicSequenceFeature::getAttribute ( const std::string &  attribute  )  const [inline, virtual]
Parameters:
attribute The name of the attribute to retrieve.
Returns:
The attribute with specified name (read only).

Implements bpp::SequenceFeature.

Definition at line 222 of file SequenceFeature.h.

References attributes_, and bpp::SequenceFeature::NO_ATTRIBUTE_SET.

const unsigned int& bpp::BasicSequenceFeature::getEnd (  )  const [inline, virtual]
Returns:
The ending position of the feature, 0-based, excluded.

Implements bpp::SequenceFeature.

Definition at line 218 of file SequenceFeature.h.

References end_.

const std::string& bpp::BasicSequenceFeature::getId (  )  const [inline, virtual]
Returns:
The id of this feature.

Implements bpp::SequenceFeature.

Definition at line 213 of file SequenceFeature.h.

References id_.

SeqRange bpp::BasicSequenceFeature::getRange (  )  const [inline, virtual]
Returns:
Coordinates as a Range object.

Implements bpp::SequenceFeature.

Definition at line 238 of file SequenceFeature.h.

References end_, negStrand_, and start_.

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

Implements bpp::SequenceFeature.

Definition at line 220 of file SequenceFeature.h.

References score_.

const std::string& bpp::BasicSequenceFeature::getSequenceId (  )  const [inline, virtual]
Returns:
The id of the sequence on which this feature is based.

Implements bpp::SequenceFeature.

Definition at line 214 of file SequenceFeature.h.

References sequenceId_.

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

const std::string& bpp::BasicSequenceFeature::getSource (  )  const [inline, virtual]
Returns:
A text intended to describe the algorithm or procedure used to generate the feature.

Implements bpp::SequenceFeature.

Definition at line 215 of file SequenceFeature.h.

References source_.

const unsigned int& bpp::BasicSequenceFeature::getStart (  )  const [inline, virtual]
Returns:
The starting position of the feature, 0-based, included.

Implements bpp::SequenceFeature.

Definition at line 217 of file SequenceFeature.h.

References start_.

const std::string& bpp::BasicSequenceFeature::getType (  )  const [inline, 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).

Implements bpp::SequenceFeature.

Definition at line 216 of file SequenceFeature.h.

References type_.

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

bool bpp::BasicSequenceFeature::isNegativeStrand (  )  const [inline, virtual]
Returns:
True if the sequence is coded on the negative strand. False if it is on the positive one or unknown.

Implements bpp::SequenceFeature.

Definition at line 219 of file SequenceFeature.h.

References negStrand_.

void bpp::BasicSequenceFeature::setAttribute ( const std::string &  attribute,
const std::string &  value 
) [inline, virtual]

Set the value of an attribute.

Parameters:
attribute The name of the attribute to set.
value The value of the attribute to set.

Implements bpp::SequenceFeature.

Definition at line 234 of file SequenceFeature.h.

References attributes_.

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


Member Data Documentation

std::map<std::string, std::string> bpp::BasicSequenceFeature::attributes_ [mutable, protected]

Definition at line 193 of file SequenceFeature.h.

Referenced by getAttribute(), and setAttribute().

unsigned int bpp::BasicSequenceFeature::end_ [protected]

Definition at line 190 of file SequenceFeature.h.

Referenced by getEnd(), and getRange().

std::string bpp::BasicSequenceFeature::id_ [protected]

Definition at line 185 of file SequenceFeature.h.

Referenced by getId().

Definition at line 191 of file SequenceFeature.h.

Referenced by getRange(), and isNegativeStrand().

const std::string SequenceFeature::NO_ATTRIBUTE_SET = "" [static, inherited]

Definition at line 103 of file SequenceFeature.h.

Referenced by getAttribute().

Definition at line 192 of file SequenceFeature.h.

Referenced by getScore().

std::string bpp::BasicSequenceFeature::sequenceId_ [protected]

Definition at line 186 of file SequenceFeature.h.

Referenced by getSequenceId().

std::string bpp::BasicSequenceFeature::source_ [protected]

Definition at line 187 of file SequenceFeature.h.

Referenced by getSource().

unsigned int bpp::BasicSequenceFeature::start_ [protected]

Definition at line 189 of file SequenceFeature.h.

Referenced by getRange(), and getStart().

std::string bpp::BasicSequenceFeature::type_ [protected]

Definition at line 188 of file SequenceFeature.h.

Referenced by getType().


The documentation for this class was generated from the following file:
Generated on Wed Feb 29 14:50:33 2012 for bpp-seq by  doxygen 1.6.3