Commit 8bc9b785 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

processing of cog and kegg orthologs added

parent 1dfaa869
......@@ -12,8 +12,8 @@ import lcsb.mapviewer.model.map.AnnotatedObject;
import lcsb.mapviewer.model.map.MiriamData;
import lcsb.mapviewer.model.map.MiriamType;
import lcsb.mapviewer.model.map.reaction.Reaction;
import lcsb.mapviewer.model.map.species.Element;
import lcsb.mapviewer.model.map.species.Chemical;
import lcsb.mapviewer.model.map.species.Element;
import lcsb.mapviewer.model.map.species.Species;
/**
......@@ -326,6 +326,18 @@ public abstract class ElementAnnotator extends CachableInterface {
element.addMiriamData(new MiriamData(MiriamType.PUBCHEM, value));
}
/**
* Adds {@link MiriamType#COG} annotation to element.
*
* @param element
* element where annotation should be added
* @param value
* annotation identifier
*/
protected void addCogMiriam(AnnotatedObject element, String value) {
element.addMiriamData(new MiriamData(MiriamType.COG, value));
}
/**
* Sets {@link Reaction#subsystem}.
*
......@@ -374,6 +386,9 @@ public abstract class ElementAnnotator extends CachableInterface {
} else if (value.startsWith("R")) {
MiriamData md = new MiriamData(MiriamType.KEGG_REACTION, value);
element.addMiriamData(md);
} else if (value.startsWith("K")) {
MiriamData md = new MiriamData(MiriamType.KEGG_ORTHOLOGY, value);
element.addMiriamData(md);
} else {
logger.warn(prefix + "Unknown Kegg identifier type (only Kegg compounds and reactions are supported): \"" + value + "\"");
}
......@@ -393,7 +408,7 @@ public abstract class ElementAnnotator extends CachableInterface {
if (element.getFormula() == null || element.getFormula().isEmpty() || element.getFormula().equals(value)) {
element.setFormula(value);
} else {
logger.warn(prefix + "Formula in db different: \"" + element.getFormula() + "\", " + value);
logger.warn(prefix + "Formula in db different: \"" + element.getFormula() + "\", \"" + value + "\"");
}
}
......@@ -427,10 +442,10 @@ public abstract class ElementAnnotator extends CachableInterface {
*/
protected void setMcs(Reaction element, String value, String prefix) {
if (element.getMechanicalConfidenceScore() == null || element.getMechanicalConfidenceScore() == 0
|| element.getMechanicalConfidenceScore().equals(value)) {
|| element.getMechanicalConfidenceScore().toString().equals(value)) {
element.setMechanicalConfidenceScore(Integer.valueOf(value));
} else {
logger.warn(prefix + "MCS in db different: \"" + element.getMechanicalConfidenceScore() + "\", " + value);
logger.warn(prefix + "MCS in db different: \"" + element.getMechanicalConfidenceScore() + "\", \"" + value + "\"");
}
}
......
......@@ -148,7 +148,7 @@ public class ReconAnnotator extends ElementAnnotator implements IExternalService
String value = null;
if (!entry.getValue().isJsonNull()) {
// if (entry.getValue().isJsonPrimitive()) {
value = entry.getValue().getAsString();
value = entry.getValue().getAsString().trim();
}
if (value == null || value.isEmpty()) {
continue;
......@@ -217,10 +217,14 @@ public class ReconAnnotator extends ElementAnnotator implements IExternalService
setSubsystem((Reaction) annotatedObject, value, prefix);
} else if (key.equals("keggId")) {
addKeggMiriam(annotatedObject, value, prefix);
} else if (key.equals("keggorthology")) {
addKeggMiriam(annotatedObject, value, prefix);
} else if (key.equals("pubChemId")) {
addPubchemMiriam(annotatedObject, value);
} else if (key.equals("hmdb")) {
addHmdbMiriam(annotatedObject, value);
} else if (key.equals("cog")) {
addCogMiriam(annotatedObject, value);
} else if (key.equals("pdmapName")) {
// for now we skip it...
continue;
......
......@@ -73,6 +73,14 @@ public enum MiriamType {
new String[] { "urn:miriam:chembl.target" }, //
new Class<?>[] { Protein.class, Complex.class }, "MIR:00000085"), //
/**
* Clusters of Orthologous Groups: https://www.ncbi.nlm.nih.gov/COG/.
*/
COG("Clusters of Orthologous Groups", //
"https://www.ncbi.nlm.nih.gov/COG/", //
new String[] { "urn:miriam:cogs" }, //
new Class<?>[] { Reaction.class }, "MIR:00000296"), //
/**
* Drugbank database: http://www.drugbank.ca/.
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment