Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

weird behavior with static compounds #20

Open
hariszaf opened this issue Dec 6, 2022 · 3 comments
Open

weird behavior with static compounds #20

hariszaf opened this issue Dec 6, 2022 · 3 comments

Comments

@hariszaf
Copy link

hariszaf commented Dec 6, 2022

Hi all and thanks a lot for comets and cometspy.

Based on the documentation site:

  • unlimited amounts (static flag)
  • Considering metabolites as "static" is the way COMETS has to simulate an unlimited supply of metabolites.
  • When a media component is static, this means that its concentration is returned in each cycle to the set static value. This is used when we want a media component to remain virtually unlimited during a simulation.

If I get this right, then one could have a static case with a non unlimited compound.
For example, I would like to have a static medium compound of 11mM glucose.

To this end i have made a short example case:

e_coli_cobra = cobra.io.load_matlab_model("e_coli_core.mat")
e_coli = c.model(e_coli_cobra)
e_coli.initial_pop = [0, 0, 1e-7] 

test_tube = c.layout()

test_tube.set_specific_metabolite('glc__D_e', 0.011);
test_tube.set_specific_static('glc__D_e', 0.011)

test_tube.set_specific_metabolite('nh4_e', 1000);
test_tube.set_specific_metabolite('pi_e', 1000);
test_tube.set_specific_metabolite('h2o_e', 1000);
test_tube.set_specific_metabolite('h_e', 1000);

e_coli.initial_pop = [0, 0, 5e-6]

test_tube.add_model(e_coli)

sim_params = c.params()
sim_params.set_param('defaultVmax', 18.5)
sim_params.set_param('defaultKm', 0.000015)
sim_params.set_param('maxCycles', 10000)
sim_params.set_param('timeStep', 0.01)
sim_params.set_param('spaceWidth', 1)
sim_params.set_param('maxSpaceBiomass', 15)
sim_params.set_param('minSpaceBiomass', 1e-11)
sim_params.set_param('writeMediaLog', True)
sim_params.set_param('writeTotalBiomassLog', True)

experiment = c.comets(test_tube, sim_params)

experiment.run()

experiment.media[experiment.media["metabolite"]=="glc__D_e"]

image

It seems that the glc__D_e compound does not behave as static even if when you run
experiment.layout.media, you see that the g_static is as it should:

image

Am i doing something wrong ?

Thank you very much in advance for all your time and help.

@dukovski
Copy link
Contributor

dukovski commented Dec 6, 2022

If the static flag is 1, the concentration must stay the same. This is a bug. Can you send me the files so I can reproduce this? Thanks.

@hariszaf
Copy link
Author

hariszaf commented Dec 6, 2022

Hi @dukovski.
Thanks a lot for the immediate response.
Attached you can find my script and the e_coli_core model i m using for this toy case.
Thanks a lot once again and I d be glad to help if possible.

comets_test_static.zip

@dukovski
Copy link
Contributor

dukovski commented Dec 6, 2022

No problem, I will take a look tomorrow. Thanks.

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

No branches or pull requests

2 participants