5 #ifndef BPP_PHYL_IO_NEWICK_H
6 #define BPP_PHYL_IO_NEWICK_H
9 #include "../Tree/PhyloTree.h"
10 #include "../Tree/TreeTemplate.h"
76 Newick(
bool allowComments =
false,
bool writeId =
false,
bool verbose =
false) :
114 std::unique_ptr<TreeTemplate<Node>>
readTreeTemplate(std::istream& in)
const override;
118 std::unique_ptr<PhyloTree>
readPhyloTree(std::istream& in)
const override;
123 std::shared_ptr<PhyloNode> father,
124 const std::string& description,
125 unsigned int& nodeCounter,
127 const std::string& propertyName,
133 const std::string& description,
134 bool bootstrap =
false,
135 const std::string& propertyName =
"",
137 bool verbose =
false)
const;
173 std::vector<std::unique_ptr<Tree>>& trees)
const override;
179 std::vector<std::unique_ptr<PhyloTree>>& trees)
const override;
191 void writeTrees(
const std::vector<const Tree*>& trees, std::ostream& out)
const override
198 void writePhyloTrees(
const std::vector<const PhyloTree*>& trees, std::ostream& out)
const override
205 void write_(
const Tree& tree, std::ostream& out)
const;
212 void write_(
const std::vector<const Tree*>& trees, std::ostream& out)
const;
214 void write_(
const std::vector<const PhyloTree*>& trees, std::ostream& out)
const;
247 std::string
nodeToParenthesis(
const PhyloTree& tree, std::shared_ptr<PhyloNode> node,
bool bootstrap,
const std::string& propertyName)
const;
Partial implementation of the IMultiTree interface.
virtual void readPhyloTrees(std::istream &in, std::vector< std::unique_ptr< PhyloTree >> &trees) const override=0
Read trees from a stream.
Partial implementation of the IMultiTree interface.
virtual void readTrees(std::istream &in, std::vector< std::unique_ptr< Tree >> &trees) const override=0
Read trees from a stream.
std::unique_ptr< PhyloTree > readPhyloTree(std::istream &in) const override=0
Read a tree from a stream.
Partial implementation of the ITree interface.
virtual std::unique_ptr< TreeTemplate< Node > > readTreeTemplate(std::istream &in) const =0
Partial implementation of the OTree interface.
virtual void writePhyloTrees(const std::vector< const PhyloTree * > &trees, std::ostream &out) const =0
Write trees to a stream.
Partial implementation of the OTree interface.
virtual void writeTrees(const std::vector< const Tree * > &trees, std::ostream &out) const =0
Write trees to a stream.
Partial implementation of the OTree interface.
virtual void writePhyloTree(const PhyloTree &tree, std::ostream &out) const =0
Write a tree to a stream.
Partial implementation of the OTree interface.
virtual void writeTree(const Tree &tree, std::ostream &out) const =0
Write a tree to a stream.
The so-called 'newick' parenthetic format.
virtual std::unique_ptr< TreeTemplate< Node > > readTreeTemplate(std::istream &in) const=0
void writeTrees(const std::vector< const Tree * > &trees, std::ostream &out) const override
Write trees to a stream.
void enableExtendedBootstrapProperty(const std::string &propertyName)
virtual void readPhyloTrees(std::istream &in, std::vector< std::unique_ptr< PhyloTree >> &trees) const override=0
std::shared_ptr< PhyloNode > parenthesisToNode(PhyloTree &tree, std::shared_ptr< PhyloNode > father, const std::string &description, unsigned int &nodeCounter, bool bootstrap, const std::string &propertyName, bool withId, bool verbose) const
std::unique_ptr< PhyloTree > parenthesisToPhyloTree(const std::string &description, bool bootstrap=false, const std::string &propertyName="", bool withId=false, bool verbose=false) const
void writePhyloTree(const PhyloTree &tree, std::ostream &out) const override
Write a tree to a stream.
std::string nodeToParenthesis(const PhyloTree &tree, std::shared_ptr< PhyloNode > node, bool writeId=false) const
Get the Newick description of a subtree.
void write_(const Tree &tree, std::ostream &out) const
std::unique_ptr< PhyloTree > readPhyloTree(std::istream &in) const override=0
IOTree::Element getElement(const std::string &elt) const override
const std::string getFormatDescription() const override
void writeTree(const Tree &tree, std::ostream &out) const override
Write a tree to a stream.
std::string bootstrapPropertyName_
Newick(bool allowComments=false, bool writeId=false, bool verbose=false)
Build a new Newick reader/writer.
void writePhyloTrees(const std::vector< const PhyloTree * > &trees, std::ostream &out) const override
Write trees to a stream.
virtual void readTrees(std::istream &in, std::vector< std::unique_ptr< Tree >> &trees) const override=0
std::string treeToParenthesis(const PhyloTree &tree, bool writeId=false) const
Get the parenthesis description of a tree.
const std::string getFormatName() const override
void disableExtendedBootstrapProperty()
The phylogenetic tree class.
Interface for phylogenetic tree objects.
Defines the basic types of data flow nodes.