cell_cycle 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b279cc91b177efae9a32de303f23d582e1f061b5
4
+ data.tar.gz: 39b00bc0f002c0c7b676621ab58825271d92f30d
5
+ SHA512:
6
+ metadata.gz: c5b2008d7d4144bd1ee6a8b35d8e4fb9310e89c3a36b377b2b26455ed675dd106c9fbd73ded3f389b22ff646a92a9f63e2275461bdfdd68d41bc048ac85b8299
7
+ data.tar.gz: d1b26d72b9f5c4ac1ced003eae61312ebacbec63330fb64babe858b91799c05458fe693460d3e1ad85507c08d6b76f946e3a1eb9b3619226881ae028d5f9990e
data/.gitignore ADDED
@@ -0,0 +1,20 @@
1
+ *~
2
+ .#*
3
+ \#*#
4
+ *.gem
5
+ *.rbc
6
+ .bundle
7
+ .config
8
+ .yardoc
9
+ Gemfile.lock
10
+ InstalledFiles
11
+ _yardoc
12
+ coverage
13
+ doc/
14
+ lib/bundler/man
15
+ pkg
16
+ rdoc
17
+ spec/reports
18
+ test/tmp
19
+ test/version_tmp
20
+ tmp
@@ -0,0 +1,6 @@
1
+ This document serves to acknowledge the support of Bioinformatics Program,
2
+ Taiwan International Graduate Program, Institute of Computer Science,
3
+ Academia Sinica (128, Academia Road, Sec. 2. Namkang, Taipei, 115), and
4
+ of Bioinformatics Institute, National Yang-Ming University, Taipei,
5
+ Taiwan. Without their support, creation of this package would not be
6
+ possible.
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in cell_cycle.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 boris
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # CellCycle
2
+
3
+ Cell cycle model.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'cell_cycle'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install cell_cycle
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it ( https://github.com/[my-github-username]/cell_cycle/fork )
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
data/bin/run_virginia ADDED
@@ -0,0 +1,6 @@
1
+ # encoding: utf-8
2
+
3
+ set_step 1; set_sampling 300; set_target_time 3600 * 24
4
+ new_simulation
5
+ run!
6
+ recording.plot
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'cell_cycle/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "cell_cycle"
8
+ spec.version = CellCycle::VERSION
9
+ spec.authors = ["boris"]
10
+ spec.email = ["\"boris@iis.sinica.edu.tw\""]
11
+ spec.summary = %q{A model of eukaryotic cell cycle.}
12
+ spec.description = %q{Eukaryotic cell cycle modelled at different levels of precision. Has two levels at the moment: Simple and Virginia Tech.}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.6"
22
+ spec.add_development_dependency "rake"
23
+ end
@@ -0,0 +1,351 @@
1
+ # encoding: utf-8
2
+
3
+ # Generic cell cycle published in Csikasznagy2006agm, alternative syntax of
4
+ # the transitions.
5
+
6
+ # == TRANSITIONS ================================================================
7
+
8
+ # This creates a timed stoichiometric (TS) transition representing cell growth.
9
+ # Cell growth changes Mass (domain), and its stoichiometry is { Mass: 1 }, that
10
+ # is, Mass simply increases at the rate indicated by the transition's function.
11
+ # The function (rate) is given by the formula m * CELL_GROWTH_RATE, where m is
12
+ # the current mass of the cell, and CELL_GROWTH_RATE a constant given by the model
13
+ # authors.
14
+ #
15
+ Cell_growth = Transition domain: Mass,
16
+ stoichiometry: { Mass: 1 },
17
+ rate: -> m { m * CELL_GROWTH_RATE }
18
+
19
+ # This creates an assignment (A) transition representing cytokinesis. It changes
20
+ # 2 places (codomain): Mass, and Ck_license. Mass is the cell mass, Ck_license is
21
+ # a special place that was added to the Petri net to prevent Cytokinesis transition
22
+ # from accidentally firing twice in a row in the same cycle. Firing depends on,
23
+ # in order, Mass, Ck_license, and ActCycB (domain). The function thus takes 3
24
+ # arguments (mass, license, b). If ActCycB is under the threshold specified by
25
+ # the model authors (CycB_DIVISION_THRESHOLD), and Ck_license is cocked
26
+ # (equal to 1), then the mass is halved and the license is consumed (set to 0).
27
+ # Otherwise, the [ mass, license ] pair is returned unchanged. The :pseudo_euler
28
+ # simulation method fires the transition once after each simulation step.
29
+ #
30
+ Cytokinesis = Transition codomain: [ Mass, Ck_license ],
31
+ domain: [ Mass, Ck_license, ActCycB ],
32
+ assignment: -> mass, license, b do
33
+ if license == 1 and b < CycB_DIVISION_THRESHOLD then
34
+ [ mass / 2, 0 ] # mass is halved, license is set to 0
35
+ else
36
+ [ mass, license ] # nothing happens
37
+ end
38
+ end
39
+
40
+ # An assignment transition that controls the Ck_license cocking (codomain), and
41
+ # whose firin depends on Ck_license and the level of ActCycB (domain). The
42
+ # assignment function cocks the license (sets it to 1) if the level of ActCycB
43
+ # is above CycB_DIVISION_THRESHOLD plus 10% margin. Otherwise, the license is
44
+ # unchanged. Again, the :pseudo_euler simulation method fires the transition once
45
+ # after each simulation step.
46
+ #
47
+ License_cocking = Transition codomain: Ck_license,
48
+ domain: [ Ck_license, ActCycB ],
49
+ assignment: -> license, b do
50
+ if b > CycB_DIVISION_THRESHOLD * 1.1 then
51
+ 1
52
+ else
53
+ license
54
+ end
55
+ end
56
+
57
+ # === Module 1
58
+
59
+ # Cdc20T synthesis and degradation functions defined as lambda expressions
60
+ # according to the definitions in Csikasznagy2006agm.
61
+ #
62
+ Cdc20T_synthesis = -> b { x = b ** N; ( Ks20p + Ks20pp * x ) / ( J20 ** N + x ) }
63
+ Cdc20T_degradation = -> cdc20T { cdc20T * Kd20 }
64
+
65
+ # A timed stoichiometric transition representing the change of anaphase-promoting
66
+ # factor (Cdc20T). Its stoichiometry is thus { Cdc20T: 1 }. Its rate depends on
67
+ # the level of activated cyclin B (ActCycB) and Cdc20T). The function is modified
68
+ # to enable larger execution step with :pseudo_euler method.
69
+ #
70
+ Cdc20T_change = Transition domain: [ ActCycB, Cdc20T ],
71
+ stoichiometry: { Cdc20T: 1 },
72
+ rate: -> b, t {
73
+ step = world.simulation.step.to_f
74
+ fine_step = step / 50.0
75
+ orig = t
76
+ # Fine-step the function.
77
+ 50.times do
78
+ t += ( Cdc20T_synthesis.( b ) - Cdc20T_degradation.( t ) ) * fine_step
79
+ end
80
+ ( t - orig ) / step # get the positive change rate
81
+ }
82
+
83
+ # # Without the modification for higher speed, there are 2 transitions
84
+ # # Cdc20T_synthesis and Cdc20T_degradation as follows:
85
+ # #
86
+ # Cdc20T_synthesis = Transition domain: [ ActCycB, Cdc20T ],
87
+ # stoichiometry: { Cdc20T: 1 },
88
+ # rate: -> b {
89
+ # x = b ** N; ( Ks20p + Ks20pp * x ) / ( J20 ** N + x )
90
+ # }
91
+ # Cdc20T_degradation = Transition stoichiometry: { Cdc20T: -1 },
92
+ # rate: Kd20
93
+
94
+ # Cdc20 activation, inactivation and degradation functions defined as lambdas as
95
+ # per Csikasznagy2006agm.
96
+ #
97
+ Cdc20_activation = -> t, a, apcp { x = t - a; Ka20 * apcp * x / ( Ja20 + x ) }
98
+ Cdc20A_inactivation = -> a { a * Ki20 / ( Ji20 + a ) }
99
+ Cdc20A_degradation = -> a { a * Kd20 }
100
+
101
+ Cdc20A_change = TS Cdc20T, Cdc20A, APCP, Cdc20A: 1 do |t, a, apcp|
102
+ step = world.simulation.step.to_f
103
+ fine_step = step / 50.0
104
+ orig = a
105
+ 50.times do
106
+ a = a +
107
+ ( Cdc20_activation.( t, a, apcp ) -
108
+ Cdc20A_inactivation.( a ) -
109
+ Cdc20A_degradation.( a )
110
+ ) * fine_step
111
+ end
112
+ ( a - orig ) / step # return the positive change rate
113
+ end
114
+
115
+ # REMARK: This section has to be band-aided for speed:
116
+ # Cdc20_activation = TS Cdc20T, Cdc20A, APCP, Cdc20A: 1 do |t, a, apcp|
117
+ # x = t - a; Ka20 * apcp * x / ( Ja20 + x )
118
+ # end
119
+ # Cdc20A_inactivation = TS Cdc20A: -1 do |a| a * Ki20 / ( Ji20 + a ) end
120
+ # Cdc20A_degradation = TS Cdc20A: -1, rate: Kd20
121
+
122
+ # REMARK: Just like in CI, this section has to be band-aided.
123
+
124
+ APC_activation = -> b, apcp { x = 1 - apcp; KaAPC * b * x / ( JaAPC + x ) }
125
+ APC_inactivation = -> apcp { KiAPC * apcp / ( JiAPC + apcp ) }
126
+
127
+ APC_change = TS ActCycB, APCP, APCP: 1 do |b, apcp|
128
+ step = world.simulation.step.to_f
129
+ fine_step = step / 50.0
130
+ orig = apcp
131
+ 50.times do
132
+ apcp += ( APC_activation.( b, apcp ) - APC_inactivation.( apcp ) ) * fine_step
133
+ end
134
+ ( apcp - orig ) / step
135
+ end
136
+
137
+ # APC_activation = TS ActCycB, APCP, APCP: 1 do |b, apcp|
138
+ # x = 1 - apcp; KaAPC * b * x / ( JaAPC + x )
139
+ # APC_inactivation = TS APCP: -1 do |apcp| KiAPC * apcp / ( JiAPC + apcp ) end
140
+
141
+ # === Module 2
142
+
143
+ # REMARK: Cdh1 activation and inactivation joined into 1 and band-aided in CI,
144
+ # and same has to be done here.
145
+
146
+ Cdh1_activation = -> cdc14, cdh1 {
147
+ x = 1 - cdh1; ( Kah1p + Kah1pp * cdc14 ) * x / ( Jah1 + x ) # orig. formula
148
+ }
149
+
150
+ Cdh1_inactivation = -> a, b, d, e, cdh1 {
151
+ ( Kih1p + Kih1pp * a + Kih1ppp * b + Kih1pppp * e + Kih1ppppp * d ) *
152
+ cdh1 / ( Jih1 + cdh1 )
153
+ }
154
+
155
+ Cdh1_change =
156
+ TS ActCycA, ActCycB, CycD, ActCycE, Cdc14, Cdh1, Cdh1: 1 do
157
+ |a, b, d, e, cdc14, cdh1|
158
+ step = world.simulation.step.to_f
159
+ fine_step = step / 500
160
+ orig = cdh1
161
+ 500.times do # fine-stepped formula
162
+ cdh1 += ( Cdh1_activation.( cdc14, cdh1 ) -
163
+ Cdh1_inactivation.( a, b, d, e, cdh1 ) ) * fine_step
164
+ end
165
+ ( cdh1 - orig ) / step
166
+ end
167
+
168
+ # Cdh1_activation = TS Cdc14, Cdh1, Cdh1: 1 do |cdc14, cdh1|
169
+ # x = 1 - cdh1; ( Kah1p + Kah1pp * cdc14 ) * x / ( Jah1 + x ) # orig. formula
170
+ # end
171
+ # Cdh1_inactivation = TS ActCycA, ActCycB, CycD, ActCycE, Cdh1, Cdh1: -1 do
172
+ # |a, b, d, e, cdh1|
173
+ # ( Kih1p + Kih1pp * a + Kih1ppp * b + Kih1pppp * e + Kih1ppppp * d ) *
174
+ # cdh1 / ( Jih1 + cdh1 )
175
+ # end
176
+
177
+ # === Module 4
178
+
179
+ CycB_synthesis = TS Vsb, Mass, CycB: 1 do |v, m| v * m end
180
+ CycB_degradation = TS Vdb, CycB, CycB: -1 do |v, b|
181
+ fod { v }.fine_step( world.simulation.step, 50 ).( b )
182
+ # v * b
183
+ end
184
+ ActCycB_synthesis = TS Vsb, Mass, ActCycB: 1 do |v, m| v * m end
185
+
186
+ ActCycB_freeing_due_to_degradation_of_CKI =
187
+ TS Vdi, CycB, PreMPF, ActCycB, ActCycB: 1 do |v, b, preMPF, actCycB|
188
+ v * ( b - preMPF - actCycB )
189
+ end
190
+
191
+ ActCycB_freeing_due_dissoociation_from_CKI =
192
+ TS CycB, PreMPF, ActCycB, ActCycB: 1 do |b, preMPF, actCycB|
193
+ Kdib * ( b - preMPF + actCycB )
194
+ end
195
+
196
+ ActCycB_creation_by_dephosphorylation_of_CycB =
197
+ TS V25, CycB, TriB, ActCycB, ActCycB: 1 do |v, b, triB, actCycB|
198
+ v * ( b - triB - actCycB )
199
+ end
200
+
201
+ ActCycB_phosphorylation_by_Wee1 =
202
+ TS Vwee, ActCycB, ActCycB: -1 do |v, b| v * b end
203
+ ActCycB_asociation_with_CKI =
204
+ TS FreeCKI, ActCycB, ActCycB: -1 do |freeCKI, b| freeCKI * b * Kasb end
205
+ ActCycB_degradation = TS Vdb, ActCycB, ActCycB: -1 do |v, b|
206
+ fod { v }.fine_step( world.simulation.step, 50 ).( b )
207
+ # v * b
208
+ end
209
+
210
+ # === Module 5
211
+
212
+ MPF_phosphorylation = TS Vwee, CycB, PreMPF, PreMPF: 1 do |v, b, preMPF|
213
+ v * ( b - preMPF )
214
+ end
215
+
216
+ PreMPF_dephosphorylation =
217
+ TS V25, PreMPF, PreMPF: -1 do |v, preMPF| v * preMPF end
218
+ PreMPF_degradation =
219
+ TS Vdb, PreMPF, PreMPF: -1 do |v, preMPF| v * preMPF end
220
+
221
+ # === Module 6
222
+
223
+ TriB_assembly = TS CycB, TriB, FreeCKI, TriB: 1 do |b, triB, freeCKI|
224
+ Kasb * ( b - triB ) * freeCKI
225
+ end
226
+
227
+ TriB_dissociation =
228
+ TS TriB: -1, rate: Kdib
229
+ TriB_decrease_due_to_CycB_degradation =
230
+ TS Vdb, TriB, TriB: -1 do |vdb, triB| vdb * triB end
231
+ TriB_decrease_due_to_CKI_degradation =
232
+ TS Vdi, TriB, TriB: -1 do |vdi, triB| vdi * triB end
233
+
234
+ # === Module 8
235
+
236
+ CKI_synthesis = TS Vsi, CKI: 1 do |v| v end
237
+
238
+ CKI_degradation = TS Vdi, CKI, CKI: -1 do |v, cki|
239
+ fod { v }.fine_step( world.simulation.step, 50 ).( cki )
240
+ # v * cki
241
+ end
242
+
243
+ # === Module 10
244
+
245
+ CycE_synthesis =
246
+ TS TFE, Mass, CycE: 1 do |f, m| ( Ksep + Ksepp * f ) * m end
247
+
248
+ CycE_degradation = TS Vde, CycE, CycE: -1 do |v, e|
249
+ # v * e
250
+ fod { v }.fine_step( world.simulation.step, 50 ).( e )
251
+ end
252
+
253
+ ActCycE_synthesis =
254
+ TS TFE, Mass, ActCycE: 1 do |f, m| ( Ksep + Ksepp * f ) * m end
255
+
256
+ ActCycE_freeing_due_to_degradation_of_CKI =
257
+ TS Vdi, TriE, ActCycE: 1 do |v, triE| v * triE end
258
+
259
+ ActCycE_freeing_due_to_dissociation_from_CKI =
260
+ TS TriE, ActCycE: 1 do |triE| Kdie * triE end
261
+
262
+ # REMARK: band-aided in CI not to go under 0, fine-stepped here.
263
+ ActCycE_degradation = TS Vde, FreeCKI, ActCycE, ActCycE: -1 do |v, freeCKI, e|
264
+ # ( v + Kase * freeCKI ) * e
265
+ fod { v + Kase * freeCKI }.fine_step( world.simulation.step, 50 ).( e )
266
+ end
267
+
268
+ # === Module 13
269
+
270
+ CycA_synthesis =
271
+ TS TFE, Mass, CycA: 1 do |f, m| ( Ksap + Ksapp * f ) * m end
272
+
273
+ CycA_degradation = TS Vda, CycA, CycA: -1 do |v, a|
274
+ # v * a
275
+ fod { v }.fine_step( world.simulation.step, 50 ).( a )
276
+ end
277
+
278
+ ActCycA_synthesis =
279
+ TS TFE, Mass, ActCycA: 1 do |f, m| ( Ksap + Ksapp * f ) * m end
280
+
281
+ ActCycA_freeing_due_to_degradation_of_CKI =
282
+ TS Vdi, TriA, ActCycE: 1 do |v, triA| v * triA end
283
+
284
+ ActCycA_freeing_due_to_dissociation_from_CKI =
285
+ TS TriA, ActCycA: 1 do |triA| Kdia * triA end
286
+
287
+ # band-aided
288
+ ActCycA_degradation = TS Vda, FreeCKI, ActCycA, ActCycA: -1 do |v, freeCKI, a|
289
+ # ( v + Kasa * freeCKI ) * a
290
+ fod { v + Kasa * freeCKI }.fine_step( world.simulation.step, 50 ).( a )
291
+ end
292
+
293
+ # === finalize
294
+
295
+ finalize # YNelson command that finishes the net from the prescribed commands.
296
+
297
+ # ==============================================================================
298
+ # THIS CONCLUDES THE MODEL. COMMANDS BELOW ARE JUST SAVED COMMANDS TO SERVE AS
299
+ # HELP WHEN PERUSING THE MODEL THROUGH THE COMMAND LINE
300
+ # ==============================================================================
301
+
302
+
303
+
304
+
305
+
306
+
307
+
308
+
309
+
310
+
311
+
312
+
313
+
314
+
315
+
316
+
317
+
318
+
319
+ =begin
320
+
321
+ # === Whole CELL_CYCLE Nelson net ===
322
+
323
+ CELL_CYCLE = Net() << A_phase << S_phase << Cdc20A
324
+
325
+ # === Cell growh net ===
326
+
327
+ CELL_GROWTH_NET = Net() <<
328
+ Mass << Cell_growth << CycD << transition( :CycD_ϝ ) << # cell growth
329
+ CycB << ActCycB << # cyclin B
330
+ Ck_license << Cytokinesis << License_cocking # cytokinesis
331
+
332
+ set_step 5 # simulation settings
333
+ set_sampling 300
334
+ set_target_time 3600 * 24 * 4
335
+
336
+ new_simulation
337
+
338
+
339
+ pm # prints marking of the newly created simulation
340
+ simulation.step! # peforms a single simulation step
341
+ pm # prints marking again
342
+
343
+ # simulation.run! upto: 3600 # we can run 1 hour of this simulation
344
+
345
+ recording.plot # and plot the recording
346
+
347
+ # and do other things with the recording, such as resampling,
348
+ # feature extraction, saving to a file, reconstruction of a new
349
+ # simulation object at a given time etc.
350
+
351
+ =end
@@ -0,0 +1,75 @@
1
+ # encoding: utf-8
2
+
3
+ # A simplistic cell cycle. It has a single input (Timer place) and 3 outputs
4
+ # (A_phase, S_phase, Cdc20A). A_phase is the phase when the cell cycle enzyme
5
+ # machinery is synthesized. S_phase has the standard meaning: DNA synthesis
6
+ # phase. Cdc20A represents the APC (Anaphase Promoting Complex). When present,
7
+ # it degrades the cell cycle enzyme machinery.
8
+
9
+ require 'y_nelson' and include YNelson
10
+ require 'sy'
11
+
12
+ # Constants that control the cell cycle settings.
13
+ S_phase_duration = 12.h
14
+ S_phase_start = 5.h
15
+ S_phase_end = S_phase_start + S_phase_duration
16
+ A_phase_start = 3.h
17
+ A_phase_end = S_phase_end
18
+ Cdc20A_start = 22.h
19
+ Cdc20A_end = 1.h
20
+
21
+ # Alternative setting for shorter cycle (4.h).
22
+ =begin
23
+ # Constants that control the cell cycle settings.
24
+ S_phase_duration = 4.h
25
+ S_phase_start = 1.h + 40.min
26
+ S_phase_end = S_phase_start + S_phase_duration
27
+ A_phase_start = 1.h
28
+ A_phase_end = S_phase_end
29
+ Cdc20A_start = 7.h + 30.min
30
+ Cdc20A_end = 20.min
31
+ =end
32
+
33
+ # Figure them out as numbers in seconds.
34
+ Sα = S_phase_start.in :s
35
+ Sω = S_phase_end.in :s
36
+ Aα = A_phase_start.in :s
37
+ Aω = A_phase_end.in :s
38
+ Cdc20Aα = Cdc20A_start.in :s
39
+ Cdc20Aω = Cdc20A_end.in :s
40
+
41
+ # Timer place
42
+ Timer = Place m!: 0
43
+
44
+ # The clock transition
45
+ Clock = Transition stoichiometry: { Timer: 1 }, rate: 1
46
+
47
+ # Empirical places (in arbitrary units); output of the cell cycle.
48
+ A_phase = Place m!: 0
49
+ S_phase = Place m!: 0
50
+ Cdc20A = Place m!: 1
51
+
52
+ # Include them in the CELL_CYCLE net.
53
+ CELL_CYCLE = Net() << Timer << Clock << A_phase << S_phase << Cdc20A
54
+
55
+ # Assignment transitions that control the state of the places A_phase, S_phase
56
+ # and Cdc20A.
57
+ #
58
+ A_phase_ϝ = Transition assignment: -> t { t > Aα && t < Aω ? 1 : 0 },
59
+ domain: Timer,
60
+ codomain: A_phase
61
+ S_phase_ϝ = Transition assignment: -> t { t > Sα && t < Sω ? 1 : 0 },
62
+ domain: Timer,
63
+ codomain: S_phase
64
+ Cdc20A_ϝ = Transition assignment: -> t { t < Cdc20Aω || t > Cdc20Aα ? 1 : 0 },
65
+ domain: Timer,
66
+ codomain: Cdc20A
67
+
68
+ # Include the A transitions in the CELL_CYCLE net.
69
+ CELL_CYCLE << A_phase_ϝ << S_phase_ϝ << Cdc20A_ϝ
70
+
71
+ def CELL_CYCLE.default_simulation
72
+ simulation time: 0..36.h.in( :s ),
73
+ step: 1.min.in( :s ),
74
+ sampling: 20.min.in( :s )
75
+ end
@@ -0,0 +1,3 @@
1
+ module CellCycle
2
+ VERSION = "0.0.2"
3
+ end