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

Initial concentrations not overwritten after preequilibration #1319

Closed
LeonardSchmiester opened this issue Oct 23, 2020 · 7 comments · Fixed by #1417
Closed

Initial concentrations not overwritten after preequilibration #1319

LeonardSchmiester opened this issue Oct 23, 2020 · 7 comments · Fixed by #1417
Labels
bug new Newly created PEtab PEtab-import related

Comments

@LeonardSchmiester
Copy link
Contributor

What did you expect to happen?
I have a model, where I want to reset initial concentrations for some species (in my case different drugs) after preequilibration. In the SBML file, I have an initial assignment to the species, which is set to 0 for the preeq condition in the PEtab condition file and then to e.g. 10 for the simulation condition. I would have expected x0 in rdata for this species to be 10.

What has happened instead?
It seems like the initial concentration of the species is not overwritten with the value in the condition file. So in the above example x0 is 0. If I delete the preeq condition, x0 is set correctly.

To Reproduce
Here is a minimal example to reproduce the problem: minimal_example.tar.gz

AMICI version and system environment

  • OS and version: Ubuntu
  • AMICI interface: Python
  • AMICI version: 0.11.8
@LeonardSchmiester LeonardSchmiester added the new Newly created label Oct 23, 2020
@paulstapor
Copy link
Contributor

Might be that this has something to do with model.setReinitializeFixedParameterInitialStates()? If this flag isn't set to True, model simulation will show exactly the behavior you described...

@LeonardSchmiester
Copy link
Contributor Author

Thanks for the hint @paulstapor . This indeed fixed the problem for the minimal example. Will also try for the large model now.

@dweindl dweindl self-assigned this Oct 28, 2020
@dweindl dweindl added bug PEtab PEtab-import related labels Oct 28, 2020
@dweindl
Copy link
Member

dweindl commented Oct 28, 2020

Okay, the problem here is that simulate_petab does not handle that correctly for initialAssignments, but only if you have a species name in the condition table.

@dweindl
Copy link
Member

dweindl commented Oct 28, 2020

I am not completely sure how that should be handled (-> PEtab-dev/PEtab#481).

@dweindl dweindl removed their assignment Oct 28, 2020
@LeonardSchmiester
Copy link
Contributor Author

Okay, the problem here is that simulate_petab does not handle that correctly for initialAssignments, but only if you have a species name in the condition table.

Using the species Id indeed gives the results I expected.

@dweindl
Copy link
Member

dweindl commented Nov 9, 2020

As this turns out to be slightly more complicated (PEtab-dev/PEtab#481), I'd suggest to only add support for simple initial assignments for now, i.e. those with math elements consisting of a single parameter that is not a target of other rules. The rest should trigger a NotImplementedError. Will fix this problem here. Anything beyond can be addressed elsewhere.

dweindl added a commit that referenced this issue Feb 18, 2021
…fixes (#1417)

Adds possibility to provide state indices for selective reinitialization based on fixed parameters.

The previous `ExpData::reinitializeFixedParameterInitialStates` is still there, but will be removed in an upcoming version.


Addresses #1345, #1396, #1319

Supersedes #1344 

Include new test cases from PEtab-dev/petab_test_suite#35
@dweindl
Copy link
Member

dweindl commented Feb 20, 2021

Should be fixed in 0.11.13

@dweindl dweindl closed this as completed Feb 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug new Newly created PEtab PEtab-import related
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants