bpp-seq  2.2.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 ISequencecreateReader (const std::string &format) throw (Exception)
 Get a new dynamically created ISequence object. More...
 
virtual IAlignmentcreateAlignmentReader (const std::string &format) throw (Exception)
 Get a new dynamically created IAlignment object. More...
 
virtual OSequencecreateWriter (const std::string &format) throw (Exception)
 Get a new dynamically created OSequence object. More...
 
virtual OAlignmentcreateAlignmentWriter (const std::string &format) throw (Exception)
 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 53 of file IoSequenceFactory.h.

Constructor & Destructor Documentation

◆ IoSequenceFactory()

bpp::IoSequenceFactory::IoSequenceFactory ( )
inline

Creates a new factory object.

Example:

Alphabet* alphabet = new DNA();
ISequence* seqReader = IoSequenceFactory().createReader(IoSequenceFactory::FASTA_FORMAT);
SequenceContainer* sequences = seqReader->read("file.fasta", alphabet);
delete seqReader;

Definition at line 80 of file IoSequenceFactory.h.

◆ ~IoSequenceFactory()

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

Definition at line 81 of file IoSequenceFactory.h.

Member Function Documentation

◆ createAlignmentReader()

IAlignment * IoSequenceFactory::createAlignmentReader ( const std::string &  format)
throw (Exception
)
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 78 of file IoSequenceFactory.cpp.

◆ createAlignmentWriter()

OAlignment * IoSequenceFactory::createAlignmentWriter ( const std::string &  format)
throw (Exception
)
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 99 of file IoSequenceFactory.cpp.

◆ createReader()

ISequence * IoSequenceFactory::createReader ( const std::string &  format)
throw (Exception
)
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 63 of file IoSequenceFactory.cpp.

◆ createWriter()

OSequence * IoSequenceFactory::createWriter ( const std::string &  format)
throw (Exception
)
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 92 of file IoSequenceFactory.cpp.

Member Data Documentation

◆ CLUSTAL_FORMAT

const string IoSequenceFactory::CLUSTAL_FORMAT = "Clustal"
static

Definition at line 58 of file IoSequenceFactory.h.

◆ DCSE_FORMAT

const string IoSequenceFactory::DCSE_FORMAT = "DCSE"
static

Definition at line 59 of file IoSequenceFactory.h.

◆ FASTA_FORMAT

const string IoSequenceFactory::FASTA_FORMAT = "Fasta"
static

Definition at line 56 of file IoSequenceFactory.h.

◆ GENBANK_FORMAT

const string IoSequenceFactory::GENBANK_FORMAT = "GenBank"
static

Definition at line 64 of file IoSequenceFactory.h.

◆ MASE_FORMAT

const string IoSequenceFactory::MASE_FORMAT = "Mase"
static

Definition at line 57 of file IoSequenceFactory.h.

◆ NEXUS_FORMAT

const string IoSequenceFactory::NEXUS_FORMAT = "Nexus"
static

Definition at line 65 of file IoSequenceFactory.h.

◆ PAML_FORMAT_INTERLEAVED

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

Definition at line 62 of file IoSequenceFactory.h.

◆ PAML_FORMAT_SEQUENTIAL

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

Definition at line 63 of file IoSequenceFactory.h.

◆ PHYLIP_FORMAT_INTERLEAVED

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

Definition at line 60 of file IoSequenceFactory.h.

◆ PHYLIP_FORMAT_SEQUENTIAL

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

Definition at line 61 of file IoSequenceFactory.h.


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