TheJacksonLaboratory / HPOworkbench

Human Phenotype Ontology Workbench
http://hpo-workbench.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
15 stars 8 forks source link

Move HPO tab code into separate controller, fix bug with property value removal. Add optional resources for Mondo support #32

Closed ielis closed 6 years ago

ielis commented 6 years ago

Hi Peter,

I found the bug with Properties. The contract of setProperty doesn't allow to use null neither as key nor as value. We need to use method remove in order to remove the property.

I've also done some progress in the Mondo tab. The Mondo ontology file is being downloaded, but there is some Exception being thrown in the process of parsing of the obo file.

[Thread-4] TRACE (Downloader.java:85) - LocalFilePath: /home/ielis/.hpoworkbench/mondo.obo
[Thread-4] TRACE (Downloader.java:91) - Size of file to be downloaded: 21393894
[Thread-4] INFO  (Downloader.java:103) - Successful download from https://osf.io/e87hn/download: 21393894(21393894) bytes read.
[JavaFX Application Thread] TRACE (MainController.java:184) - Successfully downloaded mondo to /home/ielis/.hpoworkbench
ERROR - 2018-03-26 23:40:07 - /home/ielis/ielis/HPOworkbench/src/main/resources/curie_map.yaml (No such file or directory)
java.io.FileNotFoundException: /home/ielis/ielis/HPOworkbench/src/main/resources/curie_map.yaml (No such file or directory)
    at java.io.FileInputStream.open0(Native Method)
    at java.io.FileInputStream.open(FileInputStream.java:195)
    at java.io.FileInputStream.<init>(FileInputStream.java:138)
    at java.io.FileInputStream.<init>(FileInputStream.java:93)
    at org.monarchinitiative.phenol.io.utils.CurieMapGenerator.generate(CurieMapGenerator.java:27)
    at org.monarchinitiative.phenol.io.owl.OwlImmutableOntologyLoader.<init>(OwlImmutableOntologyLoader.java:60)
    at org.monarchinitiative.hpoworkbench.io.MondoParser.parse(MondoParser.java:38)
    at org.monarchinitiative.hpoworkbench.io.MondoParser.<init>(MondoParser.java:27)
    at org.monarchinitiative.hpoworkbench.controller.MainController.lambda$downloadMondo$2(MainController.java:187)
    at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
    at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
    at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
    at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
    at javafx.event.Event.fireEvent(Event.java:198)
    at javafx.concurrent.EventHelper.fireEvent(EventHelper.java:219)
    at javafx.concurrent.Task.fireEvent(Task.java:1356)
    at javafx.concurrent.Task.setState(Task.java:723)
    at javafx.concurrent.Task$TaskCallable.lambda$call$501(Task.java:1434)
    at com.sun.javafx.application.PlatformImpl.lambda$null$172(PlatformImpl.java:295)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$173(PlatformImpl.java:294)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
    at com.sun.glass.ui.gtk.GtkApplication.lambda$null$48(GtkApplication.java:139)
    at java.lang.Thread.run(Thread.java:748)
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
    at org.prefixcommons.CurieUtil.<init>(CurieUtil.java:24)
    at org.monarchinitiative.phenol.io.owl.OwlImmutableOntologyLoader.<init>(OwlImmutableOntologyLoader.java:60)
    at org.monarchinitiative.hpoworkbench.io.MondoParser.parse(MondoParser.java:38)
    at org.monarchinitiative.hpoworkbench.io.MondoParser.<init>(MondoParser.java:27)
    at org.monarchinitiative.hpoworkbench.controller.MainController.lambda$downloadMondo$2(MainController.java:187)
    at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
    at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
    at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
    at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
    at javafx.event.Event.fireEvent(Event.java:198)
    at javafx.concurrent.EventHelper.fireEvent(EventHelper.java:219)
    at javafx.concurrent.Task.fireEvent(Task.java:1356)
    at javafx.concurrent.Task.setState(Task.java:723)
    at javafx.concurrent.Task$TaskCallable.lambda$call$501(Task.java:1434)
    at com.sun.javafx.application.PlatformImpl.lambda$null$172(PlatformImpl.java:295)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$173(PlatformImpl.java:294)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
    at com.sun.glass.ui.gtk.GtkApplication.lambda$null$48(GtkApplication.java:139)
    at java.lang.Thread.run(Thread.java:748)

It doesn't look like that the cause for the Exception is missing mondo.obo but some part of parsing code which I am not familiar with. I think, that after resolving this issue, we should be able to get the Mondo ontology support working very soon.

Cheers, Daniel

ielis commented 6 years ago

Oh, and I forgot to mention - it looks like that the default link for HPO download https://raw.githubusercontent.com/obophenotype/human-phenotype-hpoOntology/master/hp.obo located in hpowbgui/src/main/resources/application.properties looks like that it is broken.

I'm not able to download the file neither using wget nor Firefox

pnrobinson commented 6 years ago

I have added a bunch of code to get Mondo and show corresponding OMIM and ORPHA annotations as available. It is beginning to work but there are still inconsistencies. I will merge this for now.