Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update jump problems to Catalyst 13 #113

Merged
merged 1 commit into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/JumpProblemLibrary/Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "JumpProblemLibrary"
uuid = "faf0f6d7-8cee-47cb-b27c-1eb80cef534e"
version = "0.1.3"
version = "0.1.4"

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

[compat]
Aqua = "0.5"
Catalyst = "11, 12"
Catalyst = "13"
DiffEqBase = "6"
RuntimeGeneratedFunctions = "0.5"
julia = "1.6"
Expand Down
20 changes: 11 additions & 9 deletions lib/JumpProblemLibrary/src/JumpProblemLibrary.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
k4, P --> 0
k5, DNA + P --> DNAR
k6, DNAR --> DNA + P
end k1 k2 k3 k4 k5 k6
end
rates = [0.5, (20 * log(2.0) / 120.0), (log(2.0) / 120.0), (log(2.0) / 600.0), 0.025, 1.0]
tf = 1000.0
u0 = [1, 0, 0, 0]
Expand All @@ -54,7 +54,7 @@
bd_rs = @reaction_network begin
k1, 0 --> A
k2, A --> 0
end k1 k2
end
rates = [1000.0, 10.0]
tf = 1.0
u0 = [0]
Expand All @@ -73,7 +73,7 @@
k3, A + B --> C
k4, C --> A + B
k5, 3C --> 3A
end k1 k2 k3 k4 k5
end
rates = [1.0, 2.0, 0.5, 0.75, 0.25]
tf = 0.01
u0 = [200, 100, 150]
Expand Down Expand Up @@ -137,7 +137,7 @@
kAoff, S8 --> S1 + S9
kAdp, S8 --> S5
kAdp, S9 --> S3
end kon kAon koff kAoff kAp kAdp
end
rsi = rates_sym_to_idx
rates = params[[rsi[:kon], rsi[:kAon], rsi[:koff], rsi[:kAoff], rsi[:kAp], rsi[:kAdp]]]
u0 = zeros(Int, 9)
Expand All @@ -160,8 +160,8 @@

# generate the network
N = 10 # number of genes
@parameters t
@variables G[1:(2N)](t) M[1:(2N)](t) P[1:(2N)](t) G_ind[1:(2N)](t)
@variables t
@species (G(t))[1:(2N)] (M(t))[1:(2N)] (P(t))[1:(2N)] (G_ind(t))[1:(2N)]

function construct_genenetwork(N)
genenetwork = make_empty_network()
Expand Down Expand Up @@ -209,6 +209,7 @@
end
tf = 2000.0
prob = DiscreteProblem(rs, u0, (0.0, tf), eval_module = @__MODULE__)

"""
Twenty-gene model from McCollum et al,
"The sorting direct method for stochastic simulation of biochemical systems with varying reaction execution behavior"
Expand All @@ -225,7 +226,7 @@
c6, P2 --> 2P
c7, P2 + G --> P2G
c8, P2G --> P2 + G
end c1 c2 c3 c4 c5 c6 c7 c8
end
rnpar = [0.09, 0.05, 0.001, 0.0009, 0.00001, 0.0005, 0.005, 0.9]
varlabels = ["G", "M", "P", "P2", "P2G"]
u0 = [1000, 0, 0, 0, 0]
Expand All @@ -243,8 +244,9 @@
# diffusion model
function getDiffNetwork(N)
diffnetwork = make_empty_network()
@parameters t K
@variables X[1:N](t)
@parameters K
@variables t
@species (X(t))[1:N]

Check warning on line 249 in lib/JumpProblemLibrary/src/JumpProblemLibrary.jl

View check run for this annotation

Codecov / codecov/patch

lib/JumpProblemLibrary/src/JumpProblemLibrary.jl#L247-L249

Added lines #L247 - L249 were not covered by tests
for i in 1:N
addspecies!(diffnetwork, X[i])
end
Expand Down