ms609 / TreeDist

Calculate distances between phylogenetic trees in R
https://ms609.github.io/TreeDist/
28 stars 6 forks source link

Rooted trees or unrooted trees? #58

Closed Jigyasa3 closed 3 years ago

Jigyasa3 commented 3 years ago

Hey @ms609 !

I wanted to ask if any of the trees used for comparison purposes can be unrooted? Or do I need to place an (arbitrary) root for TreeDist?

ms609 commented 3 years ago

Hi, thanks for the question! TreeDist by default treats all trees as unrooted, i.e. ignoring the position of the root of the tree, unless a node is marked as a root by adding a dummy leaf at that location.

As all trees must bear the same leaf labels, you must choose to treat all trees as rooted (by arbitrarily placing a root leaf on any unrooted trees), or all trees as unrooted (by removing any root leaves).

Hope that makes sense!

Jigyasa3 commented 3 years ago

Hey Martin!

Thank you for a quick reply! I have one tree as rooted and another as unrooted. If I remove the root using unroot() function from the ape package https://www.biostars.org/p/62668/ , then it makes the tree non-ultrametric. Is there a requirement for the trees to be ultrametric to run TreeDist?

ms609 commented 3 years ago

The position of the root in the rooted tree will be ignored by default by TreeDist, so you should be able to compare trees directly as they are. There's no requirement for trees to be ultrametric.

Jigyasa3 commented 3 years ago

thank you!