Skip to content

Commit b23b6ad

Browse files
committed
Merge remote-tracking branch 'origin/master' into formatting
2 parents 816bf96 + d9701d9 commit b23b6ad

File tree

18 files changed

+230
-146
lines changed

18 files changed

+230
-146
lines changed

docs/make.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ makedocs(sitename = "Catalyst.jl",
4242
pages = pages,
4343
pagesonly = true,
4444
warnonly = true)
45+
warnonly = [:missing_docs])
4546

4647
deploydocs(repo = "github.com/SciML/Catalyst.jl.git";
4748
push_preview = true)

docs/pages.jl

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,18 @@ pages = Any[
22
"Home" => "index.md",
33
"Introduction to Catalyst" => Any[
44
"introduction_to_catalyst/catalyst_for_new_julia_users.md",
5-
# "introduction_to_catalyst/introduction_to_catalyst.md"
6-
# Advanced introduction.
5+
"introduction_to_catalyst/introduction_to_catalyst.md"
76
],
87
"Model Creation and Properties" => Any[
98
"model_creation/dsl_basics.md",
109
"model_creation/dsl_advanced.md",
11-
#"model_creation/programmatic_CRN_construction.md",
10+
"model_creation/programmatic_CRN_construction.md",
1211
"model_creation/compositional_modeling.md",
13-
#"model_creation/constraint_equations.md",
14-
# Events.
15-
"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.
17-
# Loading and writing models to files.
12+
"model_creation/constraint_equations.md",
13+
"model_creation/parametric_stoichiometry.md",
14+
"model_creation/model_file_loading_and_export.md",
1815
"model_creation/model_visualisation.md",
19-
#"model_creation/network_analysis.md",
16+
"model_creation/network_analysis.md",
2017
"model_creation/chemistry_related_functionality.md",
2118
"Model creation examples" => Any[
2219
"model_creation/examples/basic_CRN_library.md",
@@ -29,8 +26,7 @@ pages = Any[
2926
"model_simulation/simulation_plotting.md",
3027
"model_simulation/simulation_structure_interfacing.md",
3128
"model_simulation/ensemble_simulations.md",
32-
# Stochastic simulation statistical analysis.
33-
"model_simulation/ode_simulation_performance.md" # SDE Performance considerations/advice. # Jump Performance considerations/advice. # Finite state projection
29+
"model_simulation/ode_simulation_performance.md",
3430
],
3531
"Steady state analysis" => Any[
3632
"steady_state_functionality/homotopy_continuation.md",
@@ -40,28 +36,15 @@ pages = Any[
4036
"steady_state_functionality/dynamical_systems.md"
4137
],
4238
"Inverse Problems" => Any[
43-
# Inverse problems introduction.
4439
"inverse_problems/optimization_ode_param_fitting.md",
4540
# "inverse_problems/petab_ode_param_fitting.md",
46-
# ODE parameter fitting using Turing.
47-
# SDE/Jump fitting.
4841
"inverse_problems/behaviour_optimisation.md",
49-
"inverse_problems/structural_identifiability.md", # Broken on Julia v1.10.3, requires v1.10.2 or 1.10.4.
50-
# Practical identifiability.
42+
"inverse_problems/structural_identifiability.md",
5143
"inverse_problems/global_sensitivity_analysis.md",
5244
"Inverse problem examples" => Any[
5345
"inverse_problems/examples/ode_fitting_oscillation.md"
5446
]
5547
],
56-
"Spatial modelling" => Any[
57-
# Intro.
58-
# Lattice ODEs.
59-
# Lattice Jumps.
60-
],
61-
# "Developer Documentation" => Any[
62-
# # Contributor's guide.
63-
# # Repository structure.
64-
# ],
6548
"FAQs" => "faqs.md",
6649
"API" => "api.md"
6750
]

docs/src/introduction_to_catalyst/introduction_to_catalyst.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ We first import the basic packages we'll need:
1212

1313
```@example tut1
1414
# If not already installed, first hit "]" within a Julia REPL. Then type:
15-
# add Catalyst DifferentialEquations Plots Latexify
15+
# add Catalyst OrdinaryDiffEq Plots Latexify
1616
17-
using Catalyst, DifferentialEquations, Plots, Latexify
17+
using Catalyst, OrdinaryDiffEq, Plots, Latexify
1818
```
1919

2020
We now construct the reaction network. The basic types of arrows and predefined
@@ -160,7 +160,7 @@ underlying problem.
160160

161161
At this point we are all set to solve the ODEs. We can now use any ODE solver
162162
from within the
163-
[DifferentialEquations.jl](https://docs.sciml.ai/DiffEqDocs/stable/solvers/ode_solve/)
163+
[OrdinaryDiffEq.jl](https://docs.sciml.ai/DiffEqDocs/stable/solvers/ode_solve/)
164164
package. We'll use the recommended default explicit solver, `Tsit5()`, and then
165165
plot the solutions:
166166

@@ -169,7 +169,7 @@ sol = solve(oprob, Tsit5(), saveat=10.)
169169
plot(sol)
170170
```
171171
We see the well-known oscillatory behavior of the repressilator! For more on the
172-
choices of ODE solvers, see the [DifferentialEquations.jl
172+
choices of ODE solvers, see the [OrdinaryDiffEq.jl
173173
documentation](https://docs.sciml.ai/DiffEqDocs/stable/solvers/ode_solve/).
174174

175175
---
@@ -182,6 +182,9 @@ Gillespie's `Direct` method, and then solve it to generate one realization of
182182
the jump process:
183183

184184
```@example tut1
185+
# imports the JumpProcesses packages
186+
using JumpProcesses
187+
185188
# redefine the initial condition to be integer valued
186189
u₀map = [:m₁ => 0, :m₂ => 0, :m₃ => 0, :P₁ => 20, :P₂ => 0, :P₃ => 0]
187190
@@ -237,6 +240,9 @@ model by creating an `SDEProblem` and solving it similarly to what we did for OD
237240
above:
238241

239242
```@example tut1
243+
# imports the StochasticDiffEq package for SDE simulations
244+
using StochasticDiffEq
245+
240246
# SDEProblem for CLE
241247
sprob = SDEProblem(bdp, u₀, tspan, p)
242248
@@ -285,7 +291,7 @@ For details on what information can be specified via the DSL see the [The
285291
Reaction DSL](@ref dsl_description) tutorial.
286292

287293
---
288-
## Reaction rate laws used in simulations
294+
## [Reaction rate laws used in simulations](@id introduction_to_catalyst_ratelaws)
289295
In generating mathematical models from a [`ReactionSystem`](@ref), reaction
290296
rates are treated as *microscopic* rates. That is, for a general mass action
291297
reaction of the form $n_1 S_1 + n_2 S_2 + \dots n_M S_M \to \dots$ with

docs/src/inverse_problems/behaviour_optimisation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ In previous tutorials we have described how to use [PEtab.jl](@ref petab_paramet
44
## [Maximising the pulse amplitude of an incoherent feed forward loop](@id behaviour_optimisation_IFFL_example)
55
Incoherent feedforward loops (network motifs where a single component both activates and deactivates a downstream component) are able to generate pulses in response to step inputs[^2]. In this tutorial we will consider such an incoherent feedforward loop, attempting to generate a system with as prominent a response pulse as possible.
66

7-
Our model consists of 3 species: $X$ (the input node), $Y$ (an intermediary), and $Z$ (the output node). In it, $X$ activates the production of both $Y$ and $Z$, with $Y$ also deactivating $Z$. When $X$ is activated, there will be a brief time window where $Y$ is still inactive, and $Z$ is activated. However, as $Y$ becomes active, it will turn $Z$ off. This creates a pulse of $Z$ activity. To trigger the system, we create [an event](@ref ref), which increases the production rate of $X$ ($pX$) by a factor of $10$ at time $t = 10$.
7+
Our model consists of 3 species: $X$ (the input node), $Y$ (an intermediary), and $Z$ (the output node). In it, $X$ activates the production of both $Y$ and $Z$, with $Y$ also deactivating $Z$. When $X$ is activated, there will be a brief time window where $Y$ is still inactive, and $Z$ is activated. However, as $Y$ becomes active, it will turn $Z$ off. This creates a pulse of $Z$ activity. To trigger the system, we create [an event](@ref constraint_equations_events), which increases the production rate of $X$ ($pX$) by a factor of $10$ at time $t = 10$.
88
```@example behaviour_optimization
99
using Catalyst
1010
incoherent_feed_forward = @reaction_network begin

docs/src/inverse_problems/global_sensitivity_analysis.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ GSA can be carried out using the [GlobalSensitivity.jl](https://github.com/SciML
88
### [Global vs local sensitivity](@id global_sensitivity_analysis_global_vs_local_sensitivity)
99
A related concept to global sensitivity is *local sensitivity*. This, rather than measuring a function's sensitivity (with regards to its inputs) across its entire (or large part of its) domain, measures it at a specific point. This is equivalent to computing the function's gradients at a specific point in phase space, which is an important routine for most gradient-based optimisation methods (typically carried out through [*automatic differentiation*](https://en.wikipedia.org/wiki/Automatic_differentiation)). For most Catalyst-related functionalities, local sensitivities are computed using the [SciMLSensitivity.jl](https://github.com/SciML/SciMLSensitivity.jl) package. While certain GSA methods can utilise local sensitivities, this is not necessarily the case.
1010

11-
While local sensitivities are primarily used as a subroutine of other methodologies (such as optimisation schemes), it also has direct uses. E.g., in the context of fitting parameters to data, local sensitivity analysis can be used to, at the parameter set of the optimal fit, [determine the cost function's sensitivity to the system parameters](@ref ref).
11+
While local sensitivities are primarily used as a subroutine of other methodologies (such as optimisation schemes), it also has direct uses. E.g., in the context of fitting parameters to data, local sensitivity analysis can be used to, at the parameter set of the optimal fit, determine the cost function's sensitivity to the system parameters.
1212

1313
## [Basic example](@id global_sensitivity_analysis_basic_example)
1414
We will consider a simple [SEIR model of an infectious disease](https://en.wikipedia.org/wiki/Compartmental_models_in_epidemiology). This is an expansion of the classic [SIR model](@ref basic_CRN_library_sir) with an additional *exposed* state, $E$, denoting individuals who are latently infected but currently unable to transmit their infection to others.

docs/src/model_creation/constraint_equations.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ creating these two systems.
2828
Here, to create differentials with respect to time (for our differential equations), we must import the time differential operator from Catalyst. We do this through `D = default_time_deriv()`. Here, `D(V)` denotes the differential of the variable `V` with respect to time.
2929

3030
```@example ceq1
31-
using Catalyst, DifferentialEquations, Plots
31+
using Catalyst, OrdinaryDiffEq, Plots
3232
t = default_t()
3333
D = default_time_deriv()
3434
@@ -58,6 +58,7 @@ We can now merge the two systems into one complete `ReactionSystem` model using
5858
[`ModelingToolkit.extend`](@ref):
5959
```@example ceq1
6060
@named growing_cell = extend(osys, rn)
61+
growing_cell = complete(growing_cell)
6162
```
6263

6364
We see that the combined model now has both the reactions and ODEs as its
@@ -72,7 +73,7 @@ plot(sol)
7273
As an alternative to the previous approach, we could have constructed our
7374
`ReactionSystem` all at once by directly using the symbolic interface:
7475
```@example ceq2
75-
using Catalyst, DifferentialEquations, Plots
76+
using Catalyst, OrdinaryDiffEq, Plots
7677
t = default_t()
7778
D = default_time_deriv()
7879
@@ -83,6 +84,7 @@ rx1 = @reaction $V, 0 --> P
8384
rx2 = @reaction 1.0, P --> 0
8485
@named growing_cell = ReactionSystem([rx1, rx2, eq], t)
8586
setdefaults!(growing_cell, [:P => 0.0])
87+
growing_cell = complete(growing_cell)
8688
8789
oprob = ODEProblem(growing_cell, [], (0.0, 1.0))
8890
sol = solve(oprob, Tsit5())
@@ -100,12 +102,11 @@ the associated [ModelingToolkit
100102
tutorial](https://docs.sciml.ai/ModelingToolkit/stable/basics/Events/) for more
101103
details on the types of events that can be represented symbolically. A
102104
lower-level approach for creating events via the DifferentialEquations.jl
103-
callback interface is illustrated in the [Advanced Simulation Options](@ref
104-
advanced_simulations) tutorial.
105+
callback interface is illustrated [here](https://docs.sciml.ai/DiffEqDocs/stable/features/callback_functions/) tutorial.
105106

106107
Let's first create our equations and unknowns/species again
107108
```@example ceq3
108-
using Catalyst, DifferentialEquations, Plots
109+
using Catalyst, OrdinaryDiffEq, Plots
109110
t = default_t()
110111
D = default_time_deriv()
111112
@@ -124,6 +125,7 @@ continuous_events = [V ~ 2.0] => [V ~ V/2, P ~ P/2]
124125
We can now create and simulate our model
125126
```@example ceq3
126127
@named rs = ReactionSystem([rx1, rx2, eq], t; continuous_events)
128+
rs = complete(rs)
127129
128130
oprob = ODEProblem(rs, [], (0.0, 10.0))
129131
sol = solve(oprob, Tsit5())
@@ -148,6 +150,7 @@ p = [k_on => 100.0, switch_time => 2.0, k_off => 10.0]
148150
Simulating our model,
149151
```@example ceq3
150152
@named osys = ReactionSystem(rxs, t, [A, B], [k_on, k_off, switch_time]; discrete_events)
153+
osys = complete(osys)
151154
152155
oprob = ODEProblem(osys, u0, tspan, p)
153156
sol = solve(oprob, Tsit5(); tstops = 2.0)

docs/src/model_creation/dsl_advanced.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Generally, there are four main reasons for specifying species/parameters using t
8686
4. To designate a species or parameters that do not occur in reactions, but are still part of the model (e.g a [parametric initial condition](@ref dsl_advanced_options_parametric_initial_conditions))
8787

8888
!!! warn
89-
Catalyst's DSL automatically infer species and parameters from the input. However, it only does so for *quantities that appear in reactions*. Until now this has not been relevant. However, this tutorial will demonstrate cases where species/parameters that are not part of reactions are used. These *must* be designated using either the `@species` or `@parameters` options (or the `@variables` option, which is described [later](@ref ref)).
89+
Catalyst's DSL automatically infer species and parameters from the input. However, it only does so for *quantities that appear in reactions*. Until now this has not been relevant. However, this tutorial will demonstrate cases where species/parameters that are not part of reactions are used. These *must* be designated using either the `@species` or `@parameters` options (or the `@variables` option, which is described [later](@ref constraint_equations)).
9090

9191
### [Setting default values for species and parameters](@id dsl_advanced_options_default_vals)
9292
When declaring species/parameters using the `@species` and `@parameters` options, one can also assign them default values (by appending them with `=` followed by the desired default value). E.g here we set `X`'s default initial condition value to $1.0$, and `p` and `d`'s default values to $1.0$ and $0.2$, respectively:
@@ -207,7 +207,7 @@ It is not possible for the user to directly designate their own metadata. These
207207

208208
### [Designating constant-valued/fixed species parameters](@id dsl_advanced_options_constant_species)
209209

210-
Catalyst enables the designation of parameters as `constantspecies`. These parameters can be used as species in reactions, however, their values are not changed by the reaction and remain constant throughout the simulation (unless changed by e.g. the [occurrence of an event]@ref ref). Practically, this is done by setting the parameter's `isconstantspecies` metadata to `true`. Here, we create a simple reaction where the species `X` is converted to `Xᴾ` at rate `k`. By designating `X` as a constant species parameter, we ensure that its quantity is unchanged by the occurrence of the reaction.
210+
Catalyst enables the designation of parameters as `constantspecies`. These parameters can be used as species in reactions, however, their values are not changed by the reaction and remain constant throughout the simulation (unless changed by e.g. the [occurrence of an event]@ref constraint_equations_events). Practically, this is done by setting the parameter's `isconstantspecies` metadata to `true`. Here, we create a simple reaction where the species `X` is converted to `Xᴾ` at rate `k`. By designating `X` as a constant species parameter, we ensure that its quantity is unchanged by the occurrence of the reaction.
211211
```@example dsl_advanced_constant_species
212212
using Catalyst # hide
213213
rn = @reaction_network begin
@@ -357,7 +357,7 @@ plot!(ylimit = (minimum(sol[:Xtot])*0.95, maximum(sol[:Xtot])*1.05)) # hide
357357
```
358358
to plot the observables (rather than the species).
359359

360-
Observables can be defined using complicated expressions containing species, parameters, and [variables](@ref ref) (but not other observables). In the following example (which uses a [parametric stoichiometry](@ref dsl_description_stoichiometries_parameters)) `X` polymerises to form a complex `Xn` containing `n` copies of `X`. Here, we create an observable describing the total number of `X` molecules in the system:
360+
Observables can be defined using complicated expressions containing species, parameters, and [variables](@ref constraint_equations) (but not other observables). In the following example (which uses a [parametric stoichiometry](@ref dsl_description_stoichiometries_parameters)) `X` polymerises to form a complex `Xn` containing `n` copies of `X`. Here, we create an observable describing the total number of `X` molecules in the system:
361361
```@example dsl_advanced_observables
362362
rn = @reaction_network begin
363363
@observables Xtot ~ X + n*Xn
@@ -377,7 +377,7 @@ end
377377
nothing # hide
378378
```
379379

380-
Observables are by default considered [variables](@ref ref) (not species). To designate them as a species, they can be pre-declared using the `@species` option. I.e. Here `Xtot` becomes a species:
380+
Observables are by default considered [variables](@ref constraint_equations) (not species). To designate them as a species, they can be pre-declared using the `@species` option. I.e. Here `Xtot` becomes a species:
381381
```@example dsl_advanced_observables
382382
rn = @reaction_network begin
383383
@species Xtot(t)

docs/src/model_creation/dsl_basics.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# [The Catalyst DSL - Introduction](@id dsl_description)
22
In the [introduction to Catalyst](@ref introduction_to_catalyst) we described how the `@reaction_network` [macro](https://docs.julialang.org/en/v1/manual/metaprogramming/#man-macros) can be used to create chemical reaction network (CRN) models. This macro enables a so-called [domain-specific language](https://en.wikipedia.org/wiki/Domain-specific_language) (DSL) for creating CRN models. This tutorial will give a basic introduction on how to create Catalyst models using this macro (from now onwards called "*the Catalyst DSL*"). A [follow-up tutorial](@ref dsl_advanced_options) will describe some of the DSL's more advanced features.
33

4-
The Catalyst DSL generates a [`ReactionSystem`](@ref) (the [julia structure](https://docs.julialang.org/en/v1/manual/types/#Composite-Types) Catalyst uses to represent CRN models). These can be created through alternative methods (e.g. [programmatically](@ref programmatic_CRN_construction) or [compositionally](@ref compositional_modeling)). A summary of the various ways to create `ReactionSystems`s can be found [here](@ref ref). [Previous](@ref ref) and [following](@ref simulation_intro) tutorials describe how to simulate models once they have been created using the DSL. This tutorial will solely focus on model creation.
4+
The Catalyst DSL generates a [`ReactionSystem`](@ref) (the [julia structure](https://docs.julialang.org/en/v1/manual/types/#Composite-Types) Catalyst uses to represent CRN models). These can be created through alternative methods (e.g. [programmatically](@ref programmatic_CRN_construction) or [compositionally](@ref compositional_modeling)). A summary of the various ways to create `ReactionSystems`s can be found [here](@ref ref). [Previous](@ref introduction_to_catalyst) and [following](@ref simulation_intro) tutorials describe how to simulate models once they have been created using the DSL. This tutorial will solely focus on model creation.
55

66
Before we begin, we will first load the Catalyst package (which is required to run the code).
77
```@example dsl_basics_intro
@@ -88,7 +88,7 @@ rn5 = @reaction_network begin
8888
kD, X2 --> 2X
8989
end
9090
```
91-
Reactants whose stoichiometries are not defined are assumed to have stoichiometry `1`. Any integer number can be used, furthermore, [decimal numbers and parameters can also be used as stoichiometries](@ref dsl_description_stoichiometries). A discussion of non-unitary (i.e. not equal to `1`) stoichiometries affecting the created model can be found [here](@ref ref).
91+
Reactants whose stoichiometries are not defined are assumed to have stoichiometry `1`. Any integer number can be used, furthermore, [decimal numbers and parameters can also be used as stoichiometries](@ref dsl_description_stoichiometries). A discussion of non-unitary (i.e. not equal to `1`) stoichiometries affecting the created model can be found [here](@ref introduction_to_catalyst_ratelaws).
9292

9393
Stoichiometries can be combined with `()` to define them for multiple reactants. Here, the following (mock) model declares the same reaction twice, both with and without this notation:
9494
```@example dsl_basics

0 commit comments

Comments
 (0)