AMICI: high-performance sensitivity analysis for large ordinary differential equation models

Abstract Summary Ordinary differential equation models facilitate the understanding of cellular signal transduction and other biological processes. However, for large and comprehensive models, the computational cost of simulating or calibrating can be limiting. AMICI is a modular toolbox implemented in C++/Python/MATLAB that provides efficient simulation and sensitivity analysis routines tailored for scalable, gradient-based parameter estimation and uncertainty quantification. Availabilityand implementation AMICI is published under the permissive BSD-3-Clause license with source code publicly available on https://github.com/AMICI-dev/AMICI. Citeable releases are archived on Zenodo. Supplementary information Supplementary data are available at Bioinformatics online.


Introduction
Ordinary Differential Equation (ODE) models are widely used in systems biology, for example, to elucidate dynamic processes and to predict response to perturbations.Model parameters have to be inferred from data, which can be computationally intensive as thousands of simulations may be required.This is challenging for large models, with many state variables and parameters, where simulations take seconds to minutes (Fröhlich et al., 2018).
Inference can benefit from accurate sensitivities (Villaverde et al., 2018), i.e., derivatives of model outputs with respect to model parameters.Accurate sensitivities can be computed using forward, adjoint or steady-state approaches, but benefit from symbolic derivatives of model equations, which are labor-intensive and error-prone to compute manually.
The recent surge of genome-scale perturbation data as well as respective comprehensive models has increased the demand for methods for scalable sensitivity computation for ODE models.To address this demand, we introduce AMICI, a high-performance simulation and sensitivity analysis library.AMICI is implemented in C++ and Python, and provides model import from widely used formats such as the Systems Biology Markup Language (SBML) (Hucka et al., 2003), BioNetGen Language (BNGL) (Harris et al., 2016) and Kappa (Boutillier et al., 2018), and generates high-performance-computing (HPC) ready modules.These modules provide model-specific simulation and sensitivity computation routines, which can be accessed from Python, C++, and MATLAB.For parameter estimation problems specified in PEtab (Schmiester et al., 2020), AMICI can evaluate the objective function and its gradient.

Methods
For high simulation performance, AMICI reads models from high-level formats, then translates the model and symbolically derived expressions to C++ code.As symbolic processing can be computationally intensive, AMICI symbolically only computes partial derivatives, total derivatives are computed through (sparse) matrix multiplication and addition at runtime.This expedites model compilation and simulation.
To simulate stiff, large models, efficient linear solvers are crucial.AMICI features several direct dense, direct sparse and implicit solvers.For sensitivity analysis, AMICI implements forward, adjoint (Fröhlich et al., 2017), and steady-state (Lines et al., 2019) methods and combinations thereof (see Supplementary Information).

Implementation
The AMICI library is implemented in C++14 and relies on SUNDIALS (Hindmarsh et al., 2005) and SuiteSparse (Davis and Palamadai Natarajan, 2010) for simulation and sensitivity computation.For matrix multiplication, a CBLAS-compatible library is used (e.g.ATLAS, OpenBLAS, Intel MKL).
Model import is implemented in Python and supports several widely used formats (Figure 1).SBML import is implemented using libSBML (Bornstein et al., 2008), Kappa and BNGL import is implemented via PySB (Lopez et al., 2013).Symbolic processing is performed using SymPy (Meurer et al., 2017).Compilation has been tested with GCC, Clang, Intel and MinGW on Linux, MacOS and Windows platforms.For interoperability, AMICI provides CMake files and Dockerfiles.
AMICI ships with a MATLAB interface and implements a Python interface using SWIG, which can be extended to other languages.Simulation and compilation are highly configurable with the API documented on Read the Docs and in example notebooks.For HPCreadiness, AMICI implements OpenMP parallelization over experimental conditions and is thread-safe.Simulation and sensitivity analysis rely on intricate theory that is complex, error-prone to implement.Accordingly, we implemented an extensive continuous integration test pipeline.

Discussion
There is a rich ecosystem of tools for model simulation.To avoid duplication, we ensured good interoperability with other tools: AMICI does not provide a model development environment, but permits model import from standard formats.Similarly, AMICI is not part of an integrated parameter estimation framework, but features a flexible, well-documented API.Currently, several parameter estimation tools can interface AMICI, including pyPESTO (Schälte et al., 2020) and parPE (Schmiester et al., 2019).This modular design aims at researchers developing new methods or tools for parameter estimation that would benefit from

Figure 1 :
Figure 1: Outline of model compilation in AMICI.Models, specified in SBML or PySB, are imported in Python.This generates efficient C++ code for model equations and simulation bindings for Python, C++ and MATLAB.
Simulation results are verified for the SBML semantic test suite, where AMICI passes 862 out of 1780 tests (appropriate error messages to indicate unsupported features for remaining tests).Simulation results are compared against PySB simulations for 17 BNGL validation models and examples, where AMICI passes all tests.Sensitivity results are checked by regression tests covering, e.g.forward, adjoint and steady-state sensitivities.Performance tests check computation time for model import, simulation and sensitivity analysis of a large model.Unit and documentation tests, static code analysis, and memory leak checks are included, and code review is enforced for all contributions.