I just
posted
an update to the new function dotTree
that I documented in
yesterday's
post.
This update comes from two places. First, from the fact that for non-ultrametric
trees the visualization using the previous version of dotTree
looks kind of weird. For instance:
library(phytools)
tree<-rtree(n=26,tip.label=LETTERS)
x<-fastBM(tree)
dotTree(tree,x)
It is not terrible, but it would be better if all the plotted tip states lined up at the same place.
Next, when I posted this to Facebook (and, actually in the original email that inspired this method), there was a request to add multiple traits. Putting these betweem the end of the tip and the tip label seemed pretty impractical.
With these factors in consideration, I decided to try a different internal
plotting method - the same one that is used in the phytools function plotting
method for objects of class "cophylo"
(e.g.,
here).
This is what that looks like for the same data:
dotTree(tree,as.matrix(x),method="phylogram")
Using this method internally & moving the dots to the right of the plotted tip labels also makes it very convenient to show multiple traits, which I also added as a feature. For example:
X<-fastBM(tree,nsim=10)
dotTree(tree,X)
Once again, this doesn't look very good for trees with more than 60 or 70 taxa:
tree<-rtree(n=60)
X<-fastBM(tree,nsim=12)
dotTree(tree,X,fsize=0.7,cex=0.7)
I should warn that there are certainly some bugs still being worked out (some were discovered in the writing of this post), & feedback on bugs, as well as feedback generally, is welcome.
The easiest way to use this function is to update phytools from GitHub using the devtools package, e.g.:
library(devtools)
install_github("liamrevell/phytools")
No comments:
Post a Comment
Note: due to the very large amount of spam, all comments are now automatically submitted for moderation.