Skip to content

Commit ee19949

Browse files
Put docstrings on the problems
1 parent 88c63f3 commit ee19949

File tree

1 file changed

+42
-44
lines changed

1 file changed

+42
-44
lines changed

src/jump_premade_problems.jl

Lines changed: 42 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ struct JumpProblemNetwork
1212
prob_data # additional problem data, stored as a Dict
1313
end
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)
3027
Nsims = 8000
3128
expected_avg = 5.926553750000000e+02
3229
prob_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
4238
end k1 k2
@@ -47,13 +43,12 @@ prob = DiscreteProblem(u0, (0., tf), rates)
4743
Nsims = 16000
4844
expected_avg = t -> rates[1] / rates[2] .* ( 1. - exp.(-rates[2] * t))
4945
prob_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, 2A --> B
5853
k2, B --> 2A
5954
k3, A + B --> C
@@ -67,13 +62,13 @@ prob = DiscreteProblem(u0, (0., tf), rates)
6762
Nsims = 32000
6863
expected_avg = 84.876015624999994
6964
prob_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
@@ -88,15 +83,12 @@ end
8883
u0 = [200.,60.,120.,100.,50.,50.,50.] # Hill equations force use of floats!
8984
tf = 4000.
9085
prob = 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+
10092
specs_sym_to_name = Dict(
10193
:S1 => "R(a,l)",
10294
:S2 => "L(r)",
@@ -139,15 +131,16 @@ u0[ findfirst(rs.syms, :S2) ] = params[2]
139131
u0[ findfirst(rs.syms, :S3) ] = params[3]
140132
tf = 100.
141133
prob = 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+
"""
142140
prob_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
152145
N = 10 # number of genes
153146
genenetwork = "@reaction_network twentgtype begin\n"
@@ -173,15 +166,14 @@ for i = 1:(2*N)
173166
end
174167
tf = 2000.0
175168
prob = 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+
"""
176174
prob_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-
"""
185177
rn = @reaction_network gnrdtype begin
186178
c1, G --> G + M
187179
c2, M --> M + P
@@ -197,16 +189,16 @@ varlabels = ["G", "M", "P", "P2","P2G"]
197189
u0 = [1000, 0, 0, 0,0]
198190
tf = 4000.
199191
prob = 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+
"""
200198
prob_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
211203
function getDiffNetwork(N)
212204
diffnetwork = "@reaction_network dpldifftype begin\n"
@@ -223,4 +215,10 @@ function getDiffu0(N)
223215
10*ones(Int64, N)
224216
end
225217
tf = 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

Comments
 (0)