Tuesday, March 28, 2017

New phytools version (>=0.6-00) to be submitted to CRAN

I'm in the process of submitting a new version of phytools to CRAN. This update will have package version number >=0.6-00. The last CRAN phytools verison is 0.5-64 and the present version has many updates relative to this prior CRAN version which was released near the beginning of December of last year.

phytools is a fairly widely used R phylogenetics package that presently shows nearly 1,100 citations on Google Scholar (Mar. 28, 2017).

While it awaits approval, note that it is always possible to obtain the latest non-CRAN phytools version from GitHub using devtools::install_github.

Here is an abbreviated list of some of the updates from the previous CRAN version of the package:

  1. A new option to permit custom color palettes in plotBranchbyTrait.
  2. A fix to phylomorphospace3d (noted in the comments) to permit a static 3D phylomorphospace plot to be created without tip labels.
  3. A simple but handy S3 as.multiPhylo method for objects of class "phylo".
  4. S3 print, coef, residuals, and plot methods for the "phyl.RMA" object class produced by phylogenetic RMA, e.g.:
library(phytools)
obj<-phyl.RMA(x,y,tree)
obj
## 
## Coefficients:
## (Intercept)           x 
##  -0.2217216   1.0878042 
## 
## VCV matrix:
##          x        y
## x 1.605286 1.394110
## y 1.394110 1.899564
## 
## Model for the covariance structure of the error is "BM"
## 
## Estimates (or set values):
##    lambda    log(L) 
##   1.00000 -60.71938 
## 
## Hypothesis test based on Clarke (1980; Biometrika):
##        r2         T        df         P 
##  0.637365  0.684671 20.199986  0.501332 
## 
## Note that the null hypothesis test is h0 = 1
plot(obj)

plot of chunk unnamed-chunk-1

  1. A bunch of new options for plotTree.barplot, including stacked bars.
  2. A bug fix for write.simmap with "multiSimmap" objects.
  3. A completely new function, ratebytree, to compare the rate of evolution of a continuous trait between 2 or more phylogenies (1, 2, 3, 4). E.g.:
ylim<-range(X)
par(mfrow=c(1,3))
phenogram(trees[[1]],X[[1]],ylim=ylim,spread.cost=c(1,0))
phenogram(trees[[2]],X[[2]],ylim=ylim,spread.cost=c(1,0))
phenogram(trees[[3]],X[[3]],ylim=ylim,spread.cost=c(1,0))

plot of chunk unnamed-chunk-2

ratebytree(trees,X)
## ML common-rate model:
##  s^2  a[1]   a[2]    a[3]    k   logL
## value    1.2487  0.6393  0.5213  -0.7999 4   -71.0761    
## 
## ML multi-rate model:
##   s^2[1] s^2[2]  s^2[3]   a[1]   a[2]    a[3]    k   logL
## value    0.425   1.747   1.1623  0.6393  0.5213  -0.7999 6   -68.3276    
## 
## Likelihood ratio: 5.497 
## P-value (based on X^2): 0.064 
## 
## R thinks it has found the ML solution.
  1. A new option to plot up or down facing trees in phytools::plotSimmap (as well as in a number of the functions that use plotSimmap internally).
  2. The option to plot up & down facing "contMap" & "densityMap" objects.
  3. Some neat functionality for interactive node labeling (more here).
  4. Another new function, errorbar.contMap, to add colorful error bars to internal nodes of a plotted "contMap" object (1, 2, 3), e.g.:
obj<-contMap(tree,y,lims=c(-3.75,4.5),plot=FALSE)
plot(obj,xlim=c(-0.05,2),legend=1)
errorbar.contMap(obj,scale.by.ci=TRUE)

plot of chunk unnamed-chunk-3

  1. Another totally new function, plotTree.errorbars, to plot a tree with semi-transparent error bars on the ages of internal nodes (1, 2).
  2. A new function, pgls.SEy, to conduct phylogenetic generalized least squares regression (or any linear modeling) while taking into account known errors in y (1, 2).
  3. An important bug fix for a non-flat prior probability distribution on the global root state in the function make.simmap for stochastic character mapping.
  4. A simple difference equation approximation OU simulation function, to simulate Ornstein-Uhlenbeck evolution on the tree for multiple optima (more here).
  5. A small update to plotTree.singletons to assign the environmental variable "last_plot.phylo" allowing this function to work with others designed to annotate plotted trees, such as ape::nodelabels.
  6. A simple fix to the S3 plot method for "phyl.pca" class objects from phylogenetic principal components analysis.
  7. A cool new plotting function, arc.cladelabels, to add clade labels to a plotted fan-style circular tree.
  8. Today I added a new function, force.ultrametric, that forces (by multiple methods) an ultrametric tree that fails ape::is.ultrametric (due to numerical precision issues) to be precisely ultrametric.
  9. Finally, I pushed a whole bunch of updates to the help pages of the package. It’s not glamorous, but it was overdue!

I'll be working on getting this package version up on CRAN today - and will post an update when it is accepted.

1 comment:

  1. Already on CRAN - though binaries yet to be built so you will need to install from source.

    ReplyDelete

Note: due to the very large amount of spam, all comments are now automatically submitted for moderation.