Simulation and Likelihood Calculation of Phylogenetic Comparative Models

Phylogenetic comparative methods represent models of continuous trait data associated with the tips of a phylogenetic tree. Examples of such models are Gaussian continuous time branching stochastic processes such as Brownian motion (BM) and Ornstein-Uhlenbeck (OU) processes, which regard the data at the tips of the tree as an observed (final) state of a Markov process starting from an initial state at the root and evolving along the branches of the tree. The PCMBase R package provides a general framework for manipulating such models. This framework consists of an application programming interface for specifying data and model parameters, and efficient algorithms for simulating trait evolution under a model and calculating the likelihood of model parameters for an assumed model and trait data. The package implements a growing collection of models, which currently includes BM, OU, BM/OU with jumps, two-speed OU as well as mixed Gaussian models, in which different types of the above models can be associated with different branches of the tree. The PCMBase package is limited to trait-simulation and likelihood calculation of (mixed) Gaussian phylogenetic models. The PCMFit package provides functionality for ML and Bayesian fit of these models to tree and trait data. The package web-site < https://venelin.github.io/PCMBase/> provides access to the documentation and other resources.


Travis build status Coverage status CRAN_Status_Badge Downloads Latest release DOI

Phylogenetic comparative methods represent models of continuous trait data associated with the tips of a phylogenetic tree. Examples of such models are Gaussian continuous time branching stochastic processes such as Brownian motion (BM) and Ornstein-Uhlenbeck (OU) processes, which regard the data at the tips of the tree as an observed (final) state of a Markov process starting from an initial state at the root and evolving along the branches of the tree. The PCMBase R package provides a general framework for manipulating such models. This framework consists of an application programming interface for specifying data and model parameters, and efficient algorithms for simulating trait evolution under a model and calculating the likelihood of model parameters for an assumed model and trait data. The package implements a growing collection of models, which currently includes BM, OU, BM/OU with jumps, two-speed OU as well as mixed Gaussian models, in which different types of the above models can be associated with different branches of the tree. The PCMBase package is limited to trait-simulation and likelihood calculation of (mixed) Gaussian phylogenetic models. The PCMFit package provides functionality for ML and Bayesian fit of these models to tree and trait data.

Installation

The function PCMTreePlot in the package is implemented based on the R-package ggtree, which is not on CRAN. It is highly recommended to install this package in order to be able to visualize trees with colored parts corresponding to defferent evolutionary regimes. If ggtree is not installed, the package will fail to run examples and generate the vignettes. At the time of writing this documentation, ggtree can be installed from bioconductor through the following code (if that does not work, check the ggtree home page):

if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")
BiocManager::install("ggtree", version = "3.8")

Installing PCMBase from CRAN

A stable but possibly old version of PCMBase is available on CRAN and can be installed with this command:

install.packages("PCMBase")

Github

The newest but possibly less stable and tested version of the package can be installed using:

devtools::install_github("venelin/PCMBase")

Resources

The user guides and technical reference for the library are available from the PCMBase web-page.

The research article "Fast likelihood evaluation for multivariate phylogenetic comparative methods: the PCMBase R package" provides a general overview of PCMBase. The article is currently undergoing peer review for a publication and is available as a preprint from arxiv.

The PCMBase source code is located in the PCMBase github repository.

Feature requests, bugs, etc can be reported in the PCMBase issues list.

Citing PCMBase

To give credit to the PCMBase package in a publication, please cite the following article:

Mitov, V., Bartoszek, K., Asimomitis, G., & Stadler, T. (2018, September 24). Fast likelihood evaluation for multivariate phylogenetic comparative methods: the PCMBase R package. arXiv.org. https://arxiv.org/abs/1809.09014.

Used R-packages

The PCMBase R-package uses the following 3rd party R-packages:

  • For tree processing in R: ape v5.2 (Paradis et al. 2018), data.table v1.12.0 (Dowle and Srinivasan 2019);
  • For algebraic manipulation: expm v0.999.3 (Goulet et al. 2018), mvtnorm v1.0.8 (Genz et al. 2018);
  • For plotting: ggtree v1.14.6 (Yu and Lam 2019), ggplot2 v3.1.0 (Wickham et al. 2018);
  • For unit-testing: testthat v2.0.1 (Wickham 2018), covr v3.2.1 (Hester 2018);
  • For documentation and web-site generation: roxygen2 v6.1.1 (Wickham, Danenberg, and Eugster 2018), pkgdown v1.3.0 (Wickham and Hesselberth 2018);

References

Dowle, Matt, and Arun Srinivasan. 2019. Data.table: Extension of ‘Data.frame‘. https://CRAN.R-project.org/package=data.table.

Genz, Alan, Frank Bretz, Tetsuhisa Miwa, Xuefei Mi, and Torsten Hothorn. 2018. Mvtnorm: Multivariate Normal and T Distributions. https://CRAN.R-project.org/package=mvtnorm.

Goulet, Vincent, Christophe Dutang, Martin Maechler, David Firth, Marina Shapira, and Michael Stadelmann. 2018. Expm: Matrix Exponential, Log, ’Etc’. https://CRAN.R-project.org/package=expm.

Hester, Jim. 2018. Covr: Test Coverage for Packages. https://CRAN.R-project.org/package=covr.

Paradis, Emmanuel, Simon Blomberg, Ben Bolker, Joseph Brown, Julien Claude, Hoa Sien Cuong, Richard Desper, et al. 2018. Ape: Analyses of Phylogenetics and Evolution. https://CRAN.R-project.org/package=ape.

Wickham, Hadley. 2018. Testthat: Unit Testing for R. https://CRAN.R-project.org/package=testthat.

Wickham, Hadley, and Jay Hesselberth. 2018. Pkgdown: Make Static Html Documentation for a Package. https://CRAN.R-project.org/package=pkgdown.

Wickham, Hadley, Winston Chang, Lionel Henry, Thomas Lin Pedersen, Kohske Takahashi, Claus Wilke, and Kara Woo. 2018. Ggplot2: Create Elegant Data Visualisations Using the Grammar of Graphics. https://CRAN.R-project.org/package=ggplot2.

Wickham, Hadley, Peter Danenberg, and Manuel Eugster. 2018. Roxygen2: In-Line Documentation for R. https://CRAN.R-project.org/package=roxygen2.

Yu, Guangchuang, and Tommy Tsan-Yuk Lam. 2019. Ggtree: An R Package for Visualization and Annotation of Phylogenetic Trees with Their Covariates and Other Associated Data. https://guangchuangyu.github.io/software/ggtree.

News


title: "NEWS about the PCMBase R-package" author: "Venelin Mitov" date: "15 March, 2018" output: html_document

PCMBase 1.2.9

  • Important changes in the PCMTree module:
  • Renamed member 'edge.regime' in the phylo object to 'edge.part'. The word 'regime' is reserved uniquely to identify a regime of an evolutionary model. An intuitive synonyme for 'regime' is 'color'. The word 'part' stays for a monophyletic or a paraphyletic group of nodes (and the branches ending at these nodes) in a tree. It is possible to have several parts that evolve under the same model regime and, terefore, should be shown with with the same color.
  • new model types are made available within the package namespace. Hence, there is no need to call PCMGenerateModelTypes() after loading the package. Call PCMModels() after loading the package to see which are these model types.

  • Updated tests and examples due to a change in the default random generator type (see https://developer.r-project.org/blosxom.cgi/R-devel/NEWS/2019/02/28#n2019-02-28).

PCMBase 1.2.8

  • Added handling of standard error specified for each trait measurement. This is implemented as an additional matrix parameter called SE to the functions PCMLik, PCMSim, PCMVar, and PCMInfo.

PCMBase 1.2.7

  • First version of the package released on CRAN.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("PCMBase")

1.2.9 by Venelin Mitov, 3 months ago


https://venelin.github.io/PCMBase/, https://github.com/venelin/PCMBase


Report a bug at https://github.com/venelin/PCMBase/issues


Browse source code at https://github.com/cran/PCMBase


Authors: Venelin Mitov [aut, cre, cph] , Krzysztof Bartoszek [ctb] , Georgios Asimomitis [ctb] , Tanja Stadler [ctb]


Documentation:   PDF Manual  


GPL (>= 3.0) license


Imports ape, expm, mvtnorm, data.table, ggplot2

Suggests testthat, knitr, rmarkdown, abind, ggtree, cowplot, covr


Imported by mvSLOUCH.


See at CRAN