cell_cycle 0.1.2 → 0.1.3
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 +4 -4
- data/lib/cell_cycle/simple.rb +35 -14
- data/lib/cell_cycle/version.rb +1 -1
- data/test/simple_test.rb +6 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c37cd532f2f2ed050cdec62c9a9c85dc603fb43
|
4
|
+
data.tar.gz: 55f4350c8a7ede05843244502a9c73831e58b67f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de3eda093018c5de093d3bce47b877a8828b75a71e7684222f20d06be79e423f02d22c412e7373c55607f933e5d85cd681c82c9e9ee4eccf7dcba1db408829bf
|
7
|
+
data.tar.gz: 3e69f452f253460baf148a65c73426afef38697d6191d1d6892ae5d5577f7ada9c9d38022807a44ddafd9afd3fad38450889169aa4c2ff7e15def0d41b7b35b8
|
data/lib/cell_cycle/simple.rb
CHANGED
@@ -9,6 +9,7 @@
|
|
9
9
|
require_relative '../cell_cycle'
|
10
10
|
|
11
11
|
# Constants that control the cell cycle settings.
|
12
|
+
Cell_cycle_duration = 24.h
|
12
13
|
S_phase_duration = 12.h
|
13
14
|
S_phase_start = 5.h
|
14
15
|
S_phase_end = S_phase_start + S_phase_duration
|
@@ -30,10 +31,11 @@ Cdc20A_end = 20.min
|
|
30
31
|
=end
|
31
32
|
|
32
33
|
# Figure them out as numbers in seconds.
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
34
|
+
Cc_duration_s = Cell_cycle_duration.in :s
|
35
|
+
S_start_s = S_phase_start.in :s
|
36
|
+
S_end_s = S_phase_end.in :s
|
37
|
+
A_start_s = A_phase_start.in :s
|
38
|
+
A_end_s = A_phase_end.in :s
|
37
39
|
Cdc20A_s = Cdc20A_start.in :s
|
38
40
|
Cdc20A_e = Cdc20A_end.in :s
|
39
41
|
|
@@ -54,21 +56,40 @@ CELL_CYCLE << Timer << Clock << A_phase << S_phase << Cdc20A
|
|
54
56
|
# Assignment transitions that control the state of the places A_phase, S_phase
|
55
57
|
# and Cdc20A.
|
56
58
|
#
|
57
|
-
A_phase_f = Transition
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
59
|
+
A_phase_f = Transition domain: Timer, codomain: A_phase,
|
60
|
+
assignment: -> timer {
|
61
|
+
cc_progress = timer % Cc_duration_s
|
62
|
+
if cc_progress > A_start_s and cc_progress < A_end_s
|
63
|
+
1
|
64
|
+
else
|
65
|
+
0
|
66
|
+
end
|
67
|
+
}
|
68
|
+
|
69
|
+
S_phase_f = Transition domain: Timer, codomain: A_phase,
|
70
|
+
assignment: -> timer {
|
71
|
+
cc_progress = timer % Cc_duration_s
|
72
|
+
if cc_progress > S_start_s and cc_progress < S_end_s
|
73
|
+
1
|
74
|
+
else
|
75
|
+
0
|
76
|
+
end
|
77
|
+
}
|
78
|
+
Cdc20A_f = Transition domain: Timer, codomain: Cdc20A,
|
79
|
+
assignment: -> timer {
|
80
|
+
cc_progress = timer % Cc_duration_s
|
81
|
+
if cc_progress < Cdc20A_e or cc_progress > Cdc20A_s
|
82
|
+
1
|
83
|
+
else
|
84
|
+
0
|
85
|
+
end
|
86
|
+
}
|
66
87
|
|
67
88
|
# Include the A transitions in the CELL_CYCLE net.
|
68
89
|
CELL_CYCLE << A_phase_f << S_phase_f << Cdc20A_f
|
69
90
|
|
70
91
|
def CELL_CYCLE.default_simulation
|
71
|
-
simulation time: 0..
|
92
|
+
simulation time: 0..48.h.in( :s ),
|
72
93
|
step: 1.min.in( :s ),
|
73
94
|
sampling: 20.min.in( :s )
|
74
95
|
end
|
data/lib/cell_cycle/version.rb
CHANGED
data/test/simple_test.rb
CHANGED
@@ -23,13 +23,16 @@ describe :simple_cell_cycle do
|
|
23
23
|
Cdc20A_start.must_equal 22.h
|
24
24
|
Cdc20A_end.must_equal 1.h
|
25
25
|
CELL_CYCLE.A_tt.names.must_equal [ :A_phase_f, :S_phase_f, :Cdc20A_f ]
|
26
|
-
#
|
27
|
-
sim = CELL_CYCLE.simulation time: 0..
|
26
|
+
# The simulation should look good
|
27
|
+
sim = CELL_CYCLE.simulation time: 0..48.h.in( :s ),
|
28
28
|
step: 1.min.in( :s ),
|
29
29
|
sampling: 20.min.in( :s )
|
30
30
|
sim.simulation_method.must_equal :basic
|
31
31
|
sim.run!
|
32
|
-
sim.recording.marking( S_phase, A_phase, Cdc20A )
|
32
|
+
sim.recording.marking( S_phase, A_phase, Cdc20A )
|
33
|
+
.plot title: "Test of the simple cell cycle simulated for " +
|
34
|
+
"48 hours. Please visually inspect for correctness.",
|
35
|
+
ylabel: "Marking of S_phase, A_phase and Cdc20A [0 or 1]"
|
33
36
|
sleep 15
|
34
37
|
end
|
35
38
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cell_cycle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- boris
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|