Skip to content

Conversation

@mpg19
Copy link
Contributor

@mpg19 mpg19 commented Oct 15, 2025

This PR adds attributes to the models/ecoli/listeners/monomer_counts.py listener for keeping track of the number of proteins degraded (monomersDegraded) and synthesized (monomersElongated) at each time step in a given simulation. Since the number of proteins degraded and synthesized is calculated using each monomer’s corresponding free count at the start of each time step, this value is recorded as well (freeMonomerCounts).

A conversion variable called counts_to_molar is calculated at each time step using the current cell mass to convert each monomer’s free counts to a concentration value. Both the free monomer concentration (freeMonomerConcentrations) for each protein and the counts_to_molar (counts_to_molar) conversion factor are also saved to the MonomerCounts reader within the models/ecoli/listeners/monomer_counts.py listener at each time step.

All of the above new attribute are added to the the MonomerCounts reader, joining the MonomerCounts attribute which tracks the total monomer counts for each monomer at every simulation time step (accounting for both free monomers and monomers in complexation, equilibrium, and two component system complexes for each monomer).

These values can be accessed via the MonomerCounts reader in any analysis script. Here is an example of a method that can be used to access the number of synthesized monomers for each individual monomer at every time step in a given simulation:

free_monomers_synthesized = self.readFromListener("MonomerCounts", "monomersElongated")

mpg19 added 24 commits October 14, 2025 14:40
…olve state function within protein_degradation.py.
…nd written to the monomer_counts.py listener.
@mpg19 mpg19 requested a review from rjuenemann October 15, 2025 06:57
Copy link
Contributor

@rjuenemann rjuenemann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mpg19 - another great PR! See comments.

I'd recommend merging your other PR into master first, then pulling master into this branch. I did not review the files that overlapped with the other PR - let me know if there are different changes in those than the other PR. If possible, I also think we should merge the PRs into master on separate days to make sure the longer Jenkins tests clear the other one first.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

countsToMolar seems like the duplicate of a listener enzyme_kinetics? Additionally, since totalMonomerConcentrations and freeMonomerConcentrations can be created after the sims from monomerCounts, freeMonomerCounts, and countsToMolar, I would suggest doing the counts -> concentration conversion in the analysis scripts to save in time and memory used in simulation outputs.

# Update monomerCounts
# Update monomerCounts and free monomer counts at the start of the time step:
self.monomerCounts = bulkMoleculeCounts[self.monomer_idx]
self.freeMonomerCounts = self.bulkMolecules.container.counts()[self.monomer_idx]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this differ from self.monomerCounts?

Comment on lines 267 to 269
# write the number of elongated proteins to the listener
self.writeToListener('MonomerCounts', 'monomersElongated', self.bulkMonomers.counts())

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you help me understand why this gives the number of proteins elongated this time step? Does it not return the total counts of that protein?

self.h2o = self.bulkMoleculeView(sim_data.molecule_ids.water)
self.proteins = self.bulkMoleculesView(proteinIds)

# Complex view for future use
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a ToDo here for connecting this to something in the future?

))

# Record how many monomers were calculated to degrade:
counts_degraded = self.proteins.counts()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you help me understand why this gives the number of proteins degraded this time step? Does it not return the total counts of that protein? If there's something you feel would be helpful explaining how views work please link it or add it to the PR, thanks!

mpg19 added 21 commits October 20, 2025 18:19
Merging updated version of tanslation-update into branch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants