-
Notifications
You must be signed in to change notification settings - Fork 31
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
Support RateRules on Parameters #1278
Comments
Hmm, supporting RateRules on parameter is a little bit tricky since it doesn't work well with the amici definition of a parameter, i.e. something with respect to which you can compute a parameter. Probably the best approach would be to create state variables for these species and use the existing machinery for rate rules. |
Many reasons why these rate rules cannot be encoded on parameters
The problem is that AMICI is trying to do a 1:1 mapping of SBML objects on concepts in the parameter fitting problem. But what you have to do is figure out which objects in SBML correspond to which parts in your parameter fitting problem: State variables:
Parameters in fitting problem
You have to figure out the subets of the SBML model which correspond to your parameter fitting problem. |
To some degree, we already started to support parameters with assignment rules, which can be turned into splines.
One could anyhow add, beyond state variables, observables, parameters, another output such as "derived quantities" to the output. For example, that could be used to output parameters with rate or assignment rules, for example, splines or whatever kind of input functions which are non-constant. The same thing we might want to do with species with assignment rules. Currently, those are internally pruned out of the state variables and returned as observables, as far as I know... In that context, I'd vote to keep species -> x_rdata (returned state variables), as this indicates also whether a quantity way modeled as parameter or as species... and then one could return time-varying parameters as "derived quantities". |
Sorry, I don't even understand what the problem is with AMICI and RateRules on parameters. |
In principle, there is no big deal with this, you're right. We could more or less easilyimplement it, I think... |
Concerning the 1:1 mapping: |
I'd say the biggest problem is, that it wasn't considered to be important enough so far or nobody felt like implementing it...
Not so sure. I think it would absolutely make sense to put a wrapper around the internal result representation to map things back to model |
Not sure what you mean with "value/trajectory for some given entity based on the respective ID." Is this only referring to species? I have trajectories of parameters which are calculated via rate rules which I am using in parameter fitting. E.g. I have a parameter which calculates via a rate rule the time-dependent injection rate of a given substance. The parameter is a flux in [mmol/min] which cannot be encoded as a species (species are only in amount units). I want to plot it and optimize parameters in the rate rule expression to minimize the distance between experimental injection rate and model injection rate. In the field of glucose metabolism there are many tracer studies which are giving experimental rates which can be compared to reaction rates or parameters which encode these rates. I want to directly access these parameter trajectories via their id. |
No, species/compartment/parameter/rule/... (I wrote 'species' where I didn't mean it in the previous post)
Right. |
I see, why you don't want to have it as a species... And I agree that this should be doable. When simply adding it to the state variables (for the moment), this should also not create too much of work... |
I can support you here from the SBML side and explain the different cases. |
Will try to get this fixed over the next couple of days, shouldn't be too much work. Fixing this disconnect between SBML and AMICI definition of parameters will hopefully also resolve other issue but but may be tricky to implement this without breaking too much backwards compatibility. |
Would prioritize convenient API over backwards compatibility here. I think it's nice to have both an internal and an SBML result interface. (The former, mostly for debugging / performance, the latter for convenience). For example, when looking at the results, I might not care whether a certain parameter was a constant in AMICI or not. With those changes we can also handle constant species better (i.e. treat as parameters, as already written by Matthias above). This will also allow changing such internals later on transparently for most users. |
Thanks. Great for fixing this. |
What did you expect to happen?
I tried to load one of my SBML models in AMICI. Almost all my models have RateRules on parameters.
What has happened instead?
SBML model does not load.
To Reproduce
Run code on model attached
amici_example.zip
AMICI version and system environment
How to fix
Support RateRules on parameters.
The text was updated successfully, but these errors were encountered: