-
Notifications
You must be signed in to change notification settings - Fork 6
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
Generation of condition-specific SBML models #108
Conversation
New function `petab.get_model_for_condition` to generate condition-specific SBML models based on a PEtab problem.
Codecov Report
@@ Coverage Diff @@
## develop #108 +/- ##
===========================================
+ Coverage 75.90% 76.10% +0.19%
===========================================
Files 27 27
Lines 2976 3021 +45
Branches 721 733 +12
===========================================
+ Hits 2259 2299 +40
- Misses 535 537 +2
- Partials 182 185 +3
Continue to review full report at Codecov.
|
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.
👍
Looks like compartments in a conditions table aren't yet handled
petab/sbml.py
Outdated
if sbml_species.isSetInitialConcentration(): | ||
sbml_species.setInitialConcentration(new_value) | ||
elif sbml_species.isSetInitialAmount(): | ||
sbml_species.setInitialAmount(new_value) |
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.
else: raise
? or default to concentration or amount based on hasOnlySubstanceUnits
?
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.
One of those two has to be set to be valid SBML iirc. But let's raise to be on the safe side.
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.
Apparently fine if e.g. initial assignment is used. From SBML spec:
Missing initialAmount and initialConcentration
values implies that their values either are unknown, or to be obtained from an external source, or determined
by an initial assignment (Section 4.8 on p. 56) or other SBML construct elsewhere 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.
Ah, thanks. Okay, then we need to check hasOnlySubstanceUnits
indeed.
Oops. Thanks :). |
Co-authored-by: Dilan Pathirana <[email protected]>
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.
👍
Another source of initial values is from assignment rules and algebraic rules. From SBML spec:
If the species’ constant attribute is “ false ”, the species’ quantity value may be overridden by an InitialAssignment or changed by AssignmentRule or AlgebraicRule [...]
Doesn't make sense to override such rules just to set an initial value, but maybe such a contradiction (e.g. compartment in the condition table, but also with an assignment rule) could be identified by petablint
.
Co-authored-by: Dilan Pathirana <[email protected]>
True. It's currently not well defined what should happen in this case (see also discussion in PEtab-dev/PEtab#513). Let's remove all rules targeting overridden entities for now. |
Co-authored-by: Dilan Pathirana <[email protected]>
Co-authored-by: Dilan Pathirana <[email protected]>
Co-authored-by: Dilan Pathirana <[email protected]>
New function
petab.get_model_for_condition
to generate condition-specific SBML models based on a PEtab problem.