@@ -29,7 +29,7 @@ def initialize(self, sim, sim_data):
29
29
# Get constants
30
30
self .nAvogadro = sim_data .constants .n_avogadro .asNumber (1 / units .mmol )
31
31
self .cellDensity = sim_data .constants .cell_density .asNumber (units .g / units .L )
32
-
32
+ print ( sim_data . process . metabolism_new_pathway . __dir__ ())
33
33
#check if there is a new metabolic pathway to be added
34
34
if hasattr (sim_data .process .metabolism_new_pathway , 'molecule_names' ):
35
35
self .new_pathway = True
@@ -49,6 +49,7 @@ def initialize(self, sim, sim_data):
49
49
self .bulkMoleculesRequestPriorityIs (REQUEST_PRIORITY_METABOLISM_NEW )
50
50
else :
51
51
self .new_pathway = False
52
+ print ('External pathway not included' )
52
53
53
54
54
55
def calculateRequest (self ):
@@ -58,6 +59,7 @@ def calculateRequest(self):
58
59
enzymeCounts = self .enzymes .total_counts ()
59
60
EnzymesDict = dict (zip (self .cleanEnzyme , enzymeCounts ))
60
61
62
+ print ('Total molec counts ' , moleculeCounts )
61
63
# Get cell mass and volume
62
64
cellMass = (self .readFromListener ("Mass" , "cellMass" ) * units .fg ).asNumber (units .g )
63
65
self .cellVolume = cellMass / self .cellDensity
@@ -68,8 +70,8 @@ def calculateRequest(self):
68
70
# solver for this setting among the list of solvers that can be used
69
71
# by the scipy ODE suite.
70
72
self .molecules_required , self .all_molecule_changes = self .moleculesToNextTimeStep (
71
- moleculeCounts , self .moleculeNames , self .enzymeNames , EnzymesDict , self .cellVolume , self .nAvogadro ,
72
- self .timeStepSec (), method = "LSODA" , jit = self .jit )
73
+ moleculeCounts , self .moleculeNames , self .enzymeNames , EnzymesDict , self .cellVolume , self .nAvogadro ,
74
+ self .timeStepSec (), self . randomState , method = "LSODA" , jit = self .jit )
73
75
74
76
# Request counts of molecules needed
75
77
self .molecules .requestIs (self .molecules_required )
@@ -82,20 +84,21 @@ def evolveState(self):
82
84
enzymeCounts = self .enzymes .total_counts ()
83
85
EnzymesDict = dict (zip (self .cleanEnzyme , enzymeCounts ))
84
86
85
-
87
+ print ( 'Molec counts ' , moleculeCounts )
86
88
# Check if any molecules were allocated fewer counts than requested
87
89
if (self .molecules_required > moleculeCounts ).any ():
88
- # Solve ODEs to a large time step using the the counts of molecules
90
+ # Solve ODEs to a large time step using the counts of molecules
89
91
# allocated to this process using the BDF solver for stable integration.
90
92
# The number of reactions has already been determined in calculateRequest
91
93
# and rates will be much lower with a fraction of total counts allocated
92
94
# so a much longer time scale is needed.
93
95
94
96
_ , self .all_molecule_changes = self .moleculesToNextTimeStep (
95
97
moleculeCounts , self .moleculeNames , self .enzymeNames , EnzymesDict , self .cellVolume , self .nAvogadro ,
96
- 10000 , method = "BDF" , jit = self .jit
98
+ 10000 , self . randomState , method = "BDF" , min_time_step = self . timeStepSec () , jit = self .jit
97
99
)
98
100
101
+
99
102
# Increment changes in molecule counts
100
103
self .molecules .countsInc (self .all_molecule_changes )
101
104
0 commit comments