Skip to content

Commit 7d8aba3

Browse files
committed
fixes
1 parent 6da031f commit 7d8aba3

File tree

7 files changed

+48
-55
lines changed

7 files changed

+48
-55
lines changed

docs/Project.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
1919
LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae"
2020
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
2121
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
22-
MultiDocumenter = "87ed4bf0-c935-4a67-83c3-2a03bee4197c"
2322
NetworkLayout = "46757867-2c16-5918-afeb-47bfcb05e46a"
2423
NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
2524
Optim = "429524aa-4258-5aef-a3af-852621145aeb"

docs/make.jl

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ using Documenter
22
using Catalyst, ModelingToolkit
33
# Add packages for plotting
44
using GraphMakie, CairoMakie
5-
#using MultiDocumenter
65

76
docpath = Base.source_dir()
87
assetpath = joinpath(docpath, "src", "assets")
@@ -49,32 +48,5 @@ makedocs(sitename = "Catalyst.jl",
4948
pagesonly = true,
5049
warnonly = [:missing_docs])
5150

52-
#clonedir = mktempdir()
53-
54-
#docs = [MultiDocumenter.MultiDocRef(
55-
# upstream = joinpath(@__DIR__, "build"),
56-
# path = "docs",
57-
# name = "Catalyst",
58-
# fix_canonical_url = false,
59-
# ),
60-
# MultiDocumenter.MultiDocRef(
61-
# upstream = joinpath(clonedir, "build"),
62-
# path = "NetworkAnalysis",
63-
# name = "CatalystNetworkAnalysis",
64-
# giturl = "https://github.com/SciML/CatalystNetworkAnalysis.jl",
65-
# )]
66-
6751
deploydocs(repo = "github.com/SciML/Catalyst.jl.git";
6852
push_preview = true)
69-
70-
#outpath = joinpath(@__DIR__, "build")
71-
#MultiDocumenter.make(outpath, docs;
72-
# assets_dir = "docs/src/assets",
73-
# search_engine = MultiDocumenter.SearchConfig(index_versions = [
74-
# "stable",
75-
# ],
76-
# engine = MultiDocumenter.FlexSearch),
77-
# brand_image = MultiDocumenter.BrandImage("https://sciml.ai",
78-
# joinpath("assets",
79-
# "logo.png")))
80-
#

docs/pages.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ pages = Any[
2929
"Network Analysis" => Any[
3030
"network_analysis/odes.md",
3131
"network_analysis/crn_theory.md",
32-
"network_analysis/network_properties.md",
33-
"network_analysis/advanced_analysis.md"
32+
"network_analysis/network_properties.md"
3433
],
3534
"Model simulation and visualization" => Any[
3635
"model_simulation/simulation_introduction.md",

docs/src/api/core_api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ ReactionSystem
8686
```
8787

8888
## [Options for the `@reaction_network` DSL](@id api_dsl_options)
89-
We have [previously described](@ref dsl_advanced_options) how options permits the user to supply non-reaction information to [`ReactionSystem`](@ref) created through the DSL. Here follows a list
89+
We have [previously described](@ref dsl_advanced_options) how options permit the user to supply non-reaction information to [`ReactionSystem`](@ref) created through the DSL. Here follows a list
9090
of all options currently available.
9191
- [`parameters`](@ref dsl_advanced_options_declaring_species_and_parameters): Allows the designation of a set of symbols as system parameters.
9292
- [`species`](@ref dsl_advanced_options_declaring_species_and_parameters): Allows the designation of a set of symbols as system species.

docs/src/network_analysis/advanced_analysis.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/src/network_analysis/crn_theory.md

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,11 @@ which we see is mass action and has deficiency zero, but is not weakly
262262
reversible. As such, we can conclude that for any choice of rate constants the
263263
RRE ODEs cannot have a positive equilibrium solution.
264264

265-
```@docs; canonical=false
266-
satisfiesdeficiencyzero
265+
There is an API function [`satisfiesdeficiencyzero`](@ref) that will let us check
266+
all these conditions easily:
267+
268+
```@example s1
269+
satisfiesdeficiencyzero(def0_rn)
267270
```
268271

269272
## Deficiency One Theorem
@@ -282,8 +285,31 @@ stoichiometric compatibility class for any choice of rate constants and paramete
282285
the deficiency zero theorem, networks obeying the deficiency one theorem are not guaranteed
283286
to have stable solutions.
284287

285-
```@docs; canonical=false
286-
satisfiesdeficiencyone
288+
Let's look at an example network.
289+
290+
```@example s1
291+
def1_network = @reaction_network begin
292+
(k1, k2), A <--> 2B
293+
k3, C --> 2D
294+
k4, 2D --> C + E
295+
(k5, k6), C + E <--> E + 2D
296+
end
297+
plot_complexes(def1_network)
298+
```
299+
300+
We can see from the complex graph that there are two linkage classes, the deficiency of the bottom one is zero and the deficiency of the top one is one.
301+
The total deficiency is one:
302+
303+
```@example s1
304+
deficiency(def1_network)
305+
```
306+
307+
And there is only one terminal linkage class in each, so our network satisfies all three conditions.
308+
As in the deficiency zero case, there is the API function [`satisfiesdeficiencyone`](@ref)
309+
for quickly checking these conditions:
310+
311+
```@example s1
312+
satisfiesdeficiencyone(def1_network)
287313
```
288314

289315
## [Complex and Detailed Balance](@id network_analysis_complex_and_detailed_balance)
@@ -296,7 +322,7 @@ Note that detailed balance at a given steady state implies complex balance for t
296322
i.e. detailed balance is a stronger property than complex balance.
297323

298324
Remarkably, having just one positive steady state that is complex (detailed) balance implies that
299-
complex (detailed) balance obtains at *every* positive steady state, so we say that a network
325+
complex (detailed) balance holds for *every* positive steady state, so we say that a network
300326
is complex (detailed) balanced if any one of its steady states are complex (detailed) balanced.
301327
Additionally, there will be exactly one steady state in every positive stoichiometric
302328
compatibility class, and this steady state is asymptotically stable. (For proofs of these results,
@@ -328,7 +354,7 @@ isdetailedbalanced
328354

329355
## [Concentration Robustness](@id network_analysis_concentration_robustness)
330356
Certain reaction networks have species that do not change their concentration,
331-
regardless of the system is perturbed to a different stoichiometric compatibility
357+
regardless of whether the system is perturbed to a different stoichiometric compatibility
332358
class. This is a very useful property to have in biological contexts, where it might
333359
be important to keep the concentration of a critical species relatively stable in
334360
the face of changes in its environment.

docs/src/network_analysis/odes.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ in Catalyst as well](@ref dsl_advanced_options_constant_species).
1414
## [Network representation of the Repressilator `ReactionSystem`](@id network_analysis_repressilator_representation)
1515
We first load Catalyst and construct our model of the repressilator
1616
```@example s1
17-
using Catalyst
17+
using Catalyst, CairoMakie, GraphMakie, NetworkLayout
1818
repressilator = @reaction_network Repressilator begin
1919
hillr(P₃,α,K,n), ∅ --> m₁
2020
hillr(P₁,α,K,n), ∅ --> m₂
@@ -34,10 +34,10 @@ In the [Model Visualization](@ref visualisation_graphs)
3434
tutorial we showed how the above network could be visualized as a
3535
species-reaction graph. There, species are represented by the nodes of the graph
3636
and edges show the reactions in which a given species is a substrate or product.
37-
```julia
38-
g = Graph(repressilator)
37+
38+
```@example s1
39+
g = plot_network(repressilator)
3940
```
40-
![Repressilator solution](../assets/repressilator.svg)
4141

4242
We also showed in the [Introduction to Catalyst](@ref introduction_to_catalyst) tutorial that
4343
the reaction rate equation (RRE) ODE model for the repressilator is
@@ -197,7 +197,7 @@ plot_complexes(rn)
197197
```
198198

199199
while for the repressilator we find
200-
```julia
200+
```@example s1
201201
plot_complexes(repressilator)
202202
```
203203

@@ -211,15 +211,15 @@ So far we have covered two equivalent descriptions of the chemical reaction netw
211211
```math
212212
\begin{align}
213213
\frac{d\mathbf{x}}{dt} &= N \mathbf{v}(\mathbf{x}(t),t) \\
214-
&= Z B \mathbf{v}(\mathbf{x}(t),t)
214+
&= Z B \mathbf{v}(\mathbf{x}(t),t).
215215
\end{align}
216216
```
217217

218-
In this section we discuss a further decomposition of the ODEs. Recall that the reaction rate vector $\mathbf{v}$, which is a vector of length $R$ whose elements are the rate expressions for each reaction. Its elements can be written as
218+
In this section we discuss a further decomposition of the ODEs. Recall the reaction rate vector $\mathbf{v}$, which is a vector of length $R$ whose elements are the rate expressions for each reaction. Its elements can be written as
219219
```math
220220
\mathbf{v}_{y \rightarrow y'} = k_{y \rightarrow y'} \mathbf{x}^y,
221221
```
222-
where $\mathbf{x}^y = \prod_s x_s^{y_s}$, the mass-action product of the complex $y$, where $y$ is the substrate complex of the reaction $y \rightarrow y'$. We can define a new vector called the mass action vector $\Phi(\mathbf{x}(t))$, a vector of length $C$ whose elements are the mass action products of each complex:
222+
where $\mathbf{x}^y = \prod_s x_s^{y_s}$ denotes the mass-action product of the substrate complex $y$ from the $y \rightarrow y'$ reaction. We can define a new vector called the mass action vector $\Phi(\mathbf{x}(t))$, a vector of length $C$ whose elements are the mass action products of each complex:
223223
```@example s1
224224
Φ = massactionvector(rn)
225225
```
@@ -262,24 +262,24 @@ returns a `Matrix{Num}`, since some of its entries are symbolic rate constants
262262
(symbolic variables and `Num`s cannot be compared using `==`, since `a == b`
263263
is interpreted as a symbolic expression).
264264

265-
In sum, we have that
265+
In summary, we have that
266266
```math
267267
\begin{align}
268268
\frac{d\mathbf{x}}{dt} &= N \mathbf{v}(\mathbf{x}(t),t) \\
269269
&= N K \Phi(\mathbf{x}(t),t) \\
270-
&= Z B K \Phi(\mathbf{x}(t),t).
270+
&= Z B K \Phi(\mathbf{x}(t),t) \\
271271
&= Z A_k \Phi(\mathbf{x}(t),t).
272272
\end{align}
273273
```
274274

275-
All three of the objects introduced in this section (the flux matrix, mass-action vector, Laplacian matrix) will return symbolic outputs by default, but can be made to return numerical outputs if values are specified.
275+
All three of the objects introduced in this section (the flux matrix, mass-action vector, and Laplacian matrix) will return symbolic outputs by default, but can be made to return numerical outputs if values are specified.
276276
For example, `massactionvector` will return a numerical output if a set of species concentrations is supplied using a dictionary, tuple, or vector of Symbol-value pairs.
277277
```@example s1
278278
concmap = Dict([:A => 3., :B => 5., :C => 2.4, :D => 1.5])
279279
massactionvector(rn, concmap)
280280
```
281281

282-
`fluxmat` and `laplacianmat` will return numeric matrices if a set of rate constants and other aprameters are supplied the same way.
282+
`fluxmat` and `laplacianmat` will return numeric matrices if a set of rate constants and other parameters are supplied the same way.
283283
```@example s1
284284
parammap = Dict([:k => 12., :b => 8.])
285285
fluxmat(rn, parammap)
@@ -303,7 +303,7 @@ f = eval(f_oop_expr)
303303
c = [3., 5., 2., 6.]
304304
f(c)
305305
```
306-
The generated `f` now corresponds to the $f(\mathbf{x}(t))$ on the right-hand side of $\frac{d\mathbf{x}(t)}{dt} = f(\mathbf{x}(t))$. Given a vector of species concentrations $c$, `ode_func` will return the rate of change of each species. Steady state concentration vectors `c_ss` will satisfy `f(c_ss) = zeros(length(species(rn)))`.
306+
The generated `f` now corresponds to the $f(\mathbf{x}(t))$ on the right-hand side of $\frac{d\mathbf{x}(t)}{dt} = f(\mathbf{x}(t))$. Given a vector of species concentrations $c$, `f` will return the rate of change of each species. Steady state concentration vectors `c_ss` will satisfy `f(c_ss) = zeros(length(species(rn)))`.
307307

308308
Above we have generated a numeric rate matrix to substitute the rate constants into the symbolic expressions. We could have used a symbolic rate matrix, but then we would need to define the parameters `k, b`, so that the function `f` knows what `k` and `b` in its output refer to.
309309
```@example s1
@@ -333,7 +333,7 @@ Note also that `f` can take any vector with the right dimension (i.e. the number
333333
## Properties of matrix null spaces
334334
The null spaces of the matrices discussed in this section often have special meaning. Below we will discuss some of these properties.
335335

336-
Recall that we may write the net stoichiometry matrix ``N = YB``.
336+
Recall that we may write the net stoichiometry matrix ``N = ZB``, where `Z` is the complex stoichiometry matrix and `B` is the incidence matrix of the graph.
337337

338338
[Conservation laws](@ref conservation_laws) arise as left null eigenvectors of the net stoichiometry matrix ``N``, and cycles arise as right null eigenvectors of the stoichiometry matrix. A cycle may be understood as a sequence of reactions that leaves the overall species composition unchanged. These do not necessarily have to correspond to actual cycles in the graph.
339339

0 commit comments

Comments
 (0)