SimBiology from Scripts II: Parameter scanning

In a previous post, I (not so) briefly showed how to load the SimBiology file, select from it the model and simulation configuration settings, and evaluate the model with SimBiology’s simulation engine.

That’s great if you only needed the results for one model with one configuration. I’m guessing that won’t be the case for most use cases, though. In my own research, I am more often interested in how a system’s evolution changes across different initial configurations. For a specie or parameter of interest, I create a range of values to explore, and re-simulate my model for each parameter value in that range. Then I can compare the model outputs to analyze how the variations impacted the system.

SimBiology has a feature for performing these sort of studies, which it calls parameter scanning. However, these parameter scans run painfully slow through SimBio’s graphical interface (surprise, surprise), worsening with increases to model size or complexity. And this is just scanning over a single parameter. SimBiology often becomes unstable for scans of two or more parameters.

This frustration is almost wholly avoidable if we handle our SimBiology models programmatically instead. Today, I’ll demonstrate a simple way to replicate SimBio’s parameter scan process from a MATLAB script. Basically, we will decide on a parameter to vary, and a range of values we want to explore. We setup an array of values spanning that range, loop through that array, and run a simulation for each iteration.

The Model

Okay, let’s get started! This example assumes a very simple chemical reaction network ⇀ ⇀ C where k1 and k2 are kinetic rate constants for the chemical reactions where A becomes B, and B becomes C, respectively. Let’s say that we are interested in how k1 impacts levels of species C ultimately..… Read More

SimBiology from Scripts I: loading and running simulations programmatically

SimBiology is a toolkit for MATLAB that allows one to build and simulate models of dynamic systems easily, especially for systems biological applications like modeling pharmacokinetics/biochemical reaction networks. While its usual draw is the easy-to-use and fast-to-learn GUI, SimBiology has a programmatic interface too, enabling models to be built and simulated from the MATLAB console or a script. I’ve found the GUI is great for model building, but complicated simulations or parameter scans are much slower when performed from the interface.

Unfortunately, the SimBiology documentation1,2 can be a little cryptic, and it lacks a “Getting Started”-level tutorial to understand the basics. So over the next few tutorials, I’ll try to fill this void.… Read More