Entering edit mode
3 months ago
Angels
▴
10
I am trying to visualize and annotate a phylogenetic tree (Newick format) with Ggtree. However, in order to color all the descendents of a respective node, the internal nodes have to be numbered, and I found an author that did something similar to what I want to do, but in his case when he creates a tree object, he gets the internal node number as "node.label" and I was wondering if designed his Newick file in a way that would allow him to have that node.label. If any of you knows of a tool or software I can use to include the internal node number in my Newick file.
I'm pretty sure
ggtree
automatically assigns node labels as numeric values when you read in a tree, though it has been a while since I've used it. Have you tried to read your newick tree into R as aggtree
object? You could them inspect the structure of the object usingstr()
on the object, and even thegeom_nodelab
function to label the nodes so you can see the ones you are after.