bpp-seq3  3.0.0
bpp::DCSE Class Reference

Support for the Dedicated Comparative Sequence Editor format. More...

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

+ Inheritance diagram for bpp::DCSE:
+ Collaboration diagram for bpp::DCSE:

Public Member Functions

 DCSE ()
 
virtual ~DCSE ()
 
const std::string getDataType () const
 
The AbstractIAlignment interface.
void appendAlignmentFromStream (std::istream &input, SequenceContainerInterface &sc) const override
 Append sequences to a container from a stream. More...
 
The ISequence interface.

As a SiteContainer is a subclass of SequenceContainer, we hereby implement the ISequence interface by downcasting the interface.

std::unique_ptr< SequenceContainerInterfacereadSequences (std::istream &input, std::shared_ptr< const Alphabet > alpha) const override
 Create a new container from a stream. More...
 
std::unique_ptr< SequenceContainerInterfacereadSequences (const std::string &path, std::shared_ptr< const Alphabet > alpha) const override
 Create a new container from a file. More...
 
The IOSequence interface.
const std::string getFormatName () const override
 
const std::string getFormatDescription () const override
 
The ISequence interface.

As a SiteContainer is a subclass of SequenceContainer, we hereby implement the ISequence interface by downcasting the interface.

void readSequences (std::istream &input, SequenceContainerInterface &sc) const override
 Create a new container from a stream. More...
 
void readSequences (const std::string &path, SequenceContainerInterface &sc) const override
 Create a new container from a file. More...
 
IAlignment methods:
virtual void readAlignment (std::istream &input, SequenceContainerInterface &sc) const override
 Add sequences to a container from a stream. More...
 
virtual void readAlignment (const std::string &path, SequenceContainerInterface &sc) const override
 Add sequences to a container from a file. More...
 
std::unique_ptr< SiteContainerInterfacereadAlignment (const std::string &path, std::shared_ptr< const Alphabet > alpha) const override
 Create a new container from a file. More...
 
std::unique_ptr< SiteContainerInterfacereadAlignment (std::istream &input, std::shared_ptr< const Alphabet > alpha) const override
 Create a new container from a stream. More...
 

Protected Member Functions

virtual void appendAlignmentFromFile (const std::string &path, SequenceContainerInterface &sc) const
 Append sequences to a container from a file. More...
 
virtual std::unique_ptr< SiteContainerInterfacereadAlignmentFromStream (std::istream &input, std::shared_ptr< const Alphabet > alpha) const
 Read sequences from a stream. More...
 
virtual std::unique_ptr< SiteContainerInterfacereadAlignmentFromFile (const std::string &path, std::shared_ptr< const Alphabet > alpha) const
 Read sequences from a file. More...
 

Detailed Description

Support for the Dedicated Comparative Sequence Editor format.

Only the sequence information is retrieved. All structural information is dropped for now.

A description of this format may be found here: http://www.psb.ugent.be/rRNA/help/formats/aliformat.html

Definition at line 25 of file Dcse.h.

Constructor & Destructor Documentation

◆ DCSE()

bpp::DCSE::DCSE ( )
inline

Definition at line 29 of file Dcse.h.

◆ ~DCSE()

virtual bpp::DCSE::~DCSE ( )
inlinevirtual

Definition at line 30 of file Dcse.h.

Member Function Documentation

◆ appendAlignmentFromFile()

virtual void bpp::AbstractIAlignment::appendAlignmentFromFile ( const std::string &  path,
SequenceContainerInterface sc 
) const
inlineprotectedvirtualinherited

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 93 of file AbstractIAlignment.h.

References bpp::AbstractIAlignment::appendAlignmentFromStream().

Referenced by bpp::AbstractIAlignment::readAlignment(), bpp::AbstractIAlignment::readAlignmentFromFile(), and bpp::AbstractIAlignment2::readSequences().

◆ appendAlignmentFromStream()

void DCSE::appendAlignmentFromStream ( std::istream &  input,
SequenceContainerInterface sc 
) const
overridevirtual

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.

Implements bpp::AbstractIAlignment.

Definition at line 18 of file Dcse.cpp.

References bpp::TemplateSequenceContainerInterface< SequenceType, HashType >::addSequence(), bpp::TemplateSequenceDataInterface< HashType >::getAlphabet(), bpp::FileTools::getNextLine(), bpp::TextTools::removeChar(), bpp::TextTools::removeFirstWhiteSpaces(), and bpp::TextTools::removeWhiteSpaces().

◆ getDataType()

const std::string bpp::IOSequence::getDataType ( ) const
inlinevirtualinherited

Implements bpp::IOFormat.

Reimplemented in bpp::Pasta.

Definition at line 29 of file IoSequence.h.

◆ getFormatDescription()

const string DCSE::getFormatDescription ( ) const
overridevirtual

Implements bpp::IOFormat.

Definition at line 70 of file Dcse.cpp.

◆ getFormatName()

const string DCSE::getFormatName ( ) const
overridevirtual

Implements bpp::IOFormat.

Definition at line 68 of file Dcse.cpp.

◆ readAlignment() [1/4]

virtual void bpp::AbstractIAlignment::readAlignment ( const std::string &  path,
SequenceContainerInterface sc 
) const
inlineoverridevirtualinherited

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.

Implements bpp::IAlignment.

Definition at line 57 of file AbstractIAlignment.h.

References bpp::AbstractIAlignment::appendAlignmentFromFile().

◆ readAlignment() [2/4]

std::unique_ptr<SiteContainerInterface> bpp::AbstractIAlignment::readAlignment ( const std::string &  path,
std::shared_ptr< const Alphabet alpha 
) const
inlineoverridevirtualinherited

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 62 of file AbstractIAlignment.h.

References bpp::AbstractIAlignment::readAlignmentFromFile().

◆ readAlignment() [3/4]

virtual void bpp::AbstractIAlignment::readAlignment ( std::istream &  input,
SequenceContainerInterface sc 
) const
inlineoverridevirtualinherited

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.

Implements bpp::IAlignment.

Definition at line 45 of file AbstractIAlignment.h.

References bpp::AbstractIAlignment::appendAlignmentFromStream().

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

◆ readAlignment() [4/4]

std::unique_ptr<SiteContainerInterface> bpp::AbstractIAlignment::readAlignment ( std::istream &  input,
std::shared_ptr< const Alphabet alpha 
) const
inlineoverridevirtualinherited

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 67 of file AbstractIAlignment.h.

References bpp::AbstractIAlignment::readAlignmentFromStream().

◆ readAlignmentFromFile()

virtual std::unique_ptr<SiteContainerInterface> bpp::AbstractIAlignment::readAlignmentFromFile ( const std::string &  path,
std::shared_ptr< const Alphabet alpha 
) const
inlineprotectedvirtualinherited

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 125 of file AbstractIAlignment.h.

References bpp::AbstractIAlignment::appendAlignmentFromFile().

Referenced by bpp::AbstractIAlignment::readAlignment().

◆ readAlignmentFromStream()

virtual std::unique_ptr<SiteContainerInterface> bpp::AbstractIAlignment::readAlignmentFromStream ( std::istream &  input,
std::shared_ptr< const Alphabet alpha 
) const
inlineprotectedvirtualinherited

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 110 of file AbstractIAlignment.h.

References bpp::AbstractIAlignment::appendAlignmentFromStream().

Referenced by bpp::AbstractIAlignment::readAlignment().

◆ readSequences() [1/4]

void bpp::AbstractIAlignment2::readSequences ( const std::string &  path,
SequenceContainerInterface container 
) const
inlineoverridevirtualinherited

Create a new container from a file.

Parameters
pathThe path to the file to read.
containerThe container where to add data.
Exceptions
ExceptionIf the file is not in the specified format.

Implements bpp::ISequence.

Definition at line 162 of file AbstractIAlignment.h.

References bpp::AbstractIAlignment::appendAlignmentFromFile().

◆ readSequences() [2/4]

std::unique_ptr<SequenceContainerInterface> bpp::DCSE::readSequences ( const std::string &  path,
std::shared_ptr< const Alphabet alpha 
) const
inlineoverridevirtual

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.

Reimplemented from bpp::AbstractIAlignment2.

Definition at line 54 of file Dcse.h.

References bpp::AbstractIAlignment::readAlignment().

◆ readSequences() [3/4]

void bpp::AbstractIAlignment2::readSequences ( std::istream &  input,
SequenceContainerInterface container 
) const
inlineoverridevirtualinherited

Create a new container from a stream.

Parameters
inputThe input stream to read.
containerThe container where to add data.
Exceptions
ExceptionIf the file is not in the specified format.

Implements bpp::ISequence.

Definition at line 157 of file AbstractIAlignment.h.

References bpp::AbstractIAlignment::appendAlignmentFromStream().

◆ readSequences() [4/4]

std::unique_ptr<SequenceContainerInterface> bpp::DCSE::readSequences ( std::istream &  input,
std::shared_ptr< const Alphabet alpha 
) const
inlineoverridevirtual

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.

Reimplemented from bpp::AbstractIAlignment2.

Definition at line 49 of file Dcse.h.

References bpp::AbstractIAlignment::readAlignment().


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