Thursday, July 9, 2015

New feature in LTT plotter to overlay plotted tree

I just posted a version of the function ltt (Lineage-Through-Time) that permits the user to automatically overlay the phylogeny on a lineage through time plot. I wrote about how to do this manually in a previous post. This update is part of a new version of phytools, phytools 0.4-60, which has been submitted to CRAN - but for now can also be downloaded and installed from source from the phytools page.

Here is a demo of how it works:

## [1] '0.4.60'
## simulated tree:

plot of chunk unnamed-chunk-1

## object of class "ltt"
## Object of class "ltt" containing:
## (1) A phylogenetic tree with 26 tips and 25 internal nodes.
## (2) Vectors containing the number of lineages (ltt) and branching times (times) on the tree.
## (3) A value for Pybus & Harvey's "gamma" statistic of -1.0815, p-value = 0.2795.
## regular ltt plot

plot of chunk unnamed-chunk-2

## overlay tree on plot

plot of chunk unnamed-chunk-3

That's all there is to it. At present I don't have it set up to change the color of the tree - however, there is an option to increase or decrease the transparency:


plot of chunk unnamed-chunk-4

That's it for now. Stay tuned for another post detailing the updates in the latest phytools version.

No comments:

Post a Comment