Prof Darren Wilkinson Professor of Stochastic Modelling
School of Mathematics & Statistics
Newcastle University

Software / SBML-shorthand

mod2sbml.py and sbml2mod.py

This page describes a "shorthand" version of SBML that is much easier to read and write by hand than real SBML, together with a software tool that translates the shorthand model description to real SBML.

It isn't really meant as a complete alternative to GUI model-building tools. It is just a useful tool for rapid building of essential model structure. Once the basics are defined, you can translate to SBML and load up in the GUI tool of your choice.

Example

The following is a complete description of a simple enzyme-kinetics model using the shorthand notation.
@model:2.3.1=MichaelisMentenKinetics "Michaelis-Menten Kinetics"
@compartments
 cell=1
@species
 cell:Substrate=1000
 cell:Enzyme=100
 cell:Complex=0
 cell:Product=0
@parameters
 k1=1
 k1r=2
@reactions
@rr=SubstrateEnzymeBinding "Substrate-enzyme binding"
 Substrate+Enzyme -> Complex
 k1*Substrate*Enzyme-k1r*Complex
@r=Conversion
 Complex -> Product + Enzyme
 k2*Complex : k2=3
You can download this example: mm.mod. Using the translation tool below, this model translates to this SBML.

Latest SBML-shorthand specification

All previous versions are available.

mod2sbml.py model translation tool

Note that this translator is written in Python, so you need a working Python environment including libSBML version >= 4.1.0 (and < 5.0.0) and the libSBML Python bindings. N.B. This is for libSBML version 4.1.x! The libSBML API is currently undergoing a period of rapid change, and so the version of libSBML you have really matters. If you are still using libSBML version 3.x.x, you will need a previous version of the code.

sbml2mod.py

Obviously, as the shorthand specification does not contain all SBML features, there is likely to be loss involved. However, there should be no semantic loss in the round-trip SBML-sh -> SBML -> SBML-sh. ie. doing a mod2sbml.py conversion followed by a sbml2mod.py conversion should get back to a shorthand file that is semantically equivalent to the original. sbml2mod.py works very similarly to mod2sbml.py, so no separate documentation should be necessary.

Web tool for conversion

If you don't have Python and libSBML you can use the web-based converter provided by BASIS. You do not need to have a BASIS account to use the shorthand conversion tool.

SOAP Web-services

If you don't have libSBML, or you don't have Python, you can still translate documents back and forth between SBML and SBML-shorthand programmatically by using the SOAP web-services maintained by Jeff Chen. Example scripts for python: mod2sbmlWS.py and sbml2modWS.py illustrate their use, but please note that web-services are language and platform independent. Essentially, all you need to know is that the web-service proxy WSDL is http://www.basis.ncl.ac.uk:81//BasisWebServices/BasisSBMLService?WSDL, and there are two web-services, mod2sbml and sbml2mod, both of which have a single string argument and return a single string. The web-services attempt to detect the version and call the appropriate conversion tool. Note that the error-handling on the web-services is not very sophisticated.

Other software

The subset of SBML Level 1 covered by the 1.2.1 specification is consistent with that used by my gillespie simulator and my stochInf inference software. See the web page for the research project Bayesian inference for stochastic kinetic genetic regulatory networks for further details. The subset of SBML Level 2 covered by the 2.1.2 specification is consistent with that supported by the gillespie2 software maintained by the BASIS project. Also see the Discrete stochastic models test suite for details on stochastic simulator testing.

Darren J Wilkinson Book: Stochastic Modelling for
	      Systems Biology darren.wilkinson@ncl.ac.uk
http://www.staff.ncl.ac.uk/d.j.wilkinson/
tinyurl.com/darrenjw

Site design and content Copyright © 2008-2013, Darren Wilkinson