-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix ROI deletion feature #1880
Fix ROI deletion feature #1880
Conversation
const features = await set.getFeatures(chr, start, end) | ||
|
||
for (let feature of features) { | ||
if (feature.chr === chr && feature.start >= start && feature.end <= end) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this line was causing the issue as it was not an exact match for start and end but we don't need this method now.
FYI @turner |
@milandomazet can you clarify what you mean by " when a user defines a ROI over a ROI provided through config "? What do you mean by over here? |
@turner as you can see in the video basically the user defined region contains the previously provided region. For example region provided through config is |
@milandomazet I did a test with your igvjs code in igv-web app. I pre-configured the app with a single ROI:
I then created a user-defined ROI: I then deleted the user-defined ROI. It is correctly deleted and is nolonger visible in the table or in the browser. When I saved the session The user-generated ROI is present in the session file with an empty feature list:
|
@turner thanks for the feedback! To be honest I've never used session saving so I was not even checking this. Great point not just for this PR but for any future things I might do on IGV.js :) Let me know if you see any issues with this approach. |
Hello, this PR fixes a bug related to deletion of (user defined) ROIs. As we've moved
roiSet
to themenuItems
method ofROIMenu
we can now directly delete the ROI in question as there was a bug in finding the exact ROI (and its set) a user selected.As can be seen in the video when a user defines a ROI over a ROI provided through config and then tries to delete it, the ROI provided through config gets deleted instead of the user defined one. In addition the ROI table was not being updated accordingly when a ROI is deleted.
Screen.Recording.2024-09-02.at.20.21.21.mov