This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Measuring the difference or similarity between two phylogenies

Hello everyone,

I'd like to take two phylogenies for a given nucleotide alignment and create a measure of the similarity between the two alignments. Branch length is not of interest to me in this case, I only care about the branching order or edges shared.

I would like to do this in R, and ideally the method should be able to handle non-bifurcating trees. Further, all trees I am working with are unrooted.

I know how to calculate the symmetric difference using Phangorn in R, but it can only use bifurcating trees. Further, I'd like to obtain a result that is perhaps out of 1 (where symmetric distance is reported as a count of partitions not shared by the trees, I'd like a result that is perhaps a portion of edges or path shared out of 1), so that it is comparable easily across different trees for different alignments.

Does anyone have any suggestions? The tree files I have are in Newick format.

r phylogenetics

what is actually diffrence between NJ tree and UPGMA tree. secondly, i want to construct NJ tree from genetic distance values. Please suggest me some online softwares, with their input data format, because i am facing many problems in data entry

Please do not ask the same question in multiple threads. Specially do not use the "Submit Answer" section for asking a new question in existing threads.

You should start a new thread/post for new questions.

2 answers

not an R package, but this command line tool may help you: http://etetoolkit.org/documentation/ete-compare/. Most important features:

  • Robinson-Foulds symmetric difference in rooted and unrooted trees
  • Percentage of edge similarity (number of branches in one tree that are present in another)
  • Distance can be calculated between trees containing duplicated attributes
  • matches and mismatches can be dumped
  • compare trees of different sizes
  • can ignore lowly supported branches

This looks promising - I'll give it a try. Thank you.

Look at the ape R package. It has functions to compare phylogenetic trees. You could also simply represent each tree by a distance matrix and use the Mantel test (also in the ape package).

Thank you for the suggestion - the difficulty that arises with this method for me is that I'm comparing a tree that was made from a complete nucleotide alignment to a tree that was made using a subset of informative positions in the alignment. As such, the distance between the taxa is modified.

The part that matters for me is whether the same partitions in the tree remain - I'm just trying to find a way to represent this numerically.

You could use a graph distance unrelated to genetics e.g. shortest path or commute time. If you have multiple comparisons to do, another approach could be to measure similarity between the graphs directly using a graph kernel. These are global approaches and won't identify parts that are conserved or not. If you want to recover the conserved partitions themselves, you could look into algorithms for subtree isomorphism, such as this one.

This is very useful - thank you very much.

I'll look into these and let you know how I go.

Log in to answer this question.