Calculate Faith's Phylogenetic Diversity
calculatePD(x, justDF = FALSE, include_root = TRUE)
A phyloseq object
Logical if TURE returns only sample data as tibble with PD and SR values as columns.Default is FALSE
Logical if root node be included. Depends whether the input phyloseq had rooted tree (default = TRUE).
Either a phyloseq object or data.frame with results of PD added to sample_data()
A wrapper around picante
for phyloseq
objects
to calculate and add Phylogenetic Diversity and Species Richness
to sample data.
Kembel, S.W., Cowan, P.D., et al., 2010. Picante: R tools for integrating phylogenies and ecology. Bioinformatics, 26(11), pp.1463-1464. https://doi.org/10.1093/bioinformatics/btq166
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