5 #ifndef BPP_PHYL_IO_EXTENDEDNEWICK_H
6 #define BPP_PHYL_IO_EXTENDEDNEWICK_H
9 #include "../Tree/PhyloDAG.h"
57 ExtendedNewick(
bool allowComments =
false,
bool writeId =
false,
bool verbose =
false) :
83 std::unique_ptr<PhyloDAG>
readPhyloDAG(std::istream& in)
const override;
88 std::shared_ptr<PhyloNode> father,
89 const std::string& description,
90 unsigned int& nodeCounter,
91 unsigned int& branchCounter,
92 map<str::string, shared_ptr<PhyloNode> >& mapEvent,
98 const std::string& description,
100 bool verbose =
false)
const;
129 std::vector<std::unique_ptr<PhyloDAG>>& dags)
const override;
135 void writePhyloDAGs(
const std::vector<const PhyloDAG*>& dags, std::ostream& out)
const override
142 void write_(
const PhyloDAG& tree, std::ostream& out)
const;
144 void write_(
const std::vector<const PhyloDAG*>& dags, std::ostream& out)
const;
146 Element
getElement(
const std::string& elt)
const override;
158 std::string
nodeToParenthesis(
const PhyloDAG& dag, std::shared_ptr<PhyloNode> node,
bool writeId =
false)
const;
169 std::string
dagToParenthesis(
const PhyloDAG& dag,
bool writeId =
false)
const;
Partial implementation of the IMultiDAG interface.
virtual void readPhyloDAGs(std::istream &in, std::vector< std::unique_ptr< PhyloDAG >> &dags) const override=0
Read dags from a stream.
Partial implementation of the IDAG interface.
std::unique_ptr< PhyloDAG > readPhyloDAG(std::istream &in) const override=0
Read a DAG from a stream.
Partial implementation of the ODAG interface.
virtual void writePhyloDAGs(const std::vector< const PhyloDAG * > &dags, std::ostream &out) const =0
Write dags to a stream.
Partial implementation of the ODAG interface.
virtual void writePhyloDAG(const PhyloDAG &dag, std::ostream &out) const =0
Write a PhyloDAG to a stream.
The so-called 'ExtendedNewick' parenthetic format for phylogenetic networks, where hybridization node...
void write_(const PhyloDAG &tree, std::ostream &out) const
const std::string getFormatDescription() const override
ExtendedNewick(bool allowComments=false, bool writeId=false, bool verbose=false)
Build a new ExtendedNewick reader/writer.
Element getElement(const std::string &elt) const override
std::string dagToParenthesis(const PhyloDAG &dag, bool writeId=false) const
Get the parenthesis description of a tree.
std::unique_ptr< PhyloDAG > readPhyloDAG(std::istream &in) const override=0
virtual void readPhyloDAGs(std::istream &in, std::vector< std::unique_ptr< PhyloDAG >> &dags) const override=0
void writePhyloDAGs(const std::vector< const PhyloDAG * > &dags, std::ostream &out) const override
Write dags to a stream.
std::shared_ptr< PhyloNode > parenthesisToNode(PhyloDAG &dag, std::shared_ptr< PhyloNode > father, const std::string &description, unsigned int &nodeCounter, unsigned int &branchCounter, map< str::string, shared_ptr< PhyloNode > > &mapEvent, bool withId, bool verbose) const
std::unique_ptr< PhyloDAG > parenthesisToPhyloDAG(const std::string &description, bool withId, bool verbose=false) const
virtual ~ExtendedNewick()
std::string nodeToParenthesis(const PhyloDAG &dag, std::shared_ptr< PhyloNode > node, bool writeId=false) const
Get the ExtendedNewick description of a subdag.
void writePhyloDAG(const PhyloDAG &dag, std::ostream &out) const override
Write a PhyloDAG to a stream.
const std::string getFormatName() const override
Defines the basic types of data flow nodes.