bpp-seq3  3.0.0
bpp::AbstractOSequence2 Class Referenceabstract

Partial implementation of the OAlignment interface. More...

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

+ Inheritance diagram for bpp::AbstractOSequence2:
+ Collaboration diagram for bpp::AbstractOSequence2:

Public Member Functions

 AbstractOSequence2 ()
 
virtual ~AbstractOSequence2 ()
 
const std::string getDataType () const
 
virtual const std::string getFormatName () const=0
 
virtual const std::string getFormatDescription () const=0
 
OAlignment methods:

As a SiteContainer is a specialization of SequenceContainer, it is assumed that a OSequence object can write aligned sequence just like a OAlignment object. Therefore it implements the OAlignment interface by down-casting the SiteContainer to a SequenceContainer.

void writeAlignment (std::ostream &output, const SiteContainerInterface &sc) const override
 Write a container to a stream. More...
 
void writeAlignment (const std::string &path, const SiteContainerInterface &sc, bool overwrite=true) const override
 Write a container to a file. More...
 
OSequence methods:
void writeSequences (std::ostream &output, const SequenceContainerInterface &sc) const override=0
 Write a container to a stream. More...
 
void writeSequences (const std::string &path, const SequenceContainerInterface &sc, bool overwrite=true) const override
 Write a container to a file. More...
 

Detailed Description

Partial implementation of the OAlignment interface.

This implementation is for sequence formats that can store both aligned and non-aligned sequences. Alignment sequences are written as simple sequences with gaps.

Definition at line 54 of file AbstractOSequence.h.

Constructor & Destructor Documentation

◆ AbstractOSequence2()

bpp::AbstractOSequence2::AbstractOSequence2 ( )
inline

Definition at line 60 of file AbstractOSequence.h.

◆ ~AbstractOSequence2()

virtual bpp::AbstractOSequence2::~AbstractOSequence2 ( )
inlinevirtual

Definition at line 61 of file AbstractOSequence.h.

Member Function Documentation

◆ getDataType()

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

Implements bpp::IOFormat.

Reimplemented in bpp::Pasta.

Definition at line 29 of file IoSequence.h.

◆ writeAlignment() [1/2]

void bpp::AbstractOSequence2::writeAlignment ( const std::string &  path,
const SiteContainerInterface sc,
bool  overwrite = true 
) const
inlineoverridevirtual

Write a container to a file.

Parameters
pathThe path to the file to write.
scThe container to write.
overwriteIf true the sequences are written at the beginning of the file instead of being appended. Any previous content will be lost.
Exceptions
ExceptionIf the file is not in the specified format.

Implements bpp::OAlignment.

Definition at line 78 of file AbstractOSequence.h.

References bpp::AbstractOSequence::writeSequences().

◆ writeAlignment() [2/2]

void bpp::AbstractOSequence2::writeAlignment ( std::ostream &  output,
const SiteContainerInterface sc 
) const
inlineoverridevirtual

Write a container to a stream.

Parameters
outputThe output stream where to write.
scThe container to write.
Exceptions
ExceptionIf the file is not in the specified format.

Implements bpp::OAlignment.

Definition at line 73 of file AbstractOSequence.h.

References bpp::AbstractOSequence::writeSequences().

◆ writeSequences() [1/2]

void bpp::AbstractOSequence::writeSequences ( const std::string &  path,
const SequenceContainerInterface sc,
bool  overwrite = true 
) const
inlineoverridevirtualinherited

Write a container to a file.

Parameters
pathThe path to the file to write.
scThe container to write.
overwriteIf true the sequences are written at the beginning of the file instead of being appended. Any previous content will be lost.
Exceptions
ExceptionIf the file is not in the specified format.

Implements bpp::OSequence.

Reimplemented in bpp::Mase, and bpp::Fasta.

Definition at line 38 of file AbstractOSequence.h.

References bpp::AbstractOSequence::writeSequences().

◆ writeSequences() [2/2]

void bpp::AbstractOSequence::writeSequences ( std::ostream &  output,
const SequenceContainerInterface sc 
) const
overridepure virtualinherited

Write a container to a stream.

Parameters
outputThe output stream where to write.
scThe container to write.
Exceptions
ExceptionIf the file is not in the specified format.

Implements bpp::OSequence.

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

Referenced by writeAlignment(), bpp::AbstractOSequence::writeSequences(), bpp::Fasta::writeSequences(), and bpp::Mase::writeSequences().


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