SPRDist function

Approximate the Subtree Prune and Regraft (SPR) distance.

Approximate the Subtree Prune and Regraft (SPR) distance.

SPRDist() calculates an upper bound on the SPR distance between trees using the heuristic method of \insertCite deOliveira2008;textualTreeDist. Other approximations are available \insertCite @e.g. @Hickey2008, @Goloboff2008SPR, @Whidden2018TreeDist.

SPRDist(tree1, tree2 = NULL, method = "deOliveira", symmetric) ## S3 method for class 'phylo' SPRDist(tree1, tree2 = NULL, method = "deOliveira", symmetric) ## S3 method for class 'list' SPRDist(tree1, tree2 = NULL, method = "deOliveira", symmetric) ## S3 method for class 'multiPhylo' SPRDist(tree1, tree2 = NULL, method = "deOliveira", symmetric)

Arguments

  • tree1, tree2: Trees of class phylo, with leaves labelled identically, or lists of such trees to undergo pairwise comparison. Where implemented, tree2 = NULL will compute distances between each pair of trees in the list tree1 using a fast algorithm based on \insertCite Day1985;textualTreeDist.
  • method: Character specifying which method to use to approximate the SPR distance. Currently defaults to "deOliveira", the only available option; a new method will eventually become the default.
  • symmetric: Ignored (redundant after fix of phangorn#97).

Returns

SPRDist() returns a vector or distance matrix of distances between trees.

Examples

library("TreeTools", quietly = TRUE) # Compare single pair of trees SPRDist(BalancedTree(7), PectinateTree(7)) # Compare all pairs of trees SPRDist(as.phylo(30:33, 8)) # Compare each tree in one list with each tree in another 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))

References

\insertAllCited

See Also

Exact calculation with list("TBRDist")

functions USPRDist() and ReplugDist().

phangorn function SPR.dist() employs the \insertCite deOliveira2008;textualTreeDist algorithm but can crash when sent trees of certain formats, and tends to have a longer running time.

Other tree distances: JaccardRobinsonFoulds(), KendallColijn(), MASTSize(), MatchingSplitDistance(), NNIDist(), NyeSimilarity(), PathDist(), Robinson-Foulds, TreeDistance()

Author(s)

Martin R. Smith

(martin.smith@durham.ac.uk)