Thursday, April 27, 2017

Slanted phylogram & cladogram densityTree plotting using phytools

Adding a slanted phylogram (aka. 'cladogram') method to plotSimmap, as I did yesterday, had the unintented but immediate effect of permitting us to very closely approximate the slanted tree style of both the original DensiTree software & Klaus Schliep's densiTree function of the phangorn R package.

Here is what that looks like using phytools:

## [1] '0.6.11'
## 99 phylogenetic trees

plot of chunk unnamed-chunk-1

We can do the same with stochastic map trees. For instance:


plot of chunk unnamed-chunk-2

## [1] TRUE

We need to set the node position to "intermediate" because the default for densityTree, as I mentioned in a previous post, is "inner" - but this works much better for a square phylogram than a slanted one!

Note that I also had to fix add.simmap.legend to permit the legend to plot correctly when our axis is flipped, as is done for densityTree plots.

We can also show just the topological incongruence among trees as follows:


plot of chunk unnamed-chunk-3

For this one, I used nodes="centered" and increaed the alpha transparency level over its default (1/N) simply because there is so little topological incongruence in our set of trees that it is otherwise hard to see.

That's it for now.

No comments:

Post a Comment

Note: due to the very large amount of spam, all comments are now automatically submitted for moderation.