diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/data/Chemical.java b/annotation/src/main/java/lcsb/mapviewer/annotation/data/Chemical.java index 651cecb2df7128dedfd76c45aee9ad53d1abcc13..89186f8b2c6434855f2b336a9a5a3c3af5cded32 100644 --- a/annotation/src/main/java/lcsb/mapviewer/annotation/data/Chemical.java +++ b/annotation/src/main/java/lcsb/mapviewer/annotation/data/Chemical.java @@ -304,4 +304,8 @@ public class Chemical implements Serializable, TargettingStructure { return getInferenceNetwork(); } + public void addSynonyms(List<String> synonyms) { + this.synonyms.addAll(synonyms); + } + } diff --git a/annotation/src/main/java/lcsb/mapviewer/annotation/services/ChemicalParser.java b/annotation/src/main/java/lcsb/mapviewer/annotation/services/ChemicalParser.java index c6d51b90ab624eacc78a68c3feba22f1d9de4596..20f97ebc08cbf590ef79ddfff1e61d1916bd2668 100644 --- a/annotation/src/main/java/lcsb/mapviewer/annotation/services/ChemicalParser.java +++ b/annotation/src/main/java/lcsb/mapviewer/annotation/services/ChemicalParser.java @@ -26,6 +26,7 @@ import lcsb.mapviewer.annotation.cache.WebPageDownloader; import lcsb.mapviewer.annotation.cache.XmlSerializer; import lcsb.mapviewer.annotation.data.Chemical; import lcsb.mapviewer.annotation.data.ChemicalDirectEvidence; +import lcsb.mapviewer.annotation.data.MeSH; import lcsb.mapviewer.annotation.data.Target; import lcsb.mapviewer.annotation.services.annotators.AnnotatorException; import lcsb.mapviewer.annotation.services.annotators.HgncAnnotator; @@ -168,6 +169,9 @@ public class ChemicalParser extends CachableInterface implements IExternalServic @Autowired private ProjectDao projectDao; + @Autowired + private MeSHParser meshParser; + /** * */ @@ -349,7 +353,7 @@ public class ChemicalParser extends CachableInterface implements IExternalServic } List<String> list = getSuggestedQueryListWithoutCache(project, diseaseId); result = StringUtils.join(list, "\n"); - } else { + } else { result = super.refreshCacheQuery(query); } } else { @@ -396,8 +400,15 @@ public class ChemicalParser extends CachableInterface implements IExternalServic result = getChemicalFromChemicalLine(lineValues, chemID); } } + if (result != null) { + MeSH mesh = meshParser.getMeSH(result.getChemicalId()); + result.addSynonyms(mesh.getSynonyms()); + } + } catch (IOException e) { throw new ChemicalSearchException("ctdbase service unavailable", e); + } catch (AnnotatorException e) { + throw new ChemicalSearchException("problem with accessing mesh db", e); } // put them in cache