PyRates-A code-generation tool for modeling dynamical systems in biology and beyond

PLoS Comput Biol. 2023 Dec 27;19(12):e1011761. doi: 10.1371/journal.pcbi.1011761. eCollection 2023 Dec.

Abstract

The mathematical study of real-world dynamical systems relies on models composed of differential equations. Numerical methods for solving and analyzing differential equation systems are essential when complex biological problems have to be studied, such as the spreading of a virus, the evolution of competing species in an ecosystem, or the dynamics of neurons in the brain. Here we present PyRates, a Python-based software for modeling and analyzing differential equation systems via numerical methods. PyRates is specifically designed to account for the inherent complexity of biological systems. It provides a new language for defining models that mirrors the modular organization of real-world dynamical systems and thus simplifies the implementation of complex networks of interacting dynamic entities. Furthermore, PyRates provides extensive support for the various forms of interaction delays that can be observed in biological systems. The core of PyRates is a versatile code-generation system that translates user-defined models into "backend" implementations in various languages, including Python, Fortran, Matlab, and Julia. This allows users to apply a wide range of analysis methods for dynamical systems, eliminating the need for manual translation between code bases. PyRates may also be used as a model definition interface for the creation of custom dynamical systems tools. To demonstrate this, we developed two extensions of PyRates for common analyses of dynamic models of biological systems: PyCoBi for bifurcation analysis and RectiPy for parameter fitting. We demonstrate in a series of example models how PyRates can be used in combination with PyCoBi and RectiPy for model analysis and fitting. Together, these tools offer a versatile framework for applying computational modeling and numerical analysis methods to dynamical systems in biology and beyond.

MeSH terms

  • Brain
  • Computer Simulation
  • Ecosystem*
  • Models, Biological
  • Software
  • Systems Biology* / methods

Grants and funding

The study is funded by the joint efforts of The Michael J. Fox Foundation for Parkinson’s Research (MJFF) and the Aligning Science Across Parkinson’s (ASAP) initiative. The salary of R.G. was paid via the grant ASAP-020551 which A.K. received and which MJFF administers on behalf of ASAP and itself. The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.