Fast evolutionary distinctiveness

What evolutionary distinctiveness measures

Evolutionary distinctiveness (ED) quantifies how isolated a species is on a phylogenetic tree. Species with few or no close living relatives, such as the tuatara or the ginkgo, score high; species in large, recently diverged clades score low. ED is a building block of conservation priorities such as EDGE (Evolutionarily Distinct and Globally Endangered) scores.

Why a faster method

ED is usually computed with the R packages picante or caper. Both become a bottleneck for very large trees, because the calculation is slow and uses a lot of memory. phyloregion implements the same measures ("fair.proportion" and "equal.splits") with a much faster algorithm, so trees with thousands of tips take a fraction of a second.

Quick start

library(phyloregion)

set.seed(1)
tree <- ape::rcoal(8)
ed <- evol_distinct(tree, type = "fair.proportion")
round(sort(ed, decreasing = TRUE), 3)
#>    t5    t3    t2    t7    t8    t4    t6    t1 
#> 1.452 0.744 0.728 0.716 0.716 0.680 0.673 0.673

The result is a named vector with one value per tip. Use type = "equal.splits" for the equal-splits version of the measure.

Benchmark on a tree with 5,000 species

The comparison below was run once on a random coalescent tree with 5,000 tips. It is not run when this page is built, because picante takes several minutes.

library(ape)
library(phyloregion)
library(picante)
library(caper)

tree <- ape::rcoal(5000)

ed_picante     <- function(x) picante::evol.distinct(x, type = "fair.proportion")
ed_caper       <- function(x) caper::ed.calc(x)
ed_phyloregion <- function(x) phyloregion::evol_distinct(x, type = "fair.proportion")

res <- bench::mark(picante     = ed_picante(tree),
                   caper       = ed_caper(tree),
                   phyloregion = ed_phyloregion(tree),
                   check = FALSE)
summary(res)
Package Median time Iterations per second
picante 4.02 min 0.004
caper 9.17 s 0.11
phyloregion 70.6 ms 13.9

Bar chart of median run time on a log scale: phyloregion 71 milliseconds, caper 9.2 seconds, picante 4.0 minutes.

On this tree phyloregion was about 130 times faster than caper and about 3,400 times faster than picante.

Usage

evol_distinct(tree, type = c("equal.splits", "fair.proportion"), ...)

See ?evol_distinct for details, and ?EDGE to combine ED with extinction risk.

Citation

If you find this vignette useful, please cite:

Daru, B.H., Karunarathne, P. & Schliep, K. (2020) phyloregion: R package for biogeographic regionalization and macroecology. Methods in Ecology and Evolution 11: 1483–1491. doi:10.1111/2041-210X.13478