The Systems Biology Markup Language (SBML) is an XML-based format for encoding computational models of a sort common in systems biology. Although SBML is based upon XML, and thus software developers could support SBML using off-the-shelf XML parser libraries, libSBML offers numerous advantages that make it easier for developers to implement support for SBML in their software. The premise behind the development of libSBML is that it is more convenient and efficient for developers to start with a higher-level API tailored specifically to SBML and its distinctive features than it is to start with a plain XML parser library.
The following is a partial list of libSBML's features:
Some further explanations may be warranted concerning libSBML's support for working with mathematical formulas. In SBML Level 1, mathematical formulas are represented as text strings using a C-like syntax. This representation was chosen because of its simplicity, widespread familiarity and use in applications such as GEPASI4 and Jarnac,5 whose authors contributed to the initial design of SBML. In SBML Levels 2 and 3, there was a need to expand the mathematical vocabulary of Level 1 to include additional functions (both built-in and user-defined), mathematical constants, logical operators, relational operators and a special symbol to represent time. Rather than growing the simple C-like syntax into something more complicated and esoteric in order to support these features, and consequently having to manage two standards in two different formats (XML and text string formulas), SBML Levels 2 and 3 leverage an existing standard for expressing mathematical formulas, namely the content portion of MathML.
As mentioned above, LibSBML provides an abstraction for working with mathematical expressions in both text-string and MathML form: Abstract Syntax Trees (ASTs). Abstract Syntax Trees are well known in the computer science community; they are simple recursive data structures useful for representing the syntactic structure of sentences in certain kinds of languages (mathematical or otherwise). Much as libSBML allows programmers to manipulate SBML at the level of domain-specific objects, regardless of SBML Level or version, it also allows programmers to work with mathematical formula at the level of ASTs regardless of whether the original format was C-like infix or MathML. LibSBML goes one step further by allowing programmers to work exclusively with infix formula strings and instantly convert them to the appropriate MathML whenever needed.
LibSBML requires a separate library to do low-level read/write operations on XML. It can use any one of three XML parser libraries: Xerces, expat or libxml2. Users can specify which library they wish to use at libSBML compilation time. LibSBML hides the differences between these parser libraries behind an abstraction layer; it seamlessly uses whichever library against which a given instance of libSBML has been compiled. (However, released binary distributions of libSBML all make use of the libxml2 library.)
LibSBML uses software objects (i.e., instances of classes) that correspond to SBML components, with member variables representing the attributes of the corresponding SBML objects. The libSBML API is constructed to provide an intuitive way of relating SBML and the code needed to create or manipulate it with a class hierarchy that mimics the SBML structure. More information about the libSBML objects is available in the libSBML API documentation.
LibSBML enables reading from and writing to either files or strings. Once an SBML document is read, libSBML stores the SBML content in an SBMLDocument object. This object can be written out again later. The following is an example written in Python:
The libSBML API allows easy creation of objects and subobjects representing SBML elements and the subelements contained within them. The following is an example written in C++:
Each component in SBML has a number of attributes associated with it. These are stored as member variables of a given class, and libSBML provides functions to retrieve and query these values. The syntax of these functions is consistent throughout libSBML. The following is an example written in Python:
Hucka, M.; Finney, A.; Sauro, H. M.; Bolouri, H.; Doyle, J. C.; Kitano, H.; Arkin, A. P.; Bornstein, A. P.; Bray, B. J.; Cornish-Bowden, D.; Cuellar, A.; Dronov, A. A.; Gilles, S.; Ginkel, E. D.; Gor, M.; Goryanin, V.; Hedley, I. I.; Hodgman, W. J.; Hofmeyr, T. C.; Hunter, J. -H.; Juty, P. J.; Kasberger, N. S.; Kremling, J. L.; Kummer, A.; Le Novère, U.; Loew, N.; Lucio, L. M.; Mendes, P.; Minch, P.; Mjolsness, E. (2003). "The systems biology markup language (SBML): A medium for representation and exchange of biochemical network models". Bioinformatics. 19 (4): 524–531. doi:10.1093/bioinformatics/btg015. PMID 12611808. /wiki/Hiroaki_Kitano ↩
Finney, A.; Hucka, M. (2003). "Systems biology markup language: Level 2 and beyond". Biochemical Society Transactions. 31 (Pt 6): 1472–1473. CiteSeerX 10.1.1.466.8001. doi:10.1042/bst0311472. PMID 14641091. /wiki/CiteSeerX_(identifier) ↩
Hucka, M.; Finney, A.; Bornstein, B. J.; Keating, S. M.; Shapiro, B. E.; Matthews, J.; Kovitz, B. L.; Schilstra, M. J.; Funahashi, A.; Doyle, S. M.; Kitano, M. J. (2004). "Evolving a lingua franca and associated software infrastructure for computational systems biology: The Systems Biology Markup Language (SBML) project" (PDF). Systems Biology. 1 (1): 41–53. doi:10.1049/sb:20045008 (inactive 7 December 2024). PMID 17052114.{{cite journal}}: CS1 maint: DOI inactive as of December 2024 (link) https://authors.library.caltech.edu/2099/1/HUCieesb04.pdf ↩
Mendes, P. (1993). "GEPASI: A software package for modelling the dynamics, steady states and control of biochemical and other systems". Computer Applications in the Biosciences. 9 (5): 563–571. doi:10.1093/bioinformatics/9.5.563. PMID 8293329. /wiki/Pedro_Pedrosa_Mendes ↩
Jarnac, Sauro H. "A system for interactive metabolic analysis". In: Hofmeyr, J-HS, et al., eds. Animating the Cellular Map: Proceedings of the 9th International Meeting on BioThermoKinetics. Stellenbosch, South Africa: Stellenbosch University Press; 2000. pp. 221–228. ↩