PEtab-dev / PEtab

PEtab - an SBML and TSV based data format for parameter estimation problems in systems biology
https://petab.readthedocs.io
MIT License
56 stars 12 forks source link

Questions regarding setting initial concentrations via condition table #481

Open dweindl opened 3 years ago

dweindl commented 3 years ago

Related to https://github.com/AMICI-dev/AMICI/issues/1319, i was wondering about the following:

In case of preequilibration, should the occurrence in the condition table of any parameter that somehow impacts the initial state trigger a reinitialization?

Independent of preequilibration: In the presence of aninitialAssignment to a species in the model AND the assigned-to species in the condition table, what would have precedence? Would that even be valid in PEtab?

FFroehlich commented 3 years ago

Related to AMICI-dev/AMICI#1319, i was wondering about the following:

In case of preequilibration, should the occurrence in the condition table of any parameter that somehow impacts the initial state trigger a reinitialization?

In the case of precomputed steady states, this may turn out not to be what the user anticipated. Could be encoded in parameter table which parameter should and shouldn't lead to reinitialization (also makes it more transparent to the user that reinitialization is a feature and forces the user to think about it).

Independent of preequilibration: In the presence of aninitialAssignment to a species in the model AND the assigned-to species in the condition table, what would have precedence? Would that even be valid in PEtab?

I would argue that PEtab has precedence.

LeonardSchmiester commented 3 years ago

Independent of preequilibration: In the presence of aninitialAssignment to a species in the model AND the assigned-to species in the condition table, what would have precedence? Would that even be valid in PEtab?

I would argue that PEtab has precedence.

Would agree. The PEtab doc also says that a species in the condition table overrides initial assignments in the SBML model and preequilibration.

In case of preequilibration, should the occurrence in the condition table of any parameter that somehow impacts the initial state trigger a reinitialization?

At least this is how I remember it from the discussions back then and how I would have interpreted the documentation.

dweindl commented 3 years ago

Thanks for the feedback so far. Any other opinions? @yannikschaelte ?

yannikschaelte commented 3 years ago

Point 2 definitely agreed, point 1 ... not sure. Is the difference to https://github.com/AMICI-dev/AMICI/issues/1319 only that here it's about a parameter dependent initial state of the simulation as opposed to directly encoding the initial state in the condition file (where the override would happen)?

dweindl commented 3 years ago

Point 2 definitely agreed, point 1 ... not sure.

Agreed with whom? And with point exactly, the order changed on the way :).

Is the difference to AMICI-dev/AMICI#1319 only that here it's about a parameter dependent initial state of the simulation as opposed to directly encoding the initial state in the condition file (where the override would happen)?

The question is how the fix for AMICI-dev/AMICI#1319 has to be implemented.

In the case of species IDs in the condition table things are relatively simple. But InitialAssignments are somewhat more difficult. In the simplest case, they just assign a numeric value directly or via another parameter. But they can potentially depend on other terms, potentially depending on other terms, potentially... So it might not be too obvious that changing a certain parameter in the condition table would trigger a reinitialization (as Fabi mentioned).

Another point, not mentioned above, is that the math of InitialAssignments could also include other species. In case of preequilibration, if a species is referenced in the math of an InitialAssignment, that should refer to its value after preequilibration, not from before, right?

yannikschaelte commented 3 years ago

Agreed with whom? And with point exactly, the order changed on the way :).

Ah right, the PEtab having precedence thingy.

The question is how the fix for AMICI-dev/AMICI#1319 has to be implemented.

In the case of species IDs in the condition table things are relatively simple. But InitialAssignments are somewhat more difficult. In the simplest case, they just assign a numeric value directly or via another parameter. But they can potentially depend on other terms, potentially depending on other terms, potentially... So it might not be too obvious that changing a certain parameter in the condition table would trigger a reinitialization (as Fabi mentioned).

Yes, I also thought that the dependence chain may be non-trivial, so that could be problematic und yield unexpected results ... 1) Would it be possible to detect such cases via symbolic calculation and output them? With the suggestion of specifying in the parameter table whether a parameter should lead to reiniialization: could work (?) but a problem might be conflicting parameters telling to do it or not ...

Another point, not mentioned above, is that the math of InitialAssignments could also include other species. In case of preequilibration, if a species is referenced in the math of an InitialAssignment, that should refer to its value after preequilibration, not from before, right?

Sounds plausible ...

dweindl commented 3 years ago

Yes, I also thought that the dependence chain may be non-trivial, so that could be problematic und yield unexpected results ... 1) Would it be possible to detect such cases via symbolic calculation and output them?

Needs to be detected anyways for handling things correctly. Outputting afterwards is trivial.

With the suggestion of specifying in the parameter table whether a parameter should lead to reiniialization: could work (?) but a problem might be conflicting parameters telling to do it or not ...

Yes, but catching those conflicts would be the exact reason why we'd take that approach.

Such an extra field would be something to discuss for the next PEtab version. The question is, how to handle things for the moment. Would agree with Leonard's interpretation there.