bpp-phyl3  3.0.0
bpp::Nhx Class Reference

The so-called 'Nhx - New Hampshire eXtended' parenthetic format. More...

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

+ Inheritance diagram for bpp::Nhx:
+ Collaboration diagram for bpp::Nhx:

Classes

struct  Property
 

Public Member Functions

 Nhx (bool useTagsAsPptNames=true)
 Build a new Nhx reader/writer. More...
 
virtual ~Nhx ()
 
std::unique_ptr< TreeTemplate< Node > > parenthesisToTree (const std::string &description) const
 
std::unique_ptr< PhyloTreeparenthesisToPhyloTree (const std::string &description) const
 
std::string treeToParenthesis (const TreeTemplate< Node > &tree) const
 
std::string treeToParenthesis (const PhyloTree &tree) const
 
void registerProperty (const Property &property)
 
void changeTagsToNames (Node &node) const
 Convert property names from tag to names. More...
 
void changeTagsToNames (PhyloTree &tree, std::shared_ptr< PhyloNode > node) const
 
void changeNamesToTags (Node &node) const
 Convert property names from names to tags. More...
 
void changeNamesToTags (PhyloTree &tree, std::shared_ptr< PhyloNode > node) const
 
void useTagsAsPropertyNames (bool yn)
 
bool useTagsAsPropertyNames () const
 
std::string propertiesToParenthesis (const Node &node) const
 
std::string propertiesToParenthesis (const PhyloTree &tree, const std::shared_ptr< PhyloNode > node) const
 
std::unique_ptr< TreereadTree (std::istream &in) const override
 Read a tree from a stream. More...
 
std::unique_ptr< TreereadTree (const std::string &path) const override
 Read a tree from a file. More...
 
virtual std::unique_ptr< TreeTemplate< Node > > readTreeTemplate (const std::string &path) const
 
virtual const std::string getDataType () const
 
virtual void writeTree (const Tree &tree, const std::string &path, bool overwrite) const
 Write a tree to a file. More...
 
virtual void readTrees (const std::string &path, std::vector< std::unique_ptr< Tree >> &trees) const override
 Read trees from a file. More...
 
virtual void writeTrees (const std::vector< const Tree * > &trees, const std::string &path, bool overwrite) const
 Write trees to a file. More...
 
std::unique_ptr< PhyloTreereadPhyloTree (const std::string &path) const override
 Read a tree from a file. More...
 
virtual void writePhyloTree (const PhyloTree &tree, const std::string &path, bool overwrite) const
 Write a tree to a file. More...
 
virtual void readPhyloTrees (const std::string &path, std::vector< std::unique_ptr< PhyloTree >> &trees) const override
 Read trees from a file. More...
 
virtual void writePhyloTrees (const std::vector< const PhyloTree * > &trees, const std::string &path, bool overwrite) const
 Write trees to a file. More...
 
The IOTree interface
const std::string getFormatName () const override
 
const std::string getFormatDescription () const override
 
The ITree interface
std::unique_ptr< TreeTemplate< Node > > readTreeTemplate (std::istream &in) const override
 
std::unique_ptr< PhyloTreereadPhyloTree (std::istream &in) const override
 Read a tree from a stream. More...
 
virtual std::unique_ptr< TreeTemplate< Node > > readTreeTemplate (std::istream &in) const=0
 
virtual std::unique_ptr< TreeTemplate< Node > > readTreeTemplate (const std::string &path) const
 
std::unique_ptr< PhyloTreereadPhyloTree (std::istream &in) const override=0
 
std::unique_ptr< PhyloTreereadPhyloTree (const std::string &path) const override
 
The OTree interface
void writeTree (const Tree &tree, std::ostream &out) const override
 Write a tree to a stream. More...
 
void writePhyloTree (const PhyloTree &tree, std::ostream &out) const override
 Write a tree to a stream. More...
 
virtual void writeTree (const Tree &tree, std::ostream &out) const=0
 
virtual void writeTree (const Tree &tree, const std::string &path, bool overwrite) const
 
virtual void writePhyloTree (const PhyloTree &tree, std::ostream &out) const=0
 
virtual void writePhyloTree (const PhyloTree &tree, const std::string &path, bool overwrite) const
 
The IMultiTree interface
void readTrees (std::istream &in, std::vector< std::unique_ptr< Tree >> &trees) const override
 Read trees from a stream. More...
 
void readPhyloTrees (std::istream &in, std::vector< std::unique_ptr< PhyloTree >> &trees) const override
 Read trees from a stream. More...
 
virtual void readTrees (std::istream &in, std::vector< std::unique_ptr< Tree >> &trees) const override=0
 
virtual void readTrees (const std::string &path, std::vector< std::unique_ptr< Tree >> &trees) const override
 
virtual void readPhyloTrees (std::istream &in, std::vector< std::unique_ptr< PhyloTree >> &trees) const override=0
 
virtual void readPhyloTrees (const std::string &path, std::vector< std::unique_ptr< PhyloTree >> &trees) const override
 
The OMultiTree interface
void writeTrees (const std::vector< const Tree * > &trees, std::ostream &out) const override
 Write trees to a stream. More...
 
void writePhyloTrees (const std::vector< const PhyloTree * > &trees, std::ostream &out) const override
 Write trees to a stream. More...
 
virtual void writeTrees (const std::vector< const Tree * > &trees, std::ostream &out) const=0
 
virtual void writeTrees (const std::vector< const Tree * > &trees, const std::string &path, bool overwrite) const
 
virtual void writePhyloTrees (const std::vector< const PhyloTree * > &trees, std::ostream &out) const=0
 
virtual void writePhyloTrees (const std::vector< const PhyloTree * > &trees, const std::string &path, bool overwrite) const
 

Protected Member Functions

void write_ (const Tree &tree, std::ostream &out) const
 
void write_ (const PhyloTree &tree, std::ostream &out) const
 
template<class N >
void write_ (const TreeTemplate< N > &tree, std::ostream &out) const
 
void write_ (const std::vector< const Tree * > &trees, std::ostream &out) const
 
void write_ (const std::vector< const PhyloTree * > &trees, std::ostream &out) const
 
template<class N >
void write_ (const std::vector< TreeTemplate< N > * > &trees, std::ostream &out) const
 
IOTree::Element getElement (const std::string &elt) const override
 
std::string nodeToParenthesis (const Node &node) const
 
std::string nodeToParenthesis (const PhyloTree &tree, const std::shared_ptr< PhyloNode > node) const
 
bool setNodeProperties (Node &node, const std::string properties) const
 
bool setNodeProperties (PhyloTree &tree, std::shared_ptr< PhyloNode > node, const std::string properties) const
 
void checkNodesId_ (PhyloTree &tree) const
 check and fill all nodes ids. More...
 

Static Protected Member Functions

static std::string propertyToString_ (const Clonable *pptObject, short type)
 
static ClonablestringToProperty_ (const std::string &pptDesc, short type)
 

Private Member Functions

NodeparenthesisToNode (const std::string &description) const
 
std::shared_ptr< PhyloNodeparenthesisToNode (PhyloTree &tree, std::shared_ptr< PhyloNode > father, const std::string &description) const
 

Private Attributes

std::set< PropertysupportedProperties_
 
bool useTagsAsPropertyNames_
 
bool hasIds_
 

Detailed Description

The so-called 'Nhx - New Hampshire eXtended' parenthetic format.

See http://www.phylosoft.org/NHX/ for details.

Branch lengths and node annotations are supported:

ex: ((A:0.1[&&NHX:S=human], B:0.15[&&NHX:S=chimp]):0.2[&&NHX:B=90:D=N:S=primates], C:0.27[&&NHX:S=mouse]);

Where e.g. "S=human" means that the sequence A comes from species "human", "B=90" stands for a support value, and "D=N" means that there was no duplication at the node. Other tags are allowed, see http://www.phylosoft.org/NHX/. By default, comments between "[" and "]" are removed, unless the opening bracket is followed by "&&NHX".

Code example:

#include <Phyl/Nhx.h>
#include <Phyl/Tree/Tree.h>
Nhx * NhxReader = new Nhx();
try {
Tree * tree = nhxReader->read("MyTestTree.dnd"); // Tree in file MyTestTree.dnd
cout << "Tree has " << tree->getNumberOfLeaves() << " leaves." << endl;
} catch (Exception e) {
cout << "Error when reading tree." << endl;
}
delete tree;
delete nhxReader;
Nhx(bool useTagsAsPptNames=true)
Build a new Nhx reader/writer.
Definition: Nhx.cpp:29

All node annotations are stored as node properties, with type bppString for all properties except for support values, where a Number is used.

Definition at line 53 of file Nhx.h.

Constructor & Destructor Documentation

◆ Nhx()

Nhx::Nhx ( bool  useTagsAsPptNames = true)

Build a new Nhx reader/writer.

Comments between hooks ('[' ']') are ignored.

Parameters
useTagsAsPptNamesTells if the NHX tag should be used as a property name in the parsed tree.

Definition at line 29 of file Nhx.cpp.

References bpp::TreeTools::BOOTSTRAP, and registerProperty().

◆ ~Nhx()

virtual bpp::Nhx::~Nhx ( )
inlinevirtual

Definition at line 111 of file Nhx.h.

Member Function Documentation

◆ changeNamesToTags() [1/2]

void Nhx::changeNamesToTags ( Node node) const

Convert property names from names to tags.

If a tree has been parsed using useTagsAsPropertyNames=false, this method allows to convert the tree as is it was parsed using the option set to true.

Parameters
nodeThe root node of the subtree to convert.

Definition at line 619 of file Nhx.cpp.

References bpp::Node::deleteBranchProperty(), bpp::Node::deleteNodeProperty(), bpp::Node::getBranchProperty(), bpp::Node::getNodeProperty(), bpp::Node::getNumberOfSons(), bpp::Node::getSon(), bpp::Node::hasBranchProperty(), bpp::Node::hasNodeProperty(), bpp::Node::setBranchProperty(), bpp::Node::setNodeProperty(), and supportedProperties_.

Referenced by changeNamesToTags().

◆ changeNamesToTags() [2/2]

◆ changeTagsToNames() [1/2]

void Nhx::changeTagsToNames ( Node node) const

Convert property names from tag to names.

If a tree has been parsed using useTagsAsPropertyNames=true, this method allows to convert the tree as is it was parsed using the option set to false.

Parameters
nodeThe root node of the subtree to convert.

Definition at line 590 of file Nhx.cpp.

References bpp::Node::deleteBranchProperty(), bpp::Node::deleteNodeProperty(), bpp::Node::getBranchProperty(), bpp::Node::getNodeProperty(), bpp::Node::getNumberOfSons(), bpp::Node::getSon(), bpp::Node::hasBranchProperty(), bpp::Node::hasNodeProperty(), bpp::Node::setBranchProperty(), bpp::Node::setNodeProperty(), and supportedProperties_.

Referenced by changeTagsToNames().

◆ changeTagsToNames() [2/2]

◆ checkNodesId_()

◆ getDataType()

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

Implements bpp::IOFormat.

Definition at line 51 of file IoTree.h.

◆ getElement()

IOTree::Element Nhx::getElement ( const std::string &  elt) const
overrideprotectedvirtual

Reimplemented from bpp::AbstractITree.

Definition at line 203 of file Nhx.cpp.

References element.

Referenced by parenthesisToNode().

◆ getFormatDescription()

const string Nhx::getFormatDescription ( ) const
overridevirtual

Implements bpp::IOFormat.

Definition at line 60 of file Nhx.cpp.

◆ getFormatName()

const string Nhx::getFormatName ( ) const
overridevirtual

Implements bpp::IOFormat.

Definition at line 56 of file Nhx.cpp.

◆ nodeToParenthesis() [1/2]

string Nhx::nodeToParenthesis ( const Node node) const
protected

◆ nodeToParenthesis() [2/2]

◆ parenthesisToNode() [1/2]

◆ parenthesisToNode() [2/2]

◆ parenthesisToPhyloTree()

unique_ptr< PhyloTree > Nhx::parenthesisToPhyloTree ( const std::string &  description) const

Definition at line 407 of file Nhx.cpp.

References checkNodesId_(), hasIds_, and parenthesisToNode().

Referenced by readPhyloTree(), and readPhyloTrees().

◆ parenthesisToTree()

unique_ptr< TreeTemplate< Node > > Nhx::parenthesisToTree ( const std::string &  description) const

Definition at line 334 of file Nhx.cpp.

References hasIds_, and parenthesisToNode().

Referenced by readTrees(), and readTreeTemplate().

◆ propertiesToParenthesis() [1/2]

◆ propertiesToParenthesis() [2/2]

◆ propertyToString_()

string Nhx::propertyToString_ ( const Clonable pptObject,
short  type 
)
staticprotected

◆ readPhyloTree() [1/4]

std::unique_ptr<PhyloTree> bpp::AbstractIPhyloTree::readPhyloTree ( const std::string &  path) const
inlineoverridevirtualinherited

Read a tree from a file.

Parameters
pathThe file path.
Returns
A new tree object.
Exceptions
ExceptionIf an error occurred.

Implements bpp::IPhyloTree.

Definition at line 235 of file IoTree.h.

References bpp::AbstractIPhyloTree::readPhyloTree().

◆ readPhyloTree() [2/4]

std::unique_ptr<PhyloTree> bpp::AbstractIPhyloTree::readPhyloTree
inlineoverride

Definition at line 235 of file IoTree.h.

◆ readPhyloTree() [3/4]

unique_ptr< PhyloTree > Nhx::readPhyloTree ( std::istream &  in) const
overridevirtual

Read a tree from a stream.

Parameters
inThe input stream.
Returns
A new tree object.
Exceptions
ExceptionIf an error occurred.

Implements bpp::AbstractIPhyloTree.

Definition at line 102 of file Nhx.cpp.

References parenthesisToPhyloTree(), and bpp::TextTools::removeSubstrings().

◆ readPhyloTree() [4/4]

std::unique_ptr<PhyloTree> bpp::AbstractIPhyloTree::readPhyloTree
override

◆ readPhyloTrees() [1/4]

virtual void bpp::AbstractIMultiPhyloTree::readPhyloTrees ( const std::string &  path,
std::vector< std::unique_ptr< PhyloTree >> &  trees 
) const
inlineoverridevirtualinherited

Read trees from a file.

Parameters
pathThe file path.
treesThe output trees container.
Exceptions
ExceptionIf an error occurred.

Implements bpp::IMultiPhyloTree.

Definition at line 485 of file IoTree.h.

References bpp::AbstractIMultiPhyloTree::readPhyloTrees().

◆ readPhyloTrees() [2/4]

virtual void bpp::AbstractIMultiPhyloTree::readPhyloTrees
inlineoverride

Definition at line 485 of file IoTree.h.

◆ readPhyloTrees() [3/4]

void Nhx::readPhyloTrees ( std::istream &  in,
std::vector< std::unique_ptr< PhyloTree >> &  trees 
) const
overridevirtual

Read trees from a stream.

Parameters
inThe input stream.
treesThe output trees container.
Exceptions
ExceptionIf an error occurred.

Implements bpp::AbstractIMultiPhyloTree.

Definition at line 168 of file Nhx.cpp.

References parenthesisToPhyloTree(), and bpp::TextTools::removeSubstrings().

◆ readPhyloTrees() [4/4]

virtual void bpp::AbstractIMultiPhyloTree::readPhyloTrees
override

◆ readTree() [1/2]

std::unique_ptr<Tree> bpp::AbstractITree::readTree ( const std::string &  path) const
inlineoverridevirtualinherited

Read a tree from a file.

Parameters
pathThe file path.
Returns
A new tree object.
Exceptions
ExceptionIf an error occurred.

Implements bpp::ITree.

Definition at line 201 of file IoTree.h.

References bpp::AbstractITree::readTree().

◆ readTree() [2/2]

std::unique_ptr<Tree> bpp::AbstractITree::readTree ( std::istream &  in) const
inlineoverridevirtualinherited

Read a tree from a stream.

Parameters
inThe input stream.
Returns
A new tree object.
Exceptions
ExceptionIf an error occurred.

Implements bpp::ITree.

Definition at line 195 of file IoTree.h.

References bpp::AbstractITree::readTreeTemplate().

Referenced by bpp::AbstractITree::readTree().

◆ readTrees() [1/4]

virtual void bpp::AbstractIMultiTree::readTrees ( const std::string &  path,
std::vector< std::unique_ptr< Tree >> &  trees 
) const
inlineoverridevirtualinherited

Read trees from a file.

Parameters
pathThe file path.
treesThe output trees container.
Exceptions
ExceptionIf an error occurred.

Implements bpp::IMultiTree.

Definition at line 464 of file IoTree.h.

References bpp::AbstractIMultiTree::readTrees().

◆ readTrees() [2/4]

virtual void bpp::AbstractIMultiTree::readTrees
inlineoverride

Definition at line 464 of file IoTree.h.

◆ readTrees() [3/4]

void Nhx::readTrees ( std::istream &  in,
std::vector< std::unique_ptr< Tree >> &  trees 
) const
overridevirtual

Read trees from a stream.

Parameters
inThe input stream.
treesThe output trees container.
Exceptions
ExceptionIf an error occurred.

Implements bpp::AbstractIMultiTree.

Definition at line 133 of file Nhx.cpp.

References parenthesisToTree(), and bpp::TextTools::removeSubstrings().

◆ readTrees() [4/4]

virtual void bpp::AbstractIMultiTree::readTrees
override

◆ readTreeTemplate() [1/4]

virtual std::unique_ptr<TreeTemplate<Node> > bpp::AbstractITree::readTreeTemplate ( const std::string &  path) const
inlinevirtualinherited

Definition at line 211 of file IoTree.h.

References bpp::AbstractITree::readTreeTemplate().

◆ readTreeTemplate() [2/4]

virtual std::unique_ptr<TreeTemplate<Node> > bpp::AbstractITree::readTreeTemplate
inline

Definition at line 211 of file IoTree.h.

◆ readTreeTemplate() [3/4]

unique_ptr< TreeTemplate< Node > > Nhx::readTreeTemplate ( std::istream &  in) const
overridevirtual

Implements bpp::AbstractITree.

Definition at line 71 of file Nhx.cpp.

References parenthesisToTree(), and bpp::TextTools::removeSubstrings().

◆ readTreeTemplate() [4/4]

virtual std::unique_ptr<TreeTemplate<Node> > bpp::AbstractITree::readTreeTemplate

◆ registerProperty()

void bpp::Nhx::registerProperty ( const Property property)
inline

Definition at line 201 of file Nhx.h.

References supportedProperties_.

Referenced by Nhx().

◆ setNodeProperties() [1/2]

◆ setNodeProperties() [2/2]

◆ stringToProperty_()

Clonable * Nhx::stringToProperty_ ( const std::string &  pptDesc,
short  type 
)
staticprotected

◆ treeToParenthesis() [1/2]

◆ treeToParenthesis() [2/2]

◆ useTagsAsPropertyNames() [1/2]

bool bpp::Nhx::useTagsAsPropertyNames ( ) const
inline

Definition at line 231 of file Nhx.h.

References useTagsAsPropertyNames_.

◆ useTagsAsPropertyNames() [2/2]

void bpp::Nhx::useTagsAsPropertyNames ( bool  yn)
inline

Definition at line 230 of file Nhx.h.

References useTagsAsPropertyNames_.

◆ write_() [1/6]

void Nhx::write_ ( const PhyloTree tree,
std::ostream &  out 
) const
protected

Definition at line 951 of file Nhx.cpp.

References treeToParenthesis().

◆ write_() [2/6]

void Nhx::write_ ( const std::vector< const PhyloTree * > &  trees,
std::ostream &  out 
) const
protected

Definition at line 990 of file Nhx.cpp.

References treeToParenthesis().

◆ write_() [3/6]

void Nhx::write_ ( const std::vector< const Tree * > &  trees,
std::ostream &  out 
) const
protected

Definition at line 976 of file Nhx.cpp.

References treeToParenthesis().

◆ write_() [4/6]

template<class N >
void Nhx::write_ ( const std::vector< TreeTemplate< N > * > &  trees,
std::ostream &  out 
) const
protected

Definition at line 1008 of file Nhx.cpp.

References treeToParenthesis().

◆ write_() [5/6]

void Nhx::write_ ( const Tree tree,
std::ostream &  out 
) const
protected

Definition at line 940 of file Nhx.cpp.

References treeToParenthesis().

Referenced by writePhyloTree(), writePhyloTrees(), writeTree(), and writeTrees().

◆ write_() [6/6]

template<class N >
void Nhx::write_ ( const TreeTemplate< N > &  tree,
std::ostream &  out 
) const
protected

Definition at line 964 of file Nhx.cpp.

References treeToParenthesis().

◆ writePhyloTree() [1/4]

virtual void bpp::AbstractOPhyloTree::writePhyloTree ( const PhyloTree tree,
const std::string &  path,
bool  overwrite 
) const
inlinevirtualinherited

Write a tree to a file.

Parameters
treeA tree object.
pathThe file path.
overwriteTell if existing file must be overwritten. Otherwise append to the file.
Exceptions
ExceptionIf an error occurred.

Implements bpp::OPhyloTree.

Definition at line 297 of file IoTree.h.

References bpp::IOException::what(), and bpp::AbstractOPhyloTree::writePhyloTree().

◆ writePhyloTree() [2/4]

virtual void bpp::AbstractOPhyloTree::writePhyloTree
inline

Definition at line 297 of file IoTree.h.

◆ writePhyloTree() [3/4]

void bpp::Nhx::writePhyloTree ( const PhyloTree tree,
std::ostream &  out 
) const
inlineoverridevirtual

Write a tree to a stream.

Parameters
treeA tree object.
outThe output stream.
Exceptions
ExceptionIf an error occurred.

Implements bpp::AbstractOPhyloTree.

Definition at line 152 of file Nhx.h.

References write_().

◆ writePhyloTree() [4/4]

virtual void bpp::AbstractOPhyloTree::writePhyloTree

◆ writePhyloTrees() [1/4]

virtual void bpp::AbstractOMultiPhyloTree::writePhyloTrees ( const std::vector< const PhyloTree * > &  trees,
const std::string &  path,
bool  overwrite 
) const
inlinevirtualinherited

Write trees to a file.

Parameters
treesA vector of tree objects.
pathThe file path.
overwriteTell if existing file must be overwritten. Otherwise append to the file.
Exceptions
ExceptionIf an error occurred.

Implements bpp::OMultiPhyloTree.

Definition at line 528 of file IoTree.h.

References bpp::AbstractOMultiPhyloTree::writePhyloTrees().

◆ writePhyloTrees() [2/4]

virtual void bpp::AbstractOMultiPhyloTree::writePhyloTrees
inline

Definition at line 528 of file IoTree.h.

◆ writePhyloTrees() [3/4]

void bpp::Nhx::writePhyloTrees ( const std::vector< const PhyloTree * > &  trees,
std::ostream &  out 
) const
inlineoverridevirtual

Write trees to a stream.

Parameters
treesA vector of tree objects.
outThe output stream.
Exceptions
ExceptionIf an error occurred.

Implements bpp::AbstractOMultiPhyloTree.

Definition at line 187 of file Nhx.h.

References write_().

◆ writePhyloTrees() [4/4]

virtual void bpp::AbstractOMultiPhyloTree::writePhyloTrees

◆ writeTree() [1/4]

virtual void bpp::AbstractOTree::writeTree ( const Tree tree,
const std::string &  path,
bool  overwrite 
) const
inlinevirtualinherited

Write a tree to a file.

Parameters
treeA tree object.
pathThe file path.
overwriteTell if existing file must be overwritten. Otherwise append to the file.
Exceptions
ExceptionIf an error occurred.

Implements bpp::OTree.

Definition at line 263 of file IoTree.h.

References bpp::IOException::what(), and bpp::AbstractOTree::writeTree().

◆ writeTree() [2/4]

virtual void bpp::AbstractOTree::writeTree
inline

Definition at line 263 of file IoTree.h.

◆ writeTree() [3/4]

void bpp::Nhx::writeTree ( const Tree tree,
std::ostream &  out 
) const
inlineoverridevirtual

Write a tree to a stream.

Parameters
treeA tree object.
outThe output stream.
Exceptions
ExceptionIf an error occurred.

Implements bpp::AbstractOTree.

Definition at line 145 of file Nhx.h.

References write_().

◆ writeTree() [4/4]

virtual void bpp::AbstractOTree::writeTree

◆ writeTrees() [1/4]

virtual void bpp::AbstractOMultiTree::writeTrees ( const std::vector< const Tree * > &  trees,
const std::string &  path,
bool  overwrite 
) const
inlinevirtualinherited

Write trees to a file.

Parameters
treesA vector of tree objects.
pathThe file path.
overwriteTell if existing file must be overwritten. Otherwise append to the file.
Exceptions
ExceptionIf an error occurred.

Implements bpp::OMultiTree.

Definition at line 505 of file IoTree.h.

References bpp::AbstractOMultiTree::writeTrees().

◆ writeTrees() [2/4]

virtual void bpp::AbstractOMultiTree::writeTrees
inline

Definition at line 505 of file IoTree.h.

◆ writeTrees() [3/4]

void bpp::Nhx::writeTrees ( const std::vector< const Tree * > &  trees,
std::ostream &  out 
) const
inlineoverridevirtual

Write trees to a stream.

Parameters
treesA vector of tree objects.
outThe output stream.
Exceptions
ExceptionIf an error occurred.

Implements bpp::AbstractOMultiTree.

Definition at line 180 of file Nhx.h.

References write_().

◆ writeTrees() [4/4]

virtual void bpp::AbstractOMultiTree::writeTrees

Member Data Documentation

◆ hasIds_

bool bpp::Nhx::hasIds_
mutableprivate

Definition at line 100 of file Nhx.h.

Referenced by parenthesisToNode(), parenthesisToPhyloTree(), and parenthesisToTree().

◆ supportedProperties_

std::set<Property> bpp::Nhx::supportedProperties_
private

◆ useTagsAsPropertyNames_

bool bpp::Nhx::useTagsAsPropertyNames_
private

Definition at line 99 of file Nhx.h.

Referenced by propertiesToParenthesis(), setNodeProperties(), and useTagsAsPropertyNames().


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