cell_cycle 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dce3f739814e5f5dcb459a2d1c2f66f40adf6a54
4
- data.tar.gz: 0b9ba146d61529716fb2f2afe3d7418bcc45ed95
3
+ metadata.gz: 3c37cd532f2f2ed050cdec62c9a9c85dc603fb43
4
+ data.tar.gz: 55f4350c8a7ede05843244502a9c73831e58b67f
5
5
  SHA512:
6
- metadata.gz: 341fcbf722125071761ea284641b6daf130960830ce51b4904b531917b5fa5c0e51b9029f65d52f891b558caef7eae640010320d5159b6ea6111a46a3581ceb0
7
- data.tar.gz: 1fcc82fa61087b0e92237a926cbde6c7345b79ab06f50e66e427fa3b4e2d2c9f767da25b6c2e0f86d616ea9e3ebba478d44238d71ae661ac4ed37cbc0525ae27
6
+ metadata.gz: de3eda093018c5de093d3bce47b877a8828b75a71e7684222f20d06be79e423f02d22c412e7373c55607f933e5d85cd681c82c9e9ee4eccf7dcba1db408829bf
7
+ data.tar.gz: 3e69f452f253460baf148a65c73426afef38697d6191d1d6892ae5d5577f7ada9c9d38022807a44ddafd9afd3fad38450889169aa4c2ff7e15def0d41b7b35b8
@@ -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
- S_s = S_phase_start.in :s
34
- S_e = S_phase_end.in :s
35
- A_s = A_phase_start.in :s
36
- A_e = A_phase_end.in :s
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 assignment: -> t { t > A_s && t < A_e ? 1 : 0 },
58
- domain: Timer,
59
- codomain: A_phase
60
- S_phase_f = Transition assignment: -> t { t > S_s && t < S_e ? 1 : 0 },
61
- domain: Timer,
62
- codomain: S_phase
63
- Cdc20A_f = Transition assignment: -> t { t < Cdc20A_e || t > Cdc20A_s ? 1 : 0 },
64
- domain: Timer,
65
- codomain: Cdc20A
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..36.h.in( :s ),
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
@@ -1,5 +1,5 @@
1
1
  module CellCycle
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  # TODO: Once Net class is made a subclass of module, I can define
4
4
  # VERSION constant directly on it. If it turns out plausible.
5
5
  end
@@ -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
- # the simulation should look good
27
- sim = CELL_CYCLE.simulation time: 0..36.h.in( :s ),
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 ).plot
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.2
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-22 00:00:00.000000000 Z
11
+ date: 2016-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler