Skip to content

Commit 50313ad

Browse files
authored
Merge pull request #797 from ICB-DCM/release_0.10.11
Release 0.10.11 * Fixed setting initial conditions for preequilibration (#784) * Fixed species->parameter conversion during PEtab import (#782) * Set correct Matlab include directories in CMake (#793) * Extended and updated documentation (#785, #787) * Fix various SBML import issues * Run SBML test suite using github actions instead of travisCI (#789)
2 parents b39a39f + d19f9bc commit 50313ad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1426
-539
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: SBML semantic test suite
2+
on:
3+
push:
4+
branches:
5+
- develop
6+
- master
7+
- test_action
8+
pull_request:
9+
branches:
10+
- master
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v1
19+
with:
20+
fetch-depth: 1
21+
- name: apt
22+
run: sudo apt-get install -y swig3.0 libatlas-base-dev && sudo ln -s /usr/bin/swig3.0 /usr/bin/swig
23+
- run: AMICI_PARALLEL_COMPILE=2 ./scripts/installAmiciSource.sh
24+
- run: AMICI_PARALLEL_COMPILE=2 ./scripts/run-SBMLTestsuite.sh

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ script:
120120
- if [[ "$TRAVIS_OS_NAME" != "linux" ]] && [[ "$CI_MODE" == "test" ]]; then $FOLD cppcheck ./scripts/run-cppcheck.sh; fi
121121
- if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$CI_MODE" == "test" ]]; then $FOLD valgrind ./scripts/run-valgrind.sh; fi
122122
- if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$CI_MODE" == "test" ]]; then $FOLD codecov ./scripts/run-codecov.sh; fi
123-
- if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$TRAVIS_EVENT_TYPE" == "cron" ]]; then $FOLD sbmltestsuite ./scripts/run-SBMLTestsuite.sh; fi
124123

125124
after_failure:
126125
- $FOLD ls -alR

CMakeLists.txt

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,22 @@ target_link_libraries(${PROJECT_NAME}
167167
)
168168

169169
# Create targets to make the sources show up in IDEs for convenience
170-
add_custom_target(matlabInterface SOURCES src/interface_matlab.cpp src/returndata_matlab.cpp)
170+
171+
# For matlab interface
172+
add_custom_target(matlabInterface
173+
SOURCES src/interface_matlab.cpp src/returndata_matlab.cpp)
174+
set_target_properties(matlabInterface
175+
PROPERTIES INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}/include/")
176+
find_package(Matlab)
177+
if (${Matlab_FOUND})
178+
# In case we can find Matlab, use the respective include directories
179+
# for better IDE integration (set Matlab_ROOT_DIR cmake variable
180+
# if CMake cannot find your Matlab installation)
181+
set_property(TARGET matlabInterface APPEND
182+
PROPERTY INCLUDE_DIRECTORIES "${Matlab_INCLUDE_DIRS}")
183+
endif()
184+
185+
# For template files
171186
add_custom_target(
172187
fileTemplates
173188
SOURCES

CONTRIBUTING.md

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,12 @@
11
# How to contribute
22

3-
We are happy about contributions to AMICI in any form (new functionality, documentation, bug reports, ...).
3+
We are happy about contributions to AMICI in any form, be it new functionality,
4+
documentation, bug reports, or anything else.
45

5-
## Making code changes
6+
If you would to contribute to AMICI, a good start is looking for issues tagged
7+
[`good first issue`](https://github.com/ICB-DCM/AMICI/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
8+
or [`help wanted`](https://github.com/ICB-DCM/AMICI/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22).
9+
For other ideas or questions, just post an issue.
610

7-
When making code changes:
8-
9-
* Check if you agree to release your contribution under the conditions provided in `LICENSE`
10-
* Start a new branch from `develop`
11-
* Implement your changes
12-
* Submit a pull request to the `develop` branch
13-
* Make sure your code is documented appropriately
14-
* Run `mtoc/makeDocumentation.m` to check completeness of your documentation
15-
* Make sure your code is compatible with C++11, `gcc` and `clang`
16-
* when adding new functionality, please also provide test cases (see `tests/cpputest/`)
17-
* Write meaningful commit messages
18-
* Run all tests to ensure nothing was broken
19-
* Run `tests/cpputest/wrapTestModels.m` followed by CI tests `scripts/buildAll.sh && scripts/run-cpputest.sh`
20-
* Run `tests/testModels.m`
21-
* Run `make python-tests` in `build`
22-
* When all tests are passing and you think your code is ready to merge, request a code review
23-
24-
## Adding/Updating tests
25-
26-
To add new tests add a new corresponding python script (see, e.g., `tests/example_dirac.py`) and add it to and run `tests/generateTestConfigurationForExamples.sh`
27-
To update test results replace `tests/cpputest/expectedResults.h5` by `tests/cpputest/writeResults.h5.bak` [ONLY DO THIS AFTER TRIPLE CHECKING CORRECTNESS OF RESULTS]
28-
Before replacing the test results, confirm that only expected datasets have changed, e.g. using
29-
`h5diff -v -r 1e-8 tests/cpputest/expectedResults.h5 tests/cpputest/writeResults.h5.bak | less`
11+
For code contributions, please read our
12+
[developer's guide](documentation/development.md) first.

README.md

Lines changed: 113 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,133 @@
11
# About AMICI
22

3+
AMICI provides a multi-language (Python, C++, Matlab) interface for the
4+
[SUNDIALS](https://computing.llnl.gov/projects/sundials/) solvers
5+
[CVODES](https://computing.llnl.gov/projects/sundials/cvodes)
6+
(for ordinary differential equations) and
7+
[IDAS](https://computing.llnl.gov/projects/sundials/idas)
8+
(for algebraic differential equations). AMICI allows the user to read
9+
differential equation models specified as [SBML](http://sbml.org/)
10+
and automatically compiles such models as `.mex` simulation files
11+
(Matlab), C++ executables or Python modules.
312

4-
AMICI provides a multilanguage (Python, C++, Matlab) interface for the SUNDIALS solvers CVODES (for ordinary differential equations) and IDAS (for algebraic differential equations). AMICI allows the user to read differential equation models specified as SBML and automatically compiles such models as .mex simulation files, C++ executables or python modules. In contrast to the SUNDIALSTB interface, all necessary functions are transformed into native C++ code, which allows for a significantly faster simulation. Beyond forward integration, the compiled simulation file also allows for forward sensitivity analysis, steady state sensitivity analysis and adjoint sensitivity analysis for likelihood based output functions.
13+
In contrast to the (no longer maintained)
14+
[sundialsTB](https://computing.llnl.gov/projects/sundials/sundials-software)
15+
Matlab interface, all necessary functions are transformed into native
16+
C++ code, which allows for a significantly faster simulation.
517

6-
The interface was designed to provide routines for efficient gradient computation in parameter estimation of biochemical reaction models but is also applicable to a wider range of differential equation constrained optimization problems.
18+
Beyond forward integration, the compiled simulation file also allows for
19+
forward sensitivity analysis, steady state sensitivity analysis and
20+
adjoint sensitivity analysis for likelihood based output functions.
721

8-
Online documentation is available as [github-pages](http://icb-dcm.github.io/AMICI/).
22+
The interface was designed to provide routines for efficient gradient
23+
computation in parameter estimation of biochemical reaction models but
24+
it is also applicable to a wider range of differential equation
25+
constrained optimization problems.
926

10-
## Publications
11-
12-
[![DOI](https://zenodo.org/badge/43677177.svg)](https://zenodo.org/badge/latestdoi/43677177)
1327

14-
[Fröhlich, F., Kaltenbacher, B., Theis, F. J., & Hasenauer, J. (2017). Scalable Parameter Estimation for Genome-Scale Biochemical Reaction Networks. Plos Computational Biology, 13(1), e1005331. doi: 10.1371/journal.pcbi.1005331](https://doi.org/10.1371/journal.pcbi.1005331)
28+
## Features
1529

16-
[Fröhlich, F., Theis, F. J., Rädler, J. O., & Hasenauer, J. (2017). Parameter estimation for dynamical systems with discrete events and logical operations. Bioinformatics, 33(7), 1049-1056. doi: 10.1093/bioinformatics/btw764](https://doi.org/10.1093/bioinformatics/btw764)
30+
* SBML import (see details below)
31+
* Generation of C++ code for model simulation and sensitivity
32+
computation
33+
* Access to and high customizability of CVODES and IDAS solver
34+
* Python, C++, Matlab interface
35+
* Sensitivity analysis
36+
* forward
37+
* steady state
38+
* adjoint
39+
* first- and second-order
40+
* Pre-equilibration and pre-simulation conditions
41+
* Support for
42+
[discrete events and logical operations](https://academic.oup.com/bioinformatics/article/33/7/1049/2769435)
1743

18-
[Full list](documentation/references.md)
1944

2045
## Interfaces & workflow
2146

2247
The AMICI workflow starts with importing a model from either
2348
[SBML](http://sbml.org/) (Matlab, Python) or a Matlab definition of the
2449
model (Matlab-only). From this input, all equations for model simulation
2550
are derived symbolically and C++ code is generated. This code is then
26-
compiled into a C++ library, a Python module, or a Matab mex file and
27-
is then used for model simulation.
51+
compiled into a C++ library, a Python module, or a Matlab `.mex` file and
52+
is then used for model simulation.
53+
54+
![AMICI workflow](https://raw.githubusercontent.com/ICB-DCM/AMICI/master/documentation/gfx/amici_workflow.png)
55+
56+
## Getting started
57+
58+
AMICI installation instructions are provided
59+
[here](http://icb-dcm.github.io/AMICI/md__i_n_s_t_a_l_l.html).
60+
61+
To get you started with Python-AMICI the best way might be this
62+
[Jupyter notebook](https://github.com/ICB-DCM/AMICI/blob/master/python/examples/example_steadystate/ExampleSteadystate.ipynb).
63+
64+
For Matlab, various examples are available
65+
[here](https://github.com/ICB-DCM/AMICI/tree/master/matlab/examples).
66+
67+
68+
Comprehensive documentation on installation and usage of AMICI is available
69+
online at [http://icb-dcm.github.io/AMICI/](http://icb-dcm.github.io/AMICI/).
70+
71+
Any contributions to AMICI are welcome, read more contributing
72+
[here](http://icb-dcm.github.io/AMICI/md__c_o_n_t_r_i_b_u_t_i_n_g.html).
73+
74+
75+
### Getting help
76+
77+
In case of questions or problems with using AMICI, feel free to post an
78+
[issue](https://github.com/ICB-DCM/AMICI/issues) on Github. We are trying to
79+
get back to you quickly.
80+
81+
## Publications
82+
83+
**Citeable DOI for the latest AMICI release:**
84+
[![DOI](https://zenodo.org/badge/43677177.svg)](https://zenodo.org/badge/latestdoi/43677177)
85+
86+
There is a list of [publications using AMICI](documentation/references.md).
87+
If you used AMICI in your work, we are happy to include
88+
your project, please let us know via a Github issue.
89+
90+
When using AMICI in your project, please cite
91+
* [Fröhlich, F., Kaltenbacher, B., Theis, F. J., & Hasenauer, J. (2017). Scalable Parameter Estimation for Genome-Scale Biochemical Reaction Networks. Plos Computational Biology, 13(1), e1005331. doi: 10.1371/journal.pcbi.1005331](https://doi.org/10.1371/journal.pcbi.1005331)
92+
and/or
93+
* [Fröhlich, F., Theis, F. J., Rädler, J. O., & Hasenauer, J. (2017). Parameter estimation for dynamical systems with discrete events and logical operations. Bioinformatics, 33(7), 1049-1056. doi: 10.1093/bioinformatics/btw764](https://doi.org/10.1093/bioinformatics/btw764)
94+
95+
96+
## Status of SBML support in Python-AMICI
97+
98+
Python-AMICI currently passes 494 out of the 1780 (~28%) test cases from
99+
the semantic
100+
[SBML Test Suite](https://github.com/sbmlteam/sbml-test-suite/).
101+
102+
In additional, we currently plan to add support for the following features
103+
(see corresponding issues for details and progress):
104+
105+
- Events (currently Matlab-only)
106+
- Rate rules
107+
- Algebraic rules
108+
- Species assignment rules
109+
- Compartment assignment rules
110+
- Models without species
111+
- Logical operators
112+
113+
contributions are welcome.
114+
115+
However, the following features are unlikely to be supported:
116+
117+
- SBML extensions
118+
- `factorial()`, `ceil()`, `floor()`, due to incompatibility with
119+
symbolic sensitivity computations
120+
- initial assignments for parameters
121+
- `delay()` due to missing SUNDIALS solver support
28122

29-
![AMICI workflow](documentation/gfx/amici_workflow.png)
30123

31124
## Current build status
32125

33-
[![PyPI version](https://badge.fury.io/py/amici.svg)](https://badge.fury.io/py/amici)
34-
[![Build Status](https://travis-ci.com/ICB-DCM/AMICI.svg?branch=master)](https://travis-ci.com/ICB-DCM/AMICI)
35-
[![CodeCov](https://codecov.io/gh/ICB-DCM/AMICI/branch/master/graph/badge.svg)](https://codecov.io/gh/ICB-DCM/AMICI)
36-
[![Codacy](https://api.codacy.com/project/badge/Grade/945235766e344a7fa36278feab915ff6)](https://www.codacy.com/app/FFroehlich/AMICI?utm_source=github.com&utm_medium=referral&utm_content=ICB-DCM/AMICI&utm_campaign=Badge_Grade)
126+
<a href="https://badge.fury.io/py/amici" alt="PyPI version">
127+
<img src="https://badge.fury.io/py/amici.svg"></a>
128+
<a href="https://travis-ci.com/ICB-DCM/AMICI" alt="Build Status">
129+
<img src="https://travis-ci.com/ICB-DCM/AMICI.svg?branch=master"></a>
130+
<a href="https://codecov.io/gh/ICB-DCM/AMICI" alt="CodeCov">
131+
<img src="https://codecov.io/gh/ICB-DCM/AMICI/branch/master/graph/badge.svg"></a>
132+
<a href="https://www.codacy.com/app/FFroehlich/AMICI" alt="Codacy">
133+
<img src="https://api.codacy.com/project/badge/Grade/945235766e344a7fa36278feab915ff6"></a>

documentation/CI.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Continuous integration (CI) and tests
2+
3+
AMICI uses a continuous integration pipeline running on https://travis-ci.org/.
4+
This includes the following steps:
5+
6+
- Checking existence and format of documentation
7+
- Static code analysis (http://cppcheck.sourceforge.net/)
8+
- Unit and integration tests
9+
- Memory leak detection
10+
11+
More details are provided in the sections below.
12+
13+
The CI scripts and tests can be found in `tests/` and `scripts/`. Some of the
14+
tests are integrated with CMake, see `make help` in the build directory.
15+
16+
17+
## C++ unit and integration tests
18+
19+
To run C++ tests, build AMICI with `make` or `scripts/buildAll.sh`,
20+
then run `scripts/run-cpputest.sh`.
21+
22+
23+
## Python unit and integration tests
24+
25+
To run Python tests, run `../scripts/run-python-tests.sh` from anywhere
26+
(assumes build directory is `build/`) or run `make python-tests` in your build
27+
directory.
28+
29+
30+
## Matlab tests (not included in CI pipeline)
31+
32+
To execute the Matlab test suite, run `tests/testModels.m`.
33+
34+
35+
## Model simulation integration tests
36+
37+
Many of our integration tests are model simulations. The simulation results
38+
obtained from the Python and C++ are compared to results saved in an HDF5 file
39+
(`tests/cpputest/expectedResults.h5`).
40+
Settings and data for the test simulations are also specified in this file.
41+
42+
**Note:** The C++ code for the models is included in the repository under
43+
`models/`.
44+
This code is to be updated whenever `amici::Model` changes.
45+
46+
47+
### Regenerating C++ code of the test models
48+
49+
Regeneration of the model code must done whenever `amici::Model` or
50+
the Matlab model import routines change.
51+
52+
This is done with
53+
54+
tests/cpputest/wrapTestModels.m
55+
56+
**Note:** This is currently only possible from Matlab < R2018a. This should
57+
change as soon as 1) all second-order sensitivity code is ported to C++/Python,
58+
2) a non-SBML import exists for Python and 3) support for events has been added
59+
for Python.
60+
61+
62+
### Regenerating expected results
63+
64+
To update test results, run `make test` in the build directory,
65+
replace `tests/cpputest/expectedResults.h5` by
66+
`tests/cpputest/writeResults.h5.bak`
67+
[ONLY DO THIS AFTER TRIPLE CHECKING CORRECTNESS OF RESULTS]
68+
Before replacing the test results, confirm that only expected datasets have
69+
changed, e.g. using
70+
71+
h5diff -v -r 1e-8 tests/cpputest/expectedResults.h5 tests/cpputest/writeResults.h5.bak | less
72+
73+
74+
## Adding/Updating tests
75+
76+
To add new tests add a new corresponding python script (see, e.g.,
77+
`./tests/generateTestConfig/example_dirac.py`) and add it to and run
78+
`tests/generateTestConfigurationForExamples.sh`.
79+
Then regenerate the expected test results (see above).

0 commit comments

Comments
 (0)