Fast and flexible simulation and parameter estimation for synthetic biology using bioscrape

Fast and flexible simulation and parameter estimation for synthetic biology using bioscrape - Published in JOSS (2023)

https://github.com/biocircuits/bioscrape

Science Score: 95.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: biorxiv.org, joss.theoj.org
  • Committers with academic emails
    2 of 9 committers (22.2%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

chemical-reaction-networks crn cython parameter-identification python simulation stochastic-simulation-algorithm

Scientific Fields

Mathematics Computer Science - 65% confidence
Physics Physical Sciences - 40% confidence
Last synced: 4 months ago · JSON representation

Repository

BioSCRAPE (Bio-circuit Stochastic Single-cell Reaction Analysis and Parameter Estimation)

Basic Info
  • Host: GitHub
  • Owner: biocircuits
  • License: mit
  • Language: Jupyter Notebook
  • Default Branch: master
  • Homepage:
  • Size: 180 MB
Statistics
  • Stars: 29
  • Watchers: 3
  • Forks: 19
  • Open Issues: 32
  • Releases: 2
Topics
chemical-reaction-networks crn cython parameter-identification python simulation stochastic-simulation-algorithm
Created over 7 years ago · Last pushed 9 months ago
Metadata Files
Readme Contributing License

README.md

Bioscrape — Biological Stochastic Simulation of Single Cell Reactions and Parameter Estimation

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:

```python from bioscrape.types import Model

Load an SBML file repressilator.xml

(you can find this file in examples/models directory)

M = Model(sbmlfilename = 'repressilatorsbml.xml')

Simulate the model

from bioscrape.simulator import pysimulatemodel import numpy as np tp = np.linspace(0,256,100) result = pysimulatemodel(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!

```python 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(sbmlfilename='toysbml_model.xml')

Load experimental data

(you can find test data in inference examples/data/ directory)

df = pd.readcsv('testdata.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 = pyinference(Model = M, expdata = df, measurements = ['X'], timecolumn = ['time'], nwalkers = 20, nsteps = 5500, paramsto_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:

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 wiki.

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.3.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.

Owner

  • Name: biocircuits
  • Login: biocircuits
  • Kind: organization

JOSS Publication

Fast and flexible simulation and parameter estimation for synthetic biology using bioscrape
Published
March 09, 2023
Volume 8, Issue 83, Page 5057
Authors
Ayush Pandey ORCID
Control and Dynamical Systems, California Institute of Technology, Pasadena, CA, USA
William Poole ORCID
Altos Labs, San Francisco, CA, USA
Anandh Swaminathan ORCID
Ghost Locomotion, Mountain View, CA, USA
Victoria Hsiao ORCID
Amyris, Emeryville, CA, USA
Richard M. Murray ORCID
Control and Dynamical Systems and Biology and Biological Engineering, California Institute of Technology, Pasadena, CA, USA
Editor
Charlotte Soneson ORCID
Tags
synthetic biology systems biology deterministic and stochastic simulations parameter inference

GitHub Events

Total
  • Issues event: 1
  • Watch event: 10
  • Delete event: 3
  • Issue comment event: 14
  • Push event: 18
  • Pull request event: 11
  • Pull request review event: 6
  • Fork event: 1
  • Create event: 5
Last Year
  • Issues event: 1
  • Watch event: 10
  • Delete event: 3
  • Issue comment event: 14
  • Push event: 18
  • Pull request event: 11
  • Pull request review event: 6
  • Fork event: 1
  • Create event: 5

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 402
  • Total Committers: 9
  • Avg Commits per committer: 44.667
  • Development Distribution Score (DDS): 0.463
Past Year
  • Commits: 14
  • Committers: 3
  • Avg Commits per committer: 4.667
  • Development Distribution Score (DDS): 0.143
Top Committers
Name Email Commits
ayush9pandey a****y@g****m 216
sclamons s****s@g****m 59
William Poole w****e@c****u 53
William Poole w****x@h****m 44
Anandh Swaminathan a****m@g****m 25
sclamons s****s@S****l 2
Richard Murray m****y@c****u 1
Ayush Pandey a****y@g****r 1
Anandh Swaminathan a****n@A****l 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 58
  • Total pull requests: 60
  • Average time to close issues: 6 months
  • Average time to close pull requests: 14 days
  • Total issue authors: 13
  • Total pull request authors: 5
  • Average comments per issue: 1.78
  • Average comments per pull request: 1.37
  • Merged pull requests: 52
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 10
  • Average time to close issues: N/A
  • Average time to close pull requests: 5 days
  • Issue authors: 1
  • Pull request authors: 2
  • Average comments per issue: 0.0
  • Average comments per pull request: 2.1
  • Merged pull requests: 7
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • ayush9pandey (22)
  • WilliamIX (14)
  • sclamons (7)
  • Robaina (4)
  • zoltuz (2)
  • Farnazmdi (2)
  • murrayrm (2)
  • sophiejwalton (1)
  • oliviaywangn (1)
  • mkratz (1)
  • SpencerUyematsu (1)
  • teddiclax (1)
  • TiamHeydari (1)
Pull Request Authors
  • ayush9pandey (42)
  • WilliamIX (12)
  • sclamons (3)
  • murrayrm (1)
  • csoneson (1)
Top Labels
Issue Labels
Bioscrape Core (16) enhancement (14) bug (14) Lineages (11) documentation (11) Analysis Features (5) Inference (4) help wanted (3) question (2) invalid (1)
Pull Request Labels
Bioscrape Core (5) Analysis Features (5) bug (4) enhancement (4) Lineages (3) documentation (2) Inference (2)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 129 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 10
  • Total maintainers: 3
pypi.org: bioscrape

Biological Stochastic Simulation of Single Cell Reactions and Parameter Estimation

  • Homepage: https://github.com/biocircuits/bioscrape/
  • Documentation: https://bioscrape.readthedocs.io/
  • License: MIT License Copyright (c) 2023, Biocircuits, California Institute of Technology Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  • Latest release: 1.3.0
    published 10 months ago
  • Versions: 10
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 129 Last month
Rankings
Forks count: 8.9%
Dependent packages count: 10.0%
Stargazers count: 14.8%
Average: 15.5%
Dependent repos count: 21.7%
Downloads: 21.8%
Maintainers (3)
Last synced: 4 months ago

Dependencies

requirements.txt pypi
  • Cython *
  • beautifulsoup4 *
  • emcee >=3.0.2
  • lmfit *
  • matplotlib *
  • numpy >=1.16.5
  • pandas *
  • pytest *
  • python-libsbml *
  • scipy >=1.5.4
  • sympy *
setup.py pypi
  • beautifulsoup4 *
  • cython *
  • emcee *
  • matplotlib *
  • numpy *
  • pandas *
  • pytest *
  • python-libsbml *
  • scipy *
  • sympy *
.github/workflows/deploy_bioscrape.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
.github/workflows/test_bioscrape.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
pyproject.toml pypi
  • beautifulsoup4 *
  • corner *
  • cython *
  • emcee *
  • lmfit *
  • matplotlib *
  • numpy *
  • pandas *
  • pytest *
  • python-libsbml *
  • scipy *
  • sympy *