-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add sllh computation back to
petab_objective.simulate_petab
(#1548)
* add sllh to `simulate_petab` * use ExpData for plist if available * use plist if set; breakpoint at error; preliminary test * add sensi test to preexisting benchmark model test * remove outdated test and test cases * add FD check for petab problems; add petab problem test case for SLLH; clean up * typo, RTOL * fix paths * docs * Apply suggestions from code review Co-authored-by: Yannik Schälte <31767307+yannikschaelte@users.noreply.github.com> Co-authored-by: Daniel Weindl <dweindl@users.noreply.github.com> * reviews: docstring;error handling;optional sllh aggregation * Apply suggestions from code review Co-authored-by: Fabian Fröhlich <fabian_froehlich@hms.harvard.edu> * review: clean up * ignore parameters missing due to estimate=0 * add test for petab benchmark models * use fiddy * develop merge * fix after merge * merge conflicts * restore changes * make scaled gradients optional, default to linear * test scaled and unscaled * add fiddy to installation * fix deps * update for fiddy redesign * fix fiddy version * update benchmark settings * move tests * add fiddy * Update test_benchmark_collection_models.yml * fix paths * Update test_petab_benchmark.py * restrict test set * Update test_petab_benchmark.py * Update test_petab_benchmark.py * Update test_petab_benchmark.py * Update test_petab_benchmark.py * use fiddy main * Update test_petab_benchmark.py * oopsie * address code review * remove custom grad check methods; adjust test * Update python/sdist/amici/petab_objective.py Co-authored-by: Dilan Pathirana <59329744+dilpath@users.noreply.github.com> --------- Co-authored-by: Daniel Weindl <dweindl@users.noreply.github.com> Co-authored-by: Yannik Schälte <31767307+yannikschaelte@users.noreply.github.com> Co-authored-by: Fabian Fröhlich <fabian_froehlich@hms.harvard.edu> Co-authored-by: Daniel Weindl <daniel.weindl@helmholtz-muenchen.de> Co-authored-by: Fabian Fröhlich <fabian@schaluck.com> Co-authored-by: Fabian Fröhlich <fabian.frohlich@crick.ac.uk>
- Loading branch information
1 parent
255be19
commit d2fb35e
Showing
17 changed files
with
793 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
A Lotka-Volterra model, based on the model provided as an example in the `yaml2sbml` package: https://github.com/yaml2sbml-dev/yaml2sbml | ||
|
||
The PEtab problem can be created by running `bash model/convert_to_petab.sh` (test on Ubuntu 20.04) inside the `model` directory, in a Python 3 environment with `yaml2sbml`: https://pypi.org/project/yaml2sbml/ | ||
|
||
The model is augmented with new parameters `departure_prey` and `arrival_predator`, to allow for a steady-state under certain conditions. This results in a model that can pre-equilibrate, then switch to the expected oscillations of a Lotka-Volterra model. |
24 changes: 24 additions & 0 deletions
24
python/tests/petab_test_problems/lotka_volterra/model/convert_to_petab.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
set -eou pipefail | ||
script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
petab_path=$script_dir/../petab | ||
|
||
mkdir -p "${petab_path}" | ||
|
||
# Validate input yaml2sbml model | ||
yaml2sbml_validate lotka_volterra.yaml | ||
|
||
# Copy measurements to PEtab directory | ||
cp "${script_dir}/measurements.tsv" "$petab_path/measurements.tsv" | ||
|
||
# Write the PEtab problem | ||
python "${script_dir}/writer.py" | ||
|
||
# Remove condition parameters from PEtab parameters table | ||
for condition_parameter in beta delta departure_prey arrival_predator | ||
do | ||
sed -i "/^${condition_parameter}/d" "${petab_path}/parameter*" | ||
done | ||
|
||
# Validate the PEtab problem | ||
petablint -vy "${petab_path}/problem.yaml" |
Oops, something went wrong.