background preloader

Continuous character evolution

Facebook Twitter

BayesTraits. Home People Research Selected Publications Book Software Data Sets Reading Evolutionary Biology Group - BayesTraits V2.0 (Beta) 12 July 2013 Description BayesTraits is a computer package for performing analyses of trait evolution among groups of species for which a phylogeny or sample of phylogenies is available. BayesTraits V1 Back to Software. Main Page - NESCent Informatics Wiki. Package snowfall. Computing phylogenetic signal. I have posted a new function to compute phylogenetic signal for continuous traits using two methods: the lambda method of Pagel (1999) and Blomberg et al. (2003)'s K-statistic.

Rich Glor already created a very helpful wiki page on how to do this in R using several different functions. My function, phylosig() (code here), should make this even easier. With phylosig() you can specify method (presently either "K" or "lambda") and optionally return a P-value for either the randomization test of Blomberg et al. or a likelihood ratio test against the null hypothesis that lambda=0. For instance, after loading our function from source, to compute K and conduct a hypothesis test of the null hypothesis of no signal we just type: > phylosig(tree,x,test=TRUE)$K[1] 1.053583 By default, the function uses method="K" and nsim=1000. Next, we can also estimate lambda using maximum likelihood: > phylosig(tree,x,method="lambda",test=TRUE)$lambda[1] 0.9999339 $logL[1] -132.7309.

Computing phylogenetic signal across multiple trees. A user just inquired as to whether there was an easy way to compute phylogenetic signal across multiple trees (say, a set of trees sampled from the posterior distribution or a set of equally parsimonious trees). In fact, this is quite easy. To illustrate this, I will first simulate a set of 10 trees, and then I will generate data on one of these. This is intended to replicate our typical data analysis pipeline in which we have multiple trees but one vector of phenotypic trait values for species.

> require(phytools) # load phytools & ape> trees<-rmtree(10,50) # 10 random trees> x<-fastBM(trees[[1]]) If we are reading data from file, x should be a vector with the phenotypic trait values for species in which names(x) contains the tip names in the tree. Now, we can use the base function sapply() to get a vector of K values for each tree in our set (of course, in this example, all the trees except the 1st are random with respect to the phenotypic data in x). Good question. Diagnostics_v3.