Skip to main content

Python code relating to the textbook, Stochastic modelling for systems biology, third edition

Project description

smfsb for python

Code style: black

Python library for the book, Stochastic modelling for systems biology, third edition. This library is a Python port of the R package associated with the book.

Install

Latest stable version:

pip install smfsb

You can test your installation by typing

import smfsb

at a python prompt. If it returns silently, then it is probably installed correctly.

Note that a major breaking change has been introduced in version 1.2.0, and that the documentation has been updated to reflect this change. Following recommended good practice for numpy random number generation, random number generators are now explicity threaded through the code. This has the side-benefit of making the API more similar to the JAX version of the library.

Documentation

Note that the book, and its associated github repo is the main source of documentation for this library. The code in the book is in R, but the code in this library is supposed to mirror the R code, but in Python.

For an introduction to this library, see the python-smfsb tutorial.

Further information

For further information, see the demo directory and the API documentation. Within the demos directory, see sbmlsh-demo.py for an example of how to specify a (SEIR epidemic) model using SBML-shorthand and sbml-params.py for how to modify the parameters of models parsed from SBML (or SBML-shorthand). Also see step_cle_2df.py for a 2-d reaction-diffusion simulation. For parameter inference (from time course data), see abc-cal.py for ABC inference, abc_smc.py for ABC-SMC inference and pmmh.py for particle marginal Metropolis-Hastings MCMC-based inference. There are many other demos besides these.

You can see this package on PyPI or GitHub.

Fast simulation and inference

If you like this library but find it a little slow, you should know that there is a JAX port of this package: jax-smfsb. It requires a JAX installalation, and the API is (very) slightly modified, but it has state-of-the-art performance for simulation and inference.

Copyright 2023-2026 Darren J Wilkinson

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

smfsb-1.2.0.tar.gz (2.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

smfsb-1.2.0-py3-none-any.whl (25.9 kB view details)

Uploaded Python 3

File details

Details for the file smfsb-1.2.0.tar.gz.

File metadata

  • Download URL: smfsb-1.2.0.tar.gz
  • Upload date:
  • Size: 2.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.3

File hashes

Hashes for smfsb-1.2.0.tar.gz
Algorithm Hash digest
SHA256 394d7e69028903ebc1350ca0bd245d9c368d0b6d85a64dd4ef3ee357d8cf27f4
MD5 de9c2d8f77c7e72292f9faa564c0ccf8
BLAKE2b-256 f4eee570b8d89e2830525a347a937aecbdbe7dfb9695f3cf7729d165d279461d

See more details on using hashes here.

File details

Details for the file smfsb-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: smfsb-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 25.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.3

File hashes

Hashes for smfsb-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 309600e0d829387c5213fbb97f274d92b9f11d23211ba555da929c719981bf1a
MD5 32a83ce430207e29427655bcb6ba1aad
BLAKE2b-256 e26349c0d98e08c25f51656d9bee3b5242b59f16adf561e1fce9e62bc7783e13

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page