biocore / empress

A fast and scalable phylogenetic tree viewer for microbiome data analysis
BSD 3-Clause "New" or "Revised" License
48 stars 31 forks source link

Create a dotted line linking tips to barplot #366

Open kwcantrell opened 4 years ago

kwcantrell commented 4 years ago

It would be nice to have a dotted line (like what iTol does) that links tips in the tree to locations on the bar plots. Currently, it is difficult to see exactly which part of the bar plot corresponds to which tip on the tree.

kwcantrell commented 4 years ago

For large tree, drawing a dotted line for each tip might not be the best option so, another option would be if the user clicks on the bar plot, the tip associated with that part of the bar plot gets highlighted.

gibsramen commented 4 years ago

In iTOL you can mouse over the barplot and it displays the node name and value of the corresponding layer.

image

fedarko commented 3 years ago

Some ideas for this:

ElDeveloper commented 3 years ago

These are great ideas! I would suggest that instead of drawing all the dotted lines for the descendants of an internal node you draw a "wedge" that shows the leftmost and rightmost (or topmost/bottommost) nodes in the subtree. I think that for a group of tips it's more important to see the area covered rather than all of the individual lines, right?

On (Nov-27-20|15:46), Marcus Fedarko wrote:

Some ideas for this:

  • Dotted lines should be drawn when a node/nodes are selected, similarly to the circumstances when green circles showing the positions of selected nodes are drawn. We could also probably support just having dotted lines drawn at all times, but I think that would be 1) slow and 2) hard to look at for large trees (since visually distinguishing dotted lines from each other might be tricky).

  • We should be able to draw dotted lines for multiple tips at once:

    • If a tip is selected, then we just draw a dotted line for this tip, as planned.

    • If an internal node is selected, then we should draw dotted lines for all of the descendant tips of that internal node (this would pair really well with barplots, since we can easily see e.g. "oh the tips descending from this node are all members of Synechococcus" or whatever). See mockup below. mockup2

    • If multiple internal nodes are selected, we should draw dotted lines for all of the descendant tips of all of these internal nodes.

  • There should be an option in the Settings to turn "Draw dotted lines for selected / descendant tips" on/off. I am not sure if we should default to having this on or off; for massive trees, I could imagine drawing dotted lines being a problem, esp. if the user clicks on the root node of the tree (in which case we would draw a dotted line for every tip in the tree). This might be a case where we could default to "yes do draw dotted lines", and then once the tree being visualized gets big enough we could make it default to "no don't do that".

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://urldefense.com/v3/__https://github.com/biocore/empress/issues/366*issuecomment-735012637__;Iw!!Mih3wA!Q0ebVvDvMCd-x7uQd8yCkF49sT7Y-vETFHV0TLuWGwEK1Q_tEtb-V-Wi42zuZSc$

fedarko commented 3 years ago

That seems like a better way of doing things! Yeah, that would totally work :D I think we can probably reuse some of the code from clade collapsing to figure out the leftmost / rightmost nodes in a clade, and then draw dotted lines for those nodes. This would scale really well, since even if the root node is selected then we'd just draw two dotted lines (one at each "end" of the tree).

... OK, so now all that's left is implementing this ;)

ChrisKeefe commented 3 years ago

Just a bump for this feature. I love love love that this is already on your radar! I have a couple of nasty-long branches in this plot, and the extra space they add between the tree and the barplot limits interpretability a bit:

image

Super impressed with this viz so far, btw. :heart_eyes_cat: Awesome work all!

kwcantrell commented 3 years ago

@ChrisKeefe this feature has been on my todo list. In the meantime, you can align the tips of the tree with the barplot by selecting Make ultrametric under the Branch Length section of the Layout tab. It wont preserve the branch lengths but it will at least allow you to see which bars go to which tips.