Skip to content
Snippets Groups Projects
Commit 67c456b0 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

chemical contains synonyms

parent 9f0dd59e
No related branches found
No related tags found
1 merge request!156Resolve "search by chemical names"
......@@ -304,4 +304,8 @@ public class Chemical implements Serializable, TargettingStructure {
return getInferenceNetwork();
}
public void addSynonyms(List<String> synonyms) {
this.synonyms.addAll(synonyms);
}
}
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment