Tuesday, September 3, 2013

New version of plotTree that doesn't need branch lengths

I just posted a new version of phytools (phytools 0.3-43) that can plot a phylogenetic tree even if branch lengths are not provided by the user. This was really trivial & I meant to do it ages ago. Basically, it just calls ape's compute.brlen internally, and then plots the tree as normal. E.g.,

> require(phytools)
Loading required package: phytools
> packageVersion("phytools")
[1] ‘0.3.43’
> tree<-pbtree(n=26)
> tree$tip.label<-LETTERS[1:26]
> tree$edge.length<-NULL # strip branch lengths
> plotTree(tree)

It also now (like plotSimmap) sets the environmental variable "last_plot.phylo" in the environment .PlotEnvPhylo by default - so we can do this:

> nodelabels()
which can be handy.

No comments:

Post a Comment

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