— the global portal for all things SBML

Suggested exercises and mini-projects


Following are exercises and mini-projects that were designed to help people get started with using SBML.

Idea: LibSBML examples in different languages

The libsbml library source code currently includes a few simple examples written in only two programming languages. Libsbml supports several other languages too. Exercise: pick one language you are interested in, and rewrite the libsbml examples in that language. Please make sure the code has comments so that people reading it can understand it more easily, and please write code that is portable to at least Linux and Windows. We will split the current libsbml "examples" directory into separate languages (e.g., "examples/java", "examples/perl", etc.) and incorporate your new example code in the appropriate examples/language subdirectory. Currently the languages missing from the examples are: Python, Lisp, MATLAB.

Idea: Better SBML output program

The current command-line-based readSBML and printSBML programs in the examples directory print only a small amount of information about an SBML model. Write an improved version of printSBML that outputs more information about a model. (But, maintain its ability to output to the terminal, so that it's maximally portable.) The output could, for example, include not only general information about the model, but also print a formatted list of the different components of a model (species, compartments, etc.) and their attributes.

Idea: SBML viewer applet

Write an applet that provides a clever SBML display capability (but not editing). The purpose would be to provide a way to embed the display capability into a web page, so that people can provide a button on web pages that will bring up their model in this viewer applet. To program this, using Java is one option, but perhaps it can be done using Javascript or Flash. For maximum portability, make it a client-side program that doesn't rely on the server (so, no PHP). A simple approach would be to use a tree-display widget of some sort, similar to what is used in EBI's Java-based SBMLeditor and Herbert Sauro's Delphi-based SBML Inspector, but perhaps there is another way of displaying the information, so feel free to be creative here.

Idea: SWIG bindings for libSBML for other languages

Write SWIG bindings for some of the languages not yet supported in libSBML. For example: C#, JavaScript, PHP, Tcl/Tk. See for information about languages supported by SWIG.

Idea: Within-SBML translation facilities

Some model constructs can be expressed in more than one way in SBML. For example, a model can contain mathematical statements assigning values to named parameters, or the model can be written such that the numerical values themselves appear everywhere in the model where they are used. Some software tools cannot handle models containing assignment statements or other kinds of Rules, but can handle models that contain the values or other kinds of constructs substituted in. For these tools, the second style of model representation is preferable; the first style of model is inaccessible to them on the face of it, yet could in principle also be accessible to the tool if it had a means for interpreting the model and translating it into a more appropriate form. Write an SBML translator to perform certain types of these translations. Here is a list of ideas to start:

  1. Analyze a model's use of assignment rules, determine whether they can actually be substituted out ahead of time (e.g., the value is actually a constant), and make the appropriate changes or substitutions in the model.
  2. Others...?

Idea: SBML "normalizer" program

With the variety of SBML applications out there, there is some variability in the form of the SBML being written by different applications. Since it is unrealistic to assume that all the different tools will eventually use a common library like libSBML, we can assume there will always be different examples of SBML formatting and style. A simple aid would be to have a program that reads in SBML, "normalizes" it, and writes out the result. Currently, this can be done extremely simply by writing a program that calls on libsbml's reader function and then immediately calls libsbml's writer function. It could be made to work with Unix pipes, so that you could use it as part of a pipeline. This would be a very simple program to write, but would go a long way towards normalizing the form of the XML generated. Perhaps there are additional ways of normalizing, pretty-printing, and sanitizing SBML?

Idea: Validation in SBMLToolbox

Currently the SBMLToolbox does not validate a document before importing it into MATLAB. Write a MATLAB program that will locate the schema files and incorporate validation into the translateSBML function using libSBML.

Retrieved from ""

This page was last modified 00:20, 25 March 2011.

Please use our issue tracking system for any questions or suggestions about this website. This page was last modified 00:20, 25 March 2011.