-
Notifications
You must be signed in to change notification settings - Fork 0
/
steptutorial.pl
executable file
·318 lines (307 loc) · 10.5 KB
/
steptutorial.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print <<ENDHTML;
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>
ADAM Step-by-step tutorial
</title>
<link rel="stylesheet" type="text/css" href="adam_style.css">
</head>
<body>
<div id="header">
ENDHTML
$header = &Constant_HTML('header.html');
print $header;
print <<ENDHTML;
</div>
<div id="main" >
<div id="nav">
ENDHTML
$navigation = &Constant_HTML('navigation.html');
print $navigation;
print <<ENDHTML;
<h1>
Detailed examples of how to use ADAM
</h1>
<p><font size="3">
<a href="#GS">Logical Model (GINsim)</a> <a href="#PDS">Polynomial Dynamical System</a> <a href="#PDSep">Polynomial Dynamical System with External Parameters</a> <a href="#PBN">Probabilistic Boolean Network</a> <a href="#LN">Large Network</a> <a href="#conj">Conjunctive Network</a> <a href="#SDDS">Stochastic Discrete Dynamical System</a></font>
</p>
<h2>
<a name="GS" id="GS">How to use a Logical Model (GINsim file) as an input</a>
</h2>
<p>
Select <b>Logical Model</b> as the format of the input functions
</p>
<p>
Note that input for number of states per node is not allowed as it is not needed. Adam pulls this information from the GINsim file.
</p>
<p>
Upload the 4 node Lambda Phage model named regulatoryGraph.ginml (inside the zipped folder phage4.zginml available <a href="http://gin.univ-mrs.fr/GINsim/model_repository/MICROBIOLOGICAL%20REGULATORY%20NETWORKS/Phage%20Lambda/PhageLambda/description.html">here</a>)
</p>
<p>
Select Simulation (as the model is small enough with only four nodes)
</p>
<p>
<img border="0" width="434" height="347" src="steptutorial_files/image002.png">
</p>
<p>
Click <i>Analyze</i> to view the outputs
</p>
<p>
<img border="0" width="434" height="111" src="steptutorial_files/image004.png">
</p>
<h2>
<a name="PDS" id="PDS">How to enter a Polynomial Dynamical System</a>
</h2>
<p>
Select <b>PDS</b> as the format for input functions
</p>
<p>
Enter the number of states each node may have. For this example, enter 3. This indicates each node may be 0, 1 or 2
</p>
<p>
Enter the functions in the text box below. For this example we will have 2 functions. Enter
</p>
<p>
f1 = x1*x2
</p>
<p>
f2 = x1+x2
</p>
<p>
Under network options, select simulation, as there are only 2 nodes. Leave synchronous selected for the updating scheme to have the states updated synchronously, and leave all trajectories selected to view the entire state space.
</p>
<p>
<img border="0" width="434" height="183" src="steptutorial_files/image006.png">
</p>
<p>
<img border="0" width="434" height="181" src="steptutorial_files/image008.png">
</p>
<p>
Click <i>Analyze</i> to view the results.
</p>
<p>
<img border="0" width="314" height="128" src="steptutorial_files/image010.png">
</p>
<h2>
<a name="PDSep" id="PDSep">How to enter a Polynomial Dynamical System with External Parameters</a>
</h2>
<p>
Select <b>PDSep</b> as the format for input functions.
</p>
<p>
Enter the number of states each node may have. For this example, enter 3. This indicates each node may be 0, 1 or 2.
</p>
<p>
Enter the functions in the text box below. For this example we will have 4 functions. Enter
</p>
<p>
f1 = x1+x2+N
</p>
<p>
f2 = x1*x2*x3+N^2*Mg
</p>
<p>
f3 = Mg*x2+x3^2
</p>
<p>
f4 = x1+Mg^2+x1+1
</p>
<p>
Enter the external parameters in the text box below. For this example we will have 2 external parameters. Enter
</p>
<p>
N = 1
</p>
<p>
Mg = 0
</p>
<p>
Under network options, select simulation, as there are only 4 nodes.
</p>
<p>
Click <i>Analyze</i> to view the results.
</p>
<h2>
<a name="PBN" id="PBN">How to Enter a Probabilistic Boolean Network</a>
</h2>
<p>
Select <b>PBN</b> as the format for function input.
</p>
<p>
The number of states per node must now be set to 2 and the drop-box to the right must be changed from polynomial to boolean.
</p>
<p>
For this example, enter the following for the functions:
</p>
<p>
f1 = (x1*x2)
</p>
<p>
f2 = (x1+x3)
</p>
<p>
f3 = (~(x1+x2))
</p>
<p>
This is read as f1 equals x1 AND x2, f2 equals x1 OR x3, f3 equals NOT (x1 OR x2). Note that each operation must have a set of parenthesis that correspond to it. It is important not to place extra sets of parenthesis in any of the equations. Note that changing f3 to (~((x1)+x2)) gives a different, incorrect output as there is an unnecessary set of parenthesis around x1.
</p>
<p>
Under network options, select simulation, as there are only 3 nodes. Leave synchronous selected for the updating scheme to have the states updated synchronously, and leave all trajectories selected to view the entire state space.
</p>
<p>
<img border="0" width="434" height="128" src="steptutorial_files/image012.png">
</p>
<p>
<img border="0" width="434" height="171" src="steptutorial_files/image014.png">
</p>
<p>
Click Analyze to view the ouput, which should be as follows:
</p>
<p>
<img border="0" width="414" height="130" src="steptutorial_files/image016.png">
</p>
<h2>
<a name="LN" id="LN">How to Enter a Large Network (number of nodes > 11)</a>
</h2>
<p>
Select GINsim as the format of the input functions.
</p>
<p>
Note that input for number of states per node is not allowed as it is not needed. Adam pulls this information from the GINsim file.
</p>
<p>
Upload the TCR model named TCRsig40.ginml(inside the zipped folder phage4.zginml available <a href="http://gin.univ-mrs.fr/GINsim/model_repository/MAMMALIAN%20REGULATORY%20NETWORKS/T%20lymphocytes/TCR_sig/description.html">here</a>).
</p>
<p>
Select Algorithms (as the model has 40 nodes and its state space is too large to be simulated), and enter 7 for the limit cycle length to view all 7-cycles.
</p>
<p>
<img border="0" width="434" height="233" src="steptutorial_files/image018.png">
</p>
<p>
Click <i>Analyze</i> to view the results. There is one 7-cycle.
</p>
<p>
<img border="0" width="434" height="39" src="steptutorial_files/image020.png">
</p>
<h2>
<a name="conj" id="conj">How to Enter a Conjunctive Network</a>
</h2>
<p>
Select <b>PBN</b> the format of input functions for this example (either PDS or PBN may be used).
</p>
<p>
The number of states per node must be set to two. Select Boolean as we are entering a PBN, but for a PDS select Polynomial.
</p>
<p>
In the function box enter
</p>
<p>
f1 = (x1*x3)
</p>
<p>
f2 = (x2*x1)
</p>
<p>
f3 = (x2*x3)
</p>
<p>
The functions must only use either the AND operator or the OR operator. Additionally, the dependency graph formed from these functions must be strongly connected.
</p>
<p>
<img border="0" width="434" height="128" src="steptutorial_files/image022.png">
</p>
<p>
Select Conjunctive network.
</p>
<p>
Leave synchronous selected for the updating scheme to have the states updated synchronously, and leave all trajectories selected to view the entire state space.
</p>
<p>
<img border="0" width="434" height="181" src="steptutorial_files/image024.png">
</p>
<p>
Click <i>Analyze</i> to view the results
</p>
<p>
<img border="0" width="434" height="49" src="steptutorial_files/image026.png">
</p>
<h2>
<a name="SDDS" id="SDDS">How to enter a Stochastic Discrete Dynamical System (SDDS)</a>
</h2>
<p>
Select <b>Stochastic Discrete Dynamical Systems</b> as the format of the input functions.
</p>
<p>
Upload either the (complete) transition table file for 4 node Lambda phage model (available <a href="steptutorial_files/LambdaPhage_tt.txt" target="_blank">here</a>) or the functions file for 4 node Lambda phage model (available <a href="steptutorial_files/LambdaPhage_func.txt" target="_blank">here</a>).
</p>
<p>
Enter
<p>
0.8 0.2
</p>
<p>
0.2 0.8
</p>
<p>
0.9 0.9
</p>
<p>
0.9 0.9
</p>
in the text area as the propensity matrix for 4 node Lambda phage model.
</p>
<p>
Enter 0 0 0 0 as the initial state for 4 node Lambda phage model.
</p>
<p>
Enter 1, 2, 3, 4 as the nodes of interest.
</p>
<p>
Enter 5 as the number of states for 4 node Lambda phage model.
</p>
<p>
Enter 50 as the number of steps for 4 node Lambda phage model.
</p>
<p>
Enter 100 as the number of simulations for 4 node Lambda phage model.
</p>
<p>
Note that "Plot of cell population simulation and Histogram for probability distribution" is always selected.
</p>
<p>
Select "Print Steady States" if you would like to know what the steady states are.
</p>
<p>
Select "Print Probability Transition Matrix" if you would like to see the probability transition matrix.
</p>
<p>
Click <i>Analyze</i> to view the outputs. <br><br>
</p>
<p>
<img border="0" width="434" height="181" src="steptutorial_files/sdds.png">
</p>
</div>
<div id="nav">
<h2>
<a href="adam.pl">Back to ADAM</a> <a href="userGuide.pl">User Guide</a>
</h2>
</div>
</div>
</body>
</html>
ENDHTML
# read in a file to include it
sub Constant_HTML {
local(*FILE); # filehandle
local($file); # file path
local($HTML); # HTML data
$file = $_[0] || die "There was no file specified!\n";
open(FILE, "<$file") || die "Couldn't open $file!\n";
$HTML = do { local $/; <FILE> }; #read whole file in through slurp #mode (by setting $/ to undef)
close(FILE);
return $HTML;
}