How to convert a tree drawn with ete2 to Newick format?

177 views Asked by At

I have drawn a tree in python using ete2 commands Tree(), .add_child(), .add_sister() and so on. Is there any way I can convert this tree to the corresponding Newick format?

1

There are 1 answers

0
jhc On BEST ANSWER
from ete3 import Tree
tree = Tree()
tree.add_child(name="c")
tree.add_child(name="b")
print tree.write()
#(c:1,b:1);