Skip to content

Time-dependent changes in component values #564

@dilpath

Description

@dilpath

related: #16 #540

If you are already familiar with this, you could skip straight to the "Feedback" section and share your thoughts.

A couple of (currently unofficial) PEtab extensions have been developed, to specify time-dependent changes in model components like parameters and state variables. An application example is a blood glucose model with intravenous infusion of glucose into a patient, where the rate of intravenous infusion might be manually adjusted by a nurse to control blood glucose levels. The intravenous infusion rate could be modeled as a time-dependent rate, which is fast or slow according to how the nurse chooses.

In terms of PEtab, this application example could be specified by first specifying two conditions (fast and slow), then specifying the timepoints when they are applied.

Table 1 Example PEtab condition table

conditionId infusion_rate
fast_infusion 1.5
slow_infusion 0.5

Table 2 Example timecourse specification, in the current PEtab Timecourse format

timecourseId timecourse
patient0 0:slow_infusion;20:fast_infusion;45:slow_infusion

This specifies that "patient0" receives a fast infusion in 20 <= time < 45, and a slow infusion otherwise.

Alternative implementations
There are currently two implementations of a specification format for these timecourses. An important difference is that the PumasQSP dosing table describes relative changes, whereas PEtab Timecourse specifies absolute changes.
PEtab Timecourse: https://github.com/dilpath/petab_timecourse/
Pumas QSP dosing table: https://help.juliahub.com/pumasqsp/dev/tutorials/petabimport/#dosing_table

The PEtab Timecourse format is shown in Table 2.
The Pumas QSP format extension has a "dosing" table, which augments the standard PEtab condition table, just like the PEtab Timecourse table above.
Table 3 Example timecourse, as a PumasQSP dosing table

conditionId speciesId value time isRate
slow_infusion infusion_rate 1 20 0

i.e., here "infusion_rate" is modeled as a species, and the fast infusion rate is modeled as a relative change of the default "slow_infusion" condition. i.e., "infusion_rate" at t=20 is "infusion_rate + 1" => "0.5 + 1" => "1.5", which matches the fast infusion rate in Table 1. After 25 time units, the relative change is reverted back to the value prior to "t=20", i.e. 0.5.

Further alternatives
After discussing with @paulflang @dweindl and others, there are a few more alternatives.

Alternative dosing table
This replaces both the condition table (Table 1) and dosing table (Table 3), with a single combined table.
Table 4

conditionId componentId value time isRate relative
patient0 infusion_rate 0.5 0 0
patient0 infusion_rate 1 20 0 1

Here, the relative change from the previous dosing table is now explicitly specified.

Alternative timecourse table
This replaces the PEtab Timecourse (Table 2), to support relative changes.
Table 5

timecourseId conditionId time relative
patient0 slow_infusion 0
patient0 fast_infusion 20
patient0 slow_infusion 45

Alternative condition table
This replaces Table 1, to support relative changes. This can be paired with Table 2 or Table 5 (without the "relative" column).
Table 6

conditionId infusion_rate
fast_infusion infusion_rate + 1
slow_infusion 0.5

New measurement table
The measurements table would be changed to now use timecourses. e.g., to specify pre-equilibration with condition "slow_infusion", then simulation with condition "fast_infusion" for 20 time units:
Table 7 Measurements example: condition table in the Table 1 format

conditionId infusion_rate
fast_infusion 1.5
slow_infusion 0.5

Table 8 Measurements example: timecourse table in the Table 2 format

timecourseId timecourse
patient0 inf:slow_infusion;0:fast_infusion;20:slow_infusion

The measurements table would then look like the following, where preequilibrationConditionId and simulationConditionId have been replaced with timecourseId. For simplicity, we can support conditionIds in the timecourseId, for timecourses that only involve a single condition ID.
Table 9 Measurements example: new measurement table

observableId timecourseId measurement time
observed_blood_glucose patient0 ... ...

Feedback
At this point, it would be great if we could firstly agree on the scope of this work.

  1. Are you in favor of timecourse specification -- i.e., instantaneous changes in parameter or species values, at specified timepoints?
    1.1. Are you in favour of specifying the duration of changes explicitly? e.g. Tables 3 and 4
    1.2. Are you in favour of being able to specify modifications of the species' ODE, rather than the species directly? e.g. Tables 3 and 4 have "isRate". e.g. given a "relative" change: if "isRate" is "1", then the "value" gets added to the species ODE RHS. If "isRate" is "0", then the "value" gets added to the species itself.
  2. Are you in favor of specifying relative changes in components?
    2.1. Are you in favor of arbitrary expressions in the conditions table? e.g. Table 6
  3. Which of the changes would you be OK with including in core PEtab, and which would you prefer in an official extension?

After getting some consensus on the scope, I would then ask for feedback on specific format alternatives.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions