AliTVTeam / AliTV

Visualize whole genome alignments as linear maps
https://alitvteam.github.io/AliTV/d3/AliTV.html
MIT License
69 stars 11 forks source link

Order of link display #172

Closed ambenj closed 3 years ago

ambenj commented 3 years ago

Hello! Is it possible to change the order in which the links display? I'm using AliTV to look at a region containing gene duplications and it seems that the links on top are the ones with earlier coordinates. However for my region these earlier coordinate links also have lower identity and makes it hard to see the ones with higher identity (even after playing around with filtering and opacity). Is it possible to display the links so the ones with highest identity are on top in the display order? Thanks!

iimog commented 3 years ago

This is an excellent question. Links being hidden by other links is a problem we faced in the past as well. Currently, AliTV draws the links in the order they appear in the json (which is the order given by the alignment program) and in svg this order is used implicitly: https://www.w3.org/TR/SVG11/render.html#RenderingOrder

I will have a look into ordering by identity (or length, or both) in the javascript frontend. Until then, one thing you can do to deal with this issue in a specific setting is using "right click > hide" to hide the link you are not interested in (I know, not an ideal solution).

iimog commented 3 years ago

I added a checkbox "draw links ordered by identity" to the web interface under "Layout Settings > Change parameters for links". When you check that box and click "Apply", links will be drawn ordered by identity (so links with higher identity will be drawn above links with lower identity). As this might not always be the desired behavior I decided to add it as an option. Let me know if that resolves your issue or if you have other ideas for improvement.

ambenj commented 3 years ago

Thanks so much for your quick response! The checkbox to change the display order helps a lot.

iimog commented 3 years ago

Awesome!