I would need to get the node number within a tree in ete3.
Here is an example of a tree:
rooted_tree = Tree( "((A,B),(C,D));" )
print rooted_tree
#
# /-A
# /---|
# | \-B
#----|
# | /-C
# \---|
# \-D
then I calculate some stuff from this tree (not important for the question), and this stuff gives me values for each node in the tree, which then I plot in ggplot tree. But ggplot tree need the node number to plot this information, the problem here is that I cannot manage to find the code in order to get the node number of the tree "rooted_tree"
Let say I want the node number of the ancestor of A and B , how can I get it ? I only know to do that:
ancestor = tree.get_common_ancestor("A","B")
but something like ancestor.num of ancestor.node_number does not work...
all the nodes in ete tree are objects, they don't have a number but they have a hash ID labeled for topological perspect
you can access those topology id by
quote from ete3 documentation:
further reference: http://etetoolkit.org/docs/latest/reference/reference_tree.html#get_topology_id