Download Links

Simulate 3D | SBW (Win32) | Bifurcation Discovery | FluxBalance

Monday, September 14, 2009

Debugging the Systems Biology Workbench

SBW Logo (short)-transparent Work on an SBW and JSim integration is in full progress. However the other day I came across a minor snag with the SBW Java bindings, for the life of me I couldn’t find out why we could not send a model from one application to another. On any other platform (OSX, Ubuntu, Windows), I would just have started the SBW Inspector, and called the methods from the UI, or I would have used PowerShell, or the CSharp interactive shell, or even IronPython to code against the SBW object model. However I was out of luck, I did not have the mono runtime available on that system. So it dawned to me that really there should be some sort of simple debugging tools available. Given that on the system the only thing I had available was Java, I went and wrote the simplest Java SBW modules to narrow down the process. I figured in case others have the same problem I might as well put them up here for grabs.

So how would you use those java classes:

  1. Download the SBWtest.tar.gz file
  2. Extract with: tar zxf SBWtest.tar.gz
  3. change to the directory: cd SBWtest

at this point you will find two jar files (SBWCore.jar and SBWCore-debug.jar). Those jar files are the SBW Java bindings. All the following commands will assume that you include them in your classpath. There are two jar files, the SBWCore.jar will silently do its work and SBWCore-debug.jar will work just the same but add tons of debugging information for when it is really needed. Usually you’d just use the SBWCore.jar, and only switch to the other one if something fishy is going on. Let us have a brief look at the java classes included in the archive:

ListModules This all this simple class does, is to connect to SBW, and get a list of registered modules and print them to stdout. Use with:

java –cp SBWCore.jar:. ListModules

This will print a list of module names, you will have the ‘unique’ module name, followed by an equals sign and then the human readable name.
ListRunningModules This class connects to SBW and lists all currently running SBW modules. Use with:

java –cp SBWCore.jar:. ListRunningModules
StartModule A simple java class, that will just start another SBW module, it expects one argument, the ‘unique’ name of an SBW module (the name before the equals sign in the ListModules output). Start with:

java –cp SBWCore.jar:. StartModule <moduleName>

for example:

java –cp SBWCore.jar:. StartModule edu.caltech.NOM

to start the SBML support module.
Analyzer The Analyzer class represents a simple SBW module by itself. It belongs to the ‘/Analysis’ category, and as such will when registered appear in the SBW module. It has one method, ‘void doAnalysis(string)’ which will take a string (usually an SBML model, when called through the SBW menu) and print it to the command line. As with all SBW modules, it takes one argument, either ‘-sbwmodule’ in which case it is launched as module, or ‘-sbwregister’ in which case it registers with the Broker (and it should be displayed with a call to ListModules as ‘testAnalyzer’). Use with:

java –cp SBWCore.jar:. Analyzer –sbwregister

to register, or with:

java –cp SBWCore.jar:. Analyzer –sbwmodule

to run it as module.
CallAnalyzer Finally there is CallAnalyzer, a simple class, that takes two arguments, the first is a ‘unique’ SBW module name (as given by ListModules) and the other is a fileName of a SBML file, which is read and passed to the SBW module. This basically mimics what will happen if an SBW analyzer is called from the SBW menu. Use with:

java –cp SBWCore.jar:. CallAnalyzer <moduleName> <fileName>

as in:

java –cp SBWCore.jar:. Analzer ~/SBML\ Models/BorisEJB.xml

I hope they will be useful for someone else … btw … turns out that the only thing that was not working as planned, was that the module in question was registered as SELF_MANAGED module instead of a UNIQUE one … so all is well with the bindings …

Wednesday, September 9, 2009

SBW FluxBalance Module – Step 2

Some time ago I’ve implemented a basic FluxBalance SBW Module. It never was that useful really, all one could do was to load an SBML file and to define a couple of constraints and objectives. So while Brett Olivier is visiting Seattle, we sat together and came up with a scheme to store this sort of Information. This resulted in the next version of the FluxBalance tool:


This new version does not do much more than it did before, however now at least it stores the constraint and objective function in an SBML compliant annotation (which hopefully later on becomes an official SBML Level 3 package for flux balance analysis).

There is a new Windows Installer, that you can try right away …

Tuesday, September 8, 2009

RoadRunner and Events

Finally I’m back from this years ICSB. In discussions at the SBML Forum I noticed that the timing of events in roadRunner could be improved. RoadRunner is of course our high performance simulator, which is also available as web application on our home page. I’ve just finished the modifications on roadRunner and ran through the test suite again:


And while roadRunner still won’t support Algebraic Rules, the ‘fast’ flag on SBML Reactions or Delay Differential Equations, we now pass all other tests. (You might wonder about the isolated four points that in red scream that the event timing would be off. For full disclosure those are the test cases 408, 428, 684 and 849. In discussions with the COPASI team and Chris Myers from iBioSim it would seem that it is the test cases that are to blame.)

Windows users can get the new roadRunner installed from here, or by choosing “Systems Biology Workbench\Utilities\Update SBW” from the Start menu of an existing SBW 2.7.10 release. A new Linux and OSX release will be made later in the month, or early next month, when we hopefully have SBML Level 3.