Skip to content
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

Support coloring the tree by continuous feature metadata #405

Open
fedarko opened this issue Oct 1, 2020 · 0 comments
Open

Support coloring the tree by continuous feature metadata #405

fedarko opened this issue Oct 1, 2020 · 0 comments

Comments

@fedarko
Copy link
Collaborator

fedarko commented Oct 1, 2020

I thought there was an open issue for this, but can't find it. Anyway, this would be useful to have: each tip (with metadata, at least) would get assigned a color based on its numeric value for a given feature metadata field, with non-numeric / missing values remaining uncolored (or colored a specific "non-numeric" color, or hidden, I guess?)

Colors could be "propagated" up the tree from the tips by doing something like averaging all child nodes' values -- this should create a pretty gradient effect and (hopefully) be a meaningful way of representing this. (Could also support e.g. taking the median of child values, and there are probably lots of different ways of representing the "gradient" coloring.)

Inspired by this section of the ggtree manual which has a lot of pretty examples of trees colored using continuous data.

A lot of this should involve code reusable from continuous barplots, so hopefully this wouldn't be too much of a pain to add.

Also, this'd pair really well with #387, since many color maps include very light colors, which are hard to draw on a white background by themselves -- being able to draw a node and then draw a rectangle behind it of a given color would make this a lot clearer, probably.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant