marbl / MetagenomeScope

Visualization tool for (meta)genome assembly graphs
https://marbl.github.io/MetagenomeScope/
GNU General Public License v3.0
24 stars 8 forks source link

Clean up coordinate rotation / conversion code + fix inaccuracies in component tiling #198

Open fedarko opened 3 years ago

fedarko commented 3 years ago

Goals with tiling:

Long story short, coordinates are currently mostly stored as negative numbers -- this is a weird artifact of 1) rotating coordinates from going from top -> bottom to left -> right, and 2) switching from Graphviz coordinates to Cytoscape.js coordinates (which inverts the y-axis). The current Python code for dealing with this kind of works, but it's not very pleasant code to read, it makes writing JS code dealing with these coordinates / component tiling difficult, and there are some inaccuracies as shown above.

The ideal solution would be converting coordinates in such a way as to make them all use positive numbers, even after doing the rotation and conversion to Cytoscape.js space (so with (0, 0) being at the top left of the screen). Once this is done, hopefully fixing component tiling should be more straightforward.