BioSANS2020.propagation.stochastic.gillespie_ssa

This module is the gillespie_ssa module

This module propagates the stochastic simulation algorithm also known as Gillespie.

Module Contents

Functions

gillespie_ssa(tvar, sp_comp, ks_dict, conc, r_dict, p_dict, stch_var, rand_seed, implicit=False, rfile='')

[summary]

BioSANS2020.propagation.stochastic.gillespie_ssa.gillespie_ssa(tvar, sp_comp, ks_dict, conc, r_dict, p_dict, stch_var, rand_seed, implicit=False, rfile='')

[summary]

Args:

tvar (list): time stamp of simulation sp_comp (dict): dictionary of appearance or position of species

or component in the reaction tag of BioSANS topology file.

For example;

#REACTIONS A => B, -kf1 # negative means to be estimated B => C, kf2

The value of sp_comp is

sp_comp = {‘A’: {0}, ‘B’: {0, 1}, ‘C’: {1}}

A appears in first reaction with index 0 B appears in first and second reaction with index 0, 1 C appears in second reaction with index 1

ks_dict (dict): dictionary of rate constant that appear in each

reactions.

For example;

#REACTIONS A => B , 0.3 # first reaction B <=> C, 0.1, 0.2 # second reaction

The value of ks_dict is

ks_dict = {

0 : [0.3], # first reaction 1 : [0.1, 0.2] # second reaction

}

conc (dict): dictionary of initial concentration.

For example;

{‘A’: 100.0, ‘B’: -1.0, ‘C’: 0.0} negative means unknown or for estimation

r_dict (dict): dictionary of reactant stoichiometry. For example

r_dict = {

0: {‘A’: 1}, # first reaction, coefficient of A is 1 1: {‘B’: 1} # second reaction, coefficient of B is 1

}

p_dict (dict): dictionary of product stoichiometry. For example

p_dict = {

0: {‘B’: 1}, # first reaction, coefficient of B is 1 1: {‘C’: 1} # second reaction, coefficient of C is 1

}

stch_var (numpy.ndarray): stoichiometric matrix. For example

v_stoich = np.array([

[ -1, 0 ] # species A [ 1, -1 ] # species B [ 0, 1 ] # species C

#1st rxn 2nd rxn

])

rand_seed (float): random seed value picked at random for each

trajectory. They have been sampled from the calling program.

implicit (bool, optional): True means report in time intervals

similar to the input time intervals even if actual step is more or less. Defaults to False.

rfile (string, optional): name of topology file where some

parameters or components are negative indicating they have to be estimated. Defaults to None.

Returns:

tuple: (time, trajectories)