lidaof / eg-react

WashU Epigenome Browser
https://epigenomegateway.wustl.edu
Other
66 stars 29 forks source link

Bug with Highlights in Session File #286

Closed joreynajr closed 1 year ago

joreynajr commented 1 year ago

Hello,

I've started working with Session Files but I found a funny bug. Let's say I highlight chr16:28845327-28864126, save the session, and reopen the session in a new browser instance. If I do this then I will definitely see a highlight for chr16:28845327-28864126 but if I navigate to any other chromosome with the same exact coordinates then I'll see a highlight at chrOTHER:28845327-28864126 even though it was not in my original session. I think the issue may lie within the JSON files which don't store the chromosome location:

image

Just hoping this can be fixed so I don't end up with highlights where they are not supposed to be.

Thanks in advance!

Joaquin

lidaof commented 1 year ago

Hi @joreynajr , thanks for reporting :) The start and end are not for the start or end position of a particular chromosome, they are actually for the whole genome context coordinates. you can the see the numbers are much bigger, so you should be be safe to go to other regions which should not be highlighted if you didn't highlight them.

image
joreynajr commented 1 year ago

Hi @lidaof, was I was hoping to do is create a python function where I could generate sessionFiles with a particular set of highlights. This would be very powerful from a visualization standpoint and there might be a workaround but I think it would be a great feature to have.

lidaof commented 1 year ago

Hi @joreynajr do you mean if you have a chrX:xxx-xxxx region, you want to know how to convert to start/end in your python script? it will depend on the genome, you can line up all the chromosomes, then for example 0 position in chr2 will be used by end of chr1 instead, same applied to other chrom and positions. let me know if I misunderstood your request. thanks!

joreynajr commented 1 year ago

No worries @lidaof, I think I found a nice workaround! Thanks for your quick responses and the great software!

lidaof commented 1 year ago

Great, thanks! @joreynajr