Calculate Faith's Phylogenetic Diversity

calculatePD(x, justDF = FALSE, include_root = TRUE)

Arguments

x

A phyloseq object

justDF

Logical if TURE returns only sample data as tibble with PD and SR values as columns.Default is FALSE

include_root

Logical if root node be included. Depends whether the input phyloseq had rooted tree (default = TRUE).

Value

Either a phyloseq object or data.frame with results of PD added to sample_data()

Details

A wrapper around picante for phyloseq objects to calculate and add Phylogenetic Diversity and Species Richness to sample data.

References

Author

Sudarshan A. Shetty

Examples

library(biomeUtils)
data("FuentesIliGutData")
# reduce size for example
ps1 <- subset_samples(FuentesIliGutData, ILI == "C")
ps1 <- prune_taxa(taxa_sums(ps1) > 0, ps1)

meta_tib <- calculatePD(ps1, justDF = TRUE)
# check
meta_tib[c(1, 2, 3), c("PD", "SR")]
#>                 PD  SR
#> sample_1  967.3003 259
#> sample_2 1035.1305 291
#> sample_3 1189.0248 336