Reputation: 129
I need to paint manually some phylogenetic trees into two regimes, "0" and "1". I found out that it is possible to do that with the functions paintSubTree()
and paintBranches()
from the phytools
package. The problem is that by using these functions, one can paint the trees only by specific branches or nodes:
library(ape)
library(phytools)
tree <- rtree(4)
tree <- paintBranches(tree = tree, edge = 4, state = "1", anc.state="0")
plotSimmap(tree,lwd=4)
I need to paint the tree according to the edge.length, e.g., at time 0.7 (so that only the middle of branch t4 would be red). Is there a function that could be used for that purpose?
Upvotes: 3
Views: 164
Reputation: 1
If all you want is a way to visualize a single branch that is changing halfway down the branch, and you don't want to incorporate it into the structure of the tree, you can do this using identifyBranches in the package bayOU. It's an interactive function that allows you to click on a branch, and if you set plot.simmap = T in the function call, it will change the color of the tree below the clicked region.
Upvotes: 0