You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/catalyst_functionality/compositional_modeling.md
+10-18Lines changed: 10 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,13 +6,12 @@ identically repressed genes, and how to use compositional modeling to create
6
6
compartments.
7
7
8
8
## A note on *completeness*
9
-
Catalyst `ReactionSystem` can either be *complete* or *incomplete*. *By default they are created as complete*. Here, only complete `ReactionSystem`s can be used to create the various problem types (e.g. `ODEProblem`). However, only incomplete `ReactionSystem`s can be composed using the features described below. Hence, for compositional modeling, `ReactionSystem` must be created as incomplete, and later set to complete before simulation.
9
+
Catalyst `ReactionSystem` can either be *complete* or *incomplete*. When created using the `@reaction_network` DSL they are *created as complete*. Here, only complete `ReactionSystem`s can be used to create the various problem types (e.g. `ODEProblem`). However, only incomplete `ReactionSystem`s can be composed using the features described below. Hence, for compositional modeling, `ReactionSystem` must be created as incomplete, and later set to complete before simulation.
10
10
11
-
To set a`ReactionSystem` created via the DSL as complete, use the `@incomplete` option:
11
+
To create incomplete`ReactionSystem`s using the DSL as complete, use the `@network_component` instead of `@reaction_network`:
12
12
```@example ex0
13
13
using Catalyst
14
-
degradation_component = @reaction_network begin
15
-
@incomplete
14
+
degradation_component = @network_component begin
16
15
d, X --> 0
17
16
end
18
17
```
@@ -40,12 +39,10 @@ Catalyst supports two ModelingToolkit interfaces for composing multiple
40
39
extending a system is the `extend` command
41
40
```@example ex1
42
41
using Catalyst
43
-
basern = @reaction_network rn1 begin
44
-
@incomplete
42
+
basern = @network_component rn1 begin
45
43
k, A + B --> C
46
44
end
47
-
newrn = @reaction_network rn2 begin
48
-
@incomplete
45
+
newrn = @network_component rn2 begin
49
46
r, C --> A + B
50
47
end
51
48
@named rn = extend(newrn, basern)
@@ -58,8 +55,7 @@ The second main compositional modeling tool is the use of subsystems. Suppose we
58
55
now add to `basern` two subsystems, `newrn` and `newestrn`, we get a
59
56
different result:
60
57
```@example ex1
61
-
newestrn = @reaction_network rn3 begin
62
-
@incomplete
58
+
newestrn = @network_component rn3 begin
63
59
v, A + D --> 2D
64
60
end
65
61
@named rn = compose(basern, [newrn, newestrn])
@@ -131,8 +127,7 @@ modular fashion. We start by defining a function that creates a negatively
131
127
repressed gene, taking the repressor as input
132
128
```@example ex1
133
129
function repressed_gene(; R, name)
134
-
@reaction_network $name begin
135
-
@incomplete
130
+
@network_component $name begin
136
131
hillr($R,α,K,n), ∅ --> m
137
132
(δ,γ), m <--> ∅
138
133
β, m --> m + P
@@ -189,15 +184,13 @@ In our model we'll therefore add the conversions of the last column to properly
189
184
account for compartment volumes:
190
185
```@example ex1
191
186
# transcription and regulation
192
-
nuc = @reaction_network nuc begin
193
-
@incomplete
187
+
nuc = @network_component nuc begin
194
188
α, G --> G + M
195
189
(κ₊/V,κ₋), D + G <--> DG
196
190
end
197
191
198
192
# translation and dimerization
199
-
cyto = @reaction_network cyto begin
200
-
@incomplete
193
+
cyto = @network_component cyto begin
201
194
β, M --> M + P
202
195
(k₊/V,k₋), 2P <--> D
203
196
σ, P --> 0
@@ -206,8 +199,7 @@ end
206
199
207
200
# export reactions,
208
201
# γ,δ=probability per time to be exported/imported
functionReactionSystem(rxs::Vector, iv = Catalyst.DEFAULT_IV; kwargs...)
@@ -1472,6 +1471,8 @@ function spatial_convert_err(rs::ReactionSystem, systype)
1472
1471
isspatial(rs) &&error("Conversion to $systype is not supported for spatial networks.")
1473
1472
end
1474
1473
1474
+
COMPLETENESS_ERROR ="A ReactionSystem must be complete before it can be converted to other system types. A ReactionSystem can be marked as complete using the `compelte` function."
0 commit comments