Running the Right Version of BionetSolver with CC3D

•July 26, 2011 • Leave a Comment

I’ve recently completed a second version of BionetSolver that I’ve called BionetSolver 1.0.0. It’s a fair amount faster than version 0.0.6, although the speedup scales with the number of bionetworks. If your CC3D-BionetSolver simulation only has a single bionetwork, then there won’t be much speed difference between 0.0.6 and 1.0.0. However, if you have 20, 40, 100 or more bionetworks, there will be noticeable (and pretty significant) speedup.

All that said, though, I wanted to write this post to clarify something about running the correct versions of BionetSolver with the correct versions of CC3D. Let me just list out some important points:

  1. BionetSolver must be used with CC3D 3.5.0 or newer. Right now, the newest version of CC3D is 3.6.0.
  2. CC3D 3.5.0 uses Python 2.5 while CC3D 3.6.0 uses Python 2.7. BionetSolver needs to be linked to the appropriate version of Python to be used with CC3D.
  3. Either BionetSolver 0.0.6 or 1.0.0 may be used with CC3D 3.5.0 and 3.6.0 as long as it is linked to the correct version of Python.
  4. So, I have built four versions of BionetSolver. I have a version of BionetSolver 0.0.6 linked to Python 2.5 and another version linked to Python 2.7. Likewise, I have a version of BionetSolver 1.0.0 linked to Python 2.5 and another version linked to Python 2.5.

Here I provide Windows installers for all four versions:

For CompuCell3D version 3.5.0, use the following versions of BionetSolver linked to Python 2.5:

For CompuCell3D version 3.6.0, use the following versions of BionetSolver linked to Python 2.7:
And lastly, it’s important to note that there have been some minor changes to the BionetSolver API with version 1.0.0. If you look in the \Demos\BionetSolverExamples folder after installing BionetSolver 1.0.0, you’ll see two Word documents. One is a quick start guide for BionetSolver 0.0.6 and the other is a document describing version 1.0.0 (particularly describing the minor API changes with respect to version 0.0.6). The basic information in the BionetSolver 0.0.6 quick start guide is essentially the same for version 1.0.0 except for the minor API changes. The bionetAPI function names are almost exactly the same as for version 0.0.6 but the arguments for a few of these functions are slightly different in version 1.0.0. So take a look at both of these documents. *And* of course look at the demos in the \Demos\BionetSolverExamples folder. All Demos have been appropriately revised for version 1.0.0 so that these demos will be a good resource for learning the slight differences between the 0.0.6 API and the version 1.0.0 API.

Multiscale Simulation with CompuCell3D and BionetSolver

•May 4, 2011 • 4 Comments

SOSlibPy, mentioned in previous posts (here, here and here), has now been replaced by BionetSolver. If you want to run multicellular, multiscale simulations with CompuCell3D, you may download a windows installer for BionetSolver. BionetSolver works with CC3D 3.5.0 or newer. Please download CC3D here. First install CC3D 3.5.0 and then run the installer for BionetSolver. When you do, it should default to the installation directory for CC3D. Just double check to make sure the default installation path for BionetSolver is the same as the root CC3D directory on your machine. Once you’ve installed it, there are demo BionetSolver simulations in the ‘\Demos\BionetSolverExamples’ folder. In the same folder, you will also find a quick start document for writing BionetSolver/CC3D simulations. The following is a series of slides that provide an introduction to using BionetSolver with CC3D. It takes you through a simple demo simulation called ‘CellSort_BionetsolverDemo’. As a final note, if you’re interested in using BionetSolver on a platform other than Windows, let me know. I can help you get it built for your machine.

Just some quick notes before you go through the slides below:

1) SBML stands for Systems Biology Markup Language, an XML-based model-description language for reaction kinetic models. BionetSolver can load SBML models which are essentially translated to a system of ordinary differential equations (ODEs) and solved as such. Underneath BionetSolver is SOSlib (SBML ODE Solver library) which, in turn, uses Sundials CVODE to numerically solve systems of ODEs. These can be ‘attached’ to cells in CC3D to represent internal (subcellular) biochemical networks.

2) Note that there is nothing particularly ‘special’ or different about BionetSolver steppables (refer to CC3D documentation to learn about steppables – these are written in Python and they allow one to specify complex biological processes or mechanisms in CC3D). The ‘skeleton’ of the steppable is just like any other CC3D steppable. Importing the BionetSolver API and initializing the Bionetwork Manager object in the steppable (see 3rd slide below) makes the simple BionetSolver API (7 core functions) available within the steppable.

Okay, now you can proceed with the slides…  🙂

Delta-Notch Signaling with Cell Growth and Division

•September 24, 2009 • 1 Comment

Here’s another multicellular, multiscale simulation using CompuCell3D and SOSlib. This is a more complex simulation as compared to the oscillating contact energies simulation I showed before (even if it is, perhaps, a little less visually interesting).

This simulation incorporates cell growth and division along with cell-cell communication through delta-notch signaling. ‘Internally’ there is a 2-ODE model running in association with each cell (I found this ODE model in Collier et al. 1996 and Eglen and Willshaw 2002). The numerical solution of these models (concurrently with the CC3D simulation) is accomplished using the SBML ODE Solver library (SOSlib). At the CC3D level, cell color is set depending on whether the internal (normalized) concentration of delta is above 0.5 or below 0.5. This is not intended to indicate distinct cell types. Rather, for visualization purposes, cell color is set in this manner.

Note that, with the creation of each new cell (by mitosis), a new SOSlib integrator instance must be created and associated with the new cell. The initial state of the new cell is set to be the same as the parent cell. However, as can be seen in the simulation, the child cell begins to behave in a manner distinct from the parent cell (as indicated by changing cell color).

soslibPy: Python Wrappers for the SBML ODE Solver Library

•July 17, 2009 • 3 Comments

Download Windows installer for soslibPy (setup_soslib.exe)

** Update (7-28-09): soslibPy has been repackaged in a new installer (follow the link above) that makes it easier to run the examples. The readme and tutorial have not been updated accordingly so I’ll give you brief instructions here. Open up a command prompt (go to Start –> All Programs –> Accessories –> Command Prompt) and change the directory to your soslibPy installation directory. By default, setup_soslib.exe installs to ‘c:\Program Files\soslib\’. In the command prompt, go to this directory by typing ‘cd c:\Program Files\soslib’. Then, you may run a very basic example by typing ‘runSoslibExample’. This prints 10 integration steps for a very simple ODE model. You may run a couple of more exciting examples by typing ‘runSoslibPythonExample -s <example script> -i <sbml model>’ where <example script> is replaced by the name of the example script you want to run and <sbml model> is replaced by the name of an SBML file. The names of the two example Python scripts provided with the installation are and There are also SBML files (*.xml) in the folder ‘examplesSoslib/sbmlModels/’. Be sure to include the full relative path to both the Python script and the SBML file. For example:

runSoslibPythonExample -s examplesSoslib/ -i examplesSoslib/sbmlModels/testModel.xml


runSoslibPythonExample -s examplesSoslib/ -i examplesSoslib/sbmlModels/testModel.xml

The first example above ( can run with any SBML file. Look in the ‘examplesSoslib/sbmlModels/’ folder for other SBML files. The second example, however, should be run with testModel.xml since this Python script references a parameter named ‘k1’. If, however, you provide another SBML model that happens to have a parameter named ‘k1’, the example should run okay.

Note that this work is being done in collaboration with Maciek Swat at the Biocomplexity Institute of Indiana University. We will eventually start releasing CompuCell3D with soslibPy.

I have been working with CompuCell3D to run multicellular simulations (you can download CompuCell 3.3.1 for free). My primary interest (and a focus of my current research) is multiscale model integration in biology. The core of CompuCell3D (CC3D) is written in C++ and provides the necessary functionality for setting up a multicellular simulation based on the Cellular Potts Model or CPM (also called the Glazier-Graner-Hogeweg or GGH Model). I like the following overview of the CPM: Magnetization to Morphogenesis: A Brief History of the Glazier-Graner-Hogeweg Model. The history of its development is very interesting.

Python wrappers are available for CC3D permitting scripting access to its core functionality. Additional layers of Python have been written to extend the basic capabilities of CC3D and to allow more sophisticated multicellular modeling simulations. Recently, I created a Python wrapper library for the essential functions of SOSLib (SBML ODE Solver Library – written in C) that allow SBML-defined models to be read and numerically solved. SOSLib makes use of libSBML (for reading SBML files) and SUNDIALS (particularly CVODES, the ODE solver library). The wrappers were generated using SWIG.

The Windows download for soslibPy (see the top of this post) provides a couple of sample Python scripts ( and demonstrating the use of the soslibPy library. These can be run at the Python command line by typing “from soslibPyTest import *” or “from SLPyObjectsTest import *”. Be sure to download and install Python 2.5. There are also a couple of CC3D simulation scripts ( and that demonstrate how soslibPy can be used with CC3D. Be sure to download and install CompuCell3D 3.3.1. For details on how to run these examples, see “soslibPy_README.txt” and “soslibPy_TUTORIAL.txt” from the soslibPy installation.

** Take a look at this simulation using CC3D and soslibPy **

NOTE: This work is being done as part of an NIH-funded project with James Glazier (PI) at the Indiana University Biocomplexity Institute and the Sauro Lab at the University of Washington (Bioengineering Department).

Compucell3D and SOSLib: A Match Made in Heaven??

•July 17, 2009 • 3 Comments

Update: You can download soslibPy (Python wrapper library for SOSLib) here.

What do you get when you combine the multicellular modeling capabilities of CompuCell and the SBML ODE Solver Library? Well take a look…

The following Powerpoint slides give you some idea of what’s going on.

Integrated Cellular-Subcellular Simulation PART 2

Calculation of Contact Energies PART 1

Cell Sorting Simulation 1500-2000

NOTE: This work is being done as part of an NIH-funded project with James Glazier (PI) at the Indiana University Biocomplexity Institute and the Sauro Lab at the University of Washington (Bioengineering Department).