Skip to content

Commit 297208f

Browse files
authored
Merge branch 'master' into param_stoich
2 parents 56acc1f + 705d684 commit 297208f

38 files changed

+2655
-113
lines changed

.github/workflows/Documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- uses: actions/checkout@v4
1515
- uses: julia-actions/setup-julia@latest
1616
with:
17-
version: '1'
17+
version: '1.10.2'
1818
- name: Install dependencies
1919
run: julia --project=docs/ -e 'ENV["JULIA_PKG_SERVER"] = ""; using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
2020
- name: Build and deploy

Project.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ BifurcationKit = "0.3"
4040
DataStructures = "0.18"
4141
DiffEqBase = "6.83.0"
4242
DocStringExtensions = "0.8, 0.9"
43+
DynamicPolynomials = "0.5"
4344
DynamicQuantities = "0.13.2"
4445
Graphs = "1.4"
4546
HomotopyContinuation = "2.9"
@@ -57,7 +58,7 @@ StructuralIdentifiability = "0.5.1"
5758
SymbolicUtils = "1.0.3"
5859
Symbolics = "5.27"
5960
Unitful = "1.12.4"
60-
julia = "1.9"
61+
julia = "1.10"
6162

6263
[extras]
6364
BifurcationKit = "0f109fa4-8a5d-4b75-95aa-f515264e7665"

docs/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
3737

3838
[compat]
3939
BenchmarkTools = "1.5"
40-
BifurcationKit = "0.3"
40+
BifurcationKit = "0.3.4"
4141
CairoMakie = "0.12"
4242
Catalyst = "13"
4343
DataFrames = "1.6"

docs/pages.jl

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,29 @@ pages = Any[
99
"model_creation/dsl_basics.md",
1010
"model_creation/dsl_advanced.md",
1111
#"model_creation/programmatic_CRN_construction.md",
12-
#"model_creation/compositional_modeling.md",
12+
"model_creation/compositional_modeling.md",
1313
#"model_creation/constraint_equations.md",
1414
# Events.
1515
"model_creation/parametric_stoichiometry.md",# Distributed parameters, rates, and initial conditions.
16+
"model_creation/model_file_loading_and_export.md",# Distributed parameters, rates, and initial conditions.
1617
# Loading and writing models to files.
1718
"model_creation/model_visualisation.md",
1819
#"model_creation/network_analysis.md",
1920
"model_creation/chemistry_related_functionality.md",
2021
"Model creation examples" => Any[
2122
"model_creation/examples/basic_CRN_library.md",
2223
"model_creation/examples/programmatic_generative_linear_pathway.md",
23-
#"model_creation/examples/hodgkin_huxley_equation.md",
24+
"model_creation/examples/hodgkin_huxley_equation.md",
2425
#"model_creation/examples/smoluchowski_coagulation_equation.md"
2526
]
2627
],
2728
"Model simulation" => Any[
2829
"model_simulation/simulation_introduction.md",
29-
# Simulation introduction.
3030
"model_simulation/simulation_plotting.md",
3131
"model_simulation/simulation_structure_interfacing.md",
3232
"model_simulation/ensemble_simulations.md",
3333
# Stochastic simulation statistical analysis.
3434
"model_simulation/ode_simulation_performance.md",
35-
# ODE Performance considerations/advice.
3635
# SDE Performance considerations/advice.
3736
# Jump Performance considerations/advice.
3837
# Finite state projection
@@ -51,7 +50,7 @@ pages = Any[
5150
# ODE parameter fitting using Turing.
5251
# SDE/Jump fitting.
5352
"inverse_problems/behaviour_optimisation.md",
54-
"inverse_problems/structural_identifiability.md",
53+
"inverse_problems/structural_identifiability.md", # Broken on Julia v1.10.3, requires v1.10.2 or 1.10.4.
5554
# Practical identifiability.
5655
"inverse_problems/global_sensitivity_analysis.md",
5756
"Inverse problem examples" => Any[
@@ -68,5 +67,5 @@ pages = Any[
6867
# # Repository structure.
6968
# ],
7069
#"FAQs" => "faqs.md",
71-
#"API" => "api.md"
72-
]
70+
"API" => "api.md"
71+
]

docs/src/api.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,37 +35,41 @@ corresponding chemical reaction ODE models, chemical Langevin equation SDE
3535
models, and stochastic chemical kinetics jump process models.
3636

3737
```@example ex1
38-
using Catalyst, DifferentialEquations, Plots
38+
using Catalyst, OrdinaryDiffEq, StochasticDiffEq, JumpProcesses, Plots
3939
t = default_t()
4040
@parameters β γ
4141
@species S(t) I(t) R(t)
4242
4343
rxs = [Reaction(β, [S,I], [I], [1,1], [2])
4444
Reaction(γ, [I], [R])]
4545
@named rs = ReactionSystem(rxs, t)
46+
rs = complete(rs)
4647
4748
u₀map = [S => 999.0, I => 1.0, R => 0.0]
4849
parammap = [β => 1/10000, γ => 0.01]
4950
tspan = (0.0, 250.0)
5051
5152
# solve as ODEs
5253
odesys = convert(ODESystem, rs)
54+
odesys = complete(odesys)
5355
oprob = ODEProblem(odesys, u₀map, tspan, parammap)
5456
sol = solve(oprob, Tsit5())
5557
p1 = plot(sol, title = "ODE")
5658
5759
# solve as SDEs
5860
sdesys = convert(SDESystem, rs)
61+
sdesys = complete(sdesys)
5962
sprob = SDEProblem(sdesys, u₀map, tspan, parammap)
60-
sol = solve(sprob, EM(), dt=.01)
63+
sol = solve(sprob, EM(), dt=.01, saveat = 2.0)
6164
p2 = plot(sol, title = "SDE")
6265
6366
# solve as jump process
6467
jumpsys = convert(JumpSystem, rs)
68+
jumpsys = complete(jumpsys)
6569
u₀map = [S => 999, I => 1, R => 0]
6670
dprob = DiscreteProblem(jumpsys, u₀map, tspan, parammap)
67-
jprob = JumpProblem(jumpsys, dprob, Direct())
68-
sol = solve(jprob, SSAStepper())
71+
jprob = JumpProblem(jumpsys, dprob, Direct(); save_positions = (false,false))
72+
sol = solve(jprob, SSAStepper(), saveat = 2.0)
6973
p3 = plot(sol, title = "jump")
7074
7175
plot(p1, p2, p3; layout = (3,1))

docs/src/assets/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
55
Catalyst = "479239e8-5488-4da2-87a7-35f2df7eef83"
66
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
77
DiffEqParamEstim = "1130ab10-4a5a-5621-a13d-e4788d82bd4c"
8+
DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa"
89
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
910
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
1011
DynamicalSystems = "61744808-ddfa-5f27-97ff-6e42cc95d634"

docs/src/assets/brusselator_sim_SBMLImporter.svg

Lines changed: 50 additions & 0 deletions
Loading
Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!-- Created by COPASI version 4.42 (Build 284) on 2024-01-10 09:22 with libSBML version 5.20.0. -->
3+
<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
4+
<model metaid="COPASI0" id="New_Model" name="New Model">
5+
<annotation>
6+
<copasi:COPASI xmlns:copasi="http://www.copasi.org/static/sbml">
7+
<rdf:RDF xmlns:dcterms="http://purl.org/dc/terms/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
8+
<rdf:Description rdf:about="#COPASI0">
9+
<dcterms:created>
10+
<rdf:Description>
11+
<dcterms:W3CDTF>2024-01-09T21:46:45Z</dcterms:W3CDTF>
12+
</rdf:Description>
13+
</dcterms:created>
14+
</rdf:Description>
15+
</rdf:RDF>
16+
</copasi:COPASI>
17+
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:vCard="http://www.w3.org/2001/vcard-rdf/3.0#" xmlns:bqbiol="http://biomodels.net/biology-qualifiers/" xmlns:bqmodel="http://biomodels.net/model-qualifiers/">
18+
<rdf:Description rdf:about="#COPASI0">
19+
<dcterms:created rdf:parseType="Resource">
20+
<dcterms:W3CDTF>2024-01-09T21:46:45Z</dcterms:W3CDTF>
21+
</dcterms:created>
22+
<dcterms:modified rdf:parseType="Resource">
23+
<dcterms:W3CDTF>2024-01-09T21:46:45Z</dcterms:W3CDTF>
24+
</dcterms:modified>
25+
</rdf:Description>
26+
</rdf:RDF>
27+
</annotation>
28+
<listOfFunctionDefinitions>
29+
<functionDefinition id="Constant_flux__irreversible" name="Constant flux (irreversible)">
30+
<math xmlns="http://www.w3.org/1998/Math/MathML">
31+
<lambda>
32+
<bvar>
33+
<ci> v </ci>
34+
</bvar>
35+
<ci> v </ci>
36+
</lambda>
37+
</math>
38+
</functionDefinition>
39+
</listOfFunctionDefinitions>
40+
<listOfUnitDefinitions>
41+
<unitDefinition id="length" name="length">
42+
<listOfUnits>
43+
<unit kind="metre" exponent="1" scale="0" multiplier="1"/>
44+
</listOfUnits>
45+
</unitDefinition>
46+
<unitDefinition id="area" name="area">
47+
<listOfUnits>
48+
<unit kind="metre" exponent="2" scale="0" multiplier="1"/>
49+
</listOfUnits>
50+
</unitDefinition>
51+
<unitDefinition id="volume" name="volume">
52+
<listOfUnits>
53+
<unit kind="litre" exponent="1" scale="0" multiplier="1"/>
54+
</listOfUnits>
55+
</unitDefinition>
56+
<unitDefinition id="time" name="time">
57+
<listOfUnits>
58+
<unit kind="second" exponent="1" scale="0" multiplier="1"/>
59+
</listOfUnits>
60+
</unitDefinition>
61+
<unitDefinition id="substance" name="substance">
62+
<listOfUnits>
63+
<unit kind="mole" exponent="1" scale="0" multiplier="1"/>
64+
</listOfUnits>
65+
</unitDefinition>
66+
</listOfUnitDefinitions>
67+
<listOfCompartments>
68+
<compartment id="compartment" name="compartment" spatialDimensions="3" size="1" constant="true"/>
69+
</listOfCompartments>
70+
<listOfSpecies>
71+
<species id="X" name="X" compartment="compartment" hasOnlySubstanceUnits="true" initialAmount="2" boundaryCondition="false" constant="false"/>
72+
<species id="Y" name="Y" compartment="compartment" hasOnlySubstanceUnits="true" initialAmount="10" boundaryCondition="false" constant="false"/>
73+
</listOfSpecies>
74+
<listOfParameters>
75+
<parameter id="A" name="A" value="1" constant="true"/>
76+
<parameter id="B" name="B" value="4" constant="true"/>
77+
</listOfParameters>
78+
<listOfReactions>
79+
<reaction id="r2" name="r2" reversible="false">
80+
<listOfReactants>
81+
<speciesReference species="Y" stoichiometry="1"/>
82+
<speciesReference species="X" stoichiometry="2"/>
83+
</listOfReactants>
84+
<listOfProducts>
85+
<speciesReference species="X" stoichiometry="3"/>
86+
</listOfProducts>
87+
<kineticLaw>
88+
<math xmlns="http://www.w3.org/1998/Math/MathML">
89+
<apply>
90+
<times/>
91+
<ci> compartment </ci>
92+
<ci> k1 </ci>
93+
<apply>
94+
<power/>
95+
<ci> X </ci>
96+
<cn> 2 </cn>
97+
</apply>
98+
<ci> Y </ci>
99+
</apply>
100+
</math>
101+
<listOfParameters>
102+
<parameter id="k1" name="k1" value="1"/>
103+
</listOfParameters>
104+
</kineticLaw>
105+
</reaction>
106+
<reaction id="r3" name="r3" reversible="false">
107+
<listOfReactants>
108+
<speciesReference species="X" stoichiometry="1"/>
109+
</listOfReactants>
110+
<listOfProducts>
111+
<speciesReference species="Y" stoichiometry="1"/>
112+
</listOfProducts>
113+
<kineticLaw>
114+
<math xmlns="http://www.w3.org/1998/Math/MathML">
115+
<apply>
116+
<times/>
117+
<ci> compartment </ci>
118+
<ci> B </ci>
119+
<ci> X </ci>
120+
</apply>
121+
</math>
122+
</kineticLaw>
123+
</reaction>
124+
<reaction id="r4" name="r4" reversible="false">
125+
<listOfReactants>
126+
<speciesReference species="X" stoichiometry="1"/>
127+
</listOfReactants>
128+
<kineticLaw>
129+
<math xmlns="http://www.w3.org/1998/Math/MathML">
130+
<apply>
131+
<times/>
132+
<ci> compartment </ci>
133+
<ci> k1 </ci>
134+
<ci> X </ci>
135+
</apply>
136+
</math>
137+
<listOfParameters>
138+
<parameter id="k1" name="k1" value="1"/>
139+
</listOfParameters>
140+
</kineticLaw>
141+
</reaction>
142+
<reaction id="r1" name="r1" reversible="false">
143+
<listOfProducts>
144+
<speciesReference species="X" stoichiometry="1"/>
145+
</listOfProducts>
146+
<kineticLaw>
147+
<math xmlns="http://www.w3.org/1998/Math/MathML">
148+
<apply>
149+
<times/>
150+
<ci> compartment </ci>
151+
<apply>
152+
<ci> Constant_flux__irreversible </ci>
153+
<ci> A </ci>
154+
</apply>
155+
</apply>
156+
</math>
157+
</kineticLaw>
158+
</reaction>
159+
</listOfReactions>
160+
</model>
161+
</sbml>
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Created by BioNetGen 2.3.1
2+
begin parameters
3+
1 Na 6.022e23 # Constant
4+
2 V 1.4e-15 # Constant
5+
3 c0 1e9 # Constant
6+
4 c1 224 # Constant
7+
5 c2 9 # Constant
8+
6 c3 0.5 # Constant
9+
7 c4 5e-4 # Constant
10+
8 c5 0.167 # Constant
11+
9 c6 ln(2)/120 # Constant
12+
10 c7 ln(2)/600 # Constant
13+
11 tF 1e-4 # Constant
14+
12 rF 1000 # Constant
15+
13 pF 1000 # Constant
16+
14 _rateLaw1 (((c0/Na)/V)*tF)/pF # ConstantExpression
17+
15 _rateLaw2 c1*tF # ConstantExpression
18+
16 _rateLaw3 (((c0/Na)/V)*tF)/pF # ConstantExpression
19+
17 _rateLaw4 c2*tF # ConstantExpression
20+
18 _rateLaw5 c3*rF # ConstantExpression
21+
19 _rateLaw6 c4*rF # ConstantExpression
22+
20 _rateLaw7 (c5/rF)*pF # ConstantExpression
23+
21 _rateLaw8 (((c0/Na)/V)*tF)/pF # ConstantExpression
24+
22 _rateLaw9 c1*tF # ConstantExpression
25+
23 _rateLaw10 (((c0/Na)/V)*tF)/pF # ConstantExpression
26+
24 _rateLaw11 c2*tF # ConstantExpression
27+
25 _rateLaw12 c3*rF # ConstantExpression
28+
26 _rateLaw13 c4*rF # ConstantExpression
29+
27 _rateLaw14 (c5/rF)*pF # ConstantExpression
30+
28 _rateLaw15 (((c0/Na)/V)*tF)/pF # ConstantExpression
31+
29 _rateLaw16 c1*tF # ConstantExpression
32+
30 _rateLaw17 (((c0/Na)/V)*tF)/pF # ConstantExpression
33+
31 _rateLaw18 c2*tF # ConstantExpression
34+
32 _rateLaw19 c3*rF # ConstantExpression
35+
33 _rateLaw20 c4*rF # ConstantExpression
36+
34 _rateLaw21 (c5/rF)*pF # ConstantExpression
37+
end parameters
38+
begin species
39+
1 Null() 1
40+
2 gTetR(lac!1,lac!2).pLacI(tet!1).pLacI(tet!2) 1
41+
3 gCI(tet!1,tet!2).pTetR(cI!1).pTetR(cI!2) 1
42+
4 gLacI(cI!1,cI!2).pCI(lac!1).pCI(lac!2) 1
43+
5 mTetR() 3163
44+
6 mCI() 6819
45+
7 mLacI() 129
46+
8 pTetR(cI) 183453
47+
9 pCI(lac) 2006198
48+
10 pLacI(tet) 165670
49+
11 gTetR(lac!1,lac).pLacI(tet!1) 0
50+
12 gCI(tet!1,tet).pTetR(cI!1) 0
51+
13 gLacI(cI!1,cI).pCI(lac!1) 0
52+
14 gTetR(lac,lac) 0
53+
15 gCI(tet,tet) 0
54+
16 gLacI(cI,cI) 0
55+
end species
56+
begin reactions
57+
1 2 10,11 2*_rateLaw4 #_reverse__R2
58+
2 2 2,5 _rateLaw6 #_R4
59+
3 5 5,8 _rateLaw7 #_R5
60+
4 1,5 1 c6 #_R6
61+
5 1,8 1 c7 #_R7
62+
6 3 8,12 2*_rateLaw11 #_reverse__R9
63+
7 3 3,6 _rateLaw13 #_R11
64+
8 6 6,9 _rateLaw14 #_R12
65+
9 1,6 1 c6 #_R13
66+
10 1,9 1 c7 #_R14
67+
11 4 9,13 2*_rateLaw18 #_reverse__R16
68+
12 4 4,7 _rateLaw20 #_R18
69+
13 7 7,10 _rateLaw21 #_R19
70+
14 1,7 1 c6 #_R20
71+
15 1,10 1 c7 #_R21
72+
16 11 10,14 _rateLaw2 #_reverse__R1
73+
17 10,11 2 _rateLaw3 #_R2
74+
18 11 5,11 _rateLaw6 #_R4
75+
19 12 8,15 _rateLaw9 #_reverse__R8
76+
20 8,12 3 _rateLaw10 #_R9
77+
21 12 6,12 _rateLaw13 #_R11
78+
22 13 9,16 _rateLaw16 #_reverse__R15
79+
23 9,13 4 _rateLaw17 #_R16
80+
24 13 7,13 _rateLaw20 #_R18
81+
25 10,14 11 2*_rateLaw1 #_R1
82+
26 14 5,14 _rateLaw5 #_R3
83+
27 8,15 12 2*_rateLaw8 #_R8
84+
28 15 6,15 _rateLaw12 #_R10
85+
29 9,16 13 2*_rateLaw15 #_R15
86+
30 16 7,16 _rateLaw19 #_R17
87+
end reactions
88+
begin groups
89+
1 pTetR 8
90+
2 pCI 9
91+
3 pLacI 10
92+
4 NULL 1
93+
end groups
14.3 KB
Loading

0 commit comments

Comments
 (0)