A two-way interface between limited Systems Biology Markup Language and R
© Radivoyevitch; licensee BioMed Central Ltd. 2004
Received: 03 June 2004
Accepted: 07 December 2004
Published: 07 December 2004
Systems Biology Markup Language (SBML) is gaining broad usage as a standard for representing dynamical systems as data structures. The open source statistical programming environment R is widely used by biostatisticians involved in microarray analyses. An interface between SBML and R does not exist, though one might be useful to R users interested in SBML, and SBML users interested in R.
A model structure that parallels SBML to a limited degree is defined in R. An interface between this structure and SBML is provided through two function definitions: write.SBML() which maps this R model structure to SBML level 2, and read.SBML() which maps a limited range of SBML level 2 files back to R. A published model of purine metabolism is provided in this SBML-like format and used to test the interface. The model reproduces published time course responses before and after its mapping through SBML.
List infrastructure preexisting in R makes it well-suited for manipulating SBML models. Further developments of this SBML-R interface seem to be warranted.
Systems biology markup language (SBML) is a standard for representing dynamical systems of biological interest [1, 2]. Interfaces between SBML and high level computational environments are currently being developed for Mathematica  and Matlab , but to the author's knowledge, no such efforts are being carried forth for R/S-plus. This brief paper presents the author's initial developments toward a two-way SBML-R interface. The interface is currently limited in the range of SBML input files that it can handle. For example, it only handles SBML level 2 and does not handle "Events" and "FunctionDefinitions." The interface can nevertheless be used for some models, examples [5, 6] of which are included under "demo" in the SBMLR package . This paper provides an explicit example of one approach to an SBML-R interface. It is assumed throughout that the reader is already quite familiar with both SBML  and R .
The software exists completely in R. It is comprised of four functions and is currently being distributed as a developmental package called "SBMLR" through Bioconductor . The software was written subject to two constraints: 1) models expressed in SBML-like R must be exchangeable with a range of SBML models; and 2) models must be amenable to simulation in R. The first subsection that follows defines an SBML-like R model structure, the second illustrates how it can be used in simulations, and the third describes its conversions into and out of SBML.
An SBML-Like Model Structure in R
SBML-like Model Execution in R
The function fderiv() creates the current species vector by overriding initial states with current states clipped to positive values, and by overriding any time varying boundary conditions defined by rules (SBML rules are not needed for the purine model, but are needed to implement other models ). The function fderiv() then computes the reaction rate flux vector (v) based on the current species vector (St) and multiplies it by the incidence matrix to produce the current state derivative vector (xp). The names of xp and v are reset at the end of each function call to override the problem of variables gaining new composite names from the names of their expression arguments.
A Two-Way Interface between SBML and R
The function write.SBML() was applied to Curto.r to generate Curto.xml and the function read.SBML() was then applied to Curto.xml to generate CurtoX.r. Execution of the script given in Figure 2 with line 4 of the execution code changed to act on CurtoX.r instead of Curto.r generated the same plots as before (Figure 3). This shows that the R model was successfully converted into an SBML file that can be reconverted back into a properly functioning R model. The intermediate file Curto.xml was successfully validated as an SBML level 2 file . The SBML file could thus be imported into visualization packages such as JDesigner .
As SBML evolves to handle a broader range of dynamical systems, it will become more and more challenging for simulation packages to handle all possible SBML models. It is envisioned here that the development of this SBML-R interface will be driven by its users, and not by the model representation capabilities of SBML, i.e. it is expected that the users of this interface will be programmers who are capable of modifying it as their needs require.
Compared to Matlab, which may be better equipped than R to simulate arbitrarily complex dynamical systems, R has the advantage of list handling infrastructure in parse() and xmlTreeParse(), and it also has the advantage of indexing by names instead of numbers. A further advantage, though not exploited here, is that R is object-oriented; in future versions of this interface, a print() method might be defined for objects of class SBMLR (i.e. models) to generate more readable renderings of models in R. Another advantage of R over Matlab is that it provides access to a much broader collection of microarray analysis tools, e.g. see Bioconductor . This aspect is important for those individuals who are interested in biochemical systems analyses of microarray data [14, 15]. For statisticians already familiar with R, there are also the obvious economies of maintaining system familiarity. Finally, perhaps the biggest advantage of R over Matlab is that it is freely available. On balance, there seems to be ample motivation for further developments of this interface between SBML and R.
Availability and requirements
Project name: SBMLR
Project home page: http://www.bioconductor.org/repository/devel/package/html/SBMLR.html
Operating system(s): Windows XP
Programming language: R 2.0
Other requirements: R packages: XML and ODESOLVE
License: GNU GPL
Any restrictions to use by non-academics: no restrictions
The SBMLR package is available through Bioconductor as a developmental package . It has been developed and tested only under Windows XP. To install, do NOT unzip the file SBMLR.zip after downloading to a local directory, rather, within the R GUI, click packages and install from local zip. The XML package installs similarly . Note that an error message from library(XML) can be resolved by copying the *.dll files of the XML package libs directory into the "C:\windows" directory. The ODESOLVE package must be installed before running simulations. This package is installed from the R GUI by clicking packages and install from CRAN.
The implementation of Curto et al.'s model shown in Figure 7 is independent of any knowledge of SBML. It is included here to illustrate what comes "naturally" when implementing a model in R, see Discussion.
List of abbreviations
Systems Biology Markup Language
extensible markup language
Mathematical Markup Language
ordinary differential equation.
This research was supported by the Biostatistics Core Facility of the Comprehensive Cancer Center of Case Western Reserve University and University Hospitals of Cleveland (P30 CA43703), by the American Cancer Society (IRG-91-022-09), and by the National Cancer Institute's Integrative Cancer Biology Program (P20 CA112963-01).
- Hucka M, Finney A, Sauro HM, Bolouri H, Doyle JC, Kitano H, Arkin AP, Bornstein BJ, Bray D, Cornish-Bowden A, Cuellar AA, Dronov S, Gilles ED, Ginkel M, Gor V, Goryanin II, Hedley WJ, Hodgman TC, Hofmeyr JH, Hunter PJ, Juty NS, Kasberger JL, Kremling A, Kummer U, Le Novere N, Loew LM, Lucio D, Mendes P, Minch E, Mjolsness ED, Nakayama Y, Nelson MR, Nielsen PF, Sakurada T, Schaff JC, Shapiro BE, Shimizu TS, Spence HD, Stelling J, Takahashi K, Tomita M, Wagner J, Wang J: The systems biology markup language (SBML): a medium for representation and exchange of biochemical network models. Bioinformatics 2003, 19: 524–531. 10.1093/bioinformatics/btg015View ArticlePubMedGoogle Scholar
- Finney A, Hucka M: Systems biology markup language: Level 2 and beyond. Biochem Soc Trans 2003, 31: 1472–1473.View ArticlePubMedGoogle Scholar
- Shapiro BE, Hucka M, Finney A, Doyle J: MathSBML: a package for manipulating SBML-based biological models. Bioinformatics 2004, 20: 2829–2831. 10.1093/bioinformatics/bth271PubMed CentralView ArticlePubMedGoogle Scholar
- Keating SM: SBMLToolbox.[http://sbml.org/software/sbmltoolbox/]
- Morrison PF, Allegra CJ: Folate cycle kinetics in human breast cancer cells. J Biol Chem 1989, 264: 10552–10566.PubMedGoogle Scholar
- Curto R, Voit EO, Sorribas A, Cascante M: Mathematical models of purine metabolism in man. Math Biosci 1998, 151: 1–49. 10.1016/S0025-5564(98)10001-9View ArticlePubMedGoogle Scholar
- Systems Biology Markup Language[http://sbml.org]
- The R Project for Statistical Computing[http://www.r-project.org/]
- SBML Online Tools[http://sbml.org/tools/htdocs/sbmltools.php]
- Sauro HM, Hucka M, Finney A, Wellock C, Bolouri H, Doyle J, Kitano H: Next generation simulation tools: the Systems Biology Workbench and BioSPICE integration. Omics 2003, 7: 355–372. 10.1089/153623103322637670View ArticlePubMedGoogle Scholar
- Radivoyevitch T: Sphingoid base metabolism in yeast: Mapping gene expression patterns into qualitative metabolite time course predictions. Comparative & Functional Genomics 2001, 2: 289–294. 10.1002/cfg.106View ArticleGoogle Scholar
- Voit EO, Radivoyevitch T: Biochemical systems analysis of genome-wide expression data. Bioinformatics 2000, 16: 1023–1037. 10.1093/bioinformatics/16.11.1023View ArticlePubMedGoogle Scholar
This article is published under license to BioMed Central Ltd. This is an Open Access article distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/2.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.