-
Notifications
You must be signed in to change notification settings - Fork 12
19. Chapter 19
"ape" (Paradis et al 2004)
"ade4" (Dray & Dufour, 2007; Chessel et al. 2004; Dray et al. 2007)
"MASS" (Venables & Ripey, 2004)
"picante" (Kembel et al., 2010)
"apTreeshape" (Bartolussi et al. 2012)
"spacodiR" (Eastman et al., 2013)
"phylobase" (R Hackathon et al. 2013)
"phyloseq" (McMurdie & Holmes, 2013)
METRIC CODE ("metrics.R"), Novel code to calculate community phylogenetic metrics
WRAPPER CODE ("functions.R"), Wrapper code to rapidly calculate the shape, evenness, and dispersion metrics described in the chapter
FIGURE 2 ANALYSES ("figures.R"), Code used to generate figure 2 in the chapter, and use the above files to calculate metrics and compare them
PGLMM ANALYSES ("pglmm.R"), Code to calculate the PGLMM models in the chapter
METRIC TABLES ("tables.pdf"), Description of additional metrics and their placement into the framework described in the chapter. Also the abbreviations used in figure 2 in the chapter.
The file functions.R shows how the metrics described in the chapter can be calculated. However, below is a more annotated example that shows how the functions can be used.
#Load the functions written for the chapter
source(‘functions.R’)
## Loading required package: apTreeshape
- Attaching package: ‘apTreeshape’
- The following object is masked from ‘package:phylobase’:
- ancestor
#Load example data from ‘picante’
data(phylocom)
#Prune species from the phylogeny missing from the community data
tree <- drop.tip(phylocom$phy, setdiff(phylocom$phy$tip.label, colnames(phylocom$sample)))
#Calculate metrics! (ignore the warnings)
shape <- shape.metrics(phylocom$sample, tree)
evenness <- evenness.metrics(phylocom$sample, tree)
dispersion <- dispersion.metrics(phylocom$sample, tree)
#Take a quick look!
head(shape)
## PSV PSR SR MPD PD regPD Ic Gamma TDI_Dplus TDI_SRDplus
- Bortolussi, N., Durand, E., Blum, M., and Francois, O. (2012). apTreeshape: analyses of phylogenetic treeshape. R package version 1.4-5. http://CRAN.R-project.org/package=apTreeshape
- Chessel, D. and Dufour, A.B. and Thioulouse, J. (2004): The ade4 package-I- One-table methods. R News. 4: 5-10.
- Dray, S. and Dufour, A.B. (2007): The ade4 package: implementing the duality diagram for ecologists. Journal of Statistical Software.22(4): 1-20.
- Dray, S. and Dufour, A.B. and Chessel, D. (2007): The ade4 package-II: Two-table and K-table methods. R News. 7(2): 47-52
- Eastman, J., Paine, T., and Hardy, O. (2013). spacodiR: spatial and phylogenetic analysis of community diversity. R package version 0.13.0115. http://CRAN.R-project.org/package=spacodiR
- Kembel, S.W., Cowan, P.D., Helmus, M.R., Cornwell, W.K., Morlon, H., Ackerly, D.D., Blomberg, S.P., and Webb, C.O.. 2010. Picante: R tools for integrating phylogenies and ecology. Bioinformatics 26:1463-1464.
- McMurdie, P.J., and Holmes, S. (2013) PLoS ONE 8(4):e61217. phyloseq: An R package for reproducible interactive analysis and graphics of microbiome census data.
- Paradis E, Claude J, Strimmer K (2004) APE: analyses of phylogenetics and evolution in R language. Bioinformatics 20:289-290
- R Core Team (2014). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. URL http://www.R-project.org/.
- R Hackathon et al. (2013). phylobase: Base package for phylogeneticstructures and comparative data. R package version 0.6.5.2.http://CRAN.R-project.org/package=phylobase
- Venables, W. N. & Ripley, B. D. (2002) Modern Applied Statistics with S. Fourth Edition. Springer, New York. ISBN 0-387-95457-0