simulation: Simulation of a biochemical system with spatial effects

Description Usage Arguments Details Value See Also Examples

Description

These functions simulate a biochemical reacton system with spatial effects parameterized as a Petri Net. sGillespieOptimDirect and sGillespieDirectCR performs pure stochastic simulations, sRungeKuttaDormandPrince45 a pure deterministic integration, sHaseltineRawlings a hybrid of the above. Multiple runs can be performed at once.

See init for a way of defining the model that is close to the way reactions are written.

Usage

1
2
3
4
5
6
7
8
9
## Exact stochastic simulation: 
sGillespieOptimDirect(model, timep, delta=1, runs=1)
sGillespieDirectCR(model, timep, delta=1, runs=1)

## Pure deterministic:
sRungeKuttaDormandPrince45(model, timep, delta=1, ect = 1e-09)

## Hybrid stochastic/deterministic:
sHaseltineRawlings(model, timep, delta=1, runs=1, ect = 1e-09)

Arguments

model

list containing named elements:

timep

It can be either a numeric, indicating for how long (in the same time units as the propensity constants) the process will run, or a functions (R or C), in which case can be used to change the protocol at time intervals. See details.

delta

Interval time at which the state will be saved.

runs

How many runs will be performed.

ect

Precision for the fast reactions.

Details

model is a list containing the following elements:

Value

The functions return a list with the following elements:

place

vector with the names of the places if supplied. If not, the function creates names as follows: P1, P2, ...

transition

vector with the names of the transitions if supplied. If not, the function creates names as follows: T1, T2, ...

dt

vector containing the discretized times at which the state is saved (according to delta)

run

list with as many elements as runs. We will describe the first element, run[[1]], as the rest have exactly the same structure. It is also a list, with the following elements:

run[[1]]$M

list with as many elements as places, each of them containing the state of the system sampled according to delta.

run[[1]]$transitions

vector with as many elements as transitions, with the total of time each slow reaction fired.

run[[1]]$tot.transitions

numeric with the summ of run[[1]]$transitions.

See Also

init, atr

Examples

1
2
## sbioPN has been tested only on 64 bits machines.
## It may fail in 32 bits architecture.

sbioPN documentation built on May 1, 2019, 8:47 p.m.