use of org.vcell.pathway.sbo.SBOTerm in project vcell by virtualcell.
the class SBPAXKineticsExtractor method matchSBOKineticLaw.
// recursively navigate the hierarchy of SBOTerms until we find a match with a known kinetic law
// the root element should be SBO:0000006 - kinetic constant
public static MappedKinetics matchSBOKineticLaw(SBOTerm sboT) {
MappedKinetics current = MappedKinetics.valueOf(sboT.getIndex().replace(':', '_'));
switch(current) {
case SBO_0000069:
case SBO_0000432:
case SBO_0000012:
case SBO_0000078:
case SBO_0000043:
case SBO_0000044:
case SBO_0000028:
case SBO_0000029:
case SBO_0000438:
return current;
default:
break;
}
Set<SBOTerm> subC = SBOUtil.getSuperClasses(sboT);
if (subC.isEmpty()) {
return null;
}
for (SBOTerm sbot : subC) {
// due to multiple inheritance we may have 2 ancestors
MappedKinetics ancestor = matchSBOKineticLaw(sbot);
if (ancestor != null) {
// for simplicity we return as soon as we find a match, for now we don't care about depth
return ancestor;
}
}
// no match found, perhaps this SBOTerm is not a kinetic law
return null;
}
use of org.vcell.pathway.sbo.SBOTerm in project vcell by virtualcell.
the class SBPAXSBOExtractor method extractSBOTerms.
public static Set<SBOTerm> extractSBOTerms(SBVocabulary sbTerm) {
Set<SBOTerm> sboTerms = new HashSet<SBOTerm>();
for (Xref xref : sbTerm.getxRef()) {
String db = xref.getDb().trim();
String id = xref.getId().trim();
if (db != null && id != null) {
if (db.equalsIgnoreCase("sbo") || db.equalsIgnoreCase("systems biology ontology")) {
SBOTerm sboTerm = SBOList.getTermFromIndex(SBOUtil.getIndexFromId(id));
if (sboTerm != null) {
sboTerms.add(sboTerm);
}
}
}
}
return sboTerms;
}
Aggregations