# Create a NHX phylogeny format with r or python

I need help to add information in my phylogenetic tree on each branch.

I have two pieces of information at my disposal:

1 ) A phylogenetic tree in newick format :

**(mammal:0.14,turtle:0.02,(rayfinfish:0.25,(frog:0.01,salamander:0.01)50:0.12)95:0.09);**


2 ) A matrix with the edge number and information in the Information column:

Edge    Inf
7        0
6        0
5        2
4        1
3        2
2        2
1        2


Does someone have an idea in order to add these informations by creating a NHX format in python (witg ete3 for instance) or with a R package ?

Here is the tree :

Thank you for your help

## 1 Answer

The treedata book has a section on tree annotations that should work for you.