GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - LoqmanSamani/biostoch: A Python library for simulating biological and chemical systems using deterministic and stochastic methods, including Euler’s method, Runge-Kutta, SSA, Tau-Leaping, and CLE.

BranchesTags
Open more actions menu

Latest commit

 

History

62 Commits
62 Commits

Folders and files

NameName
Last commit message
Last commit date
article
article
 
 
examples
examples
 
 
package
package
 
 
.gitignore
.gitignore
 
 
A_CME_Model.ipynb
A_CME_Model.ipynb
 
 
CME_SSA_T-leaping_ODE.ipynb
CME_SSA_T-leaping_ODE.ipynb
 
 
Gillespie_model.ipynb
Gillespie_model.ipynb
 
 
Gillespie_studentspy.sec
Gillespie_studentspy.sec
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
Tellurium.ipynb
Tellurium.ipynb
 
 
combine_cle_ssa_t-leaping_ode_t-hybrid.ipynb
combine_cle_ssa_t-leaping_ode_t-hybrid.ipynb
 
 
deterministic_simulation.py
deterministic_simulation.py
 
 
model.py
model.py
 
 
phosporilation.ipynb
phosporilation.ipynb
 
 
pro_phosporilation_dephosphorylation.ipynb
pro_phosporilation_dephosphorylation.ipynb
 
 
pro_synthesis_degradation.ipynb
pro_synthesis_degradation.ipynb
 
 
protein_synthesis&degradation.py
protein_synthesis&degradation.py
 
 
schlögl_model.py
schlögl_model.py
 
 
sigmoidal_curve.ipynb
sigmoidal_curve.ipynb
 
 
simulation_methods.ipynb
simulation_methods.ipynb
 
 
simulation_using_gillespy2.py
simulation_using_gillespy2.py
 
 
synthesis.ipynb
synthesis.ipynb
 
 

Repository files navigation

BioStoch

Static Badge PyPI - Version Static Badge Static Badge Static Badge

ssa1.png

Simulated with GillespySimulator: Concentration trajectories of species A and B over time. Ten independent simulations were performed, each represented by a different line color

Overview

  • biostoch is a Python library for simulating chemical and biological models using various deterministic and stochastic methods. It provides implementations of methods such as Euler's method, the Runge-Kutta algorithm, the Stochastic Simulation Algorithm (SSA), Tau-Leaping, and the Chemical Langevin Equation (CLE). These methods can be used to model and analyze the dynamics of biochemical reactions, gene regulatory networks, and other biological systems.

Article

  • Introducing BioStoch: A Python Library for Simulating Biological Systems is the article, which was published on Towards Data Science, provides an exploration of the mathematical bases behind various simulation methods used by BioStoch. From deterministic to stochastic algorithms, learn how to use the library to model biological systems.

Installation

  • Install biostoch and its dependencies using pip:
pip install numpy matplotlib 
pip install biostoch

Usage

import numpy
import matplotlib
import time
from biostoch.model import Model
from biostoch.ode import EulerSimulator, RungeKuttaSimulator
from biostoch.ssa import GillespieSimulator
from biostoch.tau_leaping import TauLeaping
from biostoch.cle import ChemicalLangevin
from biostoch.visualization import Visualization

# Define a system of reactions, in this case, a simple system with two reactions: A <-> B; with rate constants K1 = 0.1, K2 = 0.05
model = Model()

# Add rate constants for each reaction in the system
model.parameters({
    "K1": 0.1,
    "K2": 0.05
})

# Add species and rate of change for each of them
model.species(
    components={
        "A": 100.0,
        "B": 0.0
    },
    rate_change={
        "A": "K2 * B - K1 * A",
        "B": "K1 * A - K2 * B"
    }
)

# Add reactions and rate for each of them
model.reactions(
    reacts={
        "reaction1": "A -> B",
        "reaction2": "B -> A"
    },
    rates={
        "reaction1": "K1 * A",
        "reaction2": "K2 * B"
    }
)

# Simulate the model using ordinary differential equations (ODE) with the Euler method
euler_model = EulerSimulator(
    model=model,
    start=0,
    stop=100,
    epochs=1000
)
euler_model.reset()  # Reset the model to initialize if it has been used before
euler_model.individual_simulation()  # Simulate the model 
euler_model.species  # Print the model species after the simulation, a dictionary containing the change in species concentration during the simulation time
euler_model.time  # Show how long the simulation took to complete

# Simulate the model using ordinary differential equations (ODE) with the Runge-Kutta method
runge_model = RungeKuttaSimulator(
    model=model,
    start=0,
    stop=100,
    epochs=1000
)

runge_model.individual_simulation()
runge_model.species
runge_model.time

# Simulate the model using the Stochastic Simulation Algorithm (SSA)
ssa_model = GillespieSimulator(
    model=model,
    start=0,
    stop=100,
    max_epochs=1000
)

ssa_model.individual_simulation()
ssa_model.species
ssa_model.time

# Simulate the model using the Tau-Leaping method
tau_model = TauLeaping(
    model=model,
    start=0,
    stop=100,
    max_epochs=100
)

tau_model.individual_simulation()
tau_model.species
tau_model.time

# Simulate the model using the Chemical Langevin Equation method
cle_model = ChemicalLangevin(
    model=model,
    start=0,
    stop=100,
    max_epochs=1000
)

cle_model.individual_simulation()
cle_model.species
cle_model.time

# Visualize the simulated models using integrated matplotlib.pyplot in biostoch
euler_plot = Visualization(euler_model)
runge_plot = Visualization(runge_model)
ssa_plot = Visualization(ssa_model)
tau_plot = Visualization(tau_model)
cle_plot = Visualization(cle_model)

euler_plot.plot()
runge_plot.plot()
ssa_plot.plot()
tau_plot.plot()
cle_plot.plot()

License

  • This project is licensed under the MIT License

About

A Python library for simulating biological and chemical systems using deterministic and stochastic methods, including Euler’s method, Runge-Kutta, SSA, Tau-Leaping, and CLE.

Topics

cleoderunge-kutta-4ssatau-leaping

Resources

Readme
MIT license
Activity

Stars

6 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.