Skip to content

Commit

Permalink
Changes to accomodate Catalyst 13
Browse files Browse the repository at this point in the history
  • Loading branch information
voduchuy committed Oct 28, 2023
1 parent acd2612 commit 7a17051
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Sundials = "c3572dad-4567-51f8-b174-8c6c989267f4"
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"

[compat]

Catalyst = 13

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
18 changes: 17 additions & 1 deletion examples/hog1p.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,23 @@ function Hog1p(t)
return signal
end

rn = @reaction_network begin
@parameters begin
k01
k10
a
k12
k21
k23
k32
λ0
λ1
λ2
λ3
γnuc
ktrans
γcyt
end
rn = @reaction_network begin
k01, G0 --> G1
max(0, k10 - a*Hog1p(t)), G1 --> G0
k12, G1 --> G2
Expand Down
13 changes: 7 additions & 6 deletions examples/telegraph_cme.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ a4 = propensity() do x, p
p[4] * x[3]
end

k₀₁ = 0.05
k₁₀ = 0.1
λ = 5.0
γ = 0.5
θ = [k₀₁, k₁₀, λ, γ]
k01 = 0.05
k10 = 0.1
lbda = 5.0
gamma = 0.5
θ = [k01, k10, lbda, gamma]

model = CmeModel(𝕊, [a1, a2, a3, a4], θ)

Expand All @@ -42,12 +42,13 @@ tspan = (0.0, 300.0)
fspsol1 = solve(model, p0, tspan, fspalgorithm)

# Bursting model definition using Catalyst
@parameters k₀₁ k₁₀ λ γ
bursting_rn = @reaction_network begin
k₀₁, G0 --> G1
k₁₀, G1 --> G0
λ, G1 --> G1 + mRNA
γ, mRNA -->
end
end k₀₁ k₁₀ λ γ

parameter_values = [k₀₁ => 0.05, k₁₀ => 0.1, λ => 5.0, γ => 0.5]
model_from_catalyst = CmeModel(bursting_rn, parameter_values)
Expand Down
6 changes: 1 addition & 5 deletions src/fspmatrix/sparse/fspsparsematrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,4 @@ function *(A::FspMatrixSparse, v::Vector{RealT}) where {RealT<:AbstractFloat}
return matvec(0.0, A, v)
end

#=
Interface to DifferentialEquations.jl's Linear operator
=#
# mutable struct FspDiffEqOperator <: AbstractDiffEqOperator
# end

3 changes: 1 addition & 2 deletions test/test_catalyst_interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@ end

cmemodel1 = CmeModel(𝕊, [a1,a2,a3,a4], θ)

# @parameters k01 k10 α γ
rn = @reaction_network begin
k01, G0 --> G1
k10, G1 --> G0
α, G1 --> G1 + RNA
γ*max(0.0, 1.0 - sin* t / L)), RNA -->
end
end k01 k10 α γ L

cmemodel2 = CmeModel(rn, θ)
@test get_species_count(cmemodel2) == 3
Expand Down

0 comments on commit 7a17051

Please sign in to comment.