TreeDist: Distances between Phylogenetic Trees
'TreeDist' is an R package that implements a suite of metrics that quantify the topological distance between pairs of unweighted phylogenetic trees. It also includes a simple "Shiny" application to allow the visualization of distance-based tree spaces, and functions to calculate the information content of trees and splits. package
UTF-8
"TreeDist" primarily employs metrics in the category of "generalized Robinson–Foulds distances": they are based on comparing splits (bipartitions) between trees, and thus reflect the relationship data within trees, with no reference to branch lengths. Detailed documentation and usage instructions are available online or in the vignettes.
simply tallies the number of non-trivial splits (sometimes inaccurately termed clades, nodes or edges) that occur in both trees -- any splits that are not perfectly identical contributes one point to the distance score of zero, however similar or different they are. By overlooking potential similarities between almost-identical splits, this conservative approach has undesirable properties.
generate matchings that pair each split in one tree with a similar split in the other. Each pair of splits is assigned a similarity score; the sum of these scores in the optimal matching then quantifies the similarity between two trees.
Different ways of calculating the the similarity between a pair of splits lead to different tree distance metrics, implemented in the functions below:
list("MutualClusteringInfo()"), list("SharedPhylogeneticInfo()")
list("MatchingSplitDistance()")
Bogdanowicz and Giaro (2012) and Lin et al. (2012) independently proposed counting the number of "mismatched" leaves in a pair of splits. list("MatchingSplitInfoDistance()")
provides an information-based equivalent (Smith 2020).
The package also implements the variation of the path distance proposed by Kendal and Colijn (2016) (function list("KendallColijn()")), approximations of the Nearest-Neighbour Interchange (NNI) distance (function list("NNIDist()"); following Li et al. (1996)), and calculates the size (function list("MASTSize()")) and information content (function list("MASTInfo()")) of the Maximum Agreement Subtree.
For an implementation of the Tree Bisection and Reconnection (TBR) distance, see the package 'TBRDist'.
Map tree spaces and readily visualize mapped landscapes, avoiding common analytical pitfalls (Smith, forthcoming), using the inbuilt graphical user interface:
TreeDist::MapTrees()
Serious analysts should consult the vignette
for a command-line interface.
Further documentation is available in the package vignettes, visible from R using vignette(package = "TreeDist")
.
Other R packages implementing tree distance functions include:
ape:
cophenetic.phylo()
: Cophenetic distancedist.topo()
: Path (topological) distance, Robinson–Foulds distance.treedist()
: Path, Robinson–Foulds and approximate SPR distances.Quartet: Triplet and Quartet distances, using the tqDist algorithm.
TBRDist: TBR and SPR distances on unrooted trees, using the 'uspr' C library.
distory (unmaintained): Geodesic distance
Maintainer : Martin R. Smith martin.smith@durham.ac.uk (ORCID) [copyright holder, programmer]
Other contributors:
Useful links