StochPy is a versatile stochastic modeling package which is designed for stochastic simulation of molecular control networks inside living cells. Its integration with Python’s scientific libraries and PySCeS makes it an easily extensible and a user-friendly simulator. The high-level statistical and plotting functions of StochPy allow for quick and interactive model interrogation at the command line. Python’s scripting capabilities allow for more complicated and in-depth analysis of stochastic models.


  • Augustus 2015: StochPy 2.3 is out now with a completely rewritten user guide.
  • Augustus 2015: Various iPython notebooks that illustrate using StochPy can be found here.
  • October 2014: We used StochPy 2.0 in a new publication where we build a mechanistic stochastic model of histone modification pattern formation.
  • Augustus 2014: StochPy 2.1 is now available for Python 2.6+ and 3.4+ .
  • June 2014: StochPy 2.0 used for recent publication about stochastic simulations of prokaryotic two-component signaling pathways.
  • April 2014: StochPy 2.0 is out now. Major improvements: support of delayed stochastic simulation algorithms, support of explicit cell growth and cell division into stochastic simulations.
  • November 2013: StochPy Publication online in PLoS ONE: Maarleveld et al. 2013 - StochPy: A Comprehensive, User-Friendly Tool for Simulating Stochastic Biological Processes, PLoS ONE 8(11).

  • StochPy features:

  • stochastic simulation algorithms, stochastic simulation algorithms with delay, and stochastic simulation algorithms with growth and cell division;
  • explicit stochastic simulation output;
  • a human readable Model Description Language used to define models;
  • explicit stochastic simulation output;
  • the full power of Python available for you to test, build and share your modeling experiments (supports both Python 2.6+ and 3.4+);
  • SBML import capability is provided by an interface module that converts SBML into the PySCeS MDL;
  • user-friendly documentation available as docstrings, HTML and PDF;
  • allows specifying specific species to track and store;
  • analysis of event waiting times, autocorrelations, and autocovariances;
  • Allows for interactive modeling;
  • Usable as a library; and
  • StochPy is developed as Open Source software distributed under its own BSD style licence.

  • StochPy allows stochastic simulations with Cain and StochKit fixed-interval output solvers

    Because of the flexible design of StochPy, we decided to offer users of StochPy interfaces to both Cain and StochKit solvers. Users can benefit from the speed advantage of both the Cain and StochKit fixed-interval output solvers in the interactive modeling environment of StochPy. Note that these fixed-interval output solvers give incorrect output if net stoichiometric coefficients are used in the model description. The following movie illustrates some of the differences between explicit and fixed-interval stochastic output. See our user guide for more information about the the StochPy solvers and these fixed-interval output solvers.

    Using StochPy as a Library

    It is straightforward to use StochPy as a library in your project. A data object, data_stochsim, is created for those that want to use StochPy as a library or for those that want to do their own analysis. Species, distributions, propensities, simulation time, and waiting times are stored in NumPy arrays and lists. In addition, labels are stored for each of these data types in separate lists. Data is, of course, only available if it is calculated. Furthermore, determined means and standard deviations are stored in dictionaries and information about the stochastic simulation such as the number of time steps, the simulation end time, and the trajectory is stored. This data object (data_stochsim) is written to disk space if multiple trajectories are generated. The high-level function GetTrajectoryData(n) can be used to access the simulation data of a specific trajectory. By default the latest generated trajectory is not written to disk space, thus is accessible without using the high-level function GetTrajectoryData().


  • StochPy's User Guide (html)
  • Download StochPy
  • StochPy's Forum
  • PySCeS' Homepage

  •                                Get StochPy at Fast, secure and Free Open Source software downloads

    Examples of StochPy in use

  • Lofgren 2015 - Pools versus Queues: The Variable Dynamics of Stochastic “Steady States”
  • Anink-Groenen et al. 2014 - Mechanistic stochastic model of histone modification pattern formation
  • Wei 2014 - Extending the Deterministic and stochastic modelling of gene expression in the PURE system (M.Sc thesis, Delft University of Technology)
  • Wei et al. 2014 - Stochastic simulation of prokaryotic two-component signalling indicates stochasticity-induced active-state locking and growth-rate dependent bistability Molecular Biosystems, 2014
  • Rivers et al 2014 - Modeling the Impact of Interventions on an Epidemic of Ebola in Sierra Leone and Liberia
  • Schwabe et al. 2013 - Exploration of the spontaneous fluctuating activity of single enzyme molecules (FEBS Lett. 2013 Sep 2;587(17):2744-52)
  • Graf 2012 - Simulation of the Insulin Pathway (M.Sc thesis, ETH Zurich)
  • Noble et al. 2011 - Multivariate Moran Process with Lotka-Volterra Phenomenology (Phys. Rev. Lett. 107, 228101 2011)

  • StochPy development papers

  • Moinat 2014 - Extending the Stochastic Simulation Software Package StochPy with Stochastic Delays, Cell Growth and Cell Division (M.Sc thesis, VU University Amsterdam)
  • Maarleveld et al. 2013 - StochPy: A Comprehensive, User-Friendly Tool for Simulating Stochastic Biological Processes (PLoS ONE 8(11): e79345. doi:10.1371/journal.pone.0079345)