Skip to content

Commit ae8f1ad

Browse files
committed
Update jump problems to Catalyst 13
1 parent 5299b3e commit ae8f1ad

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

lib/JumpProblemLibrary/Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "JumpProblemLibrary"
22
uuid = "faf0f6d7-8cee-47cb-b27c-1eb80cef534e"
3-
version = "0.1.3"
3+
version = "0.1.4"
44

55
[deps]
66
Catalyst = "479239e8-5488-4da2-87a7-35f2df7eef83"
@@ -9,7 +9,7 @@ RuntimeGeneratedFunctions = "7e49a35a-f44a-4d26-94aa-eba1b4ca6b47"
99

1010
[compat]
1111
Aqua = "0.5"
12-
Catalyst = "11, 12"
12+
Catalyst = "13"
1313
DiffEqBase = "6"
1414
RuntimeGeneratedFunctions = "0.5"
1515
julia = "1.6"

lib/JumpProblemLibrary/src/JumpProblemLibrary.jl

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ dna_rs = @reaction_network begin
3838
k4, P --> 0
3939
k5, DNA + P --> DNAR
4040
k6, DNAR --> DNA + P
41-
end k1 k2 k3 k4 k5 k6
41+
end
4242
rates = [0.5, (20 * log(2.0) / 120.0), (log(2.0) / 120.0), (log(2.0) / 600.0), 0.025, 1.0]
4343
tf = 1000.0
4444
u0 = [1, 0, 0, 0]
@@ -54,7 +54,7 @@ prob_jump_dnarepressor = JumpProblemNetwork(dna_rs, rates, tf, u0, prob, prob_da
5454
bd_rs = @reaction_network begin
5555
k1, 0 --> A
5656
k2, A --> 0
57-
end k1 k2
57+
end
5858
rates = [1000.0, 10.0]
5959
tf = 1.0
6060
u0 = [0]
@@ -73,7 +73,7 @@ nonlin_rs = @reaction_network begin
7373
k3, A + B --> C
7474
k4, C --> A + B
7575
k5, 3C --> 3A
76-
end k1 k2 k3 k4 k5
76+
end
7777
rates = [1.0, 2.0, 0.5, 0.75, 0.25]
7878
tf = 0.01
7979
u0 = [200, 100, 150]
@@ -137,7 +137,7 @@ rs = @reaction_network begin
137137
kAoff, S8 --> S1 + S9
138138
kAdp, S8 --> S5
139139
kAdp, S9 --> S3
140-
end kon kAon koff kAoff kAp kAdp
140+
end
141141
rsi = rates_sym_to_idx
142142
rates = params[[rsi[:kon], rsi[:kAon], rsi[:koff], rsi[:kAoff], rsi[:kAp], rsi[:kAdp]]]
143143
u0 = zeros(Int, 9)
@@ -160,8 +160,8 @@ prob_jump_multistate = JumpProblemNetwork(rs, rates, tf, u0, prob,
160160

161161
# generate the network
162162
N = 10 # number of genes
163-
@parameters t
164-
@variables G[1:(2N)](t) M[1:(2N)](t) P[1:(2N)](t) G_ind[1:(2N)](t)
163+
@variables t
164+
@species (G(t))[1:(2N)] (M(t))[1:(2N)] (P(t))[1:(2N)] (G_ind(t))[1:(2N)]
165165

166166
function construct_genenetwork(N)
167167
genenetwork = make_empty_network()
@@ -209,6 +209,7 @@ for i in 1:(2 * N)
209209
end
210210
tf = 2000.0
211211
prob = DiscreteProblem(rs, u0, (0.0, tf), eval_module = @__MODULE__)
212+
212213
"""
213214
Twenty-gene model from McCollum et al,
214215
"The sorting direct method for stochastic simulation of biochemical systems with varying reaction execution behavior"
@@ -225,7 +226,7 @@ rn = @reaction_network begin
225226
c6, P2 --> 2P
226227
c7, P2 + G --> P2G
227228
c8, P2G --> P2 + G
228-
end c1 c2 c3 c4 c5 c6 c7 c8
229+
end
229230
rnpar = [0.09, 0.05, 0.001, 0.0009, 0.00001, 0.0005, 0.005, 0.9]
230231
varlabels = ["G", "M", "P", "P2", "P2G"]
231232
u0 = [1000, 0, 0, 0, 0]
@@ -243,8 +244,9 @@ prob_jump_dnadimer_repressor = JumpProblemNetwork(rn, rnpar, tf, u0, prob,
243244
# diffusion model
244245
function getDiffNetwork(N)
245246
diffnetwork = make_empty_network()
246-
@parameters t K
247-
@variables X[1:N](t)
247+
@parameters K
248+
@variables t
249+
@species (X(t))[1:N]
248250
for i in 1:N
249251
addspecies!(diffnetwork, X[i])
250252
end

0 commit comments

Comments
 (0)