sys-bio / tellurium

Python Environment for Modeling and Simulating Biological Systems
http://tellurium.analogmachine.org/
Apache License 2.0
107 stars 36 forks source link

Can't modify some model parameters from SBML model #508

Open danolson1 opened 3 years ago

danolson1 commented 3 years ago

I imported an SBML model from COPASI. I can edit the species concentrations in the usual way, but I can't edit any variables (i.e. Vmax values).

import tellurium as te
r = te.loadSBMLModel('YeastGlycolysis_cell_free_DO02262021.xml')
print(r.ATP)
print(r.PGI_Vmax) # this gives an error message

The 3rd line gives me an error message. Interestingly, if I convert the SBML file to an Antimony text file, and then re-import the model, it works fine.

-Dan YeastGlycolysis_cell_free_DO02262021.zip

hsauro commented 3 years ago

I had a look at the copasi file and it appears to be treating the parameters as local to the reaction which makes them inaccessible. Converting to antimony promotes the parameters to the global space. That’s what seems to be happening, it’s appears to be the way copasi saves its models. There maybe an option when you save from copasi to promote the parameters but copasi also separates rate laws into user functions so it might not be possible. Generally I convert to antimony first so I’ve never seen this issue before.

Herbert Sauro

luciansmith commented 3 years ago

In the original model, there is nothing with the id "PGI_Vmax". Instead, there is a reaction with the id 'PGI', and that reaction has a local parameter child called "Vmax". Both Antimony and Roadrunner will read SBML models with local parameters, but roadrunner does not provide an interface that allows people to modify or otherwise interact with them directly. Instead, as Herbert says, if you convert it to Antimony first, Antimony will 'promote' local parameters to global parameters by using the naming scheme you're using. There may be a similar thing you can do from Copasi when saving to SBML.

danolson1 commented 3 years ago

Thanks for clarifying that. I thought maybe there was a way to access the Vmax parameter within PGI, but sounds like that's not the case. Using conversion to Antimony as a workaround is pretty simple, though.

-Dan

On Fri, Feb 26, 2021 at 10:28 PM Lucian Smith notifications@github.com wrote:

In the original model, there is nothing with the id "PGI_Vmax". Instead, there is a reaction with the id 'PGI', and that reaction has a local parameter child called "Vmax". Both Antimony and Roadrunner will read SBML models with local parameters, but roadrunner does not provide an interface that allows people to modify or otherwise interact with them directly. Instead, as Herbert says, if you convert it to Antimony first, Antimony will 'promote' local parameters to global parameters by using the naming scheme you're using. There may be a similar thing you can do from Copasi when saving to SBML.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sys-bio/tellurium/issues/508#issuecomment-786996082, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABK4ACH2NSNYCISQYJ4ZJX3TBBRGFANCNFSM4YJPA65Q .