bpp-seq3  3.0.0
bpp::IoSequenceFactory Class Reference

Utilitary class for creating sequence readers and writers. More...

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

+ Collaboration diagram for bpp::IoSequenceFactory:

Public Member Functions

 IoSequenceFactory ()
 Creates a new factory object. More...
 
virtual ~IoSequenceFactory ()
 
virtual std::unique_ptr< ISequencecreateReader (const std::string &format)
 Get a new dynamically created ISequence object. More...
 
virtual std::unique_ptr< IAlignmentcreateAlignmentReader (const std::string &format)
 Get a new dynamically created IAlignment object. More...
 
virtual std::unique_ptr< OSequencecreateWriter (const std::string &format)
 Get a new dynamically created OSequence object. More...
 
virtual std::unique_ptr< OAlignmentcreateAlignmentWriter (const std::string &format)
 Get a new dynamically created OAlignment object. More...
 

Static Public Attributes

static const std::string FASTA_FORMAT = "Fasta"
 
static const std::string MASE_FORMAT = "Mase"
 
static const std::string CLUSTAL_FORMAT = "Clustal"
 
static const std::string DCSE_FORMAT = "DCSE"
 
static const std::string PHYLIP_FORMAT_INTERLEAVED = "Phylip I"
 
static const std::string PHYLIP_FORMAT_SEQUENTIAL = "Phylip S"
 
static const std::string PAML_FORMAT_INTERLEAVED = "PAML I"
 
static const std::string PAML_FORMAT_SEQUENTIAL = "PAML S"
 
static const std::string GENBANK_FORMAT = "GenBank"
 
static const std::string NEXUS_FORMAT = "Nexus"
 

Detailed Description

Utilitary class for creating sequence readers and writers.

Definition at line 18 of file IoSequenceFactory.h.

Constructor & Destructor Documentation

◆ IoSequenceFactory()

bpp::IoSequenceFactory::IoSequenceFactory ( )
inline

Creates a new factory object.

Example:

auto seqReader = IoSequenceFactory().createReader(IoSequenceFactory::FASTA_FORMAT);
unique_ptr<SequenceContainer> sequences = seqReader->read("file.fasta", alphabet);
delete seqReader;
static std::shared_ptr< const DNA > DNA_ALPHABET
Definition: AlphabetTools.h:34
IoSequenceFactory()
Creates a new factory object.
static const std::string FASTA_FORMAT

Definition at line 44 of file IoSequenceFactory.h.

◆ ~IoSequenceFactory()

virtual bpp::IoSequenceFactory::~IoSequenceFactory ( )
inlinevirtual

Definition at line 45 of file IoSequenceFactory.h.

Member Function Documentation

◆ createAlignmentReader()

unique_ptr< IAlignment > IoSequenceFactory::createAlignmentReader ( const std::string &  format)
virtual

Get a new dynamically created IAlignment object.

Parameters
formatThe input file format.
Returns
A pointer toward a new IAlignment object.
Exceptions
ExceptionIf the format name do not match any available format.

Definition at line 54 of file IoSequenceFactory.cpp.

◆ createAlignmentWriter()

unique_ptr< OAlignment > IoSequenceFactory::createAlignmentWriter ( const std::string &  format)
virtual

Get a new dynamically created OAlignment object.

Parameters
formatThe output file format.
Returns
A pointer toward a new OAlignment object.
Exceptions
ExceptionIf the format name do not match any available format.

Definition at line 88 of file IoSequenceFactory.cpp.

◆ createReader()

unique_ptr< ISequence > IoSequenceFactory::createReader ( const std::string &  format)
virtual

Get a new dynamically created ISequence object.

Parameters
formatThe input file format.
Returns
A pointer toward a new ISequence object.
Exceptions
ExceptionIf the format name do not match any available format.

Definition at line 28 of file IoSequenceFactory.cpp.

◆ createWriter()

unique_ptr< OSequence > IoSequenceFactory::createWriter ( const std::string &  format)
virtual

Get a new dynamically created OSequence object.

Parameters
formatThe output file format.
Returns
A pointer toward a new OSequence object.
Exceptions
ExceptionIf the format name do not match any available format.

Definition at line 78 of file IoSequenceFactory.cpp.

Member Data Documentation

◆ CLUSTAL_FORMAT

const string IoSequenceFactory::CLUSTAL_FORMAT = "Clustal"
static

Definition at line 23 of file IoSequenceFactory.h.

◆ DCSE_FORMAT

const string IoSequenceFactory::DCSE_FORMAT = "DCSE"
static

Definition at line 24 of file IoSequenceFactory.h.

◆ FASTA_FORMAT

const string IoSequenceFactory::FASTA_FORMAT = "Fasta"
static

Definition at line 21 of file IoSequenceFactory.h.

◆ GENBANK_FORMAT

const string IoSequenceFactory::GENBANK_FORMAT = "GenBank"
static

Definition at line 29 of file IoSequenceFactory.h.

◆ MASE_FORMAT

const string IoSequenceFactory::MASE_FORMAT = "Mase"
static

Definition at line 22 of file IoSequenceFactory.h.

◆ NEXUS_FORMAT

const string IoSequenceFactory::NEXUS_FORMAT = "Nexus"
static

Definition at line 30 of file IoSequenceFactory.h.

◆ PAML_FORMAT_INTERLEAVED

const string IoSequenceFactory::PAML_FORMAT_INTERLEAVED = "PAML I"
static

Definition at line 27 of file IoSequenceFactory.h.

◆ PAML_FORMAT_SEQUENTIAL

const string IoSequenceFactory::PAML_FORMAT_SEQUENTIAL = "PAML S"
static

Definition at line 28 of file IoSequenceFactory.h.

◆ PHYLIP_FORMAT_INTERLEAVED

const string IoSequenceFactory::PHYLIP_FORMAT_INTERLEAVED = "Phylip I"
static

Definition at line 25 of file IoSequenceFactory.h.

◆ PHYLIP_FORMAT_SEQUENTIAL

const string IoSequenceFactory::PHYLIP_FORMAT_SEQUENTIAL = "Phylip S"
static

Definition at line 26 of file IoSequenceFactory.h.


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