Skip to content

Commit

Permalink
improve vis
Browse files Browse the repository at this point in the history
  • Loading branch information
koehlers committed Feb 26, 2018
1 parent 499f828 commit 56c5c39
Show file tree
Hide file tree
Showing 22 changed files with 375 additions and 135 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="false"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_DISABLED_BUILDER" value="org.eclipse.m2e.core.maven2Builder"/>
<mapAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS"/>
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
</launchConfiguration>
8 changes: 6 additions & 2 deletions .project
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,17 @@
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
<value>&lt;project&gt;/.externalToolBuilders/org.eclipse.m2e.core.maven2Builder.launch</value>
</dictionary>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
Expand Down
3 changes: 2 additions & 1 deletion .settings/com.vaadin.integration.eclipse.prefs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
com.vaadin.integration.eclipse.mavenAutoCompileWidgetset=true
com.vaadin.integration.eclipse.mavenLatestVersionsUpgrade=["7.6.8","7.7.3"]
com.vaadin.integration.eclipse.previousCompileAction=both
com.vaadin.integration.eclipse.useLatestNightly=false
com.vaadin.integration.eclipse.widgetsetCompilationEta=35476
com.vaadin.integration.eclipse.widgetsetCompilationEta=34834
com.vaadin.integration.eclipse.widgetsetDirty=false
eclipse.preferences.version=1
2 changes: 2 additions & 0 deletions WebContent/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/data/
/WEB-INF/

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions build/classes/hpoweb/widgetset/HpowebWidgetset.gwt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.5.1//EN" "http:https://google-web-toolkit.googlecode.com/svn/tags/2.5.1/distro-source/core/src/gwt-module.dtd">
<module>
<inherits name="com.vaadin.graph.GraphExplorerWidgetset" />


<inherits name="com.vaadin.DefaultWidgetSet" />
</module>
2 changes: 1 addition & 1 deletion ivy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<dependency org="com.vaadin" name="vaadin-client-compiler" rev="&vaadin.version;" conf="widgetset-compile->default" />
<dependency org="org.vaadin" name="viritin" rev="1.34" />
<dependency org="org.vaadin.addons" name="graph-explorer" rev="0.7.0" />
<dependency org="org.vaadin.addon" name="tableexport-for-vaadin" rev="1.5.1.5" />
<dependency org="org.vaadin.addon" name="tableexport-for-vaadin" rev="1.6.0" />
<dependency org="org.vaadin.addons" name="googleanalyticstracker" rev="2.1.0" />
<dependency org="com.github.vaadin4qbanos" name="jsclipboard" rev="1.0.2" />
<dependency org="com.sebworks" name="vaadstrap" rev="0.1.2" />
Expand Down
27 changes: 27 additions & 0 deletions src/hpoweb/data/HpData.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
package hpoweb.data;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.semanticweb.owlapi.model.IRI;
import org.semanticweb.owlapi.model.OWLClass;

import com.google.common.collect.HashMultimap;
import com.google.common.collect.ImmutableSet;
import com.vaadin.server.VaadinService;

import de.charite.phenowl.annotations.AnnotationUtils;
import de.charite.phenowl.hpowl.util.ExtendedOwlOntology;
import de.charite.phenowl.hpowl.util.OwlAxiomClass;
import hpo.DiseaseGeneMapper;
import hpoweb.uicontent.table.HpoClassTableEntry;

public class HpData {

Expand Down Expand Up @@ -57,4 +61,27 @@ public AnnotationUtils getAnnotationUtils() {
public ExtendedOwlOntology getExtOwlOntologyWithLogicalDefs() {
return extOwlOntologyWithLogicalDefs;
}

/**
* @param tableContent
* @return
*/
public HashMultimap<OWLClass, OWLClass> getLevelOneBins(List<HpoClassTableEntry> tableContent) {

HashMultimap<OWLClass, OWLClass> ret = HashMultimap.create();

ImmutableSet<OWLClass> targets = extOwlOntology.getChildrenAsserted(extOwlOntology.getClassForId("HP:0000118"));

for (HpoClassTableEntry hpoCTE : tableContent) {
OWLClass cls = extOwlOntology.getClassForId(hpoCTE.getHpoId());
ImmutableSet<OWLClass> anc = extOwlOntology.getAncestorsAsserted(cls);
for (OWLClass a : anc) {
if (targets.contains(a)) {
ret.put(a, cls);
}
}
}
return ret;
}

}
6 changes: 3 additions & 3 deletions src/hpoweb/data/dataprovider/IDiseaseDataProvider.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package hpoweb.data.dataprovider;

import hpoweb.data.entities.DiseaseGene;
import hpoweb.uicontent.table.HpoClassTableEntry;

import java.util.Collection;
import java.util.List;

import hpoweb.data.entities.DiseaseGene;
import hpoweb.uicontent.table.HpoClassTableEntry;

public interface IDiseaseDataProvider extends IEntityDataProvider {

Collection<String> getAlternativeNames();
Expand Down
4 changes: 4 additions & 0 deletions src/hpoweb/data/dataprovider/IEntityDataProvider.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package hpoweb.data.dataprovider;

import hpoweb.data.HpData;

/**
* Provide data for an entity like an HPO class or a gene
*
Expand All @@ -14,4 +16,6 @@ public interface IEntityDataProvider {

public String getTypeOfEntityString();

public HpData getHpData();

}
13 changes: 11 additions & 2 deletions src/hpoweb/data/dataprovider/impl/DiseaseDataProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ private String generateAnnotationDescription(Set<HPOAnnotation> annotations) {

if (multipleAnnotations) {
buffer.append(" Meta data for annotation " + i + ":<br>");
}
else {
} else {
buffer.append(" Meta data for this annotation:<br>");
}

Expand All @@ -133,4 +132,14 @@ private String generateAnnotationDescription(Set<HPOAnnotation> annotations) {
public Collection<DiseaseGene> getAssociatedGenes() {
return diseaseGenes;
}

/*
* (non-Javadoc)
*
* @see hpoweb.data.dataprovider.IEntityDataProvider#getHpData()
*/
@Override
public HpData getHpData() {
return hpData;
}
}
29 changes: 22 additions & 7 deletions src/hpoweb/data/dataprovider/impl/FakeDiseaseDataProvider.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
package hpoweb.data.dataprovider.impl;

import hpoweb.data.dataprovider.IDiseaseDataProvider;
import hpoweb.data.entities.DiseaseGene;
import hpoweb.uicontent.table.HpoClassTableEntry;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
Expand All @@ -13,6 +9,11 @@

import com.google.common.collect.ImmutableSet;

import hpoweb.data.HpData;
import hpoweb.data.dataprovider.IDiseaseDataProvider;
import hpoweb.data.entities.DiseaseGene;
import hpoweb.uicontent.table.HpoClassTableEntry;

public class FakeDiseaseDataProvider implements IDiseaseDataProvider {

public FakeDiseaseDataProvider() {
Expand All @@ -38,8 +39,10 @@ public String getTypeOfEntityString() {
public Collection<String> getAlternativeNames() {
double rand = Math.random();
if (rand > 0.3) {
return ImmutableSet.of(RandomStringUtils.randomAlphabetic(10).toUpperCase(), RandomStringUtils.randomAlphabetic(7).toUpperCase(),
RandomStringUtils.randomAlphabetic(9).toUpperCase(), RandomStringUtils.randomAlphabetic(15).toUpperCase(),
return ImmutableSet.of(RandomStringUtils.randomAlphabetic(10).toUpperCase(),
RandomStringUtils.randomAlphabetic(7).toUpperCase(),
RandomStringUtils.randomAlphabetic(9).toUpperCase(),
RandomStringUtils.randomAlphabetic(15).toUpperCase(),
"ghfsadgfibba gfisbafkba hfjksbfkjsabf hfjksdhfsaf hflhsa fhsdahfa hfldshflsad hflsahfkldsaf");
} else {
return ImmutableSet.of();
Expand All @@ -52,7 +55,8 @@ public List<HpoClassTableEntry> getAnnotatedHpoClasses() {
for (int i = 0; i < 50; i++) {

String hpoId = "HP:" + RandomStringUtils.randomNumeric(7);
String hpoLab = "Abnormality of " + RandomStringUtils.randomAlphabetic(4) + " " + RandomStringUtils.randomAlphabetic(8);
String hpoLab = "Abnormality of " + RandomStringUtils.randomAlphabetic(4) + " "
+ RandomStringUtils.randomAlphabetic(8);
HpoClassTableEntry entry = new HpoClassTableEntry(hpoId, hpoLab, "fake description here");
tableEntries.add(entry);
}
Expand All @@ -76,4 +80,15 @@ public Collection<DiseaseGene> getAssociatedGenes() {
}

}

/*
* (non-Javadoc)
*
* @see hpoweb.data.dataprovider.IEntityDataProvider#getHpData()
*/
@Override
public HpData getHpData() {
// TODO Auto-generated method stub
return null;
}
}
18 changes: 16 additions & 2 deletions src/hpoweb/data/dataprovider/impl/FakeGeneDataProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

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

Expand Down Expand Up @@ -44,7 +45,8 @@ public List<HpoClassTableEntry> getAssociatedHpoClasses() {
for (int i = 0; i < 50; i++) {

String hpoId = "HP:" + RandomStringUtils.randomNumeric(7);
String hpoLab = "Abnormality of " + RandomStringUtils.randomAlphabetic(4) + " " + RandomStringUtils.randomAlphabetic(8);
String hpoLab = "Abnormality of " + RandomStringUtils.randomAlphabetic(4) + " "
+ RandomStringUtils.randomAlphabetic(8);
HpoClassTableEntry entry = new HpoClassTableEntry(hpoId, hpoLab, "fake description here");
tableEntries.add(entry);
}
Expand All @@ -56,8 +58,20 @@ public Collection<OwlAnnotatedDiseaseEntry> getAssociatedDiseases() {

ItemId id = new ItemId("OMIM", RandomStringUtils.randomNumeric(6));
OwlAnnotatedDiseaseEntry entry = new OwlAnnotatedDiseaseEntry(id, null, null);
entry.setName(RandomStringUtils.randomAlphabetic(8) + " " + RandomStringUtils.randomAlphabetic(4) + " syndrome");
entry.setName(
RandomStringUtils.randomAlphabetic(8) + " " + RandomStringUtils.randomAlphabetic(4) + " syndrome");
return Lists.newArrayList(entry);
}

/*
* (non-Javadoc)
*
* @see hpoweb.data.dataprovider.IEntityDataProvider#getHpData()
*/
@Override
public HpData getHpData() {
// TODO Auto-generated method stub
return null;
}

}
Loading

0 comments on commit 56c5c39

Please sign in to comment.