SPRDist: Approximate the Subtree Prune and Regraft (SPR) distance.

SPRDistR Documentation

Approximate the Subtree Prune and Regraft (SPR) distance.

Description

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

Usage

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 \insertCiteDay1985;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).

Value

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

Author(s)

Martin R. Smith (martin.smith@durham.ac.uk)

References

\insertAllCited

See Also

Exact calculation with TBRDist functions USPRDist() and ReplugDist().

phangorn function SPR.dist() employs the \insertCitedeOliveira2008;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()

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))

ms609/TreeDist documentation built on Sept. 13, 2024, 12:09 a.m.