The bioBakery help forum

How can I annotate the internal nodes from Newick tree?

Dear all,

I would like to create an annotated tree from the output (.nwk) of PhyloPhlAn 3 using GraPhlan.
I tried to annotate the internal nodes, but I can’t get it to work.

graphlan_annotate.py tree.newick annot.xml --annot annotation.txt && graphlan.py annot.xml tree.png

Then I realized that most of the data in graphlan-master/example/ is not newick or nexus, but a hierarchical plain text file. Do I need to manually create such a plain text file in addition to the annotation file to be able to annotate it with detailed clade local annotations? I would like to retain the branch length information, so I would like to use graphlan directly from the PhyloPhlAn 3 output (.nwk) if possible.

Regards,
Kazuma.

1 Like

Hi Kazuma,

Thanks for using GraPhlAn.

Yes. The annotation file is a hierarchical text file, as you said. You will need to create one of these files to annotate your tree. To add an label to “node_1”, for example, you would add a row to your annotation file like this:

# # #
node_1 annotation My annotation

Column 1 is the node to annotate, column 2 tells GraPhlAn that you want to add a label to that node, and column 3 is the label, itself.

GraPhlAn is able to draw the branch lengths specified in your tree.

Please let me know if you have any other questions. If so, could you send me a copy of your input files? Thanks.

Regards,
Aaron.