From 52f6cd6dc727f413be085db7f719a346844cb3b9 Mon Sep 17 00:00:00 2001 From: drseb Date: Fri, 22 Apr 2016 13:53:19 +0200 Subject: [PATCH] update on disease-gene associations closes #17 closes #9 --- .../com.vaadin.integration.eclipse.prefs | 6 +- src/hpoweb/HpowebUI.java | 80 ++++++++----------- src/hpoweb/data/HpData.java | 2 +- 3 files changed, 39 insertions(+), 49 deletions(-) diff --git a/.settings/com.vaadin.integration.eclipse.prefs b/.settings/com.vaadin.integration.eclipse.prefs index 61d5711..a70e34d 100644 --- a/.settings/com.vaadin.integration.eclipse.prefs +++ b/.settings/com.vaadin.integration.eclipse.prefs @@ -1,5 +1,5 @@ -com.vaadin.integration.eclipse.previousCompileAction=theme +com.vaadin.integration.eclipse.previousCompileAction=both com.vaadin.integration.eclipse.useLatestNightly=false -com.vaadin.integration.eclipse.widgetsetCompilationEta=41585 -com.vaadin.integration.eclipse.widgetsetDirty=true +com.vaadin.integration.eclipse.widgetsetCompilationEta=190643 +com.vaadin.integration.eclipse.widgetsetDirty=false eclipse.preferences.version=1 diff --git a/src/hpoweb/HpowebUI.java b/src/hpoweb/HpowebUI.java index 3cf79f4..9315654 100644 --- a/src/hpoweb/HpowebUI.java +++ b/src/hpoweb/HpowebUI.java @@ -1,5 +1,25 @@ package hpoweb; +import hpoweb.data.HpData; +import hpoweb.data.dataprovider.IDiseaseDataProvider; +import hpoweb.data.dataprovider.IEntityDataProvider; +import hpoweb.data.dataprovider.IGeneDataProvider; +import hpoweb.data.dataprovider.IHpClassDataProvider; +import hpoweb.data.dataprovider.impl.DiseaseDataProvider; +import hpoweb.data.dataprovider.impl.FakeDiseaseDataProvider; +import hpoweb.data.dataprovider.impl.FakeGeneDataProvider; +import hpoweb.data.dataprovider.impl.FakeHpClassDataProvider; +import hpoweb.data.dataprovider.impl.GeneDataProvider; +import hpoweb.data.dataprovider.impl.HpClassDataProvider; +import hpoweb.data.entities.SearchableEntity; +import hpoweb.uicontent.SearchBarFactory; +import hpoweb.uicontent.graph.GraphtestUI; +import hpoweb.uicontent.tabs.disease.DiseaseTabFactory; +import hpoweb.uicontent.tabs.gene.GeneTabFactory; +import hpoweb.uicontent.tabs.hpoclass.HpoClassTabFactory; +import hpoweb.util.CONSTANTS; +import hpoweb.util.TableUtils; + import java.util.Map; import javax.servlet.annotation.WebServlet; @@ -38,25 +58,6 @@ import com.vaadin.ui.themes.ValoTheme; import de.charite.phenowl.annotations.DiseaseId; -import hpoweb.data.HpData; -import hpoweb.data.dataprovider.IDiseaseDataProvider; -import hpoweb.data.dataprovider.IEntityDataProvider; -import hpoweb.data.dataprovider.IGeneDataProvider; -import hpoweb.data.dataprovider.IHpClassDataProvider; -import hpoweb.data.dataprovider.impl.DiseaseDataProvider; -import hpoweb.data.dataprovider.impl.FakeDiseaseDataProvider; -import hpoweb.data.dataprovider.impl.FakeGeneDataProvider; -import hpoweb.data.dataprovider.impl.FakeHpClassDataProvider; -import hpoweb.data.dataprovider.impl.GeneDataProvider; -import hpoweb.data.dataprovider.impl.HpClassDataProvider; -import hpoweb.data.entities.SearchableEntity; -import hpoweb.uicontent.SearchBarFactory; -import hpoweb.uicontent.graph.GraphtestUI; -import hpoweb.uicontent.tabs.disease.DiseaseTabFactory; -import hpoweb.uicontent.tabs.gene.GeneTabFactory; -import hpoweb.uicontent.tabs.hpoclass.HpoClassTabFactory; -import hpoweb.util.CONSTANTS; -import hpoweb.util.TableUtils; @SuppressWarnings("serial") @Theme("hpoweb") @@ -142,13 +143,11 @@ protected void init(VaadinRequest request) { hpoClassTabFactory.addTermInfoElements(gridContainer, (IHpClassDataProvider) dataProvider); addExtraButtons(gridContainer, (IHpClassDataProvider) dataProvider); - } - else if (dataProvider instanceof IDiseaseDataProvider) { + } else if (dataProvider instanceof IDiseaseDataProvider) { DiseaseTabFactory diseaseTabFactory = new DiseaseTabFactory(tableUtils); diseaseTabFactory.addDiseaseInfoElements(gridContainer, (IDiseaseDataProvider) dataProvider); - } - else if (dataProvider instanceof IGeneDataProvider) { + } else if (dataProvider instanceof IGeneDataProvider) { GeneTabFactory geneTabFactory = new GeneTabFactory(tableUtils); geneTabFactory.addGeneInfoElements(gridContainer, (IGeneDataProvider) dataProvider); @@ -161,8 +160,7 @@ else if (dataProvider instanceof IGeneDataProvider) { String ontologyVersion; if (doParseHpo) { ontologyVersion = hpData.getExtOwlOntology().getOntologyVersionIri().toString(); - } - else + } else { ontologyVersion = "some ontology version here"; @@ -259,52 +257,44 @@ private IEntityDataProvider setupDataProvider(VaadinRequest request, Map
Can't parse gene id from '" + request.getParameter(CONSTANTS.geneRequestId) + "'", Notification.Type.ERROR_MESSAGE, - true).show(Page.getCurrent()); + new Notification("Invalid gene id input", "

Can't parse gene id from '" + request.getParameter(CONSTANTS.geneRequestId) + + "'", Notification.Type.ERROR_MESSAGE, true).show(Page.getCurrent()); return null; } if (doParseHpo) { dataProvider = new GeneDataProvider(geneId, hpData); - } - else { + } else { dataProvider = new FakeGeneDataProvider(); } - } - else if (parameterMap.containsKey(CONSTANTS.diseaseRequestId)) { + } else if (parameterMap.containsKey(CONSTANTS.diseaseRequestId)) { DiseaseId diseaseId = parseDiseaseId(request); if (diseaseId == null && doParseHpo) { - new Notification("Invalid disease id input", - "

Can't parse disease id from '" + request.getParameter(CONSTANTS.geneRequestId) + "'", - Notification.Type.ERROR_MESSAGE, true).show(Page.getCurrent()); + new Notification("Invalid disease id input", "

Can't parse disease id from '" + + request.getParameter(CONSTANTS.geneRequestId) + "'", Notification.Type.ERROR_MESSAGE, true).show(Page.getCurrent()); return null; } if (doParseHpo) { dataProvider = new DiseaseDataProvider(diseaseId, hpData); - } - else { + } else { dataProvider = new FakeDiseaseDataProvider(); } - } - else { + } else { new Notification("Invalid URL", "

You have to provide one URL parameter (" + CONSTANTS.hpRequestId + "," - + CONSTANTS.geneRequestId + ", or " + CONSTANTS.diseaseRequestId + ") ! ", Notification.Type.WARNING_MESSAGE, true) - .show(Page.getCurrent()); + + CONSTANTS.geneRequestId + ", or " + CONSTANTS.diseaseRequestId + ") ! ", Notification.Type.WARNING_MESSAGE, true).show(Page + .getCurrent()); return null; } return dataProvider; diff --git a/src/hpoweb/data/HpData.java b/src/hpoweb/data/HpData.java index a34bb8b..f4eabac 100644 --- a/src/hpoweb/data/HpData.java +++ b/src/hpoweb/data/HpData.java @@ -44,7 +44,7 @@ public HpData() { DiseaseGeneMapper.setOrphanetPath(datapath); annotationUtils.setDataPath(datapath); annotationUtils.parseAssociation(); - + annotationUtils.getDiseaseGeneMapper().addCancerGeneAssociationsToDiseaseGenes(); } public ExtendedOwlOntology getExtOwlOntology() {