@@ -40,14 +40,15 @@ end k1 k2 k3 k4 k5 k6
40
40
rates = [0.5 , (20 * log (2.0 ) / 120.0 ), (log (2.0 ) / 120.0 ), (log (2.0 ) / 600.0 ), 0.025 , 1.0 ]
41
41
tf = 1000.0
42
42
u0 = [1 , 0 , 0 , 0 ]
43
- prob = DiscreteProblem (dna_rs, u0, (0.0 , tf), rates)
43
+ prob = DiscreteProblem (dna_rs, u0, (0.0 , tf), rates, eval_module = @__MODULE__ )
44
44
Nsims = 8000
45
45
expected_avg = 5.926553750000000e+02
46
46
prob_data = Dict (" num_sims_for_mean" => Nsims, " expected_mean" => expected_avg)
47
47
"""
48
48
DNA negative feedback autoregulatory model. Protein acts as repressor.
49
49
"""
50
- prob_jump_dnarepressor = JumpProblemNetwork (dna_rs, rates, tf, u0, prob, prob_data)
50
+ prob_jump_dnarepressor = JumpProblemNetwork (dna_rs, rates, tf, u0, prob, prob_data,
51
+ eval_module = @__MODULE__ )
51
52
52
53
bd_rs = @reaction_network begin
53
54
k1, 0 --> A
@@ -56,14 +57,15 @@ end k1 k2
56
57
rates = [1000.0 , 10.0 ]
57
58
tf = 1.0
58
59
u0 = [0 ]
59
- prob = DiscreteProblem (bd_rs, u0, (0.0 , tf), rates)
60
+ prob = DiscreteProblem (bd_rs, u0, (0.0 , tf), rates, eval_module = @__MODULE__ )
60
61
Nsims = 16000
61
62
expected_avg = t -> rates[1 ] / rates[2 ] .* (1.0 - exp .(- rates[2 ] * t))
62
63
prob_data = Dict (" num_sims_for_mean" => Nsims, " expected_mean_at_t" => expected_avg)
63
64
"""
64
65
Simple birth-death process with constant production and degradation.
65
66
"""
66
- prob_jump_constproduct = JumpProblemNetwork (bd_rs, rates, tf, u0, prob, prob_data)
67
+ prob_jump_constproduct = JumpProblemNetwork (bd_rs, rates, tf, u0, prob, prob_data,
68
+ eval_module = @__MODULE__ )
67
69
68
70
nonlin_rs = @reaction_network begin
69
71
k1, 2 A --> B
@@ -75,14 +77,15 @@ end k1 k2 k3 k4 k5
75
77
rates = [1.0 , 2.0 , 0.5 , 0.75 , 0.25 ]
76
78
tf = 0.01
77
79
u0 = [200 , 100 , 150 ]
78
- prob = DiscreteProblem (nonlin_rs, u0, (0.0 , tf), rates)
80
+ prob = DiscreteProblem (nonlin_rs, u0, (0.0 , tf), rates, eval_module = @__MODULE__ )
79
81
Nsims = 32000
80
82
expected_avg = 84.876015624999994
81
83
prob_data = Dict (" num_sims_for_mean" => Nsims, " expected_mean" => expected_avg)
82
84
"""
83
85
Example with a mix of nonlinear reactions, including third order
84
86
"""
85
- prob_jump_nonlinrxs = JumpProblemNetwork (nonlin_rs, rates, tf, u0, prob, prob_data)
87
+ prob_jump_nonlinrxs = JumpProblemNetwork (nonlin_rs, rates, tf, u0, prob, prob_data,
88
+ eval_module = @__MODULE__ )
86
89
87
90
oscil_rs = @reaction_network begin
88
91
0.01 , (X, Y, Z) --> 0
@@ -98,11 +101,12 @@ oscil_rs = @reaction_network begin
98
101
end
99
102
u0 = [200.0 , 60.0 , 120.0 , 100.0 , 50.0 , 50.0 , 50.0 ] # Hill equations force use of floats!
100
103
tf = 4000.0
101
- prob = DiscreteProblem (oscil_rs, u0, (0.0 , tf))
104
+ prob = DiscreteProblem (oscil_rs, u0, (0.0 , tf), eval_module = @__MODULE__ )
102
105
"""
103
106
Oscillatory system, uses a mixture of jump types.
104
107
"""
105
- prob_jump_osc_mixed_jumptypes = JumpProblemNetwork (oscil_rs, nothing , tf, u0, prob, nothing )
108
+ prob_jump_osc_mixed_jumptypes = JumpProblemNetwork (oscil_rs, nothing , tf, u0, prob, nothing ,
109
+ eval_module = @__MODULE__ )
106
110
107
111
specs_sym_to_name = Dict (:S1 => " R(a,l)" ,
108
112
:S2 => " L(r)" ,
@@ -144,7 +148,7 @@ u0[findfirst(isequal(:S1), statesyms)] = params[1]
144
148
u0[findfirst (isequal (:S2 ), statesyms)] = params[2 ]
145
149
u0[findfirst (isequal (:S3 ), statesyms)] = params[3 ]
146
150
tf = 100.0
147
- prob = DiscreteProblem (rs, u0, (0.0 , tf), rates)
151
+ prob = DiscreteProblem (rs, u0, (0.0 , tf), rates, eval_module = @__MODULE__ )
148
152
"""
149
153
Multistate model from Gupta and Mendes,
150
154
"An Overview of Network-Based and -Free Approaches for Stochastic Simulation of Biochemical Systems",
@@ -154,7 +158,8 @@ prob = DiscreteProblem(rs, u0, (0.0, tf), rates)
154
158
prob_jump_multistate = JumpProblemNetwork (rs, rates, tf, u0, prob,
155
159
Dict (" specs_to_sym_name" => specs_sym_to_name,
156
160
" rates_sym_to_idx" => rates_sym_to_idx,
157
- " params" => params))
161
+ " params" => params),
162
+ eval_module = @__MODULE__ )
158
163
159
164
# generate the network
160
165
N = 10 # number of genes
@@ -206,13 +211,14 @@ for i in 1:(2 * N)
206
211
u0[findfirst (isequal (G[i]), states (rs))] = 1
207
212
end
208
213
tf = 2000.0
209
- prob = DiscreteProblem (rs, u0, (0.0 , tf))
214
+ prob = DiscreteProblem (rs, u0, (0.0 , tf), eval_module = @__MODULE__ )
210
215
"""
211
216
Twenty-gene model from McCollum et al,
212
217
"The sorting direct method for stochastic simulation of biochemical systems with varying reaction execution behavior"
213
218
Comp. Bio. and Chem., 30, pg. 39-49 (2006).
214
219
"""
215
- prob_jump_twentygenes = JumpProblemNetwork (rs, nothing , tf, u0, prob, nothing )
220
+ prob_jump_twentygenes = JumpProblemNetwork (rs, nothing , tf, u0, prob, nothing ,
221
+ eval_module = @__MODULE__ )
216
222
217
223
rn = @reaction_network begin
218
224
c1, G --> G + M
@@ -228,15 +234,16 @@ rnpar = [0.09, 0.05, 0.001, 0.0009, 0.00001, 0.0005, 0.005, 0.9]
228
234
varlabels = [" G" , " M" , " P" , " P2" , " P2G" ]
229
235
u0 = [1000 , 0 , 0 , 0 , 0 ]
230
236
tf = 4000.0
231
- prob = DiscreteProblem (rn, u0, (0.0 , tf), rnpar)
237
+ prob = DiscreteProblem (rn, u0, (0.0 , tf), rnpar, eval_module = @__MODULE__ )
232
238
"""
233
239
Negative feedback autoregulatory gene expression model. Dimer is the repressor.
234
240
Taken from Marchetti, Priami and Thanh,
235
241
"Simulation Algorithms for Comptuational Systems Biology",
236
242
Springer (2017).
237
243
"""
238
244
prob_jump_dnadimer_repressor = JumpProblemNetwork (rn, rnpar, tf, u0, prob,
239
- Dict (" specs_names" => varlabels))
245
+ Dict (" specs_names" => varlabels),
246
+ eval_module = @__MODULE__ )
240
247
241
248
# diffusion model
242
249
function getDiffNetwork (N)
@@ -265,6 +272,6 @@ tf = 10.0
265
272
u0 is a similar function that returns the initial condition vector.
266
273
"""
267
274
prob_jump_diffnetwork = JumpProblemNetwork (getDiffNetwork, params, tf, getDiffu0, nothing ,
268
- nothing )
275
+ nothing , eval_module = @__MODULE__ )
269
276
270
277
end # module
0 commit comments