@@ -12,10 +12,7 @@ struct JumpProblemNetwork
1212 prob_data # additional problem data, stored as a Dict
1313end
1414
15- """
16- DNA negative feedback autoregulatory model. Protein acts as repressor.
17- """
18- rs = @reaction_network ptype begin
15+ dna_rs = @reaction_network ptype begin
1916 k1, DNA --> mRNA + DNA
2017 k2, mRNA --> mRNA + P
2118 k3, mRNA --> 0
@@ -30,13 +27,12 @@ prob = DiscreteProblem(u0, (0.0, tf), rates)
3027Nsims = 8000
3128expected_avg = 5.926553750000000e+02
3229prob_data = Dict (" num_sims_for_mean" => Nsims, " expected_mean" => expected_avg)
33- prob_jump_dnarepressor = JumpProblemNetwork (rs, rates, tf, u0, prob, prob_data)
34-
35-
3630"""
37- Simple constant production with degradation example
31+ DNA negative feedback autoregulatory model. Protein acts as repressor.
3832"""
39- rs = @reaction_network pdtype begin
33+ prob_jump_dnarepressor = JumpProblemNetwork (dna_rs, rates, tf, u0, prob, prob_data)
34+
35+ bd_rs = @reaction_network pdtype begin
4036 k1, 0 --> A
4137 k2, A --> 0
4238end k1 k2
@@ -47,13 +43,12 @@ prob = DiscreteProblem(u0, (0., tf), rates)
4743Nsims = 16000
4844expected_avg = t -> rates[1 ] / rates[2 ] .* ( 1. - exp .(- rates[2 ] * t))
4945prob_data = Dict (" num_sims_for_mean" => Nsims, " expected_mean_at_t" => expected_avg)
50- prob_jump_constproduct = JumpProblemNetwork (rs, rates, tf, u0, prob, prob_data)
51-
52-
5346"""
54- Example with a mix of nonlinear reactions, including third order
47+ Simple birth-death process with constant production and degradation.
5548"""
56- rs = @reaction_network dtype begin
49+ prob_jump_constproduct = JumpProblemNetwork (bd_rs, rates, tf, u0, prob, prob_data)
50+
51+ nonlin_rs = @reaction_network dtype begin
5752 k1, 2 A --> B
5853 k2, B --> 2 A
5954 k3, A + B --> C
@@ -67,13 +62,13 @@ prob = DiscreteProblem(u0, (0., tf), rates)
6762Nsims = 32000
6863expected_avg = 84.876015624999994
6964prob_data = Dict (" num_sims_for_mean" => Nsims, " expected_mean" => expected_avg)
70- prob_jump_nonlinrxs = JumpProblemNetwork (rs, rates, tf, u0, prob, prob_data)
71-
72-
7365"""
74- Oscillatory system, uses a mixture of jump types.
66+ Example with a mix of nonlinear reactions, including third order
7567"""
76- rs = @reaction_network rnoscType begin
68+ prob_jump_nonlinrxs = JumpProblemNetwork (nonlin_rs, rates, tf, u0, prob, prob_data)
69+
70+
71+ oscil_rs = @reaction_network rnoscType begin
7772 0.01 , (X,Y,Z) --> 0
7873 hill (X,3. ,100. ,- 4 ), 0 --> Y
7974 hill (Y,3. ,100. ,- 4 ), 0 --> Z
8883u0 = [200. ,60. ,120. ,100. ,50. ,50. ,50. ] # Hill equations force use of floats!
8984tf = 4000.
9085prob = DiscreteProblem (u0, (0. ,tf))
91- prob_jump_osc_mixed_jumptypes = JumpProblemNetwork (rs, nothing , tf, u0, prob, nothing )
92-
93-
9486"""
95- Multistate model from Gupta and Mendes,
96- "An Overview of Network-Based and -Free Approaches for Stochastic Simulation of Biochemical Systems",
97- Computation 2018, 6, 9; doi:10.3390/computation6010009
98- Translated from supplementary data file: Models/Multi-state/fixed_multistate.xml
87+ Oscillatory system, uses a mixture of jump types.
9988"""
89+ prob_jump_osc_mixed_jumptypes = JumpProblemNetwork (oscil_rs, nothing , tf, u0, prob, nothing )
90+
91+
10092specs_sym_to_name = Dict (
10193 :S1 => " R(a,l)" ,
10294 :S2 => " L(r)" ,
@@ -139,15 +131,16 @@ u0[ findfirst(rs.syms, :S2) ] = params[2]
139131u0[ findfirst (rs. syms, :S3 ) ] = params[3 ]
140132tf = 100.
141133prob = DiscreteProblem (u0, (0. , tf), rates)
134+ """
135+ Multistate model from Gupta and Mendes,
136+ "An Overview of Network-Based and -Free Approaches for Stochastic Simulation of Biochemical Systems",
137+ Computation 2018, 6, 9; doi:10.3390/computation6010009
138+ Translated from supplementary data file: Models/Multi-state/fixed_multistate.xml
139+ """
142140prob_jump_multistate = JumpProblemNetwork (rs, rates, tf, u0, prob,
143141 Dict (" specs_to_sym_name" => specs_sym_to_name, " rates_sym_to_idx" => rates_sym_to_idx, " params" => params))
144142
145143
146- """
147- Twenty-gene model from McCollum et al,
148- "The sorting direct method for stochastic simulation of biochemical systems with varying reaction execution behavior"
149- Comp. Bio. and Chem., 30, pg. 39-49 (2006).
150- """
151144# generate the network
152145N = 10 # number of genes
153146genenetwork = " @reaction_network twentgtype begin\n "
@@ -173,15 +166,14 @@ for i = 1:(2*N)
173166end
174167tf = 2000.0
175168prob = DiscreteProblem (u0, (0.0 , tf))
169+ """
170+ Twenty-gene model from McCollum et al,
171+ "The sorting direct method for stochastic simulation of biochemical systems with varying reaction execution behavior"
172+ Comp. Bio. and Chem., 30, pg. 39-49 (2006).
173+ """
176174prob_jump_twentygenes = JumpProblemNetwork (rs, nothing , tf, u0, prob, nothing )
177175
178176
179- """
180- Negative feedback autoregulatory gene expression model. Dimer is the repressor.
181- Taken from Marchetti, Priami and Thanh,
182- "Simulation Algorithms for Comptuational Systems Biology",
183- Springer (2017).
184- """
185177rn = @reaction_network gnrdtype begin
186178 c1, G --> G + M
187179 c2, M --> M + P
@@ -197,16 +189,16 @@ varlabels = ["G", "M", "P", "P2","P2G"]
197189u0 = [1000 , 0 , 0 , 0 ,0 ]
198190tf = 4000.
199191prob = DiscreteProblem (u0, (0.0 , tf), rnpar)
192+ """
193+ Negative feedback autoregulatory gene expression model. Dimer is the repressor.
194+ Taken from Marchetti, Priami and Thanh,
195+ "Simulation Algorithms for Comptuational Systems Biology",
196+ Springer (2017).
197+ """
200198prob_jump_dnadimer_repressor = JumpProblemNetwork (rn, rnpar, tf, u0, prob,
201199 Dict (" specs_names" => varlabels))
202200
203201
204- """
205- Continuous time random walk (i.e. diffusion approximation) example.
206- Here the network in the JumpProblemNetwork is a function that returns a
207- network given the number of lattice sites.
208- u0 is a similar function that returns the initial condition vector.
209- """
210202# diffusion model
211203function getDiffNetwork (N)
212204 diffnetwork = " @reaction_network dpldifftype begin\n "
@@ -223,4 +215,10 @@ function getDiffu0(N)
223215 10 * ones (Int64, N)
224216end
225217tf = 10.
226- prob_jump_diffnetwork = JumpProblemNetwork (getDiffNetwork, params, tf, getDiffu0, nothing , nothing )
218+ """
219+ Continuous time random walk (i.e. diffusion approximation) example.
220+ Here the network in the JumpProblemNetwork is a function that returns a
221+ network given the number of lattice sites.
222+ u0 is a similar function that returns the initial condition vector.
223+ """
224+ prob_jump_diffnetwork = JumpProblemNetwork (getDiffNetwork, params, tf, getDiffu0, nothing , nothing )
0 commit comments