Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Edge colouring with vector containing continuous data #105
This is probably the wrong place to post this question, but I've been stuck with this problem for quite some time and so I thought I might ask here for help. Apologies in advance, if I should have posted this somewhere else.
I have a phylogenetic tree in "phylo" format and a vector with continuous data that corresponds to the branch/endge lengths of my tree. The continuous data values in the vector are in the same order as the edge lengths on the tree. I would like to colour the branch lengths of my tree according to the continuous data values of my vector. The output tree should look somewhat similar to the "Color tree" shown here:
I managed to produce such a tree with phytools, following this tutorial:
But when I try to do this with ggtree, I always get stuck somewhere. I've tried to convert my tree and the associated data into a phylo4d object (see #76), but when i do this the order of the continuous data points no longer corresponds to the original branch lengths. I've also tried to produce a jplace file, but that does not seem to work either for me.
I'm pretty sure there's probably a straightforward way of doing this in ggtree, but currently I just cannot see it. Could you help me with that? Apologies again for the silly question.
Here contains more examples you may find useful.
The data has been applied to the correct branches!
Thank you very much for your comment: Yes, indeed, that's how I did it (see also https://groups.google.com/forum/#!topic/bioc-ggtree/4GgivKqVjB8).
I'll close this issue.