Pages

Thursday, September 20, 2012

Using ltt on a set of trees, plus a cool animation

A phytools user just commented that it would be cool to be able to automate the calculation of Pybus & Harvey's γ statistic for a set of phylogenies (say, a posterior sample of trees from a Bayesian analysis). This is actually already pretty easy - just do the following (trees is a set of trees stored in an object of class "multiPhylo"):

g

For example, let's try it on a set of pure-birth phylogenies simulated using phytools::pbtree:

Running ltt on a set of trees also incidentally creates a neat animation. Here's what it looked like for my 1000 simulated trees (more or less - I added the counter & diagonal reference line for effect):

1 comment:

I just realized that the diagonal dashed line (the expectation for a pure-birth tree) should connect log(2) with log(100) [not log(1)=0 with log(100)], since the trees start with two lineages, not one. Oh well.

About this blog

This web-log chronicles the development of new tools for phylogenetic analyses in the phytools R package. Unless you a reading a very recent page of the blog, I recommend that you install the latest CRAN version of phytools (or latest beta release) before attempting to replicate any of the analyses of this site. That is because the linked functions may be archived, and very likely have been replaced by newer versions.