Skip to main content

A Python package to simulate biochemical systems using the Constraint-Based Simulation Algorithm

Project description

Constraint-Based Simulation Algorithm (CBSA)

CBSA is a Python package for simulation of biochemical systems using the Constraint-Based Simulation Algorithm.

PyPI PyPI - License PyPI - Python Version

Table of contents

Installation

CBSA can be installed on your computer using pip.

Just run the following command:

python3 -m pip install cbsa --user --upgrade

Usage

CBSA

Simple reaction example

Consider the following reaction system:

equation

Using the Constrain-Based Modeling, the Stoichiometric matrix becomes:

equation

A sample code to simulate this system is:

import cbsa
import matplotlib.pyplot as plt
import numpy as np

S = [[-1, 1, 0],
     [ 1,-1,-1],
     [ 0, 0, 1]]

init_mols = [50,0,0]
k = [0.5,0.1,0.8]
max_dt = 0.1
total_sim_time = 10

sim = cbsa.ReactionSystem(S)
sim.setup()
sim.set_x(init_mols)
sim.set_k(k)
sim.set_max_dt(max_dt)

sim.setup_simulation()
sim.compute_simulation(total_sim_time)
sim_data = np.array(sim.simulation_data)

plt.plot(sim_data[:,0],sim_data[:,1],label="A")
plt.plot(sim_data[:,0],sim_data[:,2],label="B")
plt.plot(sim_data[:,0],sim_data[:,3],label="C")
plt.legend()
plt.show()

example 1 image

License

CBSA is licensed under the MIT License. Please see the file LICENCE for more information.

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

cbsa-0.1.0.tar.gz (7.8 kB view hashes)

Uploaded Source

Built Distribution

cbsa-0.1.0-py3-none-any.whl (13.6 kB view hashes)

Uploaded Python 3

Supported by

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