Skip to content

Commit 1e522c6

Browse files
authored
Merge pull request #830 from SciML/Catalyst_version_14
merge Catalyst version 14 into master
2 parents 4024e67 + 1b90ecc commit 1e522c6

File tree

84 files changed

+8061
-2444
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+8061
-2444
lines changed

.github/workflows/CI.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ on:
33
pull_request:
44
branches:
55
- master
6+
- Catalyst_version_14
67
push:
78
branches:
89
- master
10+
- Catalyst_version_14
911
jobs:
1012
test:
1113
runs-on: ubuntu-latest
@@ -14,7 +16,7 @@ jobs:
1416
group:
1517
- Core
1618
version:
17-
- '1'
19+
- '1.10.2'
1820
steps:
1921
- uses: actions/checkout@v4
2022
- uses: julia-actions/setup-julia@v2

HISTORY.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,32 @@
11
# Breaking updates and feature summaries across releases
22

33
## Catalyst unreleased (master branch)
4+
5+
## Catalyst 14.0
6+
- To be more consistent with ModelingToolkit's immutability requirement for systems, we have removed API functions that mutate `ReactionSystem`s such as `addparam!`, `addreaction!`, `addspecies`, `@add_reactions`, and `merge!`. Please use `ModelingToolkit.extend` and `ModelingToolkit.compose` to generate new merged and/or composed `ReactionSystem`s from multiple component systems.
7+
- Added CatalystStructuralIdentifiabilityExtension, which permits StructuralIdentifiability.jl function to be applied directly to Catalyst systems. E.g. use
8+
```julia
9+
using Catalyst, StructuralIdentifiability
10+
goodwind_oscillator = @reaction_network begin
11+
(mmr(P,pₘ,1), dₘ), 0 <--> M
12+
(pₑ*M,dₑ), 0 <--> E
13+
(pₚ*E,dₚ), 0 <--> P
14+
end
15+
assess_identifiability(goodwind_oscillator; measured_quantities=[:M])
16+
```
17+
to assess (global) structural identifiability for all parameters and variables of the `goodwind_oscillator` model (under the presumption that we can measure `M` only).
18+
- Automatically handles conservation laws for structural identifiability problems (eliminates these internally to speed up computations).
19+
- Adds a tutorial to illustrate the use of the extension.
20+
- Enable adding metadata to individual reactions, e.g:
21+
```julia
22+
rn = @reaction_network begin
23+
@parameters η
24+
k, 2X --> X2, [noise_scaling=η]
25+
end
26+
get_noise_scaling(rn)
27+
```
28+
- `SDEProblem` no longer takes the `noise_scaling` argument (see above for new approach to handle noise scaling).
29+
- Changed fields of internal `Reaction` structure. `ReactionSystems`s saved using `serialize` on previous Catalyst versions cannot be loaded using this (or later) versions.
430
- Simulation of spatial ODEs now supported. For full details, please see https://github.com/SciML/Catalyst.jl/pull/644 and upcoming documentation. Note that these methods are currently considered alpha, with the interface and approach changing even in non-breaking Catalyst releases.
531
- LatticeReactionSystem structure represents a spatial reaction network:
632
```julia
@@ -24,6 +50,13 @@
2450
```
2551
X's value will be `1.0` in the first vertex, but `0.0` in the remaining one (the system have 25 vertexes in total). SInce th parameters `p` and `d` are part of the non-spatial reaction network, their values are tied to vertexes. However, if the `D` parameter (which governs diffusion between vertexes) is given several values, these will instead correspond to the specific edges (and transportation along those edges.)
2652

53+
- Update how compounds are created. E.g. use
54+
```julia
55+
@variables t C(t) O(t)
56+
@compound CO2 ~ C + 2O
57+
```
58+
to create a compound species `CO2` that consists of `C` and 2 `O`.
59+
- Added documentation for chemistry related functionality (compound creation and reaction balancing).
2760
- Add a CatalystBifurcationKitExtension, permitting BifurcationKit's `BifurcationProblem`s to be created from Catalyst reaction networks. Example usage:
2861
```julia
2962
using Catalyst
@@ -35,7 +68,6 @@ wilhelm_2009_model = @reaction_network begin
3568
k5, 0 --> X
3669
end
3770

38-
3971
using BifurcationKit
4072
bif_par = :k1
4173
u_guess = [:X => 5.0, :Y => 2.0]

Project.toml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ version = "13.5.1"
66
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
77
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"
88
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
9+
DynamicPolynomials = "7c1d4256-1411-5781-91ec-d7bc3513ac07"
10+
DynamicQuantities = "06fc5a27-2a28-4c7c-a15d-362465fb6821"
911
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
1012
JumpProcesses = "ccbc3e58-028d-4f4c-8cd5-9ae44345cda5"
1113
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
@@ -26,41 +28,47 @@ Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
2628
[weakdeps]
2729
BifurcationKit = "0f109fa4-8a5d-4b75-95aa-f515264e7665"
2830
HomotopyContinuation = "f213a82b-91d6-5c5d-acf7-10f1c761b327"
31+
StructuralIdentifiability = "220ca800-aa68-49bb-acd8-6037fa93a544"
2932

3033
[extensions]
3134
CatalystBifurcationKitExtension = "BifurcationKit"
3235
CatalystHomotopyContinuationExtension = "HomotopyContinuation"
36+
CatalystStructuralIdentifiabilityExtension = "StructuralIdentifiability"
3337

3438
[compat]
3539
BifurcationKit = "0.3"
3640
DataStructures = "0.18"
3741
DiffEqBase = "6.83.0"
3842
DocStringExtensions = "0.8, 0.9"
43+
DynamicQuantities = "0.13.2"
3944
Graphs = "1.4"
40-
JumpProcesses = "9.3.2"
4145
HomotopyContinuation = "2.9"
46+
JumpProcesses = "9.3.2"
4247
LaTeXStrings = "1.3.0"
4348
Latexify = "0.14, 0.15, 0.16"
4449
MacroTools = "0.5.5"
45-
ModelingToolkit = "8.73"
50+
ModelingToolkit = "9.11.0"
4651
Parameters = "0.12"
4752
Reexport = "0.2, 1.0"
4853
Requires = "1.0"
4954
RuntimeGeneratedFunctions = "0.5.12"
5055
Setfield = "1"
56+
StructuralIdentifiability = "0.5.1"
5157
SymbolicUtils = "1.0.3"
52-
Symbolics = "5.0.3"
58+
Symbolics = "5.27"
5359
Unitful = "1.12.4"
5460
julia = "1.9"
5561

5662
[extras]
5763
BifurcationKit = "0f109fa4-8a5d-4b75-95aa-f515264e7665"
64+
DiffEqCallbacks = "459566f4-90b8-5000-8ac3-15dfb0a30def"
5865
DomainSets = "5b8099bc-c8ec-5219-889f-1d9e522a28bf"
5966
Graphviz_jll = "3c863552-8265-54e4-a6dc-903eb78fde85"
6067
HomotopyContinuation = "f213a82b-91d6-5c5d-acf7-10f1c761b327"
6168
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
6269
NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
6370
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
71+
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
6472
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
6573
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
6674
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
@@ -69,8 +77,9 @@ StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
6977
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
7078
SteadyStateDiffEq = "9672c7b4-1e72-59bd-8a11-6ac3964bc41f"
7179
StochasticDiffEq = "789caeaf-c7a9-5a7d-9973-96adeb23e2a0"
80+
StructuralIdentifiability = "220ca800-aa68-49bb-acd8-6037fa93a544"
7281
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
7382
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
7483

7584
[targets]
76-
test = ["BifurcationKit", "DomainSets", "Graphviz_jll", "HomotopyContinuation", "NonlinearSolve", "OrdinaryDiffEq", "Random", "SafeTestsets", "SciMLBase", "SciMLNLSolve", "StableRNGs", "Statistics", "SteadyStateDiffEq", "StochasticDiffEq", "Test", "Unitful"]
85+
test = ["BifurcationKit", "DiffEqCallbacks", "DomainSets", "Graphviz_jll", "HomotopyContinuation", "NonlinearSolve", "OrdinaryDiffEq", "Plots", "Random", "SafeTestsets", "SciMLBase", "SciMLNLSolve", "StableRNGs", "Statistics", "SteadyStateDiffEq", "StochasticDiffEq", "StructuralIdentifiability", "Test", "Unitful"]

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@ etc).
3131

3232
## Breaking changes and new features
3333

34-
**NOTE:** version 13 is a breaking release, with changes to simplify the DSL
35-
notation while also adding more features, changes to how chemical species are
36-
specified symbolically when directly building `ReactionSystem`s, and changes that
37-
simplify how to include ODE or algebraic constraint equation.
34+
**NOTE:** version 14 is a breaking release, prompted by the release of ModelingToolkit.jl version 9. This caused several breaking changes in how Catalyst models are represented and interfaced with.
3835

3936
Breaking changes and new functionality are summarized in the
4037
[HISTORY.md](HISTORY.md) file.
@@ -48,6 +45,8 @@ the current master branch.
4845

4946
Several Youtube video tutorials and overviews are also available, but note these use older
5047
Catalyst versions with slightly different notation (for example, in building reaction networks):
48+
- From JuliaCon 2023: A short 15 minute overview of Catalyst as of version 13 is
49+
available in the talk [Catalyst.jl, Modeling Chemical Reaction Networks](https://www.youtube.com/watch?v=yreW94n98eM&ab_channel=TheJuliaProgrammingLanguage).
5150
- From JuliaCon 2022: A three hour tutorial workshop overviewing how to use
5251
Catalyst and its more advanced features as of version 12.1. [Workshop
5352
video](https://youtu.be/tVfxT09AtWQ), [Workshop Pluto.jl
@@ -60,6 +59,8 @@ Catalyst.jl](https://www.youtube.com/watch?v=5p1PJE5A5Jw).
6059
Modelling of Biochemical Reaction
6160
Networks](https://www.youtube.com/watch?v=s1e72k5XD6s)
6261

62+
Finally, an overview of the package and its features (as of version 13) can also be found in its corresponding research paper, [Catalyst: Fast and flexible modeling of reaction networks](https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1011530).
63+
6364
## Features
6465

6566
- A DSL provides a simple and readable format for manually specifying chemical

docs/Project.toml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,21 @@
22
BifurcationKit = "0f109fa4-8a5d-4b75-95aa-f515264e7665"
33
Catalyst = "479239e8-5488-4da2-87a7-35f2df7eef83"
44
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
5+
DiffEqParamEstim = "1130ab10-4a5a-5621-a13d-e4788d82bd4c"
56
DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa"
67
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
78
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
89
HomotopyContinuation = "f213a82b-91d6-5c5d-acf7-10f1c761b327"
910
Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
11+
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
1012
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
1113
NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
1214
Optim = "429524aa-4258-5aef-a3af-852621145aeb"
1315
Optimization = "7f7a1694-90dd-40f0-9382-eb1efda571ba"
16+
OptimizationNLopt = "4e6fcdb7-1186-4e1f-a706-475e75c168bb"
17+
OptimizationOptimJL = "36348300-93cb-4f02-beb5-3c3902f8871e"
1418
OptimizationOptimisers = "42dfb2eb-d2b4-4451-abcd-913932933ac1"
1519
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
16-
PEtab = "48d54b35-e43e-4a66-a5a1-dde6b987cf69"
1720
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
1821
QuasiMonteCarlo = "8a4e6c94-4038-4cdc-81c3-7e6ffdb2a71b"
1922
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
@@ -22,29 +25,33 @@ Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
2225
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
2326
SteadyStateDiffEq = "9672c7b4-1e72-59bd-8a11-6ac3964bc41f"
2427
StochasticDiffEq = "789caeaf-c7a9-5a7d-9973-96adeb23e2a0"
28+
StructuralIdentifiability = "220ca800-aa68-49bb-acd8-6037fa93a544"
2529
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
2630

2731
[compat]
2832
BifurcationKit = "0.3"
2933
Catalyst = "13"
3034
DataFrames = "1"
35+
DiffEqParamEstim = "2.1"
3136
DifferentialEquations = "7.7"
3237
Distributions = "0.25"
3338
Documenter = "0.27"
3439
HomotopyContinuation = "2.6"
3540
Latexify = "0.15, 0.16"
36-
ModelingToolkit = "8.47"
37-
NonlinearSolve = "1.6.0, 2"
41+
ModelingToolkit = "9.5"
42+
NonlinearSolve = "3.4.0"
3843
Optim = "1"
3944
Optimization = "3.19"
45+
OptimizationNLopt = "0.1.8"
46+
OptimizationOptimJL = "0.1.14"
4047
OptimizationOptimisers = "0.1.1"
4148
OrdinaryDiffEq = "6"
42-
PEtab = "2"
4349
Plots = "1.36"
44-
SciMLBase = "~2.5"
50+
SciMLBase = "2.13"
4551
SciMLSensitivity = "7.19"
4652
Setfield = "1.1"
4753
SpecialFunctions = "2.1"
48-
SteadyStateDiffEq = "1"
54+
SteadyStateDiffEq = "2.0.1"
4955
StochasticDiffEq = "6"
50-
Symbolics = "5.0.3"
56+
StructuralIdentifiability = "0.5.1"
57+
Symbolics = "5.14"

docs/pages.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
pages = Any["Home" => "index.md",
22
"Introduction to Catalyst" => Any["introduction_to_catalyst/catalyst_for_new_julia_users.md",
3-
"introduction_to_catalyst/introduction_to_catalyst.md" ],
3+
"introduction_to_catalyst/introduction_to_catalyst.md"],
44
"Catalyst Functionality" => Any["catalyst_functionality/dsl_description.md",
55
"catalyst_functionality/programmatic_CRN_construction.md",
66
"catalyst_functionality/compositional_modeling.md",
77
"catalyst_functionality/constraint_equations.md",
88
"catalyst_functionality/parametric_stoichiometry.md",
99
"catalyst_functionality/network_analysis.md",
10+
"catalyst_functionality/chemistry_related_functionality.md",
1011
"Model creation examples" => Any["catalyst_functionality/example_networks/basic_CRN_examples.md",
1112
"catalyst_functionality/example_networks/hodgkin_huxley_equation.md",
1213
"catalyst_functionality/example_networks/smoluchowski_coagulation_equation.md"]],
@@ -15,7 +16,9 @@ pages = Any["Home" => "index.md",
1516
"catalyst_applications/homotopy_continuation.md",
1617
"catalyst_applications/nonlinear_solve.md",
1718
"catalyst_applications/bifurcation_diagrams.md"],
18-
"Inverse Problems" => Any["inverse_problems/parameter_estimation.md",
19-
"inverse_problems/petab_ode_param_fitting.md"],
19+
"Inverse Problems" => Any["inverse_problems/optimization_ode_param_fitting.md",
20+
#"inverse_problems/petab_ode_param_fitting.md",
21+
"inverse_problems/structural_identifiability.md",
22+
"Inverse problem examples" => Any["inverse_problems/examples/ode_fitting_oscillation.md"]],
2023
"FAQs" => "faqs.md",
2124
"API" => "api/catalyst_api.md"]

docs/src/api/catalyst_api.md

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ models, and stochastic chemical kinetics jump process models.
3636

3737
```@example ex1
3838
using Catalyst, DifferentialEquations, Plots
39+
t = default_t()
3940
@parameters β γ
40-
@variables t
4141
@species S(t) I(t) R(t)
4242
4343
rxs = [Reaction(β, [S,I], [I], [1,1], [2])
@@ -95,11 +95,11 @@ retrieve info from just a base [`ReactionSystem`](@ref) `rn`, ignoring
9595
sub-systems of `rn`, one can use the ModelingToolkit accessors (these provide
9696
direct access to the corresponding internal fields of the `ReactionSystem`)
9797

98-
* `ModelingToolkit.get_states(rn)` is a vector that collects all the species
98+
* `ModelingToolkit.get_unknowns(rn)` is a vector that collects all the species
9999
defined within `rn`, ordered by species and then non-species variables.
100100
* `Catalyst.get_species(rn)` is a vector of all the species variables in the system. The
101101
entries in `get_species(rn)` correspond to the first `length(get_species(rn))`
102-
components in `get_states(rn)`.
102+
components in `get_unknowns(rn)`.
103103
* `ModelingToolkit.get_ps(rn)` is a vector that collects all the parameters
104104
defined *within* reactions in `rn`.
105105
* `ModelingToolkit.get_eqs(rn)` is a vector that collects all the
@@ -120,10 +120,10 @@ To retrieve information from the full reaction network represented by a system
120120
`rn`, which corresponds to information within both `rn` and all sub-systems, one
121121
can call:
122122

123-
* `ModelingToolkit.states(rn)` returns all species *and variables* across the
123+
* `ModelingToolkit.unknowns(rn)` returns all species *and variables* across the
124124
system, *all sub-systems*, and all constraint systems. Species are ordered
125-
before non-species variables in `states(rn)`, with the first `numspecies(rn)`
126-
entires in `states(rn)` being the same as `species(rn)`.
125+
before non-species variables in `unknowns(rn)`, with the first `numspecies(rn)`
126+
entires in `unknowns(rn)` being the same as `species(rn)`.
127127
* [`species(rn)`](@ref) is a vector collecting all the chemical species within
128128
the system and any sub-systems that are also `ReactionSystems`.
129129
* `ModelingToolkit.parameters(rn)` returns all parameters across the
@@ -181,22 +181,14 @@ reactionrates
181181
```
182182

183183
## [Functions to extend or modify a network](@id api_network_extension_and_modification)
184-
`ReactionSystem`s can be programmatically extended using
185-
[`@add_reactions`](@ref), [`addspecies!`](@ref), [`addparam!`](@ref) and
186-
[`addreaction!`](@ref), or using [`ModelingToolkit.extend`](@ref) and
184+
`ReactionSystem`s can be programmatically extended using [`ModelingToolkit.extend`](@ref) and
187185
[`ModelingToolkit.compose`](@ref).
188186

189187
```@docs
190-
@add_reactions
191-
addspecies!
192-
addparam!
193-
addreaction!
194188
setdefaults!
195189
ModelingToolkit.extend
196190
ModelingToolkit.compose
197191
Catalyst.flatten
198-
merge!(network1::ReactionSystem, network2::ReactionSystem)
199-
reorder_states!
200192
```
201193

202194
## Network analysis and representations
@@ -251,6 +243,8 @@ latexify(rn; form=:sde)
251243
(As of writing this, an upstream bug causes the SDE form to be erroneously
252244
displayed as the ODE form)
253245

246+
Finally, another optional argument (`expand_functions=true`) automatically expands functions defined by Catalyst (such as `mm`). To disable this, set `expand_functions=false`.
247+
254248
If [Graphviz](https://graphviz.org/) is installed and commandline accessible, it
255249
can be used to create and save network diagrams using [`Graph`](@ref) and
256250
[`savegraph`](@ref).
@@ -280,6 +274,17 @@ Base.convert
280274
ModelingToolkit.structural_simplify
281275
```
282276

277+
## Chemistry-related functionalities
278+
Various functionalities primarily relevant to modelling of chemical systems (but potentially also in biology).
279+
```@docs
280+
@compound
281+
@compounds
282+
iscompound
283+
components
284+
coefficients
285+
component_coefficients
286+
```
287+
283288
## Unit validation
284289
```@docs
285290
validate(rx::Reaction; info::String = "")

0 commit comments

Comments
 (0)