-
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
Proposal: Different languages for model specification #538
base: release/2.0.0
Are you sure you want to change the base?
Conversation
So just that I understand this correctly, if I want to do pattern matching, I can still create a BNGL observable in the BNGL model like so
and use its ID Anyway, awesome that PEtab will soon allow other model specifications. Thanks and congratulations! |
Yes, that is correct. In principle, you could also assign the value of the observable in the condition table, but there probably are only a few circumstances where this would make sense.
Thank you! |
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.
Just some suggestions, nothing major.
- "SBML" occurs a few times (e.g. in "doc/documentation_data_format.rst").
- The order of tables in "doc/documentation_data_format.rst" used to be alphabetical.
doc/_static/petab_schema.yaml
Outdated
description: One or multiple models | ||
|
||
# the model ID | ||
patternProperties: ^[a-zA-Z_]\w*$ |
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.
Could allow hyphens, but maybe problematic as the first character in YAML
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.
Could do that, or even allow for arbitrary strings. The current pattern is the same as for any other PEtab-related IDs, which would be easiest to remember.
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.
Ah, agreed 👍
doc/documentation_data_format.rst
Outdated
no preequilibration is defined) is used. | ||
|
||
- ``${compartmentId}`` | ||
|
||
If a compartment ID is provided, it is interpreted as the initial | ||
compartment size. | ||
|
||
- For all other entities, values are statically replaced at all time points. |
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.
In discussions with @dweindl, we have identified that this explanation is insufficient for rules that assign rates (where we only want to replace initial values not the rate at all timepoints). I am proposing the following text instead:
For all other entities, the value in the condition table either replaces the initial value or the value at all timepoints based on whether the model entity has a rate law assigned or not. For model entities that have constant algebraic assignments (but not necessarily constant values), i.e, that do not have a rate of change with respect to time assigned and that are not subject to event assignments, the algebraic assignment is replaced statically at all timepoints. Examples for such model entities are the targets of SBML `AssignmentRules`.
For all other entities, e.g., those that are assigned by SBML `RateRules`, only the initial value value can be assigned in the condition table. If an assignment of the rate of change with respect to time or event assignment is desired, the values of model entities that are used to define rate of change or event assignments must be assigned in the condition table. If no such model entities exist, assignment is not possible.
This text may, in fact ,replace the definition above and parameters/compartments/species could be listed as examples of the two categories.
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 @FFroehlich. Looks good to me.
@fbergmann : What do you think?
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.
@dweindl so it would mean, if the entity reference has an assignment rule, drop the assignment rule, right? That would essentially ensure that the value assigned holds for all timepoints. If that is what was meant, then its all good to me.
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.
Not really dropping the assignment rule, but rather replacing the value of the math
attribute of the AssignmentRule
by the provided value. (Well, it's the same as dropping the AssignmentRule
and replacing it by a different one with the same variable
.)
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.
@FFroehlich I included your suggestion. Could you please have another look?
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.
👍
Add abstraction for models. This helps to keep libsbml code closely together and to potentially accommodate non-SBML models in the future(PEtab-dev/PEtab#538). Wraps `libsbml.Model` using `petab.models.Model` and replaces the respective function arguments. In the (what I consider) most relevant function for downstream use, the `sbml_model` argument is kept, but deprecated. Co-authored-by: Dilan Pathirana <59329744+dilpath@users.noreply.github.com>
including test cases for multilanguage proposal PEtab-dev/PEtab#538
doc/_static/petab_schema.yaml
Outdated
@@ -78,8 +91,12 @@ properties: | |||
type: string | |||
description: PEtab visualization file name or URL. | |||
|
|||
mapping_file: |
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 all other file types we now allow for multiple files. It would be more coherent to also turn this into a list of filenames. Opinions?
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!
Co-authored-by: Dilan Pathirana <59329744+dilpath@users.noreply.github.com>
Co-authored-by: Dilan Pathirana <59329744+dilpath@users.noreply.github.com>
|
||
- ``modelEntityId`` [STRING, NOT NULL] | ||
|
||
A globally unique identifier defined 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.
A globally unique identifier defined in the model. | |
A globally unique identifier defined in the model, *that is not a valid PEtab ID*. |
That would make life much easier, since we won't have multiple PEtab parameter IDs mapping to the same model parameter. I don't see a good reason to support several aliases for the same entity, it will only make it more difficult to interpret the PEtab files.
CC @PEtab-dev/petab-editors
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.
Makes sense, but "valid PEtab ID" is a bit ambiguous to me. Maybe "that is not directly referenced in any other PEtab tables (its petabEntityId
should be used instead)."
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.
Maybe "that is not directly referenced in any other PEtab tables (its
petabEntityId
should be used instead)."
I am happy to change the wording, but my point was rather that it cannot be directly referenced elsewhere (due to identifier constraints), not only that it is not referenced elsewhere through it's original identifier.
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.
Ah right, then it makes sense 👍 The rest of the text about the mapping table makes this clear too. Looks good to me.
Motivation
There are a number of formats for specifying models in systems biology, each with their specific strengths and weaknesses. PEtab version 1.0.0 only allows Systems Biology Markup Language (SBML) models. While SBML is supported by a large number of tools, there are good reasons to use other formats. For example, rule-based model formats (e.g., BioNetGenLanguage) permit more abstract and compact specification of models based on rules, which are generalisations of reactions. Therefore, and based on user request (#436), we propose to lift PEtab’s restriction to SBML models and allow arbitrary model formats.
Proposed changes
Changes to the PEtab YAML file:
sbml_files
tomodels
models
entries will be model IDs (following the existing conventions for PEtab IDs) mapping to:location
: path / URL to the modellanguage
: model formatInitial set of model format identifiers (to be extended as needed):
sbml
cellml
bngl
pysb
Example:
Before:
After:
Changes to the format of existing tables/files:
All symbols that previously referenced the ID of SBML entities, such as parameter IDs or compartment IDs, now refer to (globally unique) named entities in the model, such as parameters, observables, expressions. For example, condition table columns may correspond to parameters, states, species of the referenced model.
For species, assignments in the condition table set the initial value at the beginning of the simulation for that condition, potentially replacing the initialization from preequilibration. For all other entities, values are statically replaced at all time points. For entities that assign values to other entities, such as SBML AssignmentRules, the value of the target of that rule is statically replaced at all time points.
Additional files
Mapping PEtab entity IDs to entity IDs in the model. This optional file may be used to reference model entities in PEtab files where the ID in the model would not be a valid identifier in PEtab (e.g., due to containing blanks, dots, or other special characters).
The tsv file has two mandatory columns:
petabEntityId
,modelEntityId
. Additional columns are allowed. modelEntityIds must be unique identifiers in the model. The mapping table must not map modelEntityIds to petabEntityIds that are also defined in any other part of the PEtab problem. modelEntityId may not refer to other petabEntityIds, including those defined in the mapping table. petabEntityIds defined in the mapping table may be referenced in condition, measurement, parameter and observable tables, but cannot be referenced in the model itself.For example, in SBML, local parameters may be referenced as
$reactionId.$localParameterId
, which are not valid PEtab IDs as they contain a.
character. Similarly, this table may be used to reference specific species in a BGNL model which may contain many unsupported characters such as,
,(
or.
. However, please note that IDs must exactly match the species names in the BNGL generated network file and no pattern matching will be performed.Implications
Co-authored by @FFroehlich @fbergmann. Also thanks to everybody participating in these discussions during the last COMBINE meeting.