Learn R Programming

phangorn (version 2.0.3)

treedist: Distances between trees

Description

treedist computes different tree distance methods and RF.dist the Robinson-Foulds or symmetric distance.

Usage

treedist(tree1, tree2, check.labels = TRUE)
RF.dist(tree1, tree2=NULL, check.labels=TRUE, rooted=FALSE)
KF.dist(tree1, tree2=NULL, check.labels=TRUE, rooted=FALSE)
path.dist(tree1, tree2=NULL, check.labels=TRUE, use.weight=FALSE)

Arguments

tree1
A phylogenetic tree (class phylo) or vector of trees (an object of class multiPhylo). See details
tree2
A phylogenetic tree.
check.labels
compares labels of the trees.
rooted
take bipartitions for rooted trees into account, default is unrooting the trees.
use.weight
use edge.length argument or just count number of edges on the path (default)

Value

  • treedist returns a vector containing the following tree distance methods
  • symmetric.differencesymmetric.difference or Robinson-Foulds distance
  • branch.score.differencebranch.score.difference
  • path.differencepath.difference
  • weighted.path.differenceweighted.path.difference

Details

The Robinson-Foulds distance is well defined only for bifurcating trees. RF.dist returns the Robinson-Foulds distance (Robinson & Foulds 1981) between either 2 trees or computes a matrix of all pairwise distances if a multiPhylo object is given. KF.dist return the branch score distance (Kuhner & Felsenstein 1994). path.dist computes the path difference metric as described in Steel and Penny 1993).

For large number of trees the distance functions will use a lot of memory!

References

Steel M. A. and Penny P. (1993) Distributions of tree comparison metrics - some new results, Syst. Biol., 42(2), 126--141

Kuhner, M. K. and Felsenstein, J. (1994) A simulation comparison of phylogeny algorithms under equal and unequal evolutionary rates, Molecular Biology and Evolution, 11(3), 459--468

D.F. Robinson and L.R. Foulds (1981) Comparison of phylogenetic trees, Mathematical Biosciences, 53(1), 131--147

See Also

dist.topo

Examples

Run this code
tree1 <- rtree(100, rooted=FALSE)
tree2 <- rSPR(tree1, 3)
RF.dist(tree1, tree2)
treedist(tree1, tree2)

Run the code above in your browser using DataLab