bpp-phyl  2.2.0
bpp::PhylipDistanceMatrixFormat Class Reference

Distance matrix I/O in Phylip format. More...

#include <Bpp/Phyl/Io/PhylipDistanceMatrixFormat.h>

+ Inheritance diagram for bpp::PhylipDistanceMatrixFormat:
+ Collaboration diagram for bpp::PhylipDistanceMatrixFormat:

Public Member Functions

 PhylipDistanceMatrixFormat (bool extended=false)
 
virtual ~PhylipDistanceMatrixFormat ()
 
const std::string getFormatName () const
 
const std::string getFormatDescription () const
 
DistanceMatrix * read (const std::string &path) const throw (Exception)
 Read a distance matrix from a file. More...
 
DistanceMatrix * read (std::istream &in) const throw (Exception)
 Read a distance matrix from a stream. More...
 
void write (const DistanceMatrix &dist, const std::string &path, bool overwrite=true) const throw (Exception)
 Write a distance matrix to a file. More...
 
void write (const DistanceMatrix &dist, std::ostream &out) const throw (Exception)
 Write a distance matrix to a stream. More...
 
virtual const std::string getDataType () const
 

Private Attributes

bool extended_
 

Detailed Description

Distance matrix I/O in Phylip format.

Entry names must be 10 characters long. If 'extended' is set to true, then entry names can be of any size, and should be separated from the data by at least two spaces. Names should therefor not contian more than one consecutive space.

Definition at line 55 of file PhylipDistanceMatrixFormat.h.

Constructor & Destructor Documentation

◆ PhylipDistanceMatrixFormat()

bpp::PhylipDistanceMatrixFormat::PhylipDistanceMatrixFormat ( bool  extended = false)
inline

Definition at line 63 of file PhylipDistanceMatrixFormat.h.

◆ ~PhylipDistanceMatrixFormat()

virtual bpp::PhylipDistanceMatrixFormat::~PhylipDistanceMatrixFormat ( )
inlinevirtual

Definition at line 64 of file PhylipDistanceMatrixFormat.h.

Member Function Documentation

◆ getDataType()

virtual const std::string bpp::IODistanceMatrix::getDataType ( ) const
inlinevirtualinherited

Definition at line 65 of file IoDistanceMatrix.h.

◆ getFormatDescription()

const std::string bpp::PhylipDistanceMatrixFormat::getFormatDescription ( ) const
inline

Definition at line 69 of file PhylipDistanceMatrixFormat.h.

◆ getFormatName()

const std::string bpp::PhylipDistanceMatrixFormat::getFormatName ( ) const
inline

Definition at line 67 of file PhylipDistanceMatrixFormat.h.

◆ read() [1/2]

DistanceMatrix* bpp::PhylipDistanceMatrixFormat::read ( const std::string &  path) const
throw (Exception
)
inlinevirtual

Read a distance matrix from a file.

Parameters
pathThe file path.
Returns
A new distance matrix object.
Exceptions
ExceptionIf an error occured.

Reimplemented from bpp::AbstractIDistanceMatrix.

Definition at line 70 of file PhylipDistanceMatrixFormat.h.

References bpp::AbstractIDistanceMatrix::read().

◆ read() [2/2]

DistanceMatrix * PhylipDistanceMatrixFormat::read ( std::istream &  in) const
throw (Exception
)
virtual

Read a distance matrix from a stream.

Parameters
inThe input stream.
Returns
A new distance matrix object.
Exceptions
ExceptionIf an error occured.

Implements bpp::AbstractIDistanceMatrix.

Definition at line 56 of file PhylipDistanceMatrixFormat.cpp.

◆ write() [1/2]

void bpp::PhylipDistanceMatrixFormat::write ( const DistanceMatrix &  dist,
const std::string &  path,
bool  overwrite = true 
) const
throw (Exception
)
inlinevirtual

Write a distance matrix to a file.

Parameters
distA distance matrix object.
pathThe file path.
overwriteTell if existing file must be overwritten. Otherwise append to the file.
Exceptions
ExceptionIf an error occured.

Reimplemented from bpp::AbstractODistanceMatrix.

Definition at line 76 of file PhylipDistanceMatrixFormat.h.

References bpp::AbstractODistanceMatrix::write().

◆ write() [2/2]

void PhylipDistanceMatrixFormat::write ( const DistanceMatrix &  dist,
std::ostream &  out 
) const
throw (Exception
)
virtual

Write a distance matrix to a stream.

Parameters
distA distance matrix object.
outThe output stream.
Exceptions
ExceptionIf an error occured.

Implements bpp::AbstractODistanceMatrix.

Definition at line 96 of file PhylipDistanceMatrixFormat.cpp.

Member Data Documentation

◆ extended_

bool bpp::PhylipDistanceMatrixFormat::extended_
private

Definition at line 60 of file PhylipDistanceMatrixFormat.h.


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