Hi Bruno.

RF.dist in the phangorn package computes Robinson-Foulds distance (http://en.wikipedia.org/wiki/Robinson-Foulds_metric). This is not obvious, but (unless you want the position of the root to affect the score) you should probably unroot your trees before using RF.dist, e.g.:
> tr1<-read.tree(text="(A,(B,C));")
> plot(tr1)
> tr2<-read.tree(text="((A,B),C);")
> # tr1 & tr2 have the same unrooted topology, yet:
> RF.dist(tr1,tr2)
[1] 2
> RF.dist(unroot(tr1),unroot(tr2))
[1] 0

In addition, phangorn:treedist and ape:dist.topo provide other metrics of tree distance.

All the best, Liam

--
Liam J. Revell
University of Massachusetts Boston
web: http://faculty.umb.edu/liam.revell/
email: liam.rev...@umb.edu
blog: http://phytools.blogspot.com

On 12/26/2011 6:27 PM, Bruno de Medeiros wrote:
Hi everyone,

I am simulating characters evolving in a phylogetic tree under a number of
models and using those characters to build another tree using parsimony.
I would like, then, to measure how similar are the recovered trees when
compared to the original ones, taking only topology into account. Is there
any function in the R packages to calculate tree distance metrics? I
considered using TNT (the program that I am using to build phylogenies) to
calculate SPR distances, but it would be much more convenient if there were
a way of doing it in R.

Thanks in advance,

Bruno
--
Bruno A. S. de Medeiros
PhD Student - Farrell Lab
Harvard University

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo

_______________________________________________
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo

Reply via email to