-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #305 from ICB-DCM/develop
Release 0.0.13
- Loading branch information
Showing
68 changed files
with
3,010 additions
and
458 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,3 +103,4 @@ amici_models/* | |
*.txt | ||
test/doc/example/tmp/benchmark-models/ | ||
test/amici_models/* | ||
*.hdf5 |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
ipython | ||
nbsphinx | ||
sphinx_rtd_theme |
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
:members: | ||
:inherited-members: | ||
:special-members: | ||
:imported-members: |
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 @@ | ||
.. automodule:: pypesto.logging | ||
:members: | ||
:inherited-members: | ||
:special-members: | ||
:imported-members: |
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
:members: | ||
:inherited-members: | ||
:special-members: | ||
:imported-members: |
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
:members: | ||
:inherited-members: | ||
:special-members: | ||
:imported-members: |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
.. automodule:: pypesto.sample | ||
.. automodule:: pypesto.petab | ||
:members: | ||
:inherited-members: | ||
:special-members: | ||
:imported-members: |
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
:members: | ||
:inherited-members: | ||
:special-members: | ||
:imported-members: |
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
:members: | ||
:inherited-members: | ||
:special-members: | ||
:imported-members: |
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
:members: | ||
:inherited-members: | ||
:special-members: | ||
:imported-members: |
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 @@ | ||
.. automodule:: pypesto.sampling | ||
:members: | ||
:inherited-members: | ||
:special-members: | ||
:imported-members: |
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
:members: | ||
:inherited-members: | ||
:special-members: | ||
:imported-members: |
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 @@ | ||
.. automodule:: pypesto.storage | ||
:members: | ||
:inherited-members: | ||
:special-members: | ||
:imported-members: |
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
:members: | ||
:inherited-members: | ||
:special-members: | ||
:imported-members: |
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,2 @@ | ||
conditionId | ||
c0 |
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,11 @@ | ||
format_version: 1 | ||
parameter_file: parameters.tsv | ||
problems: | ||
- condition_files: | ||
- conditions.tsv | ||
measurement_files: | ||
- measurements.tsv | ||
observable_files: | ||
- observables.tsv | ||
sbml_files: | ||
- model_conversion_reaction.xml |
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,73 @@ | ||
from petab.C import * | ||
import petab | ||
|
||
import pandas as pd | ||
import numpy as np | ||
|
||
a0 = 1 | ||
b0 = 0 | ||
k1 = 0.8 | ||
k2 = 0.6 | ||
|
||
|
||
def analytical_a(t, a0=a0, b0=b0, k1=k1, k2=k2): | ||
return k2 * (a0 + b0) / (k1 + k2) \ | ||
+ (a0 - k2 * (a0 + b0) / (k1 + k2)) * np.exp(-(k1 + k2) * t) | ||
|
||
|
||
# problem -------------------------------------------------------------------- | ||
|
||
condition_df = pd.DataFrame(data={ | ||
CONDITION_ID: ['c0'], | ||
}).set_index([CONDITION_ID]) | ||
|
||
times = np.linspace(0, 3, 10) | ||
nt = len(times) | ||
simulations = [analytical_a(t, 1, 0, 0.8, 0.6) | ||
for t in times] | ||
sigma = 0.02 | ||
measurements = simulations + sigma * np.random.randn(nt) | ||
|
||
measurement_df = pd.DataFrame(data={ | ||
OBSERVABLE_ID: ['obs_a'] * nt, | ||
SIMULATION_CONDITION_ID: ['c0'] * nt, | ||
TIME: times, | ||
MEASUREMENT: measurements | ||
}) | ||
|
||
observable_df = pd.DataFrame(data={ | ||
OBSERVABLE_ID: ['obs_a'], | ||
OBSERVABLE_FORMULA: ['A'], | ||
NOISE_FORMULA: [sigma] | ||
}).set_index([OBSERVABLE_ID]) | ||
|
||
parameter_df = pd.DataFrame(data={ | ||
PARAMETER_ID: ['k1', 'k2'], | ||
PARAMETER_SCALE: [LOG] * 2, | ||
LOWER_BOUND: [1e-5] * 2, | ||
UPPER_BOUND: [1e5] * 2, | ||
NOMINAL_VALUE: [k1, k2], | ||
ESTIMATE: [1, 1], | ||
}).set_index(PARAMETER_ID) | ||
|
||
|
||
petab.write_condition_df(condition_df, "conditions.tsv") | ||
petab.write_measurement_df(measurement_df, "measurements.tsv") | ||
petab.write_observable_df(observable_df, "observables.tsv") | ||
petab.write_parameter_df(parameter_df, "parameters.tsv") | ||
|
||
yaml_config = { | ||
FORMAT_VERSION: 1, | ||
PARAMETER_FILE: "parameters.tsv", | ||
PROBLEMS: [{ | ||
SBML_FILES: ["model_conversion_reaction.xml"], | ||
CONDITION_FILES: ["conditions.tsv"], | ||
MEASUREMENT_FILES: ["measurements.tsv"], | ||
OBSERVABLE_FILES: ["observables.tsv"] | ||
}] | ||
} | ||
petab.write_yaml(yaml_config, "conversion_reaction.yaml") | ||
|
||
# validate written PEtab files | ||
problem = petab.Problem.from_yaml("conversion_reaction.yaml") | ||
petab.lint_problem(problem) |
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,11 @@ | ||
observableId simulationConditionId time measurement | ||
obs_a c0 0.0 1.0321025178287548 | ||
obs_a c0 0.3333333333333333 0.8009487310753414 | ||
obs_a c0 0.6666666666666666 0.6522988284518845 | ||
obs_a c0 1.0 0.5468869037277241 | ||
obs_a c0 1.3333333333333333 0.5338962162237411 | ||
obs_a c0 1.6666666666666665 0.48794403101997796 | ||
obs_a c0 2.0 0.44706262564427257 | ||
obs_a c0 2.333333333333333 0.4187284503596733 | ||
obs_a c0 2.6666666666666665 0.4586806097362004 | ||
obs_a c0 3.0 0.4106899489905058 |
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,2 @@ | ||
observableId observableFormula noiseFormula | ||
obs_a A 0.02 |
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,3 @@ | ||
parameterId parameterScale lowerBound upperBound nominalValue estimate | ||
k1 log 1e-05 100000.0 0.8 1 | ||
k2 log 1e-05 100000.0 0.6 1 |
Large diffs are not rendered by default.
Oops, something went wrong.
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,36 @@ | ||
FROM ubuntu:20.04 | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
ENV TZ=Europe/Berlin | ||
|
||
RUN apt update \ | ||
&& apt-get install -y \ | ||
g++ \ | ||
cmake \ | ||
libatlas-base-dev \ | ||
python3 \ | ||
python3-dev \ | ||
python3-pip \ | ||
swig \ | ||
git\ | ||
libhdf5-serial-dev\ | ||
&& ln -sf /usr/bin/swig4.0 /usr/bin/swig | ||
|
||
RUN pip3 install python-libsbml>=5.17.0 | ||
|
||
COPY amici.tar.gz /tmp | ||
|
||
ENV AMICI_CXXFLAGS -fopenmp | ||
ENV AMICI_LDFLAGS -fopenmp | ||
|
||
RUN pip3 install -U --upgrade pip wheel \ | ||
&& mkdir -p /tmp/amici/ \ | ||
&& cd /tmp/amici \ | ||
&& tar -xzf ../amici.tar.gz \ | ||
&& cd /tmp/amici/python/sdist \ | ||
&& python3 setup.py -v sdist \ | ||
&& pip3 install -v $(ls -t /tmp/amici/python/sdist/dist/amici-*.tar.gz | head -1)[petab,pysb] \ | ||
&& rm -rf /tmp && mkdir /tmp | ||
|
||
# RUN pip3 install git+https://github.com/ICB-DCM/pyPESTO.git@develop#egg=pypesto | ||
RUN pip3 install pyPESTO jupyter pyswarm dlib |
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,26 @@ | ||
# AMICI & pyPESTO with Docker | ||
|
||
## Create image | ||
|
||
In the AMICI base directory run: | ||
|
||
```bash | ||
git archive -o <path to pypesto base directory>/docker/amici.tar.gz --format=tar.gz HEAD | ||
cd <path to pypesto base directory>/docker && docker build -t $USER/amici_pypesto:latest . | ||
``` | ||
|
||
To install pyPESTO from a particular branch, e.g. develop, use th following | ||
line in the Dockerfile | ||
|
||
``` | ||
RUN pip3 install git+https://github.com/ICB-DCM/pyPESTO.git@develop#egg=pypesto | ||
``` | ||
|
||
environment file can be used with `--set-env` option of `ch-run` command. From | ||
charliecloud documentation: | ||
|
||
" | ||
The purpose of `--set-env=FILE` is to set environment variables that cannot be | ||
inherited from the host shell, e.g. Dockerfile ENV directives or other | ||
build-time configuration | ||
" |
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,2 @@ | ||
AMICI_CXXFLAGS=-fopenmp | ||
AMICI_LDFLAGS=-fopenmp |
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 |
---|---|---|
@@ -1,3 +1,10 @@ | ||
""" | ||
Logging | ||
======= | ||
Logging convenience functions. | ||
""" | ||
|
||
import logging | ||
|
||
|
||
|
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
Oops, something went wrong.