bpp-seq3  3.0.0
bpp::AbstractIProbabilisticSequence Class Referenceabstract

Partial implementation of the IProbabilisticSequence interface. More...

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

+ Inheritance diagram for bpp::AbstractIProbabilisticSequence:
+ Collaboration diagram for bpp::AbstractIProbabilisticSequence:

Public Member Functions

 AbstractIProbabilisticSequence ()
 
virtual ~AbstractIProbabilisticSequence ()
 
const std::string getDataType () const
 
virtual const std::string getFormatName () const=0
 
virtual const std::string getFormatDescription () const=0
 
ISequence methods:
void readSequences (std::istream &input, ProbabilisticSequenceContainerInterface &sc) const override
 Add sequences to a container from a stream. More...
 
void readSequences (const std::string &path, ProbabilisticSequenceContainerInterface &sc) const override
 Add sequences to a container from a file. More...
 
std::unique_ptr< ProbabilisticSequenceContainerInterfacereadSequences (std::istream &input, std::shared_ptr< const Alphabet > alpha) const override
 Create a new container from a stream. More...
 
std::unique_ptr< ProbabilisticSequenceContainerInterfacereadSequences (const std::string &path, std::shared_ptr< const Alphabet > alpha) const override
 Create a new container from a file. More...
 

Protected Member Functions

virtual void appendSequencesFromStream (std::istream &input, ProbabilisticSequenceContainerInterface &sc) const =0
 Append sequences to a container from a stream. More...
 
virtual void appendSequencesFromFile (const std::string &path, ProbabilisticSequenceContainerInterface &sc) const
 Append sequences to a container from a file. More...
 
std::unique_ptr< ProbabilisticSequenceContainerInterfacereadSequencesFromStream (std::istream &input, std::shared_ptr< const Alphabet > &alpha) const
 Read sequences from a stream. More...
 
std::unique_ptr< ProbabilisticSequenceContainerInterfacereadSequencesFromFile (const std::string &path, std::shared_ptr< const Alphabet > &alpha) const
 Append sequences to a container from a file. More...
 

Detailed Description

Partial implementation of the IProbabilisticSequence interface.

Definition at line 135 of file AbstractISequence.h.

Constructor & Destructor Documentation

◆ AbstractIProbabilisticSequence()

bpp::AbstractIProbabilisticSequence::AbstractIProbabilisticSequence ( )
inline

Definition at line 139 of file AbstractISequence.h.

◆ ~AbstractIProbabilisticSequence()

virtual bpp::AbstractIProbabilisticSequence::~AbstractIProbabilisticSequence ( )
inlinevirtual

Definition at line 140 of file AbstractISequence.h.

Member Function Documentation

◆ appendSequencesFromFile()

virtual void bpp::AbstractIProbabilisticSequence::appendSequencesFromFile ( const std::string &  path,
ProbabilisticSequenceContainerInterface sc 
) const
inlineprotectedvirtual

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 204 of file AbstractISequence.h.

References appendSequencesFromStream().

Referenced by readSequences(), and readSequencesFromFile().

◆ appendSequencesFromStream()

virtual void bpp::AbstractIProbabilisticSequence::appendSequencesFromStream ( std::istream &  input,
ProbabilisticSequenceContainerInterface sc 
) const
protectedpure 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.

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

◆ getDataType()

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

Implements bpp::IOFormat.

Reimplemented in bpp::Pasta.

Definition at line 44 of file IoSequence.h.

◆ readSequences() [1/4]

void bpp::AbstractIProbabilisticSequence::readSequences ( const std::string &  path,
ProbabilisticSequenceContainerInterface sc 
) const
inlineoverridevirtual

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::IProbabilisticSequence.

Definition at line 169 of file AbstractISequence.h.

References appendSequencesFromFile().

◆ readSequences() [2/4]

std::unique_ptr<ProbabilisticSequenceContainerInterface> bpp::AbstractIProbabilisticSequence::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 ProbabilisticSequenceContainer object.

Implements bpp::IProbabilisticSequence.

Definition at line 179 of file AbstractISequence.h.

References readSequencesFromFile().

◆ readSequences() [3/4]

void bpp::AbstractIProbabilisticSequence::readSequences ( std::istream &  input,
ProbabilisticSequenceContainerInterface sc 
) const
inlineoverridevirtual

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::IProbabilisticSequence.

Definition at line 157 of file AbstractISequence.h.

References appendSequencesFromStream().

◆ readSequences() [4/4]

std::unique_ptr<ProbabilisticSequenceContainerInterface> bpp::AbstractIProbabilisticSequence::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 ProbabilisticSequenceContainer object.

Implements bpp::IProbabilisticSequence.

Definition at line 174 of file AbstractISequence.h.

References readSequencesFromStream().

◆ readSequencesFromFile()

std::unique_ptr<ProbabilisticSequenceContainerInterface> bpp::AbstractIProbabilisticSequence::readSequencesFromFile ( const std::string &  path,
std::shared_ptr< const Alphabet > &  alpha 
) const
inlineprotected

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 235 of file AbstractISequence.h.

References appendSequencesFromFile().

Referenced by readSequences().

◆ readSequencesFromStream()

std::unique_ptr<ProbabilisticSequenceContainerInterface> bpp::AbstractIProbabilisticSequence::readSequencesFromStream ( std::istream &  input,
std::shared_ptr< const Alphabet > &  alpha 
) const
inlineprotected

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 221 of file AbstractISequence.h.

References appendSequencesFromStream().

Referenced by readSequences().


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