Skip to content

ode2sbml.annotations

annotations

Annotations utilities: SBO terms, MIRIAM URIs.

set_sbo_term(sbml_obj, sbo_term)

Annotate an SBML object with an SBO term.

Source code in ode2sbml/annotations.py
def set_sbo_term(sbml_obj: libsbml.SBase, sbo_term: str) -> None:
    """Annotate an SBML object with an SBO term."""
    sbml_obj.setSBOTerm(sbo_term)

add_miriam_annotation(sbml_obj, qualifier, uri)

Add a MIRIAM annotation to an SBML object.

Parameters:

Name Type Description Default
sbml_obj SBase

The SBML object to annotate.

required
qualifier str

BQB qualifier string, e.g. "BQB_IS".

required
uri str

Identifiers.org URI, e.g. "https://identifiers.org/uniprot/P12345".

required
Source code in ode2sbml/annotations.py
def add_miriam_annotation(
    sbml_obj: libsbml.SBase,
    qualifier: str,
    uri: str,
) -> None:
    """
    Add a MIRIAM annotation to an SBML object.

    Parameters
    ----------
    sbml_obj:
        The SBML object to annotate.
    qualifier:
        BQB qualifier string, e.g. ``"BQB_IS"``.
    uri:
        Identifiers.org URI, e.g. ``"https://identifiers.org/uniprot/P12345"``.
    """
    cv = libsbml.CVTerm()
    cv.setQualifierType(libsbml.BIOLOGICAL_QUALIFIER)
    bqb = getattr(libsbml, qualifier, libsbml.BQB_IS)
    cv.setBiologicalQualifierType(bqb)
    cv.addResource(uri)
    sbml_obj.addCVTerm(cv)