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 std::map<std::string, std::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
144 void write_(
const std::vector<const PhyloDAG*>& dags, std::ostream& out)
const;
146 Element
getElement(
const std::string& elt)
const override;
159 std::string
edgeToParenthesis(
const PhyloDAG& dag, std::shared_ptr<PhyloBranch> edge, std::vector<std::shared_ptr<PhyloNode>>& writtenNodes,
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...
std::shared_ptr< PhyloNode > parenthesisToNode(PhyloDAG &dag, std::shared_ptr< PhyloNode > father, const std::string &description, unsigned int &nodeCounter, unsigned int &branchCounter, std::map< std::string, std::shared_ptr< PhyloNode > > &mapEvent, bool withId, bool verbose) const
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.
void readPhyloDAGs(std::istream &in, std::vector< std::unique_ptr< PhyloDAG > > &dags) const override
Read dags from a stream.
Element getElement(const std::string &elt) const override
std::string edgeToParenthesis(const PhyloDAG &dag, std::shared_ptr< PhyloBranch > edge, std::vector< std::shared_ptr< PhyloNode > > &writtenNodes, bool writeId=false) const
Get the ExtendedNewick description of a subdag.
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
Read a DAG from a stream.
void writePhyloDAGs(const std::vector< const PhyloDAG * > &dags, std::ostream &out) const override
Write dags to a stream.
std::unique_ptr< PhyloDAG > parenthesisToPhyloDAG(const std::string &description, bool withId, bool verbose=false) const
virtual ~ExtendedNewick()
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.