JetBrains-Research / jbr

JBR Genome Browser
https://doi.org/10.1093/bioinformatics/btab376
11 stars 0 forks source link

JBR Genome Browser - silently fails to open session file #15

Closed olegs closed 5 years ago

olegs commented 5 years ago

If problem happens during track information deserialisation, it is visible only in log fine, for example:

Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: No enum constant org.jetbrains.bio.browser.tracks.impl.Adjust.OFF
    at java.lang.Enum.valueOf(Enum.java:238)
    at org.jetbrains.bio.browser.tracks.impl.Adjust.valueOf(BigWigTrackView.kt)
    at org.jetbrains.bio.browser.file.BigTrackViewExtensionPoint.deserializeTo(TrackViewTypeExtensionPoints.kt:66)
    at org.jetbrains.bio.browser.file.TrackViewLoader.deserialize$jbr_base_main(TrackViewLoader.kt:191)
    at org.jetbrains.bio.browser.file.Session.tracksDeserializingInfo$jbr_base_main(Session.kt:84)
    at org.jetbrains.bio.browser.file.Session$Companion.open(Session.kt:182)
    at org.jetbrains.bio.browser.desktop.menu.RecentSessionsMenu$$special$$inlined$forEach$lambda$1.actionPerformed(Menus.kt:39)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
    at com.apple.laf.ScreenMenuItem.actionPerformed(ScreenMenuItem.java:125)
    at java.awt.MenuItem.processActionEvent(MenuItem.java:669)
    at java.awt.MenuItem.processEvent(MenuItem.java:628)
    at java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:357)
    at java.awt.MenuComponent.dispatchEvent(MenuComponent.java:345)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:763)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
    at java.awt.EventQueue$4.run(EventQueue.java:733)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
iromeo commented 5 years ago

Cannot reproduce the exception, I see errors in log file:

[Mar 25, 2019 14:40:37] Opening session /Users/romeo/work/tmp/issur_15.yaml
[Mar 25, 2019 14:40:37] ERROR TrackViewLoader No information how to deserialize 'ADJUST1:NONE' for BigWig (BIGWIG) in file:///Users/romeo/work/tmp/issur_15.yaml
[Mar 25, 2019 14:40:37] Open session: issur_15.yaml
[Mar 25, 2019 14:40:37] * Cleanup tracks
[Mar 25, 2019 14:40:37] * Set genome mm9
[Mar 25, 2019 14:40:37] * Clear history
[Mar 25, 2019 14:40:37] Loading tracks...

but session has been sucessfully opened + no exceptions occurred

olegs commented 5 years ago

Here is the session to reproduce:

---
version: 1
build: "hg38"
location: "chr1:6367832-6664800"
tracks:
- ADJUST: "OFF"
  BAR_PLOT: "true"
  COLOR: "#000080"
  COLOR_NEGATIVE_VALUE: "#000080"
  CUSTOM_SCALE_MAX: "NaN"
  CUSTOM_SCALE_MIN: "NaN"
  TITLE: "Reads"
  TRACKDATA_LENGTH_ADDITIVE: "true"
  TRACKVIEW_SOURCE_FILE: "https://artyomovlab.wustl.edu/publications/supp_materials/4Oleg/2019_sc_ATAC_seq_gxfer1_39174753087306/reads.bw"
  TRACK_PREF_HEIGHT: "30"
  Type: "BIGWIG"
iromeo commented 5 years ago

It silently fails only when using "Recent sessions" menu item, if File | Open Session than we get image

iromeo commented 5 years ago

I agree that both actions should provide the same user experience, but what do you expect here? "Adjust.OFF" issue is a bug in your extension point code, it has changed "ADJUST" serialization format but didn't care of support legacy format on deserialization. So we could: 1) Session opening a. Don't open session b. Open session ignoring failed params 2) Error logging: a. LOG error only into the log file b. Show Error message box per each error or collect all errors and show one error dialog with all error messages c. Show error/warning dialog without errors details just warning that not all session fields were successfully loaded and suggest to look log file for details + log all errors into log file

@olegs I suggest 1.b + 2.c.

olegs commented 5 years ago

We should provide the similar user experience in both cases. I rely fully on your decision in this case.

iromeo commented 5 years ago

Fixed #4791