-
Notifications
You must be signed in to change notification settings - Fork 177
Trying to add a SINGLE circular ring to a tree #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
how about this trick: library(ggtree)
set.seed(1234)
tr=rtree(50)
geom_strip = function(...) geom_cladelabel(label="", barsize=5, align=T, offset=.5, ...)
ggtree(tr) + geom_strip(58, color='red') + geom_strip(84, color='green') + geom_strip(52, color='blue') |
This sort of addresses the problem. However I am still not sure how to deal with this as my data relates tip labels to taxonomic names (at the phyla level). Thus I first have to find the MRCA of a given phyla however often its not mono-phyletic. Therefore the results are incorrect. It would be easier if I could use the %<+% opperator to associate the phyla names to the tips and then just call a geom_strip function. Do you have any suggestions? |
So I found a workaround - a package called MonoPhy that will estimate the MRCA despite non monophyletic clades. So I can use that... Its a pretty big work around though, it would be much easier if you could just associate a color with the tips as a bar. |
wow, just realize you request a pull. Thanks, I will review your code tomorrow. |
I think I like your solution with geom_strip much better for my research! That said the pull request may be helpful as it fixes what i would consider a small bug with gheatmap function. Thank you again for the wonderful work you are doing!
|
merged & thanks |
First off, thank you for creating this wonderful package!
I am trying to add a color strip (in the style of iTOL) to my circular tree. I currently just want to define a single variable "phylum" as the coloring for that ring/heatmap.
(1) this gives an error as I think gheatmap only expects to get a dataframe with more than 1 column. (The rownames of my dataframe line up with tip labels of the tree).
(2) I agree with andersgs (#39), I think this may deserve its own function (e.g., geom_ring or geom_strip). I find the current method awkward.
I think (1) is more important than (2) obviously.
So far this is the best I have been able to come up with. I have had to double one of the columns and shrink the width. I also notice the color is washed out (looks like low alpha) which I think is because there are so many taxa and the cell borders are getting in the way.
Again I think iTOL like functionality would be wonderful for this type of comparative genomics.
The text was updated successfully, but these errors were encountered: