View source: R/tree_distance_spr.R
SPRDist | R Documentation |
Approximate the Subtree Prune and Regraft (SPR) distance.
SPRDist(tree1, tree2 = NULL, symmetric = TRUE)
tree1, tree2 |
Trees of class |
symmetric |
Logical specifying whether to produce a better heuristic
by calculating the minimum of |
SPRDist()
is a wrapper for the function
SPR.dist()
in the phangorn package.
It pre-processes trees to ensure that their internal representation does
not cause the SPR.dist()
function to crash R, and allows an improved
(but slower) symmetric heuristic.
A memory leak is present in phangorn v2.5.5. To avoid a drain on system
resources, install the latest version of phangorn with
devtools::install_github("KlausVigo/phangorn")
.
SPRDist()
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()
,
PathDist()
,
Robinson-Foulds
,
TreeDistance()
library("TreeTools", quietly = TRUE)
SPRDist(BalancedTree(7), PectinateTree(7))
SPRDist(BalancedTree(7), as.phylo(0:2, 7))
SPRDist(as.phylo(0:2, 7), PectinateTree(7))
SPRDist(list(bal = BalancedTree(7), pec = PectinateTree(7)),
as.phylo(0:2, 7))
CompareAll(as.phylo(30:33, 8), SPRDist)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.