Saturday, December 3, 2016

New phytools version (>=0.5-62) on its way to CRAN

In advance of a workshop I'll be teaching next week at the Universidad Nacional del Comahue in (reputedly) beautiful Bariloche, Argentina, I will be trying to get a new version of phytools on CRAN. This update will have version number >=0.5.62 (TBD).

It has been over five months since I last submitted a phytools update to CRAN. Obviously, there have been a ton of updates in that time. Here are some:

  1. A bug fix in collapseTree.
  2. More user control of the plot method for phylo.toBackbone (here).
  3. Another update to backbonePhylo to permit multiple clades to have the same label.
  4. Various updates to which helped enable this nice plot:
  5. A new phytools function for showing a barplot next to a plotted tree, plotTree.barplot (1, 2, 3).
  6. A new function, related to plotTree.barplot, to plot a boxplot next to a phylogeny (plotTree.boxplot). Also see this addition permitting the boxplot to be build using the ‘formula’ method.
  7. A simple update to phyl.pca to permit more columns than rows in the input data matrix.
  8. Update to plot.cophylo to permit sigmoidal linking lines.
  9. New function to resolve a polytomous node in all possible ways. (Also here.)
  10. Function to reorder the daughter edges of a multifurcation in all possible ways.
  11. New option to rotate polytomies for co-phylogenetic plotting using the algorithm developed for [10.] (here).
  12. Speed up & fixes for collapseTree.
  13. New option to get the variance and confidence intervals for reconstructed tip states obtained using anc.ML.
  14. New function to plot the likelihood surface for the phytools function rateshift.
  15. Update to the function to permit the gradient color legend to be plotted vertically as well as horizontally.
  16. Additional user control of the S3 plot method for objects of class "cophylo".
  17. Updates to tip label plotting and a new S3 summary method for "cophylo" class objects.
  18. A new phytools function to find all possible node rotations of all nodes in a tree.
  19. A new exhaustive search for the cophylo function for co-phylogenetic plotting.
  20. Some updates to fitMk to permit more user control of optimization.
  21. A small fix to pass optional arguments to fitMk within make.simmap.
  22. A fun animated optimization method for cophylo. The animation, shown below, shows the tree traversal and the node rotations of the tree gradually being improved by the algorithm:
  23. A bug fix for
  24. A very simple new cospeciation test in phytools.
  25. A function to compute a modified version of Grafen’s edge lengths.
  26. A cool S3 density method for objects of class "multiSimmap".
  27. Some new methods and user-control of phylogenetic scattergram plotting using fancyTree.
  28. Some updates to permit more user control of line end types in plotSimmap.
  29. An extremely simple function (bd) to pull birth & death (species & extinction) rates from an object of class "birthdeath" computed by ape.
  30. A simple new function and print method to compute AIC weights.
  31. And, finally, a bunch of other miscellaneous updates to address issues raised when updating ape & phangorn.

I know this isn't comprehensive, but it is a survey reflecting the wide range of updates & changes to the package. Of course, now that phytools is on GitHub, it's super easy to track all the committed changes the package has seen.

I'll post again when the updated phytools makes it on CRAN!

Tuesday, November 29, 2016

Some updates to phytools

I just pushed a series of updates (1, 2, 3, 4) to fix some issues raised by the authors of ape and phangorn in advance of the submission of new CRAN versions of those two packages.

The first was that I had inadvertently corrupted an S3 method multi2di of ape when I created the function multi2di.simmap without exporting a method to the namespace. The other issues came up in R CMD check and included such things as failing to import various functions from dependencies, other problems with the namespace, errors in documenting various variables, the absence of a manual page for one function (likSurface.rateshift) that is exported by phytools, and a few problems with the R code of some new functions.

I too hope to update the version of phytools on CRAN as the current version dates to June.

The latest phytools version can be installed from GitHub using devtools as follows:


Since both phangorn & ape are in the process of being updated, but phytools depends on the latest version of neither, you may need to do:


That's it.

Friday, November 18, 2016

Updates to permit user control of line end types in plotSimmap

I recently made a couple of small updates to plotSimmap - firstly, to allow user control of the line end type (lend, as in par); and secondly, for type="fan", to plot the two edges originating from the root as a single segmented line.

Here is a quick example using the latest version of phytools on GitHub:

## [1] '0.5.59'
## no colors provided. using the following legend:
##        CG        GB        TC        TG        Tr        Tw 
##   "black"     "red"  "green3"    "blue"    "cyan" "magenta"

plot of chunk unnamed-chunk-1

plot(anoletree,lwd=5,ftype="i",fsize=0.5,lend=0) ## curved
## no colors provided. using the following legend:
##        CG        GB        TC        TG        Tr        Tw 
##   "black"     "red"  "green3"    "blue"    "cyan" "magenta"

plot of chunk unnamed-chunk-1

plot(anoletree,lwd=5,ftype="i",fsize=0.5,lend=1) ## mitered
## no colors provided. using the following legend:
##        CG        GB        TC        TG        Tr        Tw 
##   "black"     "red"  "green3"    "blue"    "cyan" "magenta"

plot of chunk unnamed-chunk-1

Or as type="fan"

## no colors provided. using the following legend:
##        CG        GB        TC        TG        Tr        Tw 
##   "black"     "red"  "green3"    "blue"    "cyan" "magenta"

plot of chunk unnamed-chunk-2

Note that the 'pixelation' (aka. aliasing) is just an effect of the rendering and disappears if the plot is rendered as a PDF, e.g.:

Finally, the purpose of plotting the two lines originating at the root as a single segmented line is the eliminate what can be an ugly overlap of the two daughter edges when plotted separately:


plot of chunk unnamed-chunk-3


(rendered more nicely).

That's it.