Skip to main content

Bioscrape — Biological Modeling, Simulation, and Parameter Estimation

A Python toolbox to simulate, analyze, and learn biological system models

Build Status PyPI version status

  • Getting started with Bioscrape: Bioscrape Core

  • Bioscrape analysis features: Bioscrape Sensitivity Analysis

  • Parameter inference with Bioscrape: Bioscrape Inference

Bioscrape is a Systems Biology Markup Language (SBML) simulator written in Cython for speed and Python compatibility. It can be used for deterministic, stochastic, or single cell simulation and also has parameter inference capabilities.

Example 1: Simulating an SBML

Bioscrape allows for deterministic and stochastic simulation of SBML models:

from bioscrape.types import Model
# Load an SBML file repressilator.xml 
# (you can find this file in `examples/models` directory)
M = Model(sbml_filename = 'repressilator_sbml.xml')
# Simulate the model
from bioscrape.simulator import py_simulate_model
import numpy as np
tp = np.linspace(0,256,100)
result = py_simulate_model(timepoints=tp, Model=M, stochastic=True)
# Plot the simulation result (the result is a Pandas dataframe)
import matplotlib.pyplot as plt
plt.plot(tp, result['X'])

Example 2: Run Bayesian inference with Bioscrape

Bioscrape can be used to identify model parameters using experimental data. In the example below, we show the user-friendly plug-and-play nature of bioscrape inference. We load the data as a Pandas dataframe and the model as an SBML file. The Bayesian inference is implemented as a wrapper for Python emcee that implements Markov Chain Monte Carlo (MCMC) sampler. Bioscrape inference provides various features such as: multiple data conditions, multiple data trajectories, deterministic inference, automatic visualization of posteriors, convergence checking tools, built-in and customizable priors, and lots more!

from bioscrape.types import Model
import pandas as pd
from bioscrape.inference import py_inference

# Load an SBML model 
# (you can get this file in `inference examples/models/` directory)
M = Model(sbml_filename='toy_sbml_model.xml')

# Load experimental data 
# (you can find test data in `inference examples/data/` directory)
df = pd.read_csv('test_data.csv', delimiter = '\t', 
                 names = ['X','time'], skiprows = 1)

# Use built-in priors, 
# For 'd1': a Gaussian distribution of mean 0.2 and standard deviation of 20,
# while ensuring the parameter remains positive
# For 'k1': a Uniform distribution with minimum value 0 and maximum value 100

prior = {'d1' : ['gaussian', 0.2, 20, 'positive'], 'k1' : ['uniform', 0, 100]}

# Run Bayesian inference
sampler, pid = py_inference(Model = M, exp_data = df, measurements = ['X'], 
                            time_column = ['time'], nwalkers = 20, nsteps = 5500,
                            params_to_estimate = ['d1', 'k1'], prior = prior)
# A sampler object containing all samples is returned.
# The pid object consists of various utilities for further analysis.
# This will plot the resulting posterior parameter distributions as well.

All examples can be found in the examples, the inference examples, and the lineage examples folders. If you prefer to run the package without installing the package, please use the Google Colab links above. If you want a local installation for bioscrape (recommended for faster speeds), follow the steps below:

Documentation

Read more about the package, the tutorial-style examples, and the Bioscrape API in the Bioscrape ReadTheDocs.

Installation

Install the latest version of Bioscrape::

$ pip install bioscrape

Please note that Bioscrape is a Cython extension module and requires a C++ compiler to be set up on your computer for installation. With the PyPi distribution, you can only install the core Bioscrape without the additional lineages package. To install lineages, clone the GitHub repository and run python setup.py install lineage from the bioscrape directory.

Try online without installing, open self-explanatory jupyter notebooks with Google Colab (linked at the top of this README).

Further details about the installation process can be found in the Bioscrape docs.

Bugs and Contributing to Bioscrape

Please report any bugs that you find here. Or, even better, fork the repository on GitHub, and create a pull request (PR). We welcome all changes, big or small, and we will help you make the PR if you are new to git (just ask on the issue). The CONTRIBUTING.md file has more detailed set of instructions on contributing to the software.

Versions

Bioscrape versions:

  • 1.4.0 (latest release): To install run pip install bioscrape
  • 1.2.2 (tagged stable release): To install run pip install bioscrape==1.2.2
  • 1.0.4 (beta release): To install run pip install bioscrape==1.0.4

License

Released under the MIT License (see LICENSE)

Copyright (c) 2022, Biocircuits, California Institute of Technology. All rights reserved.

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

bioscrape-1.4.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (8.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

bioscrape-1.4.0-cp312-cp312-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

bioscrape-1.4.0-cp311-cp311-win_amd64.whl (1.0 MB view details)

Uploaded CPython 3.11Windows x86-64

bioscrape-1.4.0-cp311-cp311-win32.whl (886.7 kB view details)

Uploaded CPython 3.11Windows x86

bioscrape-1.4.0-cp311-cp311-musllinux_1_2_x86_64.whl (9.1 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

bioscrape-1.4.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (8.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

bioscrape-1.4.0-cp311-cp311-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

bioscrape-1.4.0-cp310-cp310-win_amd64.whl (1.0 MB view details)

Uploaded CPython 3.10Windows x86-64

bioscrape-1.4.0-cp310-cp310-win32.whl (888.0 kB view details)

Uploaded CPython 3.10Windows x86

bioscrape-1.4.0-cp310-cp310-musllinux_1_2_x86_64.whl (8.6 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

bioscrape-1.4.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (7.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

bioscrape-1.4.0-cp310-cp310-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file bioscrape-1.4.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bioscrape-1.4.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0cd03651cbea63ca93c303e4596332e8379cff7b0cc3dd9658a085f4669d39f4
MD5 0856e3f03831bf76a0f08cd12edf3bab
BLAKE2b-256 a292f95f6845c7d757e83df6630b9caa45a2f0ae0f7b1b73ceb8295c0f23676a

See more details on using hashes here.

File details

Details for the file bioscrape-1.4.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bioscrape-1.4.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cd712b162f72518de09d205fad90cdd24a0552e5b78b48105ade99e55fdb9017
MD5 de251b232bb89d18eea60700992d6a89
BLAKE2b-256 5834fcb78d54746078c16a21f002ff932bd798d31d06b72196e1c429c2ec41e3

See more details on using hashes here.

Provenance

The following attestation bundles were made for bioscrape-1.4.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: pypi_release.yml on biocircuits/bioscrape

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bioscrape-1.4.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: bioscrape-1.4.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for bioscrape-1.4.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 5e8d9f9f8f00c3872e1dc81f36f643e42d45b216ab46555360d6ad637356adf1
MD5 78acf502c2a46ef91ab999c2e2303e5f
BLAKE2b-256 9a24cb6ad6eba262cfb3d8bb3abef47bd80aad876765f0641636026ff1961bc8

See more details on using hashes here.

Provenance

The following attestation bundles were made for bioscrape-1.4.0-cp311-cp311-win_amd64.whl:

Publisher: pypi_release.yml on biocircuits/bioscrape

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bioscrape-1.4.0-cp311-cp311-win32.whl.

File metadata

  • Download URL: bioscrape-1.4.0-cp311-cp311-win32.whl
  • Upload date:
  • Size: 886.7 kB
  • Tags: CPython 3.11, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for bioscrape-1.4.0-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 f31935d74991a2a5ca9644dae9536efefe3643da12e1955e1ba2890ea1bcba5c
MD5 cd44fb3e0bb2d5fe2005ffffb4235e96
BLAKE2b-256 d7cc12d49fe91593e0ee04bfd5dd88decdb11d55bab69a873cfa95059c14d621

See more details on using hashes here.

Provenance

The following attestation bundles were made for bioscrape-1.4.0-cp311-cp311-win32.whl:

Publisher: pypi_release.yml on biocircuits/bioscrape

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bioscrape-1.4.0-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for bioscrape-1.4.0-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 b4d5219d8eb8f4ea07fa39fd3a74862503f6ac52571a2f96da9607ebb56ae31b
MD5 c0c9ef842243fa5806caa2184203b831
BLAKE2b-256 e8226baef51e3438458ec2dc4ac6c7015f1e29e75f16735dc23d689e0e2c5697

See more details on using hashes here.

Provenance

The following attestation bundles were made for bioscrape-1.4.0-cp311-cp311-musllinux_1_2_x86_64.whl:

Publisher: pypi_release.yml on biocircuits/bioscrape

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bioscrape-1.4.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bioscrape-1.4.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 586074076345f376c881e1140bbc1bda39241d39e58199ae7e5bb15847a7d33f
MD5 088b28c42e50ee985f8ee15fd73a3736
BLAKE2b-256 aff2c060b981e71ddf00c39255332af180bbaf7a066cbab8b7bf0f70dd041f67

See more details on using hashes here.

Provenance

The following attestation bundles were made for bioscrape-1.4.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: pypi_release.yml on biocircuits/bioscrape

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bioscrape-1.4.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bioscrape-1.4.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9674bface50e0eef680cb09a580405dfcc5abcb24c198bd6bb478060efec5959
MD5 4c1b188db95fd98921d2f2e61890edb4
BLAKE2b-256 214dd76d793307721fc0526fe3806e84393be3c8baaa3573fc5acbd6513dfd46

See more details on using hashes here.

Provenance

The following attestation bundles were made for bioscrape-1.4.0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: pypi_release.yml on biocircuits/bioscrape

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bioscrape-1.4.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: bioscrape-1.4.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for bioscrape-1.4.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 5ca14ce53b72b7de282cc4609d3b8e60b6719172031021a2083e88020dbf7333
MD5 383fccf451240bc818faed29ed3182a5
BLAKE2b-256 73ed7f6242651e1027e4dfa2ef15d1500767cf564dd22451b9dc6dc253f598b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for bioscrape-1.4.0-cp310-cp310-win_amd64.whl:

Publisher: pypi_release.yml on biocircuits/bioscrape

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bioscrape-1.4.0-cp310-cp310-win32.whl.

File metadata

  • Download URL: bioscrape-1.4.0-cp310-cp310-win32.whl
  • Upload date:
  • Size: 888.0 kB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for bioscrape-1.4.0-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 d2641670cf32fda2f0cea7c5aae43ca7c13e3f1b65b4055de20040d735e3bcb1
MD5 7c80e28d599d5954560f270ca86a1a3e
BLAKE2b-256 4fb4b4b68a1f5a9896d0643f204dffa72d78735c2e0adc95192c9a2da045d276

See more details on using hashes here.

Provenance

The following attestation bundles were made for bioscrape-1.4.0-cp310-cp310-win32.whl:

Publisher: pypi_release.yml on biocircuits/bioscrape

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bioscrape-1.4.0-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for bioscrape-1.4.0-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 62e07e54951a95a8cb13ba1727c393f8a77edeca06299652ceb420866796720c
MD5 762284d788a5e7de3b47da429efb4304
BLAKE2b-256 a068e3a5f790ab588101bd1c2e4ccd23c5dda6ad274e7a60b0d9ddda22b99808

See more details on using hashes here.

Provenance

The following attestation bundles were made for bioscrape-1.4.0-cp310-cp310-musllinux_1_2_x86_64.whl:

Publisher: pypi_release.yml on biocircuits/bioscrape

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bioscrape-1.4.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bioscrape-1.4.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2f729e2a6ca5511b9c374a1273a0c93b75ac265bc51c9e2abf3fbbf0b768f926
MD5 e9c7b0d729a3720fa38114445adb44cb
BLAKE2b-256 399f8fce65af6c408ea419cb7d40c3d5c549873f739fa62276b5cdfdc0957530

See more details on using hashes here.

Provenance

The following attestation bundles were made for bioscrape-1.4.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: pypi_release.yml on biocircuits/bioscrape

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bioscrape-1.4.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bioscrape-1.4.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b79c8b66bffce7d9409057ba2595afde31fb02adb9a203b6612545ff9d1937f1
MD5 c6bde8ee8932b4169a327c55da85c865
BLAKE2b-256 9446a5bacf589795fc3020edc5627235138272c857d46908221f8100083bda4c

See more details on using hashes here.

Provenance

The following attestation bundles were made for bioscrape-1.4.0-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: pypi_release.yml on biocircuits/bioscrape

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

1.4.1

25 files

This release

1.4.0 This release

12 files

1.3.0

1 file

1.2.2

1 file

1.2.1

2 files

1.2.0

2 files

1.1.0

3 files

1.0.4

2 files

1.0.3

1 file

1.0.2.2

1 file

1.0.2.1

1 file

1.0.2

1 file

Supported by

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