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.
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.
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.673The result is a named vector with one value per tip. Use
type = "equal.splits" for the equal-splits version of the
measure.
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 |
On this tree phyloregion was about 130 times faster than
caper and about 3,400 times faster than
picante.
See ?evol_distinct for details, and ?EDGE
to combine ED with extinction risk.
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