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

ensembl use generics addHgnc methods

parent 3e21aaf0
No related branches found
No related tags found
1 merge request!595Resolve "Small molecules annotators to be rearranged"
......@@ -20,7 +20,6 @@ import lcsb.mapviewer.annotation.data.Chebi;
import lcsb.mapviewer.annotation.services.ExternalServiceStatus;
import lcsb.mapviewer.annotation.services.ExternalServiceStatusType;
import lcsb.mapviewer.annotation.services.IExternalService;
import lcsb.mapviewer.common.comparator.StringSetComparator;
import lcsb.mapviewer.common.exception.InvalidArgumentException;
import lcsb.mapviewer.model.map.BioEntity;
import lcsb.mapviewer.model.map.MiriamData;
......
......@@ -572,6 +572,16 @@ public abstract class ElementAnnotator extends CachableInterface {
element.addMiriamData(md);
}
protected void addHgnc(BioEntity element, String value) {
MiriamData md = createMiriamData(MiriamType.HGNC, value);
element.addMiriamData(md);
}
protected void addHgncSymbol(BioEntity element, String value) {
MiriamData md = createMiriamData(MiriamType.HGNC_SYMBOL, value);
element.addMiriamData(md);
}
protected void addMesh(BioEntity element, String value) {
MiriamData md = createMiriamData(MiriamType.MESH_2012, value);
element.addMiriamData(md);
......
......@@ -211,7 +211,7 @@ public class EnsemblAnnotator extends ElementAnnotator implements IExternalServi
setSymbol(annotatedObject, symbol, prefix);
}
String fullName = super.getNodeAttr("description", node);
if (symbol != null) {
if (fullName != null) {
setFullName((Element) annotatedObject, fullName, prefix);
}
NodeList synonymNodeList = node.getChildNodes();
......@@ -227,11 +227,11 @@ public class EnsemblAnnotator extends ElementAnnotator implements IExternalServi
String hgncId = super.getNodeAttr("primary_id", node);
if (hgncId != null && !hgncId.isEmpty()) {
hgncId = hgncId.replaceAll("HGNC:", "");
annotatedObject.addMiriamData(createMiriamData(MiriamType.HGNC, hgncId));
addHgnc(annotatedObject, hgncId);
}
String hgncSymbol = super.getNodeAttr("display_id", node);
if (hgncSymbol != null && !hgncSymbol.isEmpty()) {
annotatedObject.addMiriamData(createMiriamData(MiriamType.HGNC_SYMBOL, hgncSymbol));
addHgncSymbol(annotatedObject, hgncSymbol);
}
NodeList synonymNodeList = node.getChildNodes();
......
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