diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/services/ModelAnnotator.java b/annotation/src/main/java/lcsb/mapviewer/annotation/services/ModelAnnotator.java index 8328716508788f665daeea66528fa8dc4bcd0530..8516fd4f6bd02b50d53bfe1b2b3ced40b6453d5e 100644 --- a/annotation/src/main/java/lcsb/mapviewer/annotation/services/ModelAnnotator.java +++ b/annotation/src/main/java/lcsb/mapviewer/annotation/services/ModelAnnotator.java @@ -348,9 +348,6 @@ public class ModelAnnotator { double counter = 0; double amount = model.getElements().size() + model.getReactions().size(); - logger.debug("annotatorsParams"); - logger.debug(annotatorsParams); - // annotate all elements for (Element element : model.getElements()) { List<ElementAnnotator> list = null; diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/services/annotators/AnnotatorParamDefinition.java b/annotation/src/main/java/lcsb/mapviewer/annotation/services/annotators/AnnotatorParamDefinition.java index 3d13f4181e468d27339e7b810b281ec99bfa6e7a..9559952e60378f012e6be87c251c6d5435ccb813 100644 --- a/annotation/src/main/java/lcsb/mapviewer/annotation/services/annotators/AnnotatorParamDefinition.java +++ b/annotation/src/main/java/lcsb/mapviewer/annotation/services/annotators/AnnotatorParamDefinition.java @@ -9,14 +9,14 @@ package lcsb.mapviewer.annotation.services.annotators; public class AnnotatorParamDefinition { private String name; - private String decription; + private String description; private Class<?> type; - public AnnotatorParamDefinition(String name, Class<?> type, String decription) { + public AnnotatorParamDefinition(String name, Class<?> type, String description) { super(); this.name = name; - this.decription = decription; + this.description = description; this.type = type; } @@ -24,8 +24,8 @@ public class AnnotatorParamDefinition { return name; } - public String getDecription() { - return decription; + public String getDescription() { + return description; } public Class<?> getType() { diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/services/annotators/KeggAnnotator.java b/annotation/src/main/java/lcsb/mapviewer/annotation/services/annotators/KeggAnnotator.java index cbf8cee52c7a6389442a61baa88629cc9d9c8af3..4f4238e70c7c1524f6df4c04a2cbfa040bbf533e 100644 --- a/annotation/src/main/java/lcsb/mapviewer/annotation/services/annotators/KeggAnnotator.java +++ b/annotation/src/main/java/lcsb/mapviewer/annotation/services/annotators/KeggAnnotator.java @@ -222,14 +222,15 @@ public class KeggAnnotator extends ElementAnnotator implements IExternalService if (params != null) { String[] keggOrgnismCodes = params.get(0).getParamValue().trim().split(" +"); for (String code: keggOrgnismCodes) { - if (code.toUpperCase() != "ATH") { - logger.warn("KEGG annotator currently supports only ATH"); + if (!code.equalsIgnoreCase("ATH")) { + logger.warn("KEGG annotator currently supports only ATH (" + code + " passed)" ); } else { m = athOrthologMatcher.matcher(pageContent); if (m.find()) { String[] tairCodes = m.group(1).trim().split(" "); for (String tairCode: tairCodes) { tairCode = tairCode.split("\\(")[0]; //some codes are in the form AT1G08510(FATB) + logger.debug("Adding tair code " + tairCode); result.add(createMiriamData(MiriamType.TAIR_LOCUS, tairCode)); } } diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/AnnotatorExceptionTest.java b/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/AnnotatorExceptionTest.java index 05162124a482e76d0ad7d42c26d07ccb7cf706e2..629717e14862fe79da3911fc8af046abf278949e 100644 --- a/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/AnnotatorExceptionTest.java +++ b/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/AnnotatorExceptionTest.java @@ -25,7 +25,7 @@ public class AnnotatorExceptionTest { public void testConstructor() { AnnotatorParamDefinition d = new AnnotatorParamDefinition("name", String.class, "description"); assertEquals(d.getName(), "name"); - assertEquals(d.getDecription(), "description"); + assertEquals(d.getDescription(), "description"); assertEquals(d.getType(), String.class); } diff --git a/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/KeggAnnotatorTest.java b/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/KeggAnnotatorTest.java index 21e5e64b7491890bc978d801de0edacbb09353c2..7228b8e6e4ecb225269c7e69e998867630e897b1 100644 --- a/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/KeggAnnotatorTest.java +++ b/annotation/src/test/java/lcsb/mapviewer/annotation/services/annotators/KeggAnnotatorTest.java @@ -148,7 +148,7 @@ public class KeggAnnotatorTest extends AnnotationTestFunctions { protein.setName("bla"); protein.addMiriamData(new MiriamData(MiriamType.UNIPROT, "Q42561")); List<UserAnnotatorsParam> aps = new ArrayList<>(); - aps.add(new UserAnnotatorsParam(String.class, "KEGG organism identifier", "ATH XXX")); + aps.add(new UserAnnotatorsParam(String.class, "KEGG organism identifier", "ATH AAA")); keggAnnotator.annotateElement(protein, aps); int cntTairs = 0; diff --git a/frontend-js/src/main/css/global.css b/frontend-js/src/main/css/global.css index 04c3b36d73ef71d18ca8b66c2429d9c4d85486ae..3ad3f016a32d4747fd3823ff6593d693583c11c2 100644 --- a/frontend-js/src/main/css/global.css +++ b/frontend-js/src/main/css/global.css @@ -587,3 +587,21 @@ h1 { font-weight: bold; } +.minerva-annotator-param-name .annotator-tooltip { + visibility: hidden; + width: 50%; + background-color: rgba(0, 0, 0, .5); + color: #fff; + text-align: left; + border-radius: 6px; + padding: 5px; + + /* Position the tooltip */ + position: absolute; + z-index: 1; +} + +.minerva-annotator-param-name:hover .annotator-tooltip { + visibility: visible; +} + diff --git a/frontend-js/src/main/js/gui/admin/ChooseAnnotatorsDialog.js b/frontend-js/src/main/js/gui/admin/ChooseAnnotatorsDialog.js index 30e9ae64058f8ec057e1ec1631f1da4a3959c561..782de66346943142ea7f420627ffed7915e76dce 100644 --- a/frontend-js/src/main/js/gui/admin/ChooseAnnotatorsDialog.js +++ b/frontend-js/src/main/js/gui/admin/ChooseAnnotatorsDialog.js @@ -106,6 +106,7 @@ ChooseAnnotatorsDialog.prototype.setElementType = function (elementType) { var paramsDefs = annotator.getParametersDefinitions(); if (paramsDefs.length > 0) { + console.log('annotator', annotator); annotatorsParams.appendChild(Functions.createElement({ type: "div", @@ -132,11 +133,21 @@ ChooseAnnotatorsDialog.prototype.setElementType = function (elementType) { className: "minerva-annotator-param" }); - paramElement.appendChild(Functions.createElement({ + var paramName = Functions.createElement({ type: "div", className: "minerva-annotator-param-name", content: param.name - })); + }); + + console.log('param', param); + var toolTip = Functions.createElement({ + type: "span", + className: "annotator-tooltip", + content: param.description + }); + + paramName.appendChild(toolTip) + paramElement.appendChild(paramName); var paramValue; @@ -169,8 +180,8 @@ ChooseAnnotatorsDialog.prototype.setElementType = function (elementType) { paramValue.checked = (existingParamValue && existingParamValue === 'true'); } else { throw new InvalidAlgorithmError("Unknown annotator parameter type"); - } - + } + paramElement.appendChild(paramValue); annotatorParams.appendChild(paramElement); }