I just posted a new version of the function
mergeMappedStates that can "merge" a set of states with only one entry into a new state (basically, change the name of state mapped on the tree). This might be useful for (for example) converting a tree with mapped states a, b, and c into one with two states: a & not-a (coded as 0 & 1, perhaps) for use with
This function version is available in a new phytools build (phytools 0.3-21).
Let's try and use the function to do exactly that:
Loading required package: phytools
> ## simulate tree & character data
> ## simulate stochastic histories
make.simmap is sampling character histories conditioned on the transition matrix
a b c
a -2.433741 1.216870 1.216870
b 1.216870 -2.433741 1.216870
c 1.216870 1.216870 -2.433741
(estimated using likelihood);
and (mean) root node prior probabilities
a b c
0.3333333 0.3333333 0.3333333
> ## now let's merge states to make a "a"/"not-a" set of trees
sorry - this might take a while; please be patient
I'm also posting a series of tutorials that will form the basis of the computer exercises I will lead this week at the NESCent Academy Evolutionary Quantitative Genetics Workshop in Durham NC this week. I have put draft version of three of these up so far. Check them out here. These tutorials were all created using knitr and have not yet been proofed thoroughly.
Post a Comment
Note: due to the very large amount of spam, all comments are now automatically submitted for moderation.