schneebergerlab / plotsr

Tool to plot synteny and structural rearrangements between genomes
MIT License
282 stars 28 forks source link

Getting pixel coordinates/feature relationships/building an imagemap #73

Open scottcain opened 10 months ago

scottcain commented 10 months ago

This is probably a pretty niche request, but I'd like to build an html imagemap for images created by plotsr so that I can use images created by plotsr as a portal into JBrowse 2 to display more details about rearrangements. Is there a way to get that info out of plotsr? Presumably at some point, plotsr knows this information while it's drawing; I'd like to get that info dumped out.

To get an idea of what I'm thinking about, I can show you this:

https://riccio.d2jjb0xowet5mr.amplifyapp.com/multiple_alignment.html

where there are partial imagemaps for chromosomes II, III, and IV, mostly for inversions. I manually created these imagemaps and then manually figured out the coordinates on each genome to create a url into JBrowse 2 to display the rearrangements. It would be really great if I could programmatically generate the imagemaps and urls!

(Also note for the future: the above url is unlikely to exist forever as it is really more of a testing tool that will end up going somewhere else once I have it all sorted out.)

mnshgl0110 commented 9 months ago

Sure, I would be happy to help. So, if I understand correctly, you would need mapping between image coordinate and genomic positions of rearrangements? And the image coordinates would need to be with respect to the entire figure and not just the plotted axis?

scottcain commented 9 months ago

Yes, exactly. Then I could use a script to generate client side image maps.

mnshgl0110 commented 9 months ago

Cool. I will try to set it up.