Skip to content

Commit

Permalink
update to be in sync
Browse files Browse the repository at this point in the history
with new data
with new libs
  • Loading branch information
drseb committed Dec 14, 2017
1 parent 2d5eb45 commit 3620fed
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 26 deletions.
8 changes: 4 additions & 4 deletions src/hpoweb/HpowebUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import com.vaadin.ui.Window;
import com.vaadin.ui.themes.ValoTheme;

import hpo.DiseaseId;
import hpo.ItemId;
import hpoweb.data.HpData;
import hpoweb.data.dataprovider.IDiseaseDataProvider;
import hpoweb.data.dataprovider.IEntityDataProvider;
Expand Down Expand Up @@ -286,7 +286,7 @@ else if (parameterMap.containsKey(CONSTANTS.geneRequestId)) {
}
else if (parameterMap.containsKey(CONSTANTS.diseaseRequestId)) {

DiseaseId diseaseId = parseDiseaseId(request);
ItemId diseaseId = parseDiseaseId(request);
if (diseaseId == null && doParseHpo) {
new Notification("Invalid disease id input",
"<br/><br/>Can't parse disease id from '" + request.getParameter(CONSTANTS.geneRequestId) + "'",
Expand Down Expand Up @@ -433,12 +433,12 @@ private Integer parseGeneId(VaadinRequest request) {
return geneIdInt;
}

private DiseaseId parseDiseaseId(VaadinRequest request) {
private ItemId parseDiseaseId(VaadinRequest request) {
if (!doParseHpo)
return null;
String diseaseIdStr = request.getParameter(CONSTANTS.diseaseRequestId);

DiseaseId diseaseId = new DiseaseId(diseaseIdStr);
ItemId diseaseId = new ItemId(diseaseIdStr);
if (!hpData.getAnnotationUtils().getDiseaseId2entry().containsKey(diseaseId)) {
return null;
}
Expand Down
8 changes: 4 additions & 4 deletions src/hpoweb/data/dataprovider/LazySearchbarService.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

import de.charite.phenowl.annotations.AnnotationUtils;
import de.charite.phenowl.hpowl.util.OboUtil;
import hpo.DiseaseEntry;
import hpo.DiseaseGeneMapper;
import hpo.DiseaseId;
import hpo.Item;
import hpo.ItemId;
import hpoweb.data.HpData;
import hpoweb.data.entities.SearchableEntity;
import hpoweb.data.entities.SearchableEntity.SearchableEntityType;
Expand Down Expand Up @@ -89,8 +89,8 @@ public LazySearchbarService(HpData hpdata) {
* Diseases
*/
AnnotationUtils annotationUtils = hpdata.getAnnotationUtils();
for (DiseaseId id : annotationUtils.getDiseaseId2entry().keySet()) {
DiseaseEntry diseaseEntry = annotationUtils.getDiseaseId2entry().get(id);
for (ItemId id : annotationUtils.getDiseaseId2entry().keySet()) {
Item diseaseEntry = annotationUtils.getDiseaseId2entry().get(id);
String diseaseId = diseaseEntry.getDiseaseIdAsString();
String searchAble = diseaseId + " " + diseaseEntry.getName();

Expand Down
6 changes: 3 additions & 3 deletions src/hpoweb/data/dataprovider/impl/DiseaseDataProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import de.charite.phenowl.annotations.HPOAnnotation;
import de.charite.phenowl.annotations.OwlAnnotatedDiseaseEntry;
import de.charite.phenowl.hpowl.util.OboUtil;
import hpo.DiseaseId;
import hpo.ItemId;
import hpoweb.data.HpData;
import hpoweb.data.dataprovider.IDiseaseDataProvider;
import hpoweb.data.entities.DiseaseGene;
Expand All @@ -24,13 +24,13 @@ public class DiseaseDataProvider implements IDiseaseDataProvider {

private HpData hpData;
private AnnotationUtils annotationUtils;
private DiseaseId diseaseId;
private ItemId diseaseId;
private OwlAnnotatedDiseaseEntry diseaseEntry;
private ArrayList<HPOAnnotation> annotations;
private HashSet<Integer> diseaseGeneIds;
private HashSet<DiseaseGene> diseaseGenes;

public DiseaseDataProvider(DiseaseId diseaseId, HpData hpData) {
public DiseaseDataProvider(ItemId diseaseId, HpData hpData) {
this.hpData = hpData;
this.diseaseId = diseaseId;
this.annotationUtils = hpData.getAnnotationUtils();
Expand Down
4 changes: 2 additions & 2 deletions src/hpoweb/data/dataprovider/impl/FakeGeneDataProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import com.google.gwt.thirdparty.guava.common.collect.Lists;

import de.charite.phenowl.annotations.OwlAnnotatedDiseaseEntry;
import hpo.DiseaseId;
import hpo.ItemId;
import hpoweb.data.dataprovider.IGeneDataProvider;
import hpoweb.uicontent.table.HpoClassTableEntry;

Expand Down Expand Up @@ -54,7 +54,7 @@ public List<HpoClassTableEntry> getAssociatedHpoClasses() {
@Override
public Collection<OwlAnnotatedDiseaseEntry> getAssociatedDiseases() {

DiseaseId id = new DiseaseId("OMIM", RandomStringUtils.randomNumeric(6));
ItemId id = new ItemId("OMIM", RandomStringUtils.randomNumeric(6));
OwlAnnotatedDiseaseEntry entry = new OwlAnnotatedDiseaseEntry(id, null, null);
entry.setName(RandomStringUtils.randomAlphabetic(8) + " " + RandomStringUtils.randomAlphabetic(4) + " syndrome");
return Lists.newArrayList(entry);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import com.google.common.collect.ImmutableSet;

import de.charite.phenowl.annotations.OwlAnnotatedDiseaseEntry;
import hpo.DiseaseId;
import hpo.ItemId;
import hpoweb.data.dataprovider.IHpClassDataProvider;
import hpoweb.data.entities.DiseaseGene;
import hpoweb.uicontent.graph.GraphtestUI;
Expand Down Expand Up @@ -140,7 +140,7 @@ else if (Math.random() < 0.6) {
}

private OwlAnnotatedDiseaseEntry getRandomDisease() {
DiseaseId id = new DiseaseId("OMIM", RandomStringUtils.randomNumeric(6));
ItemId id = new ItemId("OMIM", RandomStringUtils.randomNumeric(6));
OwlAnnotatedDiseaseEntry entry = new OwlAnnotatedDiseaseEntry(id, null, null);
entry.setName(RandomStringUtils.randomAlphabetic(8) + " " + RandomStringUtils.randomAlphabetic(4) + " syndrome");
return entry;
Expand Down
8 changes: 4 additions & 4 deletions src/hpoweb/data/dataprovider/impl/GeneDataProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import de.charite.phenowl.annotations.AnnotationUtils;
import de.charite.phenowl.annotations.OwlAnnotatedDiseaseEntry;
import de.charite.phenowl.hpowl.util.OboUtil;
import hpo.DiseaseEntry;
import hpo.DiseaseId;
import hpo.Item;
import hpo.ItemId;
import hpoweb.data.HpData;
import hpoweb.data.dataprovider.IGeneDataProvider;
import hpoweb.uicontent.table.HpoClassTableEntry;
Expand All @@ -34,7 +34,7 @@ public GeneDataProvider(Integer geneId, HpData hpData) {
hpClass2annotatedDiseases = HashMultimap.create();
associatedDiseases = new ArrayList<OwlAnnotatedDiseaseEntry>();
if (util.getDiseaseGeneMapper().entrezId2diseaseIds.containsKey(geneId)) {
for (DiseaseId diseaseId : util.getDiseaseGeneMapper().entrezId2diseaseIds.get(geneId)) {
for (ItemId diseaseId : util.getDiseaseGeneMapper().entrezId2diseaseIds.get(geneId)) {
if (!util.getDiseaseId2entry().containsKey(diseaseId))
continue;
OwlAnnotatedDiseaseEntry entry = util.getDiseaseId2entry().get(diseaseId);
Expand Down Expand Up @@ -73,7 +73,7 @@ public List<HpoClassTableEntry> getAssociatedHpoClasses() {
String hpoId = OboUtil.IRI2ID(cls.getIRI());
String hpoLabel = hpData.getExtOwlOntology().getLabel(cls.getIRI());
String description = "This annotation is supported by:<br>";
for (DiseaseEntry e : hpClass2annotatedDiseases.get(cls)) {
for (Item e : hpClass2annotatedDiseases.get(cls)) {
description += " - " + e.getName() + "<br>";
}
HpoClassTableEntry entry = new HpoClassTableEntry(hpoId, hpoLabel, description);
Expand Down
14 changes: 7 additions & 7 deletions src/hpoweb/data/dataprovider/impl/HpClassDataProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import de.charite.phenowl.annotations.OwlAnnotatedDiseaseEntry;
import de.charite.phenowl.hpowl.util.ExtendedOwlOntology;
import de.charite.phenowl.hpowl.util.OboUtil;
import hpo.DiseaseEntry;
import hpo.DiseaseId;
import hpo.Item;
import hpo.ItemId;
import hpoweb.data.HpData;
import hpoweb.data.dataprovider.IHpClassDataProvider;
import hpoweb.data.entities.DiseaseGene;
Expand All @@ -36,7 +36,7 @@ public class HpClassDataProvider implements IHpClassDataProvider {
private Set<String> synonyms;
private String textdef;
private String logicaldef;
private HashSet<DiseaseId> associatedDiseaseIds;
private HashSet<ItemId> associatedDiseaseIds;
private AnnotationUtils utils;
private HashSet<Integer> associatedGeneIds;

Expand Down Expand Up @@ -158,8 +158,8 @@ public List<DiseaseGeneTableEntry> getDiseaseGeneTableContent() {
if (this.associatedDiseaseIds == null)
return tableentries;

for (DiseaseId dID : this.associatedDiseaseIds) {
DiseaseEntry entry = utils.getDiseaseId2entry().get(dID);
for (ItemId dID : this.associatedDiseaseIds) {
Item entry = utils.getDiseaseId2entry().get(dID);
String diseaseId = dID.toString();
String diseaseName = entry.getName();
ArrayList<DiseaseGene> associatedGenes = new ArrayList<DiseaseGene>();
Expand Down Expand Up @@ -187,10 +187,10 @@ public List<GeneDiseaseTableEntry> getGeneDiseaseTableContent() {
String geneSymbol = utils.getDiseaseGeneMapper().entrez2symbol.get(geneId);

ArrayList<OwlAnnotatedDiseaseEntry> associatedDiseases = new ArrayList<OwlAnnotatedDiseaseEntry>();
HashSet<DiseaseId> diseaseIds = utils.getDiseaseGeneMapper().entrezId2diseaseIds.get(geneId);
HashSet<ItemId> diseaseIds = utils.getDiseaseGeneMapper().entrezId2diseaseIds.get(geneId);

if (diseaseIds != null)
for (DiseaseId diseaseId : diseaseIds) {
for (ItemId diseaseId : diseaseIds) {
if (utils.getDiseaseId2entry().containsKey(diseaseId)) {
OwlAnnotatedDiseaseEntry diseaseentry = utils.getDiseaseId2entry().get(diseaseId);
associatedDiseases.add(diseaseentry);
Expand Down

0 comments on commit 3620fed

Please sign in to comment.