Monday, February 1, 2016

Update to dotTree visualization method for non-ultrametric trees & multiple traits

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:


plot of chunk unnamed-chunk-1

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:


plot of chunk unnamed-chunk-2

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:


plot of chunk unnamed-chunk-3

Once again, this doesn't look very good for trees with more than 60 or 70 taxa:


plot of chunk unnamed-chunk-4

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.:


No comments:

Post a Comment