Skip to content

Commit

Permalink
Merge branch 'master' into proposed_constraint_eqs_doc_up
Browse files Browse the repository at this point in the history
  • Loading branch information
TorkelE committed Jun 4, 2024
2 parents ffb230e + 940861e commit 6f4fc6d
Show file tree
Hide file tree
Showing 39 changed files with 2,661 additions and 115 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@latest
with:
version: '1'
version: '1.10.2'
- name: Install dependencies
run: julia --project=docs/ -e 'ENV["JULIA_PKG_SERVER"] = ""; using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Build and deploy
Expand Down
3 changes: 2 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ BifurcationKit = "0.3"
DataStructures = "0.18"
DiffEqBase = "6.83.0"
DocStringExtensions = "0.8, 0.9"
DynamicPolynomials = "0.5"
DynamicQuantities = "0.13.2"
Graphs = "1.4"
HomotopyContinuation = "2.9"
Expand All @@ -57,7 +58,7 @@ StructuralIdentifiability = "0.5.1"
SymbolicUtils = "1.0.3"
Symbolics = "5.27"
Unitful = "1.12.4"
julia = "1.9"
julia = "1.10"

[extras]
BifurcationKit = "0f109fa4-8a5d-4b75-95aa-f515264e7665"
Expand Down
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"

[compat]
BenchmarkTools = "1.5"
BifurcationKit = "0.3"
BifurcationKit = "0.3.4"
CairoMakie = "0.12"
Catalyst = "13"
DataFrames = "1.6"
Expand Down
15 changes: 7 additions & 8 deletions docs/pages.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,29 @@ pages = Any[
"model_creation/dsl_basics.md",
"model_creation/dsl_advanced.md",
#"model_creation/programmatic_CRN_construction.md",
#"model_creation/compositional_modeling.md",
"model_creation/compositional_modeling.md",
"model_creation/constraint_equations.md",
# Events.
#"model_creation/parametric_stoichiometry.md",# Distributed parameters, rates, and initial conditions.
"model_creation/parametric_stoichiometry.md",# Distributed parameters, rates, and initial conditions.
"model_creation/model_file_loading_and_export.md",# Distributed parameters, rates, and initial conditions.
# Loading and writing models to files.
"model_creation/model_visualisation.md",
#"model_creation/network_analysis.md",
"model_creation/chemistry_related_functionality.md",
"Model creation examples" => Any[
"model_creation/examples/basic_CRN_library.md",
"model_creation/examples/programmatic_generative_linear_pathway.md",
#"model_creation/examples/hodgkin_huxley_equation.md",
"model_creation/examples/hodgkin_huxley_equation.md",
#"model_creation/examples/smoluchowski_coagulation_equation.md"
]
],
"Model simulation" => Any[
"model_simulation/simulation_introduction.md",
# Simulation introduction.
"model_simulation/simulation_plotting.md",
"model_simulation/simulation_structure_interfacing.md",
"model_simulation/ensemble_simulations.md",
# Stochastic simulation statistical analysis.
"model_simulation/ode_simulation_performance.md",
# ODE Performance considerations/advice.
# SDE Performance considerations/advice.
# Jump Performance considerations/advice.
# Finite state projection
Expand All @@ -51,7 +50,7 @@ pages = Any[
# ODE parameter fitting using Turing.
# SDE/Jump fitting.
"inverse_problems/behaviour_optimisation.md",
"inverse_problems/structural_identifiability.md",
"inverse_problems/structural_identifiability.md", # Broken on Julia v1.10.3, requires v1.10.2 or 1.10.4.
# Practical identifiability.
"inverse_problems/global_sensitivity_analysis.md",
"Inverse problem examples" => Any[
Expand All @@ -68,5 +67,5 @@ pages = Any[
# # Repository structure.
# ],
#"FAQs" => "faqs.md",
#"API" => "api.md"
]
"API" => "api.md"
]
12 changes: 8 additions & 4 deletions docs/src/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,37 +35,41 @@ corresponding chemical reaction ODE models, chemical Langevin equation SDE
models, and stochastic chemical kinetics jump process models.

```@example ex1
using Catalyst, DifferentialEquations, Plots
using Catalyst, OrdinaryDiffEq, StochasticDiffEq, JumpProcesses, Plots
t = default_t()
@parameters β γ
@species S(t) I(t) R(t)
rxs = [Reaction(β, [S,I], [I], [1,1], [2])
Reaction(γ, [I], [R])]
@named rs = ReactionSystem(rxs, t)
rs = complete(rs)
u₀map = [S => 999.0, I => 1.0, R => 0.0]
parammap = [β => 1/10000, γ => 0.01]
tspan = (0.0, 250.0)
# solve as ODEs
odesys = convert(ODESystem, rs)
odesys = complete(odesys)
oprob = ODEProblem(odesys, u₀map, tspan, parammap)
sol = solve(oprob, Tsit5())
p1 = plot(sol, title = "ODE")
# solve as SDEs
sdesys = convert(SDESystem, rs)
sdesys = complete(sdesys)
sprob = SDEProblem(sdesys, u₀map, tspan, parammap)
sol = solve(sprob, EM(), dt=.01)
sol = solve(sprob, EM(), dt=.01, saveat = 2.0)
p2 = plot(sol, title = "SDE")
# solve as jump process
jumpsys = convert(JumpSystem, rs)
jumpsys = complete(jumpsys)
u₀map = [S => 999, I => 1, R => 0]
dprob = DiscreteProblem(jumpsys, u₀map, tspan, parammap)
jprob = JumpProblem(jumpsys, dprob, Direct())
sol = solve(jprob, SSAStepper())
jprob = JumpProblem(jumpsys, dprob, Direct(); save_positions = (false,false))
sol = solve(jprob, SSAStepper(), saveat = 2.0)
p3 = plot(sol, title = "jump")
plot(p1, p2, p3; layout = (3,1))
Expand Down
1 change: 1 addition & 0 deletions docs/src/assets/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
Catalyst = "479239e8-5488-4da2-87a7-35f2df7eef83"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
DiffEqParamEstim = "1130ab10-4a5a-5621-a13d-e4788d82bd4c"
DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DynamicalSystems = "61744808-ddfa-5f27-97ff-6e42cc95d634"
Expand Down
50 changes: 50 additions & 0 deletions docs/src/assets/brusselator_sim_SBMLImporter.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
161 changes: 161 additions & 0 deletions docs/src/assets/model_files/brusselator.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created by COPASI version 4.42 (Build 284) on 2024-01-10 09:22 with libSBML version 5.20.0. -->
<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
<model metaid="COPASI0" id="New_Model" name="New Model">
<annotation>
<copasi:COPASI xmlns:copasi="http://www.copasi.org/static/sbml">
<rdf:RDF xmlns:dcterms="http://purl.org/dc/terms/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="#COPASI0">
<dcterms:created>
<rdf:Description>
<dcterms:W3CDTF>2024-01-09T21:46:45Z</dcterms:W3CDTF>
</rdf:Description>
</dcterms:created>
</rdf:Description>
</rdf:RDF>
</copasi:COPASI>
<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/">
<rdf:Description rdf:about="#COPASI0">
<dcterms:created rdf:parseType="Resource">
<dcterms:W3CDTF>2024-01-09T21:46:45Z</dcterms:W3CDTF>
</dcterms:created>
<dcterms:modified rdf:parseType="Resource">
<dcterms:W3CDTF>2024-01-09T21:46:45Z</dcterms:W3CDTF>
</dcterms:modified>
</rdf:Description>
</rdf:RDF>
</annotation>
<listOfFunctionDefinitions>
<functionDefinition id="Constant_flux__irreversible" name="Constant flux (irreversible)">
<math xmlns="http://www.w3.org/1998/Math/MathML">
<lambda>
<bvar>
<ci> v </ci>
</bvar>
<ci> v </ci>
</lambda>
</math>
</functionDefinition>
</listOfFunctionDefinitions>
<listOfUnitDefinitions>
<unitDefinition id="length" name="length">
<listOfUnits>
<unit kind="metre" exponent="1" scale="0" multiplier="1"/>
</listOfUnits>
</unitDefinition>
<unitDefinition id="area" name="area">
<listOfUnits>
<unit kind="metre" exponent="2" scale="0" multiplier="1"/>
</listOfUnits>
</unitDefinition>
<unitDefinition id="volume" name="volume">
<listOfUnits>
<unit kind="litre" exponent="1" scale="0" multiplier="1"/>
</listOfUnits>
</unitDefinition>
<unitDefinition id="time" name="time">
<listOfUnits>
<unit kind="second" exponent="1" scale="0" multiplier="1"/>
</listOfUnits>
</unitDefinition>
<unitDefinition id="substance" name="substance">
<listOfUnits>
<unit kind="mole" exponent="1" scale="0" multiplier="1"/>
</listOfUnits>
</unitDefinition>
</listOfUnitDefinitions>
<listOfCompartments>
<compartment id="compartment" name="compartment" spatialDimensions="3" size="1" constant="true"/>
</listOfCompartments>
<listOfSpecies>
<species id="X" name="X" compartment="compartment" hasOnlySubstanceUnits="true" initialAmount="2" boundaryCondition="false" constant="false"/>
<species id="Y" name="Y" compartment="compartment" hasOnlySubstanceUnits="true" initialAmount="10" boundaryCondition="false" constant="false"/>
</listOfSpecies>
<listOfParameters>
<parameter id="A" name="A" value="1" constant="true"/>
<parameter id="B" name="B" value="4" constant="true"/>
</listOfParameters>
<listOfReactions>
<reaction id="r2" name="r2" reversible="false">
<listOfReactants>
<speciesReference species="Y" stoichiometry="1"/>
<speciesReference species="X" stoichiometry="2"/>
</listOfReactants>
<listOfProducts>
<speciesReference species="X" stoichiometry="3"/>
</listOfProducts>
<kineticLaw>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply>
<times/>
<ci> compartment </ci>
<ci> k1 </ci>
<apply>
<power/>
<ci> X </ci>
<cn> 2 </cn>
</apply>
<ci> Y </ci>
</apply>
</math>
<listOfParameters>
<parameter id="k1" name="k1" value="1"/>
</listOfParameters>
</kineticLaw>
</reaction>
<reaction id="r3" name="r3" reversible="false">
<listOfReactants>
<speciesReference species="X" stoichiometry="1"/>
</listOfReactants>
<listOfProducts>
<speciesReference species="Y" stoichiometry="1"/>
</listOfProducts>
<kineticLaw>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply>
<times/>
<ci> compartment </ci>
<ci> B </ci>
<ci> X </ci>
</apply>
</math>
</kineticLaw>
</reaction>
<reaction id="r4" name="r4" reversible="false">
<listOfReactants>
<speciesReference species="X" stoichiometry="1"/>
</listOfReactants>
<kineticLaw>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply>
<times/>
<ci> compartment </ci>
<ci> k1 </ci>
<ci> X </ci>
</apply>
</math>
<listOfParameters>
<parameter id="k1" name="k1" value="1"/>
</listOfParameters>
</kineticLaw>
</reaction>
<reaction id="r1" name="r1" reversible="false">
<listOfProducts>
<speciesReference species="X" stoichiometry="1"/>
</listOfProducts>
<kineticLaw>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply>
<times/>
<ci> compartment </ci>
<apply>
<ci> Constant_flux__irreversible </ci>
<ci> A </ci>
</apply>
</apply>
</math>
</kineticLaw>
</reaction>
</listOfReactions>
</model>
</sbml>
93 changes: 93 additions & 0 deletions docs/src/assets/model_files/repressilator.net
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Created by BioNetGen 2.3.1
begin parameters
1 Na 6.022e23 # Constant
2 V 1.4e-15 # Constant
3 c0 1e9 # Constant
4 c1 224 # Constant
5 c2 9 # Constant
6 c3 0.5 # Constant
7 c4 5e-4 # Constant
8 c5 0.167 # Constant
9 c6 ln(2)/120 # Constant
10 c7 ln(2)/600 # Constant
11 tF 1e-4 # Constant
12 rF 1000 # Constant
13 pF 1000 # Constant
14 _rateLaw1 (((c0/Na)/V)*tF)/pF # ConstantExpression
15 _rateLaw2 c1*tF # ConstantExpression
16 _rateLaw3 (((c0/Na)/V)*tF)/pF # ConstantExpression
17 _rateLaw4 c2*tF # ConstantExpression
18 _rateLaw5 c3*rF # ConstantExpression
19 _rateLaw6 c4*rF # ConstantExpression
20 _rateLaw7 (c5/rF)*pF # ConstantExpression
21 _rateLaw8 (((c0/Na)/V)*tF)/pF # ConstantExpression
22 _rateLaw9 c1*tF # ConstantExpression
23 _rateLaw10 (((c0/Na)/V)*tF)/pF # ConstantExpression
24 _rateLaw11 c2*tF # ConstantExpression
25 _rateLaw12 c3*rF # ConstantExpression
26 _rateLaw13 c4*rF # ConstantExpression
27 _rateLaw14 (c5/rF)*pF # ConstantExpression
28 _rateLaw15 (((c0/Na)/V)*tF)/pF # ConstantExpression
29 _rateLaw16 c1*tF # ConstantExpression
30 _rateLaw17 (((c0/Na)/V)*tF)/pF # ConstantExpression
31 _rateLaw18 c2*tF # ConstantExpression
32 _rateLaw19 c3*rF # ConstantExpression
33 _rateLaw20 c4*rF # ConstantExpression
34 _rateLaw21 (c5/rF)*pF # ConstantExpression
end parameters
begin species
1 Null() 1
2 gTetR(lac!1,lac!2).pLacI(tet!1).pLacI(tet!2) 1
3 gCI(tet!1,tet!2).pTetR(cI!1).pTetR(cI!2) 1
4 gLacI(cI!1,cI!2).pCI(lac!1).pCI(lac!2) 1
5 mTetR() 3163
6 mCI() 6819
7 mLacI() 129
8 pTetR(cI) 183453
9 pCI(lac) 2006198
10 pLacI(tet) 165670
11 gTetR(lac!1,lac).pLacI(tet!1) 0
12 gCI(tet!1,tet).pTetR(cI!1) 0
13 gLacI(cI!1,cI).pCI(lac!1) 0
14 gTetR(lac,lac) 0
15 gCI(tet,tet) 0
16 gLacI(cI,cI) 0
end species
begin reactions
1 2 10,11 2*_rateLaw4 #_reverse__R2
2 2 2,5 _rateLaw6 #_R4
3 5 5,8 _rateLaw7 #_R5
4 1,5 1 c6 #_R6
5 1,8 1 c7 #_R7
6 3 8,12 2*_rateLaw11 #_reverse__R9
7 3 3,6 _rateLaw13 #_R11
8 6 6,9 _rateLaw14 #_R12
9 1,6 1 c6 #_R13
10 1,9 1 c7 #_R14
11 4 9,13 2*_rateLaw18 #_reverse__R16
12 4 4,7 _rateLaw20 #_R18
13 7 7,10 _rateLaw21 #_R19
14 1,7 1 c6 #_R20
15 1,10 1 c7 #_R21
16 11 10,14 _rateLaw2 #_reverse__R1
17 10,11 2 _rateLaw3 #_R2
18 11 5,11 _rateLaw6 #_R4
19 12 8,15 _rateLaw9 #_reverse__R8
20 8,12 3 _rateLaw10 #_R9
21 12 6,12 _rateLaw13 #_R11
22 13 9,16 _rateLaw16 #_reverse__R15
23 9,13 4 _rateLaw17 #_R16
24 13 7,13 _rateLaw20 #_R18
25 10,14 11 2*_rateLaw1 #_R1
26 14 5,14 _rateLaw5 #_R3
27 8,15 12 2*_rateLaw8 #_R8
28 15 6,15 _rateLaw12 #_R10
29 9,16 13 2*_rateLaw15 #_R15
30 16 7,16 _rateLaw19 #_R17
end reactions
begin groups
1 pTetR 8
2 pCI 9
3 pLacI 10
4 NULL 1
end groups
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 6f4fc6d

Please sign in to comment.