Skip to content

Commit 101a65e

Browse files
author
Ioana Gherman
committed
first commit wcm with violacein and MM metabolism
1 parent 592d3e6 commit 101a65e

15 files changed

+797257
-139
lines changed

models/ecoli/processes/metabolism_new_pathway.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def initialize(self, sim, sim_data):
2929
# Get constants
3030
self.nAvogadro = sim_data.constants.n_avogadro.asNumber(1 / units.mmol)
3131
self.cellDensity = sim_data.constants.cell_density.asNumber(units.g / units.L)
32-
32+
print(sim_data.process.metabolism_new_pathway.__dir__())
3333
#check if there is a new metabolic pathway to be added
3434
if hasattr(sim_data.process.metabolism_new_pathway, 'molecule_names'):
3535
self.new_pathway = True
@@ -49,6 +49,7 @@ def initialize(self, sim, sim_data):
4949
self.bulkMoleculesRequestPriorityIs(REQUEST_PRIORITY_METABOLISM_NEW)
5050
else:
5151
self.new_pathway = False
52+
print('External pathway not included')
5253

5354

5455
def calculateRequest(self):
@@ -58,6 +59,7 @@ def calculateRequest(self):
5859
enzymeCounts = self.enzymes.total_counts()
5960
EnzymesDict = dict(zip(self.cleanEnzyme, enzymeCounts))
6061

62+
print('Total molec counts ', moleculeCounts)
6163
# Get cell mass and volume
6264
cellMass = (self.readFromListener("Mass", "cellMass") * units.fg).asNumber(units.g)
6365
self.cellVolume = cellMass / self.cellDensity
@@ -68,8 +70,8 @@ def calculateRequest(self):
6870
# solver for this setting among the list of solvers that can be used
6971
# by the scipy ODE suite.
7072
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)
7375

7476
# Request counts of molecules needed
7577
self.molecules.requestIs(self.molecules_required)
@@ -82,20 +84,21 @@ def evolveState(self):
8284
enzymeCounts = self.enzymes.total_counts()
8385
EnzymesDict = dict(zip(self.cleanEnzyme, enzymeCounts))
8486

85-
87+
print('Molec counts ', moleculeCounts)
8688
# Check if any molecules were allocated fewer counts than requested
8789
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
8991
# allocated to this process using the BDF solver for stable integration.
9092
# The number of reactions has already been determined in calculateRequest
9193
# and rates will be much lower with a fraction of total counts allocated
9294
# so a much longer time scale is needed.
9395

9496
_, self.all_molecule_changes = self.moleculesToNextTimeStep(
9597
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
9799
)
98100

101+
99102
# Increment changes in molecule counts
100103
self.molecules.countsInc(self.all_molecule_changes)
101104

models/ecoli/sim/simulation.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from wholecell.sim.simulation import Simulation
2-
import os
32

43
# States
54
from wholecell.states.bulk_molecules import BulkMolecules

0 commit comments

Comments
 (0)