bpp-seq  2.1.0
bpp::AbstractIAlignment Class Reference

Partial implementation of the IAlignment interface, dedicated to alignment readers. More...

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

+ Inheritance diagram for bpp::AbstractIAlignment:
+ Collaboration diagram for bpp::AbstractIAlignment:

List of all members.

Public Member Functions

 AbstractIAlignment ()
virtual ~AbstractIAlignment ()
const std::string getDataType () const
virtual const std::string getFormatName () const =0
virtual const std::string getFormatDescription () const =0
IAlignment methods:
virtual void readAlignment (std::istream &input, SiteContainer &sc) const throw (Exception)
 Add sequences to a container from a stream.
virtual void readAlignment (const std::string &path, SiteContainer &sc) const throw (Exception)
 Add sequences to a container from a file.
virtual AlignedSequenceContainerreadAlignment (const std::string &path, const Alphabet *alpha) const throw (Exception)
 Create a new container from a file.
virtual AlignedSequenceContainerreadAlignment (std::istream &input, const Alphabet *alpha) const throw (Exception)
 Create a new container from a stream.

Protected Member Functions

virtual void appendAlignmentFromStream (std::istream &input, SiteContainer &sc) const =0 throw (Exception)
 Append sequences to a container from a stream.
virtual void appendAlignmentFromFile (const std::string &path, SiteContainer &sc) const throw (Exception)
 Append sequences to a container from a file.
virtual AlignedSequenceContainerreadAlignmentFromStream (std::istream &input, const Alphabet *alpha) const throw (Exception)
 Read sequences from a stream.
virtual AlignedSequenceContainerreadAlignmentFromFile (const std::string &path, const Alphabet *alpha) const throw (Exception)
 Read sequences from a file.

Detailed Description

Partial implementation of the IAlignment interface, dedicated to alignment readers.

Definition at line 58 of file AbstractIAlignment.h.


Constructor & Destructor Documentation

Definition at line 63 of file AbstractIAlignment.h.

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

Definition at line 64 of file AbstractIAlignment.h.


Member Function Documentation

virtual void bpp::AbstractIAlignment::appendAlignmentFromFile ( const std::string &  path,
SiteContainer 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 143 of file AbstractIAlignment.h.

References appendAlignmentFromStream().

Referenced by readAlignment(), and readAlignmentFromFile().

virtual void bpp::AbstractIAlignment::appendAlignmentFromStream ( std::istream &  input,
SiteContainer 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::Phylip, bpp::Fasta, bpp::NexusIOSequence, bpp::Clustal, and bpp::DCSE.

Referenced by appendAlignmentFromFile(), readAlignment(), and readAlignmentFromStream().

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

Implements bpp::IOFormat.

Definition at line 65 of file IoSequence.h.

virtual void bpp::AbstractIAlignment::readAlignment ( std::istream &  input,
SiteContainer 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 81 of file AbstractIAlignment.h.

References appendAlignmentFromStream().

Referenced by bpp::DCSE::readSequences(), bpp::Clustal::readSequences(), bpp::NexusIOSequence::readSequences(), and bpp::Phylip::readSequences().

virtual void bpp::AbstractIAlignment::readAlignment ( const std::string &  path,
SiteContainer 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 93 of file AbstractIAlignment.h.

References appendAlignmentFromFile().

virtual AlignedSequenceContainer* bpp::AbstractIAlignment::readAlignment ( 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 SiteContainer object.
Exceptions:
ExceptionIf the file is not in the specified format.

Implements bpp::IAlignment.

Definition at line 104 of file AbstractIAlignment.h.

References readAlignmentFromFile().

virtual AlignedSequenceContainer* bpp::AbstractIAlignment::readAlignment ( 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 SiteContainer object.
Exceptions:
ExceptionIf the file is not in the specified format.

Implements bpp::IAlignment.

Definition at line 115 of file AbstractIAlignment.h.

References readAlignmentFromStream().

virtual AlignedSequenceContainer* bpp::AbstractIAlignment::readAlignmentFromFile ( const std::string &  path,
const Alphabet alpha 
) const throw (Exception) [inline, protected, virtual]

Read sequences from a file.

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

Definition at line 173 of file AbstractIAlignment.h.

References appendAlignmentFromFile().

Referenced by readAlignment().

virtual AlignedSequenceContainer* bpp::AbstractIAlignment::readAlignmentFromStream ( 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 158 of file AbstractIAlignment.h.

References appendAlignmentFromStream().

Referenced by readAlignment().


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