Cacatoo: building, exploring, and sharing spatially structured models of biological systems

In the field of ecology and evolution, a treasure trove of data has revealed the importance of spatial structure and biogeography. Despite these rich data sets, our conceptual understanding of how spatial structure shapes biodiversity, pathogenicity, and microbial pangenomes is lagging behind. For example, we only have a limited understanding of how interactions at the microscale (molecular machinery, bacteriophages, metabolism) scale up to define ecoevolutionary dynamics of microbial communities (Rainey & Quistad, 2020) and metaorganisms (Jaspers et al., 2019). To develop our intuition on these systems, I argue we need to embrace multiple levels and structural complexity in our models. Cacatoo is a toolbox developed to make it easy to design, explore, and share simulations of such systems. Simulations can be interactively explored from a web browser, allowing the user to change parameters and observe graphs in real-time. Cacatoo is designed to be both easy-to-use and extendable, making it suitable for beginners and experts alike. Because it requires no installation and works on practically every computer, it is also ideal for teaching purposes and student projects. In summary, Cacatoo provides opportunities for everyone to get involved in spatially structured modelling.


Summary
In the field of ecology and evolution, a treasure trove of data has revealed the importance of spatial structure and biogeography. Despite these rich data sets, our conceptual understanding of how spatial structure shapes biodiversity, pathogenicity, and microbial pangenomes is lagging behind. For example, we only have a limited understanding of how interactions at the microscale (molecular machinery, bacteriophages, metabolism) scale up to define ecoevolutionary dynamics of microbial communities (Rainey & Quistad, 2020) and metaorganisms (Jaspers et al., 2019). To develop our intuition on these systems, I argue we need to embrace multiple levels and structural complexity in our models. Cacatoo is a toolbox developed to make it easy to design, explore, and share simulations of such systems. Simulations can be interactively explored from a web browser, allowing the user to change parameters and observe graphs in real-time. Cacatoo is designed to be both easy-to-use and extendable, making it suitable for beginners and experts alike. Because it requires no installation and works on practically every computer, it is also ideal for teaching purposes and student projects. In summary, Cacatoo provides opportunities for everyone to get involved in spatially structured modelling.

Statement of need
Complex systems like microbial communities have many emergent properties which arise from the interactions between individual components. As such, predicting exactly how these systems will behave and respond to various stimuli is difficult. Simulation offers a solution by allowing a modeller to simply put in what they deem important, and observe the outcome. As such, direct visual feedback is an important part of exploring the model. Not only is one more likely to detect programming mistakes this way, but it also aids in communicating the models to peers and the general public. Many current modelling frameworks require knowledge of C (e.g. Cash and Morpheus (Starruß et al., 2014)), motivated by its unparalleled speed. However, the learning curve for programming in C is steep, and even an experienced user may take days to track down a simple bug. Moreover, sharing your model with other users can be a pain, as installation is slightly different depending on each operating system. With Javascript tools like d3.js (Zhu, 2013) and Artistoo (Wortel & Textor, 2021) paving the way, Cacatoo was developed to overcome these issues, making spatially structured models easy, fast, sharable, and customisable. Other than Artistoo, which first and foremost specialises in tissue simulations, Cacatoo provides easy-to-use functions for individual-based modelling (roulette wheel selection, random walks, neighbourhood retrieval), reaction-diffusion systems (ordinary differential equations), and tools to build your own user interface (displays, graphs, sliders, interaction with mouse and keyboard, etc.). The basic recipe of a Cacatoo simulation is simple (Figure 1), and the extensive documentation provides ample opportunity for students and advanced modellers to get started right away! van Dijk, B., (2022). Cacatoo: building, exploring, and sharing spatially structured models of biological systems. Journal of Open Source Software, 7(70), 3948. https://doi.org/10.21105/joss.03948

Use cases
Potential use cases for Cacatoo range from exploring the consequences of mutations in space (Fusco et al., 2016) to setting up a multi-level eco-evolutionary system where selfish genetic elements co-evolve with their cellular hosts. The latter model is published as part of the special issue "The secret live of mobile genetic elements" (Hall et al., 2022), which revealed that transposable elements can promote genome streamlining (Dijk et al., 2021). Fullmer is currently in the process of exploring the impact of horizontal gene transfer on the black queen hypothesis (Fullmer et al., 2015). van

Financial support / Acknowledgements
BD acknowledges support from the Deutsche Forschungsgemeinschaft (DFG) Collaborative Research Center 1182 'Origin and Function of Metaorganisms' (grant no. SFB1182, Project C4 to P.R.).
The author acknowledges Inge Wortel and Johannes Textor for paving the way with their toolbox Artistoo, and for helping me with the early stages of development. Next, I would like to thank Jeroen Meijer for testing and debugging the library.