-
Notifications
You must be signed in to change notification settings - Fork 12
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
WIP: Specification of Timecourses #581
base: main
Are you sure you want to change the base?
Conversation
* extract all changes from previous * fixup * allow hyphens in extension names * fixup hyphens * only require one toolbox that implements extension * specify how to work with multiple PEtab problems * specify we do not require a quorum number of votes * allow test cases to be provided by the extension library * Apply suggestions from code review Co-authored-by: Daniel Weindl <[email protected]> Co-authored-by: Daniel Weindl <[email protected]>
PEtab extensions were introduced in #537. We should be able to distinguish there between optional extensions and required extensions, i.e. those that modify the parameter estimation problem as such, and those that just add additional/optional information (e.g. annotations, info for visualization, ...). If some tool does not know about a certain optional extension, it can safely be ignored during import, if it does not know about a required extension, it should fail. This PR adds a `required` attribute to extensions in the yaml file to indicate whether they are required for the mathematical interpretation of the PEtab problem. Resolves #544
Co-authored-by: Dilan Pathirana <[email protected]>
- remove preequilibrationConditionId - remove simulationConditionId - add timecourseID
Previously, the math expression syntax wasn't specified. This was very problematic, because different libraries and programming languages have different names for the same functions, and more importantly, differ in operator precedence. Co-authored-by: Dilan Pathirana <[email protected]> Co-authored-by: dilpath <[email protected]>
02716b3
to
06697a4
Compare
Resolved merge conflicts. This needs to be updated to match the new mostly-agreed-upon format in #586
|
f08da31
to
5933d5a
Compare
b79293f
to
56be96d
Compare
Add basic support for PEtab version 2 experiments (see also PEtab-dev/PEtab#586, and PEtab-dev/PEtab#581). Follow-up to #334. Partially supersedes #263, which was started before petab.v1/petab.v2 were introduced and before PEtab-dev/PEtab#586. * updates the required fields in the measurement table * updates some validation functions to not expect the old `simulationConditionId`s (but does not do full validation yet) * extends PEtab v1 up-conversion to create a new experiment table. --------- Co-authored-by: Dilan Pathirana <[email protected]>
56be96d
to
59eefdc
Compare
|
||
We distinguish between three types of entities: | ||
|
||
* Entities that are defined in terms of a time-derivative, e.g., the targets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Entities that are defined in terms of a time-derivative, e.g., the targets | |
* **Differential Targets**: Entities that are defined in terms of a time-derivative, e.g., the targets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same below
|
||
* Entities that are defined in terms of a time-derivative, e.g., the targets | ||
of SBML rate rules or non-constant species participating in reactions. | ||
Referred to as `differential targets` below. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Referred to as `differential targets` below. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same below
+--------------+------------------+------------------+-----------------+--------------------+ | ||
| conditionId1 | conditionName1 | modelEntityId1 | setCurrentValue | 0.42 | | ||
+--------------+------------------+------------------+-----------------+--------------------+ | ||
| conditionId1 | conditionName1 | modelEntityId2 | | 0.42 | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
according to below, operationType is required
+--------------+------------------+------------------+-----------------+--------------------+ | ||
| conditionId1 | conditionName1 | modelEntityId2 | | 0.42 | | ||
+--------------+------------------+------------------+-----------------+--------------------+ | ||
| conditionId2 | ... | modelEntityId1 | | modelEntityId1 + 3 | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing operationType
values as defined in the model). | ||
The target must be a constant target or a differential target. | ||
|
||
- ``setRate``: The time-derivative of the target is set to ``targetValue`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems natural to have an addToCurrentValue
as well
in the model. ``-inf`` indicates pre-equilibration (e.g., for drug | ||
treatments, the model would be pre-equilibrated with the no-drug condition). | ||
|
||
- ``CONDITION_ID``: Reference to a condition ID in the condition table that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[PETAB_ID, REQUIRED, REFERENCES(conditions.conditionID)]
@@ -519,7 +699,7 @@ Additional columns may be added. | |||
Detailed field description | |||
~~~~~~~~~~~~~~~~~~~~~~~~~~ | |||
|
|||
- ``parameterId`` [STRING, NOT NULL] | |||
- ``parameterId`` [STRING, REQUIRED] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- ``parameterId`` [STRING, REQUIRED] | |
- ``parameterId`` [PARAMETER_ID, REQUIRED] |
|
||
- ``experimentId`` [STRING, REQUIRED] | ||
|
||
Identifier of the experiment. The usual PEtab identifier requirements apply. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identifier of the experiment. The usual PEtab identifier requirements apply. | |
Identifier of the experiment. |
This is specified as a tab-separated value file in the following way: | ||
|
||
+---------------------+-------------------+-----------------+ | ||
| experimentId | time | conditionId | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I agree that we can drop the name in the conditions table, I think it would be nice to have an optional name column here.
@@ -757,14 +939,14 @@ The TSV file has two mandatory columns, ``petabEntityId`` and | |||
Detailed field description | |||
~~~~~~~~~~~~~~~~~~~~~~~~~~ | |||
|
|||
- ``petabEntityId`` [STRING, NOT NULL] | |||
- ``petabEntityId`` [STRING, REQUIRED] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- ``petabEntityId`` [STRING, REQUIRED] | |
- ``petabEntityId`` [PETAB_ID, REQUIRED] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I'm happy to review this again after the current feedback round
|
||
- A model | ||
|
||
- A measurement file to fit the model to [TSV] | ||
|
||
- A condition file specifying model inputs and condition-specific parameters | ||
- (optional) A condition file specifying model inputs and condition-specific parameters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we usually refer to this as the "conditions table"
- (optional) A condition file specifying model inputs and condition-specific parameters | |
- (optional) A conditions file specifying model inputs and condition-specific parameters |
- ``NON_ESTIMATED_ENTITY_ID``: A string that is a valid PEtab ID and refers | ||
to an entity that has some associated numeric value and is not estimated, | ||
e.g., a model parameter, parameter table parameter, or a species in the | ||
model. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- ``NON_ESTIMATED_ENTITY_ID``: A string that is a valid PEtab ID and refers | |
to an entity that has some associated numeric value and is not estimated, | |
e.g., a model parameter, parameter table parameter, or a species in the | |
model. | |
- ``NON_ESTIMATED_ENTITY_ID``: A string that is a valid PEtab ID and refers | |
to an entity that has some associated numeric value (e.g. a model parameter, | |
parameter table parameter, or a species in the model) and is not estimated. |
* Clarification and specification of various previously underspecified aspects | ||
(math expressions, overriding values in the condition table, etc.) | ||
(:ref:`math_expressions`, overriding values in the condition table, etc.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should list everything (explicitly or by some grouping)
(:ref:`math_expressions`, overriding values in the condition table, etc.) | |
(:ref:`math_expressions`, overriding values in the condition table) |
The conditions table specifies changes to parameters, initial values of species | ||
and compartments for specific simulation conditions. Different conditions can | ||
be combined to form time courses or experiment through the | ||
:ref:`experiments_table`. Any changes applied to the model will remain in | ||
effect until they are changed by a subsequent condition. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The conditions table specifies changes to parameters, initial values of species | |
and compartments for specific simulation conditions. Different conditions can | |
be combined to form time courses or experiment through the | |
:ref:`experiments_table`. Any changes applied to the model will remain in | |
effect until they are changed by a subsequent condition. | |
The conditions table specifies changes to parameters, initial or intermediate values of | |
species, and compartments, during specific time periods. The start and end of the time | |
period is defined in the :ref:`experiments_table`, where multiple conditions can be | |
combined to specify time courses or experiments that span multiple time periods. Any | |
changes applied to the model will remain in effect until they are changed by a condition | |
applied at a later time period. |
| ... | ... | ... | | ... | | ||
+--------------+------------------+------------------+-----------------+--------------------+ | ||
|
||
Each line specifies a change of one specific property of a specific entity. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each line specifies a change of one specific property of a specific entity. | |
Each line specifies the change in the numeric value of one specific non-estimated entity. |
We distinguish between three types of entities: | ||
|
||
* Entities that are defined in terms of a time-derivative, e.g., the targets | ||
of SBML rate rules or non-constant species participating in reactions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
of SBML rate rules or non-constant species participating in reactions. | |
of SBML rate rules or species that change by participating in reactions (educts or products). |
For any conditionId with ``operationType=noChange``, there must not be any | ||
other row with the same ``conditionId`` in the conditions table. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For any conditionId with ``operationType=noChange``, there must not be any | |
other row with the same ``conditionId`` in the conditions table. | |
For any ``conditionId`` with ``operationType=noChange``, there must not be any | |
other row with the same ``conditionId`` in the conditions table. |
+---------------------+-------------------+-----------------+ | ||
| experimentId | time | conditionId | | ||
+=====================+===================+=================+ | ||
| PETAB_ID | NUMERIC or '-inf' | CONDITION_ID | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, in the measurements table it is NUMERIC\|inf
instead
Note: The time interval in which a condition is applied includes the | ||
respective starting timepoint, but excludes the starting timepoint of | ||
the following condition. This means that for an experiment | ||
``[time_A:condition_A; time_B:condition_B]``, ``condition_A`` is active | ||
during the interval ``[time_A, time_B)``. This implies that any event | ||
assignment that triggers at ``time_B`` will occur *after* ``condition_B`` was | ||
applied and for any measurements at ``time_B``, the observables will be | ||
evaluated *after* ``condition_B`` was applied. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the old (not long format) version of the experiments table, so it might be confusing to users
Note: The time interval in which a condition is applied includes the | |
respective starting timepoint, but excludes the starting timepoint of | |
the following condition. This means that for an experiment | |
``[time_A:condition_A; time_B:condition_B]``, ``condition_A`` is active | |
during the interval ``[time_A, time_B)``. This implies that any event | |
assignment that triggers at ``time_B`` will occur *after* ``condition_B`` was | |
applied and for any measurements at ``time_B``, the observables will be | |
evaluated *after* ``condition_B`` was applied. | |
Note: The time interval in which a condition is applied includes the | |
respective starting timepoint, but excludes the starting timepoint of | |
the following condition. This means that for an experiment where | |
``condition_A`` is applied at ``time_A`` and later ``condition_B`` is | |
applied at ``time_B``, then ``condition_A`` is active | |
during the interval ``[time_A, time_B)``. This implies that any event | |
assignment that triggers at ``time_B`` will occur *after* ``condition_B`` was | |
applied and for any measurements at ``time_B``, the observables will be | |
evaluated *after* ``condition_B`` was applied. |
Multiple conditions can be applied at the same time point by specifying | ||
multiple lines with the same ``experimentId`` and ``time`` but different | ||
``conditionId``. The order of the conditions is arbitrary **????**. | ||
|
||
**TODO** how to deal with conflicts? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion based on previous conversations, not sure how to word it best though
Multiple conditions can be applied at the same time point by specifying | |
multiple lines with the same ``experimentId`` and ``time`` but different | |
``conditionId``. The order of the conditions is arbitrary **????**. | |
**TODO** how to deal with conflicts? | |
Multiple conditions can be applied at the same time point by specifying | |
multiple lines with the same ``experimentId`` and ``time`` but different | |
``conditionId``. The order of the conditions is arbitrary. | |
All changes across all simultaneous conditions are applied in order of | |
dependencies, with conservation of mass when volumes change, i.e. | |
a volume change implies a concentration change, but not vice versa. | |
Hence, volume changes are applied before concentration changes in the | |
same compartment, and changes to parameters are applied before | |
changes to species that depend on the parameters. |
This draft PR adds the descriptions from the Time course specification to the
release/2.0.0
branch.preview site is: https://petab--581.org.readthedocs.build/en/581/documentation_data_format.html#timecourses-table