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

Allow users access to local parameters from Python #100

Open
hsauro opened this issue Mar 17, 2015 · 9 comments
Open

Allow users access to local parameters from Python #100

hsauro opened this issue Mar 17, 2015 · 9 comments
Assignees

Comments

@hsauro
Copy link

hsauro commented Mar 17, 2015

Not urgent: On the to do list.

Currently there is no way for a user to access local parameters in an SBML model. The current approach it to call the promote method that promotes all local parameters to be global. An alternative would be to extend the Python syntax to allow synta such as:

print r.J1.k1

where J1 is a reaction and k1 is a local parameter to that reaction.

Question, Does Antimony support local parameters?

@luciansmith
Copy link

luciansmith commented Mar 17, 2015

Antimony converts local parameters to global parameters when importing, and
doesn't create models with local parameters. I could probably use the
syntax you suggest to make it work, though, whenever you felt it was a
priority.

@Karrenbelt
Copy link

I would really like to have this feature. Is there yet something that allows one to access the local parameters through python? I noticed that roadrunner simulates just fine with local parameters in the SBML document (they are not ignored), but I would also like to be able to set and retrieve their values from a roadrunner instance.

@matthiaskoenig
Copy link
Collaborator

If you send the SBML file with the local parameters I can post the 3 lines to promote the local parameters to global parameters and how to access/changes them subsequently.

Just can't find an example xml with local parameters to test the example.

@Karrenbelt
Copy link

Karrenbelt commented Jul 24, 2019

I know that is possible; it is the current workaround.

The thing is though that I have reaction specific parameters, which I would like to strip when I change rate-laws, but also global parameters that I do not wish to strip from the model when I change rate laws. Having local parameters thus seems to make sense in order to achieve this, and as stated roadrunner will interpret them properly during simulation. I just cannot change them on the roadrunner instance, which I would like to be able to do.

Another easy workaround would be for me to put references to all the rate-law-related parameters in a separate container, so I can use that instead. Regardless of these workarounds though, it would be good to have access to them through the roadrunner instance them in python

@matthiaskoenig
Copy link
Collaborator

Personally, I just use some simple naming syntax which allows me to filter the parameters belonging to a reaction.
All my reactions are uppercase ids, e.g. HK1, PFK1 with the corresponding parameters having the reaction prefix HK1_Km_atp, HK1_Km_glc, HK1_Vmax, PFK1_Km_atp, PFK1_Vmax.
This allows then to very easily filter subsets, e.g. parameters for a reaction.
For instance get all Km values, get all Vmax values, get all parameters of a reaction ...
Much simpler if you have one list of global parameters.

In my opinion local parameters should be avoided due to the risk of shadowing global objects like global parameters, compartments, ... .

@Karrenbelt
Copy link

well perhaps, but they have been introduced in L3V2.

And if they're part of a kinetic rate law they will affect roadrunner simulation results, but you cannot access them through the roadrunner instance in python. That is suboptimal, particularly since local parameters shadow global ones as you've stated, but you don't have access to them.

Anyway, there are ample workarounds, regardless of that, I think they should be accessible through roadrunner.

@hsauro
Copy link
Author

hsauro commented Jul 24, 2019 via email

@Karrenbelt
Copy link

alright, the alternative would be to raise a warning when loading any model containing local parameters, with the suggestion to promote local parameters to global ones.

@hsauro
Copy link
Author

hsauro commented Jul 24, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants