View source: R/tree_distance_path.R
PathDist | R Documentation |
Calculate the path distance between rooted or unrooted trees.
PathDist(tree1, tree2 = NULL)
tree1 , tree2 |
Trees of class |
This function is a faster alternative to the function
path.dist()
in the phangorn package,
which can crash if the internal representation of trees does not conform to
certain (unspecified) expectations, and which treats all trees as unrooted.
The path distance is calculated by tabulating the cladistic difference (= topological distance) between each pair of tips in each tree. A precursor to the path distance \insertCiteFarris1969TreeDist took the mean squared difference between the elements of each tree's tabulation (Farris, 1973); the method used here is that proposed by \insertCiteSteel1993;textualTreeDist, which takes the square root of this sum. Other precursor measures are described in \insertCiteWilliams1971;textualTreeDist and \insertCitePhipps1971;textualTreeDist.
If a root node is present, trees are treated as rooted.
To avoid counting the root edge twice, use UnrootTree(tree)
before
calculating the path distance.
Use of the path distance is discouraged as it emphasizes shallow relationships at the expense of deeper (and arguably more fundamental) relationships \insertCiteFarris1973TreeDist.
PathDist()
returns a vector or distance matrix of distances
between trees.
Martin R. Smith (martin.smith@durham.ac.uk)
Other tree distances:
JaccardRobinsonFoulds()
,
KendallColijn()
,
MASTSize()
,
MatchingSplitDistance()
,
NNIDist()
,
NyeSimilarity()
,
Robinson-Foulds
,
SPRDist()
,
TreeDistance()
library("TreeTools")
# Treating the two edges to the root node as distinct
PathDist(BalancedTree(7), PectinateTree(7))
# Counting those two edges once
PathDist(UnrootTree(BalancedTree(7)), UnrootTree(PectinateTree(7)))
PathDist(BalancedTree(7), as.phylo(0:2, 7))
PathDist(as.phylo(0:2, 7), PectinateTree(7))
PathDist(list(bal = BalancedTree(7), pec = PectinateTree(7)),
as.phylo(0:2, 7))
PathDist(as.phylo(30:33, 8))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.