Search in sources :

Example 6 with SBOTerm

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;
}
Also used : SBOTerm(org.vcell.pathway.sbo.SBOTerm)

Example 7 with SBOTerm

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;
}
Also used : Xref(org.vcell.pathway.Xref) SBOTerm(org.vcell.pathway.sbo.SBOTerm) HashSet(java.util.HashSet)

Aggregations

SBOTerm (org.vcell.pathway.sbo.SBOTerm)7 ArrayList (java.util.ArrayList)3 SBEntity (org.vcell.pathway.sbpax.SBEntity)3 SBMeasurable (org.vcell.pathway.sbpax.SBMeasurable)3 SBVocabulary (org.vcell.pathway.sbpax.SBVocabulary)3 ModelParameter (cbit.vcell.model.Model.ModelParameter)2 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 Control (org.vcell.pathway.Control)2 SBOParam (org.vcell.pathway.sbo.SBOParam)2 BioModelEntityObject (cbit.vcell.model.BioModelEntityObject)1 HMM_IRRKinetics (cbit.vcell.model.HMM_IRRKinetics)1 HMM_REVKinetics (cbit.vcell.model.HMM_REVKinetics)1 Kinetics (cbit.vcell.model.Kinetics)1 MassActionKinetics (cbit.vcell.model.MassActionKinetics)1 Model (cbit.vcell.model.Model)1 ModelUnitSystem (cbit.vcell.model.ModelUnitSystem)1 SimpleReaction (cbit.vcell.model.SimpleReaction)1 Expression (cbit.vcell.parser.Expression)1 VCUnitDefinition (cbit.vcell.units.VCUnitDefinition)1