phylodiv.expected: Expected Phylogenetic Diversity of ecological samples

Description Usage Arguments Details Value References

Description

Calculates the expected Phylogenetic Diversity (PD) of multiple samples simultaneously based on probabilities of occurrence (or extinction) for each combination of species and site. Note that this function uses that version of PD that always includes the path to the root of the tree.

Usage

1
phylodiv.expected(x, phy, occur = TRUE)

Arguments

x

is the community data given as a data.frame or matrix with species/OTUs as columns and samples/sites as rows (like in the vegan package). Columns are labelled with the names of the species/OTUs. Rows are labelled with the names of the samples/sites. Data are expressed as probabilities (ranging 0-1) of either occurrence or extinction. Column labels must match tip labels in the phylogenetic tree exactly!

phy

is a rooted phylogenetic tree with branch lengths stored as a phylo object (as in the ape package) with terminal nodes labelled with names matching those of the community data table. Note that the function trims away any terminal taxa not present in the community data table, so it is not necessary to do this beforehand.

occur

is a logical indicating whether x is a matrix of probabilities of occurrence (TRUE - default) or extinction (FALSE)

Details

phylodiv.expected takes probability data and a phylogenetic tree (rooted and with branch lengths) and calculates the expected Phylogenetic Diversity (PD) of all samples/sites. PD is defined as the total length of all branches spanning a set of terminal taxa representing an ecological sample (Faith, 1992). Expected PD is the summed branch length expected for each site given the probability of occurrence (or extinction) of species (and ancestral branches) at that site (Witting & Loeschcke 1995; Faith 2013). Please note that, if the common ancestor (node) of the set of taxa of a sample is not the root of the tree, then the set of branches connecting this node to the root are also included in the calculation.

Value

A vector of expected Phylogenetic Diversity (PD) values for each sample/site in x.

References


davidnipperess/PDcalc documentation built on July 7, 2021, 1:07 p.m.