Skip to content

Commit b06cfee

Browse files
authored
Merge pull request #902 from SciML/file_loading_tutorial
Documentation of file loading/saving
2 parents 0fbadf7 + 7f2d234 commit b06cfee

File tree

6 files changed

+525
-0
lines changed

6 files changed

+525
-0
lines changed

docs/pages.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ pages = Any[
1313
#"model_creation/constraint_equations.md",
1414
# Events.
1515
#"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.
1617
# Loading and writing models to files.
1718
"model_creation/model_visualisation.md",
1819
#"model_creation/network_analysis.md",

docs/src/assets/brusselator_sim_SBMLImporter.svg

Lines changed: 50 additions & 0 deletions
Loading
Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!-- Created by COPASI version 4.42 (Build 284) on 2024-01-10 09:22 with libSBML version 5.20.0. -->
3+
<sbml xmlns="http://www.sbml.org/sbml/level2/version4" level="2" version="4">
4+
<model metaid="COPASI0" id="New_Model" name="New Model">
5+
<annotation>
6+
<copasi:COPASI xmlns:copasi="http://www.copasi.org/static/sbml">
7+
<rdf:RDF xmlns:dcterms="http://purl.org/dc/terms/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
8+
<rdf:Description rdf:about="#COPASI0">
9+
<dcterms:created>
10+
<rdf:Description>
11+
<dcterms:W3CDTF>2024-01-09T21:46:45Z</dcterms:W3CDTF>
12+
</rdf:Description>
13+
</dcterms:created>
14+
</rdf:Description>
15+
</rdf:RDF>
16+
</copasi:COPASI>
17+
<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/">
18+
<rdf:Description rdf:about="#COPASI0">
19+
<dcterms:created rdf:parseType="Resource">
20+
<dcterms:W3CDTF>2024-01-09T21:46:45Z</dcterms:W3CDTF>
21+
</dcterms:created>
22+
<dcterms:modified rdf:parseType="Resource">
23+
<dcterms:W3CDTF>2024-01-09T21:46:45Z</dcterms:W3CDTF>
24+
</dcterms:modified>
25+
</rdf:Description>
26+
</rdf:RDF>
27+
</annotation>
28+
<listOfFunctionDefinitions>
29+
<functionDefinition id="Constant_flux__irreversible" name="Constant flux (irreversible)">
30+
<math xmlns="http://www.w3.org/1998/Math/MathML">
31+
<lambda>
32+
<bvar>
33+
<ci> v </ci>
34+
</bvar>
35+
<ci> v </ci>
36+
</lambda>
37+
</math>
38+
</functionDefinition>
39+
</listOfFunctionDefinitions>
40+
<listOfUnitDefinitions>
41+
<unitDefinition id="length" name="length">
42+
<listOfUnits>
43+
<unit kind="metre" exponent="1" scale="0" multiplier="1"/>
44+
</listOfUnits>
45+
</unitDefinition>
46+
<unitDefinition id="area" name="area">
47+
<listOfUnits>
48+
<unit kind="metre" exponent="2" scale="0" multiplier="1"/>
49+
</listOfUnits>
50+
</unitDefinition>
51+
<unitDefinition id="volume" name="volume">
52+
<listOfUnits>
53+
<unit kind="litre" exponent="1" scale="0" multiplier="1"/>
54+
</listOfUnits>
55+
</unitDefinition>
56+
<unitDefinition id="time" name="time">
57+
<listOfUnits>
58+
<unit kind="second" exponent="1" scale="0" multiplier="1"/>
59+
</listOfUnits>
60+
</unitDefinition>
61+
<unitDefinition id="substance" name="substance">
62+
<listOfUnits>
63+
<unit kind="mole" exponent="1" scale="0" multiplier="1"/>
64+
</listOfUnits>
65+
</unitDefinition>
66+
</listOfUnitDefinitions>
67+
<listOfCompartments>
68+
<compartment id="compartment" name="compartment" spatialDimensions="3" size="1" constant="true"/>
69+
</listOfCompartments>
70+
<listOfSpecies>
71+
<species id="X" name="X" compartment="compartment" hasOnlySubstanceUnits="true" initialAmount="2" boundaryCondition="false" constant="false"/>
72+
<species id="Y" name="Y" compartment="compartment" hasOnlySubstanceUnits="true" initialAmount="10" boundaryCondition="false" constant="false"/>
73+
</listOfSpecies>
74+
<listOfParameters>
75+
<parameter id="A" name="A" value="1" constant="true"/>
76+
<parameter id="B" name="B" value="4" constant="true"/>
77+
</listOfParameters>
78+
<listOfReactions>
79+
<reaction id="r2" name="r2" reversible="false">
80+
<listOfReactants>
81+
<speciesReference species="Y" stoichiometry="1"/>
82+
<speciesReference species="X" stoichiometry="2"/>
83+
</listOfReactants>
84+
<listOfProducts>
85+
<speciesReference species="X" stoichiometry="3"/>
86+
</listOfProducts>
87+
<kineticLaw>
88+
<math xmlns="http://www.w3.org/1998/Math/MathML">
89+
<apply>
90+
<times/>
91+
<ci> compartment </ci>
92+
<ci> k1 </ci>
93+
<apply>
94+
<power/>
95+
<ci> X </ci>
96+
<cn> 2 </cn>
97+
</apply>
98+
<ci> Y </ci>
99+
</apply>
100+
</math>
101+
<listOfParameters>
102+
<parameter id="k1" name="k1" value="1"/>
103+
</listOfParameters>
104+
</kineticLaw>
105+
</reaction>
106+
<reaction id="r3" name="r3" reversible="false">
107+
<listOfReactants>
108+
<speciesReference species="X" stoichiometry="1"/>
109+
</listOfReactants>
110+
<listOfProducts>
111+
<speciesReference species="Y" stoichiometry="1"/>
112+
</listOfProducts>
113+
<kineticLaw>
114+
<math xmlns="http://www.w3.org/1998/Math/MathML">
115+
<apply>
116+
<times/>
117+
<ci> compartment </ci>
118+
<ci> B </ci>
119+
<ci> X </ci>
120+
</apply>
121+
</math>
122+
</kineticLaw>
123+
</reaction>
124+
<reaction id="r4" name="r4" reversible="false">
125+
<listOfReactants>
126+
<speciesReference species="X" stoichiometry="1"/>
127+
</listOfReactants>
128+
<kineticLaw>
129+
<math xmlns="http://www.w3.org/1998/Math/MathML">
130+
<apply>
131+
<times/>
132+
<ci> compartment </ci>
133+
<ci> k1 </ci>
134+
<ci> X </ci>
135+
</apply>
136+
</math>
137+
<listOfParameters>
138+
<parameter id="k1" name="k1" value="1"/>
139+
</listOfParameters>
140+
</kineticLaw>
141+
</reaction>
142+
<reaction id="r1" name="r1" reversible="false">
143+
<listOfProducts>
144+
<speciesReference species="X" stoichiometry="1"/>
145+
</listOfProducts>
146+
<kineticLaw>
147+
<math xmlns="http://www.w3.org/1998/Math/MathML">
148+
<apply>
149+
<times/>
150+
<ci> compartment </ci>
151+
<apply>
152+
<ci> Constant_flux__irreversible </ci>
153+
<ci> A </ci>
154+
</apply>
155+
</apply>
156+
</math>
157+
</kineticLaw>
158+
</reaction>
159+
</listOfReactions>
160+
</model>
161+
</sbml>
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Created by BioNetGen 2.3.1
2+
begin parameters
3+
1 Na 6.022e23 # Constant
4+
2 V 1.4e-15 # Constant
5+
3 c0 1e9 # Constant
6+
4 c1 224 # Constant
7+
5 c2 9 # Constant
8+
6 c3 0.5 # Constant
9+
7 c4 5e-4 # Constant
10+
8 c5 0.167 # Constant
11+
9 c6 ln(2)/120 # Constant
12+
10 c7 ln(2)/600 # Constant
13+
11 tF 1e-4 # Constant
14+
12 rF 1000 # Constant
15+
13 pF 1000 # Constant
16+
14 _rateLaw1 (((c0/Na)/V)*tF)/pF # ConstantExpression
17+
15 _rateLaw2 c1*tF # ConstantExpression
18+
16 _rateLaw3 (((c0/Na)/V)*tF)/pF # ConstantExpression
19+
17 _rateLaw4 c2*tF # ConstantExpression
20+
18 _rateLaw5 c3*rF # ConstantExpression
21+
19 _rateLaw6 c4*rF # ConstantExpression
22+
20 _rateLaw7 (c5/rF)*pF # ConstantExpression
23+
21 _rateLaw8 (((c0/Na)/V)*tF)/pF # ConstantExpression
24+
22 _rateLaw9 c1*tF # ConstantExpression
25+
23 _rateLaw10 (((c0/Na)/V)*tF)/pF # ConstantExpression
26+
24 _rateLaw11 c2*tF # ConstantExpression
27+
25 _rateLaw12 c3*rF # ConstantExpression
28+
26 _rateLaw13 c4*rF # ConstantExpression
29+
27 _rateLaw14 (c5/rF)*pF # ConstantExpression
30+
28 _rateLaw15 (((c0/Na)/V)*tF)/pF # ConstantExpression
31+
29 _rateLaw16 c1*tF # ConstantExpression
32+
30 _rateLaw17 (((c0/Na)/V)*tF)/pF # ConstantExpression
33+
31 _rateLaw18 c2*tF # ConstantExpression
34+
32 _rateLaw19 c3*rF # ConstantExpression
35+
33 _rateLaw20 c4*rF # ConstantExpression
36+
34 _rateLaw21 (c5/rF)*pF # ConstantExpression
37+
end parameters
38+
begin species
39+
1 Null() 1
40+
2 gTetR(lac!1,lac!2).pLacI(tet!1).pLacI(tet!2) 1
41+
3 gCI(tet!1,tet!2).pTetR(cI!1).pTetR(cI!2) 1
42+
4 gLacI(cI!1,cI!2).pCI(lac!1).pCI(lac!2) 1
43+
5 mTetR() 3163
44+
6 mCI() 6819
45+
7 mLacI() 129
46+
8 pTetR(cI) 183453
47+
9 pCI(lac) 2006198
48+
10 pLacI(tet) 165670
49+
11 gTetR(lac!1,lac).pLacI(tet!1) 0
50+
12 gCI(tet!1,tet).pTetR(cI!1) 0
51+
13 gLacI(cI!1,cI).pCI(lac!1) 0
52+
14 gTetR(lac,lac) 0
53+
15 gCI(tet,tet) 0
54+
16 gLacI(cI,cI) 0
55+
end species
56+
begin reactions
57+
1 2 10,11 2*_rateLaw4 #_reverse__R2
58+
2 2 2,5 _rateLaw6 #_R4
59+
3 5 5,8 _rateLaw7 #_R5
60+
4 1,5 1 c6 #_R6
61+
5 1,8 1 c7 #_R7
62+
6 3 8,12 2*_rateLaw11 #_reverse__R9
63+
7 3 3,6 _rateLaw13 #_R11
64+
8 6 6,9 _rateLaw14 #_R12
65+
9 1,6 1 c6 #_R13
66+
10 1,9 1 c7 #_R14
67+
11 4 9,13 2*_rateLaw18 #_reverse__R16
68+
12 4 4,7 _rateLaw20 #_R18
69+
13 7 7,10 _rateLaw21 #_R19
70+
14 1,7 1 c6 #_R20
71+
15 1,10 1 c7 #_R21
72+
16 11 10,14 _rateLaw2 #_reverse__R1
73+
17 10,11 2 _rateLaw3 #_R2
74+
18 11 5,11 _rateLaw6 #_R4
75+
19 12 8,15 _rateLaw9 #_reverse__R8
76+
20 8,12 3 _rateLaw10 #_R9
77+
21 12 6,12 _rateLaw13 #_R11
78+
22 13 9,16 _rateLaw16 #_reverse__R15
79+
23 9,13 4 _rateLaw17 #_R16
80+
24 13 7,13 _rateLaw20 #_R18
81+
25 10,14 11 2*_rateLaw1 #_R1
82+
26 14 5,14 _rateLaw5 #_R3
83+
27 8,15 12 2*_rateLaw8 #_R8
84+
28 15 6,15 _rateLaw12 #_R10
85+
29 9,16 13 2*_rateLaw15 #_R15
86+
30 16 7,16 _rateLaw19 #_R17
87+
end reactions
88+
begin groups
89+
1 pTetR 8
90+
2 pCI 9
91+
3 pLacI 10
92+
4 NULL 1
93+
end groups

0 commit comments

Comments
 (0)