Skip to content

Commit

Permalink
better english for synonym suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
drseb committed Aug 30, 2016
1 parent 52f6cd6 commit e02e525
Showing 1 changed file with 22 additions and 25 deletions.
47 changes: 22 additions & 25 deletions src/hpoweb/uicontent/tabs/hpoclass/HpoClassTabFactory.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
package hpoweb.uicontent.tabs.hpoclass;

import hpoweb.data.HpData;
import hpoweb.data.dataprovider.IHpClassDataProvider;
import hpoweb.uicontent.graph.GraphtestUI;
import hpoweb.uicontent.table.DiseaseGeneTableEntry;
import hpoweb.uicontent.table.GeneDiseaseTableEntry;
import hpoweb.uicontent.table.TableLabel;
import hpoweb.util.CONSTANTS;
import hpoweb.util.TableUtils;

import java.util.Collection;
import java.util.HashSet;
import java.util.List;
Expand All @@ -20,14 +29,6 @@
import com.vaadin.ui.themes.ValoTheme;

import de.charite.phenowl.hpowl.util.OboUtil;
import hpoweb.data.HpData;
import hpoweb.data.dataprovider.IHpClassDataProvider;
import hpoweb.uicontent.graph.GraphtestUI;
import hpoweb.uicontent.table.DiseaseGeneTableEntry;
import hpoweb.uicontent.table.GeneDiseaseTableEntry;
import hpoweb.uicontent.table.TableLabel;
import hpoweb.util.CONSTANTS;
import hpoweb.util.TableUtils;

public class HpoClassTabFactory {

Expand Down Expand Up @@ -106,8 +107,8 @@ private VerticalLayout getAssociatedGenesTab(IHpClassDataProvider dataProvider)

int id = 0;
for (GeneDiseaseTableEntry entry : tableContent) {
TableLabel geneEntry = new TableLabel(entry.getGeneSymbol() + " (<a href='" + CONSTANTS.rootLocation + "?" + CONSTANTS.geneRequestId + "="
+ entry.getGeneId() + "'>" + entry.getGeneId() + "</a>)", ContentMode.HTML);
TableLabel geneEntry = new TableLabel(entry.getGeneSymbol() + " (<a href='" + CONSTANTS.rootLocation + "?" + CONSTANTS.geneRequestId
+ "=" + entry.getGeneId() + "'>" + entry.getGeneId() + "</a>)", ContentMode.HTML);

String diseasesString = tableUtils.getDiseasesAsHtmlString(entry.getAssociatedDiseases(), CONSTANTS.rootLocation);

Expand Down Expand Up @@ -150,8 +151,8 @@ private VerticalLayout getAssociatedDiseasesTab(IHpClassDataProvider dataProvide

int id = 0;
for (DiseaseGeneTableEntry entry : tableContent) {
TableLabel diseaseid = new TableLabel("<a href='" + CONSTANTS.rootLocation + "?" + CONSTANTS.diseaseRequestId + "=" + entry.getDiseaseId()
+ "'>" + entry.getDiseaseId() + "</a>", ContentMode.HTML);
TableLabel diseaseid = new TableLabel("<a href='" + CONSTANTS.rootLocation + "?" + CONSTANTS.diseaseRequestId + "="
+ entry.getDiseaseId() + "'>" + entry.getDiseaseId() + "</a>", ContentMode.HTML);
TableLabel diseasename = new TableLabel(entry.getDiseaseName(), ContentMode.HTML);

String genesString = tableUtils.getGenesAsHtmlString(entry.getAssociatedGenes(), CONSTANTS.rootLocation);
Expand Down Expand Up @@ -186,13 +187,12 @@ private VerticalLayout getSynonymsVl(IHpClassDataProvider dataProvider) {
Collection<String> synonyms = dataProvider.getSynonyms();
if (synonyms.size() < 1) {
Label suggestSyn = new Label(
"Currently we do not have synonyms for this class. If you are missing a synonym, feel free to suggest a "
+ "synonym at our <a href='https://github.com/obophenotype/human-phenotype-ontology/issues/' target='_new'>github tracker</a>",
"Currently the HPO does not have any synonyms for this class. "
+ "Suggest a synonym at our <a href='https://github.com/obophenotype/human-phenotype-ontology/issues/' target='_new'>github tracker</a>",
ContentMode.HTML);
suggestSyn.addStyleName("tab-content-content");
vl_syns.addComponent(suggestSyn);
}
else {
} else {
for (String synoym : synonyms) {
Label l = new Label(synoym);
l.addStyleName("tab-content-content");
Expand Down Expand Up @@ -223,8 +223,8 @@ private VerticalLayout getIdentifiersVl(IHpClassDataProvider dataProvider) {
* Secondary ID
*/
Label lab2 = new Label("Alternative IDs");
lab2.setDescription(
"These are other identifiers which are referring to the same HPO class. " + "These are introduced when classes are merged.");
lab2.setDescription("These are other identifiers which are referring to the same HPO class. "
+ "These are introduced when classes are merged.");
lab2.addStyleName(ValoTheme.LABEL_LIGHT);
lab2.addStyleName("tab-content-header");

Expand All @@ -240,9 +240,8 @@ private VerticalLayout getIdentifiersVl(IHpClassDataProvider dataProvider) {
* PURLs
*/
Label lab3 = new Label("PURL");
lab3.setDescription(
"This is a persistent URL. Please see <a href='https://en.wikipedia.org/wiki/Persistent_uniform_resource_locator' target='_new'>"
+ "this wikipedia article</a> for more information on PURLs.");
lab3.setDescription("This is a persistent URL. Please see <a href='https://en.wikipedia.org/wiki/Persistent_uniform_resource_locator' target='_new'>"
+ "this wikipedia article</a> for more information on PURLs.");
lab3.addStyleName(ValoTheme.LABEL_LIGHT);
lab3.addStyleName("tab-content-header");
Label iriLabel = new Label("<a href='" + dataProvider.getIRI() + "' target='_new'>" + dataProvider.getIRI() + "</a>", ContentMode.HTML);
Expand Down Expand Up @@ -283,8 +282,7 @@ private VerticalLayout getDefinitionsVl(IHpClassDataProvider dataProvider) {
* Logical def
*/
Label lab2 = new Label("Logical definition");
lab2.setDescription(
"This is a computer readable logical definition of the HPO class. If you want to learn more about this please see <a href='http:https://nar.oxfordjournals.org/content/42/D1/D966.full' target='_new'>http:https://nar.oxfordjournals.org/content/42/D1/D966.full</a>.");
lab2.setDescription("This is a computer readable logical definition of the HPO class. If you want to learn more about this please see <a href='http:https://nar.oxfordjournals.org/content/42/D1/D966.full' target='_new'>http:https://nar.oxfordjournals.org/content/42/D1/D966.full</a>.");
lab2.addStyleName(ValoTheme.LABEL_LIGHT);
lab2.addStyleName("tab-content-header");

Expand Down Expand Up @@ -370,8 +368,7 @@ private Collection<String> convertToHtml(Collection<OWLClass> classes, String ol
+ RandomStringUtils.randomAlphabetic(10).toUpperCase() + "</a>";
htmlList.add(str);
}
}
else {
} else {
// it's ugly to use hpData here, but the dataprovider doesn't know
// the labels for the parents/children
for (OWLClass c : classes) {
Expand Down

0 comments on commit e02e525

Please sign in to comment.