Importing a SBML file to Matlab
From Symbiopedia
Contents |
Note
The COBRA toolbox (see Installing COBRA toolbox for MATLAB) serves as a wrapper to SBMLToolbox, so a lot of the details of this page can be covered by using COBRA in Matlab. COBRA reformats the SBML structure to a slightly more compact, more usable structure, thus adding a layer of abstraction, as well as providing a lot of tools for using that strucutre.
I think that COBRA takes care of the problem of keeping track of what various rows and columns of the stoichiometric matrix correspond to, but am continuing to look into this. --Ben 07:03, 22 October 2008 (PDT)
The Big Picture
Systems Biology Markup Language (SBML) is a XML (eXtensible markup language) designed to share systems biology information - specifically, in silico models of organisms. SBML is described at sbml.org. It appears that SBML is mostly used to share the differential equations that define the model. SBML data can be imported to Matlab, which can than be used to do the math.
Professor Palsson (who wrote the Systems Biology textbook the group is working through in Spring 2007) makes his networks available in SBML at his web page, gcrg.ucsd.edu. His S. cerevisiae model may be of particular interest. It is availabe at http://gcrg.ucsd.edu/organisms/yeast.html.
This page is designed to explain how to
- configure Matlab so that you can import SBML data into the correct data structures;
- download an in silico organism model; and
- get the model up and running in Matlab.
Configuring Matlab
I've put the SBML toolbox on the fileserver under "Matlab Toolbox" - let's talk before you do this - bh
Note - I'm running Matlab & Simulink Release 14 with Service Pack 3 on my computer, so that's what these instructions will be based upon.
The key piece of software is the "SBML Toolbox", which "provides a set of functions that allow an SBML model to be imported into MATLAB and stored as a structure within the MATLAB environment.". The SBML Toolbox is described at http://sbml.org/software/sbmltoolbox/. Here are the installation instructions for a Windows box based on that site:
Installation
1) Download the latest Windows setup executable from SourceForge. Running this will install the SBMLToolbox onto your computer. (note: As of 2/23/07, the most recent version of the file is "SBMLToolbox-2.0.2-setup-win32.exe" - you have to scroll down a little bit to find the right file. Then you just need to doubleclick on the .exe to run the installer. Don't worry about changing any paths or anything like that - just accept the default values for everything.)
It is not necessary to have LIBSBML installed as the windows installation provides the necessary external libraries.
2) Start MATLAB and change to the SBMLToolbox/toolbox directory (the default is C:\Program Files\SBML\SBMLToolbox-2.0.2\toolbox ). Type 'install' at the MATLAB prompt.
This script performs the following: - Adds this folder (SBMLToolbox/toolbox) and all its subdirectories to the MATLAB path
- Checks whether the appropriate libraries are on the system PATH and if not adds these libraries to the MATLABROOT\bin\win32 directory which is on the PATH
- Prompts for whether to exit MATLAB
The SBML Toolbox in now installed. Documentation is available on your computer at C:\Program Files\SBML\SBMLToolbox-2.0.2\toolbox\docs\
Download an organism model
Now that Matlab is configured with the SBML Toolbox, grab an organism. I'll be using the S.cerevisiae iND750 model available at http://gcrg.ucsd.edu/organisms/yeast/yeast_sbml.html. To download, right click on the Sc_iND750.xml link and save it to your Matlab working directory (or wherever you'd like). If you'd like to see the file, your web browser should display it if you left click on the link - it's an XML file that is human-readable.
Import the Model to Matlab
To load the data into Matlab, just type "Model = TranslateSBML" in Matlab. A browse window will open, and you can select your .xml file. It will then be loaded into Matlab.
The TranselateSBML function returns "a MATLAB_SBML structure named Model within the MATLAB environment. The MATLAB_SBML structure is defined in full in the document MATLAB_SBML_Structure.pdf," which is in the C:\Program Files\SBML\SBMLToolbox-2.0.2\toolbox\docs\ folder.
The structure returned ("Model") can be passed as an argument to other functions within SBMLToolbox, or other functions developed by the user.
Now, to learn what to do with this structure....
Other things to look at
Apparently, there is another XML which should be investigated - cell markup language.
