bpp-seq  2.1.0
bpp::AbstractISequence Class Reference

Partial implementation of the ISequence interface. More...

#include <Bpp/Seq/Io/AbstractISequence.h>

+ Inheritance diagram for bpp::AbstractISequence:
+ Collaboration diagram for bpp::AbstractISequence:

List of all members.

Public Member Functions

 AbstractISequence ()
virtual ~AbstractISequence ()
const std::string getDataType () const
virtual const std::string getFormatName () const =0
virtual const std::string getFormatDescription () const =0
ISequence methods:
virtual void readSequences (std::istream &input, SequenceContainer &sc) const throw (Exception)
 Add sequences to a container from a stream.
virtual void readSequences (const std::string &path, SequenceContainer &sc) const throw (Exception)
 Add sequences to a container from a file.
virtual VectorSequenceContainerreadSequences (std::istream &input, const Alphabet *alpha) const throw (Exception)
 Create a new container from a stream.
virtual VectorSequenceContainerreadSequences (const std::string &path, const Alphabet *alpha) const throw (Exception)
 Create a new container from a file.

Protected Member Functions

virtual void appendSequencesFromStream (std::istream &input, SequenceContainer &sc) const =0 throw (Exception)
 Append sequences to a container from a stream.
virtual void appendSequencesFromFile (const std::string &path, SequenceContainer &sc) const throw (Exception)
 Append sequences to a container from a file.
virtual VectorSequenceContainerreadSequencesFromStream (std::istream &input, const Alphabet *alpha) const throw (Exception)
 Read sequences from a stream.
virtual VectorSequenceContainerreadSequencesFromFile (const std::string &path, const Alphabet *alpha) const throw (Exception)
 Append sequences to a container from a file.

Detailed Description

Partial implementation of the ISequence interface.

Definition at line 58 of file AbstractISequence.h.


Constructor & Destructor Documentation

Definition at line 63 of file AbstractISequence.h.

virtual bpp::AbstractISequence::~AbstractISequence ( ) [inline, virtual]

Definition at line 64 of file AbstractISequence.h.


Member Function Documentation

virtual void bpp::AbstractISequence::appendSequencesFromFile ( const std::string &  path,
SequenceContainer sc 
) const throw (Exception) [inline, protected, virtual]

Append sequences to a container from a file.

Parameters:
pathThe path to the file to read.
scThe sequence container to update.
Exceptions:
ExceptionIf the file is not in the specified format.

Definition at line 142 of file AbstractISequence.h.

References appendSequencesFromStream().

Referenced by readSequences(), and readSequencesFromFile().

virtual void bpp::AbstractISequence::appendSequencesFromStream ( std::istream &  input,
SequenceContainer sc 
) const throw (Exception) [protected, pure virtual]

Append sequences to a container from a stream.

This is the unique method to implement!

Parameters:
inputThe input stream to read.
scThe sequence container to update.
Exceptions:
ExceptionIf the file is not in the specified format.

Implemented in bpp::Mase, bpp::Fasta, and bpp::GenBank.

Referenced by appendSequencesFromFile(), readSequences(), and readSequencesFromStream().

const std::string bpp::IOSequence::getDataType ( ) const [inline, virtual, inherited]

Implements bpp::IOFormat.

Definition at line 65 of file IoSequence.h.

virtual void bpp::AbstractISequence::readSequences ( std::istream &  input,
SequenceContainer sc 
) const throw (Exception) [inline, virtual]

Add sequences to a container from a stream.

Parameters:
inputThe input stream to read.
scThe sequence container to update.
Exceptions:
ExceptionIf the file is not in the specified format.

Definition at line 82 of file AbstractISequence.h.

References appendSequencesFromStream().

Referenced by bpp::Mase::readMeta().

virtual void bpp::AbstractISequence::readSequences ( const std::string &  path,
SequenceContainer sc 
) const throw (Exception) [inline, virtual]

Add sequences to a container from a file.

Parameters:
pathThe path to the file to read.
scThe sequence container to update.
Exceptions:
ExceptionIf the file is not in the specified format.

Definition at line 94 of file AbstractISequence.h.

References appendSequencesFromFile().

virtual VectorSequenceContainer* bpp::AbstractISequence::readSequences ( std::istream &  input,
const Alphabet alpha 
) const throw (Exception) [inline, virtual]

Create a new container from a stream.

Parameters:
inputThe input stream to read.
alphaThe alphabet to be associated to the container.
Returns:
A new SequenceContainer object.
Exceptions:
ExceptionIf the file is not in the specified format.

Implements bpp::ISequence.

Definition at line 105 of file AbstractISequence.h.

References readSequencesFromStream().

virtual VectorSequenceContainer* bpp::AbstractISequence::readSequences ( const std::string &  path,
const Alphabet alpha 
) const throw (Exception) [inline, virtual]

Create a new container from a file.

Parameters:
pathThe path to the file to read.
alphaThe alphabet to be associated to the container.
Returns:
A new SequenceContainer object.
Exceptions:
ExceptionIf the file is not in the specified format.

Implements bpp::ISequence.

Definition at line 116 of file AbstractISequence.h.

References readSequencesFromFile().

virtual VectorSequenceContainer* bpp::AbstractISequence::readSequencesFromFile ( const std::string &  path,
const Alphabet alpha 
) const throw (Exception) [inline, protected, virtual]

Append sequences to a container from a file.

Parameters:
pathThe path to the file to read.
alphaThe alphabet to use.
Exceptions:
ExceptionIf the file is not in the specified format.

Definition at line 171 of file AbstractISequence.h.

References appendSequencesFromFile().

Referenced by readSequences().

virtual VectorSequenceContainer* bpp::AbstractISequence::readSequencesFromStream ( std::istream &  input,
const Alphabet alpha 
) const throw (Exception) [inline, protected, virtual]

Read sequences from a stream.

Parameters:
inputThe input stream to read.
alphaThe alphabet to use.
Returns:
A sequence container.
Exceptions:
ExceptionIf the file is not in the specified format.

Definition at line 157 of file AbstractISequence.h.

References appendSequencesFromStream().

Referenced by readSequences().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Friends