bpp-seq3  3.0.0
bpp::GenBank Class Reference

The GenBank sequence file format. More...

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

+ Inheritance diagram for bpp::GenBank:
+ Collaboration diagram for bpp::GenBank:

Public Member Functions

 GenBank ()
 Build a new GenBank object. More...
 
virtual ~GenBank ()
 
const std::string getDataType () const
 
The AbstractISequence interface.
void appendSequencesFromStream (std::istream &input, SequenceContainerInterface &sc) const
 Append sequences to a container from a stream. More...
 
The IOSequence interface.
const std::string getFormatName () const
 
const std::string getFormatDescription () const
 
ISequence methods:
void readSequences (std::istream &input, SequenceContainerInterface &sc) const override
 Add sequences to a container from a stream. More...
 
void readSequences (const std::string &path, SequenceContainerInterface &sc) const override
 Add sequences to a container from a file. More...
 
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...
 

Protected Member Functions

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

Detailed Description

The GenBank sequence file format.

For now, only read raw sequences. Features are not yet supported.

Definition at line 21 of file GenBank.h.

Constructor & Destructor Documentation

◆ GenBank()

bpp::GenBank::GenBank ( )
inline

Build a new GenBank object.

Definition at line 28 of file GenBank.h.

◆ ~GenBank()

virtual bpp::GenBank::~GenBank ( )
inlinevirtual

Definition at line 30 of file GenBank.h.

Member Function Documentation

◆ appendSequencesFromFile()

virtual void bpp::AbstractISequence::appendSequencesFromFile ( 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 92 of file AbstractISequence.h.

References bpp::AbstractISequence::appendSequencesFromStream().

Referenced by bpp::AbstractISequence::readSequences(), and bpp::AbstractISequence::readSequencesFromFile().

◆ appendSequencesFromStream()

void GenBank::appendSequencesFromStream ( std::istream &  input,
SequenceContainerInterface sc 
) const
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.

Implements bpp::AbstractISequence.

Definition at line 15 of file GenBank.cpp.

References bpp::TemplateSequenceContainerInterface< SequenceType, HashType >::addSequence(), bpp::TemplateSequenceDataInterface< HashType >::getAlphabet(), bpp::StringTokenizer::nextToken(), bpp::TextTools::removeSurroundingWhiteSpaces(), 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 std::string bpp::GenBank::getFormatDescription ( ) const
inlinevirtual

Implements bpp::IOFormat.

Definition at line 47 of file GenBank.h.

◆ getFormatName()

const std::string bpp::GenBank::getFormatName ( ) const
inlinevirtual

Implements bpp::IOFormat.

Definition at line 46 of file GenBank.h.

◆ readSequences() [1/4]

void bpp::AbstractISequence::readSequences ( 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::ISequence.

Definition at line 57 of file AbstractISequence.h.

References bpp::AbstractISequence::appendSequencesFromFile().

◆ readSequences() [2/4]

std::unique_ptr<SequenceContainerInterface> bpp::AbstractISequence::readSequences ( 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 SequenceContainer object.
Exceptions
ExceptionIf the file is not in the specified format.

Implements bpp::ISequence.

Definition at line 67 of file AbstractISequence.h.

References bpp::AbstractISequence::readSequencesFromFile().

◆ readSequences() [3/4]

void bpp::AbstractISequence::readSequences ( 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::ISequence.

Definition at line 45 of file AbstractISequence.h.

References bpp::AbstractISequence::appendSequencesFromStream().

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

◆ readSequences() [4/4]

std::unique_ptr<SequenceContainerInterface> bpp::AbstractISequence::readSequences ( 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 SequenceContainer object.
Exceptions
ExceptionIf the file is not in the specified format.

Implements bpp::ISequence.

Definition at line 62 of file AbstractISequence.h.

References bpp::AbstractISequence::readSequencesFromStream().

◆ readSequencesFromFile()

std::unique_ptr<SequenceContainerInterface> bpp::AbstractISequence::readSequencesFromFile ( const std::string &  path,
std::shared_ptr< const Alphabet > &  alpha 
) const
inlineprotectedinherited

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

References bpp::AbstractISequence::appendSequencesFromFile().

Referenced by bpp::AbstractISequence::readSequences().

◆ readSequencesFromStream()

std::unique_ptr<SequenceContainerInterface> bpp::AbstractISequence::readSequencesFromStream ( std::istream &  input,
std::shared_ptr< const Alphabet > &  alpha 
) const
inlineprotectedinherited

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

References bpp::AbstractISequence::appendSequencesFromStream().

Referenced by bpp::AbstractISequence::readSequences().


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