Skip to content

Commit 35aa4b6

Browse files
committed
Merge branch 'devel'
Mathematica 10 support
2 parents 57c23dd + 0dbc8e1 commit 35aa4b6

12 files changed

+152018
-134784
lines changed

AutomaticUnits/AutomaticUnits.m

+4-4
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
OptionValue[UsageMessage]
104104
];
105105
Which[
106-
Head[$ToFundamental]===Dispatch,existingrules=First[$ToFundamental];dispatchedq=True,
106+
Head[$ToFundamental]===Dispatch,existingrules=Normal[$ToFundamental];dispatchedq=True,
107107
Head[$ToFundamental]===List,existingrules=$ToFundamental,
108108
True,existingrules={}];
109109
(*If unit name is already decalared, issue warning and over-write definition*)
@@ -122,7 +122,7 @@
122122
(*If relationship is exact, store it explicitely *)
123123
If[Precision[val[[1]]]===Infinity,
124124
Which[
125-
Head[$ExactUnitRules]===Dispatch,existingexactrules=First[$ExactUnitRules];dispatchedq=True,
125+
Head[$ExactUnitRules]===Dispatch,existingexactrules=Normal[$ExactUnitRules];dispatchedq=True,
126126
Head[$ExactUnitRules]===List,existingexactrules=$ExactUnitRules,
127127
True,existingrules={}
128128
];
@@ -155,9 +155,9 @@
155155
application of Dispatch by doing it just once at the end. This gives much faster package initialization*)
156156
FastGroupDeclareUnit[expr_]:=Block[{$UnitInitialization=True,newfund,newexact,junk},
157157
(*Make sure that the tables are plain lists*)
158-
If[Head[$ToFundamental]===Dispatch,$ToFundamental=First[$ToFundamental]];
158+
If[Head[$ToFundamental]===Dispatch,$ToFundamental=Normal[$ToFundamental]];
159159
If[Head[$ToFundamental]===List,$ToFundamental={}];
160-
If[Head[$ExactUnitRules]===Dispatch,$ExactUnitRules=First[$ExactUnitRules]];
160+
If[Head[$ExactUnitRules]===Dispatch,$ExactUnitRules=Normal[$ExactUnitRules]];
161161
If[Head[$ExactUnitRules]===List,$ExactUnitRules={}];
162162

163163
(*expr should be a CompoundExpression of DeclareUnit expressions*)

Tests/RegulationRelatedTests.mt

+25
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,28 @@ Test[
3535
,
3636
TestID->"RegulationRelatedTests-20120529-O4Y3U2"
3737
]
38+
39+
enzymeModules = {"Sequential_Ordered_BiBi" ->
40+
constructEnzymeModule[
41+
Mechanism -> {"E_E[c] + A[c] <=> E_E[c]&A",
42+
"E_E[c]&A + B[c] <=> E_E[c]&A&B", "E_E[c]&A&B <=> E_E[c]&Q&P",
43+
"E_E[c]&Q&P <=> E_E[c]&Q + P[c]",
44+
"E_E[c]&Q <=> E_E[c] + Q[c]"}, Activators -> {},
45+
ActivationSites -> 0, Inhibitors -> {}, InhibitionSites -> 0]
46+
};
47+
48+
Test[
49+
getEnzymeSteadyStateEquations[enzymeModules[[1, 2]]]
50+
,
51+
Import["Tests/TestData/enzModuleSSequations.m"]
52+
,
53+
TestID->"RegulationRelatedTests-20140209-S6U4N2"
54+
]
55+
56+
Test[
57+
solveEnzymeSteadyStateEquations[enzymeModules[[1, 2]]]
58+
,
59+
Import["Tests/TestData/enzModuleSSsolution.m"]
60+
,
61+
TestID->"RegulationRelatedTests-20140209-A7L1C8"
62+
]

Tests/TestData/enzModuleSSequations.m

+125
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
(* Created by Wolfram Mathematica 9.0 : www.wolfram.com *)
2+
{enzyme[{"ID" -> "E", "Compartment" -> "c", "BoundCatalytic" -> {},
3+
"BoundActivators" -> {}, "BoundInhibitors" -> {},
4+
"CatalyticSites" -> Infinity, "ActivationSites" -> 0,
5+
"InhibitionSites" -> 0}] ->
6+
0 ==
7+
-((-(enzyme[{"ID" -> "E", "Compartment" -> "c", "BoundCatalytic" ->
8+
{Toolbox`Private`wrap[metabolite]["A", "c"]},
9+
"BoundActivators" -> {}, "BoundInhibitors" -> {},
10+
"CatalyticSites" -> Infinity, "ActivationSites" -> 0,
11+
"InhibitionSites" -> 0}]/Keq["E1"]) +
12+
enzyme[{"ID" -> "E", "Compartment" -> "c", "BoundCatalytic" -> {},
13+
"BoundActivators" -> {}, "BoundInhibitors" -> {},
14+
"CatalyticSites" -> Infinity, "ActivationSites" -> 0,
15+
"InhibitionSites" -> 0}]*metabolite["A", "c"])*
16+
parameter["Volume", "c"]*rateconst["E1", True]) +
17+
(enzyme[{"ID" -> "E", "Compartment" -> "c", "BoundCatalytic" ->
18+
{Toolbox`Private`wrap[metabolite]["Q", "c"]}, "BoundActivators" ->
19+
{}, "BoundInhibitors" -> {}, "CatalyticSites" -> Infinity,
20+
"ActivationSites" -> 0, "InhibitionSites" -> 0}] -
21+
(enzyme[{"ID" -> "E", "Compartment" -> "c", "BoundCatalytic" -> {},
22+
"BoundActivators" -> {}, "BoundInhibitors" -> {},
23+
"CatalyticSites" -> Infinity, "ActivationSites" -> 0,
24+
"InhibitionSites" -> 0}]*metabolite["Q", "c"])/Keq["E2"])*
25+
parameter["Volume", "c"]*rateconst["E2", True],
26+
enzyme[{"ID" -> "E", "Compartment" -> "c", "BoundCatalytic" ->
27+
{Toolbox`Private`wrap[metabolite]["A", "c"]}, "BoundActivators" -> {},
28+
"BoundInhibitors" -> {}, "CatalyticSites" -> Infinity,
29+
"ActivationSites" -> 0, "InhibitionSites" -> 0}] ->
30+
0 == (-(enzyme[{"ID" -> "E", "Compartment" -> "c", "BoundCatalytic" ->
31+
{Toolbox`Private`wrap[metabolite]["A", "c"]}, "BoundActivators" ->
32+
{}, "BoundInhibitors" -> {}, "CatalyticSites" -> Infinity,
33+
"ActivationSites" -> 0, "InhibitionSites" -> 0}]/Keq["E1"]) +
34+
enzyme[{"ID" -> "E", "Compartment" -> "c", "BoundCatalytic" -> {},
35+
"BoundActivators" -> {}, "BoundInhibitors" -> {},
36+
"CatalyticSites" -> Infinity, "ActivationSites" -> 0,
37+
"InhibitionSites" -> 0}]*metabolite["A", "c"])*
38+
parameter["Volume", "c"]*rateconst["E1", True] -
39+
(-(enzyme[{"ID" -> "E", "Compartment" -> "c", "BoundCatalytic" ->
40+
{Toolbox`Private`wrap[metabolite]["A", "c"],
41+
Toolbox`Private`wrap[metabolite]["B", "c"]}, "BoundActivators" ->
42+
{}, "BoundInhibitors" -> {}, "CatalyticSites" -> Infinity,
43+
"ActivationSites" -> 0, "InhibitionSites" -> 0}]/Keq["E3"]) +
44+
enzyme[{"ID" -> "E", "Compartment" -> "c", "BoundCatalytic" ->
45+
{Toolbox`Private`wrap[metabolite]["A", "c"]}, "BoundActivators" ->
46+
{}, "BoundInhibitors" -> {}, "CatalyticSites" -> Infinity,
47+
"ActivationSites" -> 0, "InhibitionSites" -> 0}]*
48+
metabolite["B", "c"])*parameter["Volume", "c"]*rateconst["E3", True],
49+
enzyme[{"ID" -> "E", "Compartment" -> "c", "BoundCatalytic" ->
50+
{Toolbox`Private`wrap[metabolite]["Q", "c"]}, "BoundActivators" -> {},
51+
"BoundInhibitors" -> {}, "CatalyticSites" -> Infinity,
52+
"ActivationSites" -> 0, "InhibitionSites" -> 0}] ->
53+
0 == -((enzyme[{"ID" -> "E", "Compartment" -> "c", "BoundCatalytic" ->
54+
{Toolbox`Private`wrap[metabolite]["Q", "c"]}, "BoundActivators" ->
55+
{}, "BoundInhibitors" -> {}, "CatalyticSites" -> Infinity,
56+
"ActivationSites" -> 0, "InhibitionSites" -> 0}] -
57+
(enzyme[{"ID" -> "E", "Compartment" -> "c", "BoundCatalytic" -> {},
58+
"BoundActivators" -> {}, "BoundInhibitors" -> {},
59+
"CatalyticSites" -> Infinity, "ActivationSites" -> 0,
60+
"InhibitionSites" -> 0}]*metabolite["Q", "c"])/Keq["E2"])*
61+
parameter["Volume", "c"]*rateconst["E2", True]) +
62+
(enzyme[{"ID" -> "E", "Compartment" -> "c", "BoundCatalytic" ->
63+
{Toolbox`Private`wrap[metabolite]["Q", "c"],
64+
Toolbox`Private`wrap[metabolite]["P", "c"]}, "BoundActivators" ->
65+
{}, "BoundInhibitors" -> {}, "CatalyticSites" -> Infinity,
66+
"ActivationSites" -> 0, "InhibitionSites" -> 0}] -
67+
(enzyme[{"ID" -> "E", "Compartment" -> "c", "BoundCatalytic" ->
68+
{Toolbox`Private`wrap[metabolite]["Q", "c"]}, "BoundActivators" ->
69+
{}, "BoundInhibitors" -> {}, "CatalyticSites" -> Infinity,
70+
"ActivationSites" -> 0, "InhibitionSites" -> 0}]*
71+
metabolite["P", "c"])/Keq["E4"])*parameter["Volume", "c"]*
72+
rateconst["E4", True],
73+
enzyme[{"ID" -> "E", "Compartment" -> "c", "BoundCatalytic" ->
74+
{Toolbox`Private`wrap[metabolite]["A", "c"],
75+
Toolbox`Private`wrap[metabolite]["B", "c"]}, "BoundActivators" -> {},
76+
"BoundInhibitors" -> {}, "CatalyticSites" -> Infinity,
77+
"ActivationSites" -> 0, "InhibitionSites" -> 0}] ->
78+
0 == (-(enzyme[{"ID" -> "E", "Compartment" -> "c", "BoundCatalytic" ->
79+
{Toolbox`Private`wrap[metabolite]["A", "c"],
80+
Toolbox`Private`wrap[metabolite]["B", "c"]}, "BoundActivators" ->
81+
{}, "BoundInhibitors" -> {}, "CatalyticSites" -> Infinity,
82+
"ActivationSites" -> 0, "InhibitionSites" -> 0}]/Keq["E3"]) +
83+
enzyme[{"ID" -> "E", "Compartment" -> "c", "BoundCatalytic" ->
84+
{Toolbox`Private`wrap[metabolite]["A", "c"]}, "BoundActivators" ->
85+
{}, "BoundInhibitors" -> {}, "CatalyticSites" -> Infinity,
86+
"ActivationSites" -> 0, "InhibitionSites" -> 0}]*
87+
metabolite["B", "c"])*parameter["Volume", "c"]*rateconst["E3", True] -
88+
(enzyme[{"ID" -> "E", "Compartment" -> "c", "BoundCatalytic" ->
89+
{Toolbox`Private`wrap[metabolite]["A", "c"],
90+
Toolbox`Private`wrap[metabolite]["B", "c"]}, "BoundActivators" ->
91+
{}, "BoundInhibitors" -> {}, "CatalyticSites" -> Infinity,
92+
"ActivationSites" -> 0, "InhibitionSites" -> 0}] -
93+
enzyme[{"ID" -> "E", "Compartment" -> "c", "BoundCatalytic" ->
94+
{Toolbox`Private`wrap[metabolite]["Q", "c"],
95+
Toolbox`Private`wrap[metabolite]["P", "c"]}, "BoundActivators" ->
96+
{}, "BoundInhibitors" -> {}, "CatalyticSites" -> Infinity,
97+
"ActivationSites" -> 0, "InhibitionSites" -> 0}]/Keq["E5"])*
98+
parameter["Volume", "c"]*rateconst["E5", True],
99+
enzyme[{"ID" -> "E", "Compartment" -> "c", "BoundCatalytic" ->
100+
{Toolbox`Private`wrap[metabolite]["Q", "c"],
101+
Toolbox`Private`wrap[metabolite]["P", "c"]}, "BoundActivators" -> {},
102+
"BoundInhibitors" -> {}, "CatalyticSites" -> Infinity,
103+
"ActivationSites" -> 0, "InhibitionSites" -> 0}] ->
104+
0 == -((enzyme[{"ID" -> "E", "Compartment" -> "c", "BoundCatalytic" ->
105+
{Toolbox`Private`wrap[metabolite]["Q", "c"],
106+
Toolbox`Private`wrap[metabolite]["P", "c"]}, "BoundActivators" ->
107+
{}, "BoundInhibitors" -> {}, "CatalyticSites" -> Infinity,
108+
"ActivationSites" -> 0, "InhibitionSites" -> 0}] -
109+
(enzyme[{"ID" -> "E", "Compartment" -> "c", "BoundCatalytic" ->
110+
{Toolbox`Private`wrap[metabolite]["Q", "c"]},
111+
"BoundActivators" -> {}, "BoundInhibitors" -> {},
112+
"CatalyticSites" -> Infinity, "ActivationSites" -> 0,
113+
"InhibitionSites" -> 0}]*metabolite["P", "c"])/Keq["E4"])*
114+
parameter["Volume", "c"]*rateconst["E4", True]) +
115+
(enzyme[{"ID" -> "E", "Compartment" -> "c", "BoundCatalytic" ->
116+
{Toolbox`Private`wrap[metabolite]["A", "c"],
117+
Toolbox`Private`wrap[metabolite]["B", "c"]}, "BoundActivators" ->
118+
{}, "BoundInhibitors" -> {}, "CatalyticSites" -> Infinity,
119+
"ActivationSites" -> 0, "InhibitionSites" -> 0}] -
120+
enzyme[{"ID" -> "E", "Compartment" -> "c", "BoundCatalytic" ->
121+
{Toolbox`Private`wrap[metabolite]["Q", "c"],
122+
Toolbox`Private`wrap[metabolite]["P", "c"]}, "BoundActivators" ->
123+
{}, "BoundInhibitors" -> {}, "CatalyticSites" -> Infinity,
124+
"ActivationSites" -> 0, "InhibitionSites" -> 0}]/Keq["E5"])*
125+
parameter["Volume", "c"]*rateconst["E5", True]}

0 commit comments

Comments
 (0)