I wrote a program which calculates the distance between two trees. The trees are already rooted.
I want to make sure that the trees are rooted on the same root or outgroup.
As far as I know, in ete2 one can only set the root but cannot find the root and root the other tree on the same one.
I want to find the root in one tree and set the same root in the other. So the trees are rooted in the same way.
#>>> print t1
#
# /-aaaaaaaaad
# /-|
# /-| \-aaaaaaaaae
# | |
#--| \-aaaaaaaaaa
# |
# | /-aaaaaaaaab
# \-|
# \-aaaaaaaaac
#>>> print t2
#
# /-aaaaaaaaaa
# /-|
# | | /-aaaaaaaaab
# | \-|
#--| \-aaaaaaaaac
# |
# | /-aaaaaaaaad
# \-|
# \-aaaaaaaaae
#
So in t1, the tree is rooted on the outgroup ending with b and c. I want to get this outgroup and root t2 on the same group.
Does anyone know if there is the posibility to make sure the trees are rooted the same? Or does another package include such a method?
the etetoolkit provides the
set_outgroup
method for rooting trees. If you just want to have the same root in two trees for topology comparison, the simplest approach would be to pick the same tip name as the root in both trees.