The openCARP Simulation Environment for Cardiac Electrophysiology

Background and Objective Cardiac electrophysiology is a medical specialty with a long and rich tradition of computational modeling. Nevertheless, no community standard for cardiac electrophysiology simulation software has evolved yet. Here, we present the openCARP simulation environment as one solution that could foster the needs of large parts of this community. Methods and Results openCARP and the Python-based carputils framework allow developing and sharing simulation pipelines which automate in silico experiments including all modeling and simulation steps to increase reproducibility and productivity. The continuously expanding openCARP user community is supported by tailored infrastructure. Documentation and training material facilitate access to this complementary research tool for new users. After a brief historic review, this paper summarizes requirements for a high-usability electrophysiology simulator and describes how openCARP fulfills them. We introduce the openCARP modeling workflow in a multi-scale example of atrial fibrillation simulations on single cell, tissue, organ and body level and finally outline future development potential. Conclusion As an open simulator, openCARP can advance the computational cardiac electrophysiology field by making state-of-the-art simulations accessible. In combination with the carputils framework, it offers a tailored software solution for the scientific community and contributes towards increasing use, transparency, standardization and reproducibility of in silico experiments.

: PubMed-listed studies with "(atria* OR ventric* OR cardi*) AND ("computer model" OR "mathematical model" OR "computational model" OR "in silico")" in title or abstract. robust and versatile CEP simulation tools. The costs in terms of personnel necessary to develop such tools from scratch is daunting. For instance, the cost of development of CARP, the proprietary predecessor of openCARP, 142 is estimated to be around 50 person-years, not including any of the pre-and post-processing codes necessary for 143 building the workflows. 144 145 In other fields, certain software has been adopted by a critical mass of the community and thus have become the     • Import from (e.g. CellML [51] for cellular models) and export to (e.g. VTK [70]) common data formats 181 increases interoperability. Easy integration in existing pre-and post-processing workflows attracts a wider

191
The main objective of the openCARP initiative is to provide and establish simulation software within the CEP 192 modeling community which fulfills the criteria outlined above. To better meet these user requirements, the 193 openCARP modeling environment is organized as comprising two major software bundles, the actual code for 194 executing simulations, i.e., the openCARP simulator, and a framework for describing in silico experiments, referred 195 to as carputils (Fig. 2). The openCARP simulator has been developed with the following objectives in mind:

196
• Accessibility: The main distribution mechanism of openCARP emphasizes binary packaging for commonly 197 used platforms (currently Linux and macOS), platform-independent Docker containers, and a detailed   with adequate tools for their management provided as source code.

218
• Performance: openCARP has been implemented from scratch in C++ (2011 standard) but follows the same 219 discretization and solver schemes that have been used successfully in the predecessor code CARP [16,71]. 220 Briefly, the openCARP simulator spatially discretizes the partial differential equations underlying the mono-  structural entities such as fibrotic lesions or scars, functional heterogeneities, conduction system topology, 264 and parabolic solver method, to name but a few important ones.

265
• Productivity: carputils aims to boost productivity by providing standardized workflows for common tasks 266 such as setting conduction velocities, computing limit cycles of ionic models to generate initial states, 267 interrogate restitution properties, or post-processing and visualization of outputs.

268
• Abstraction: carputils uncouples technicalities of executing simulations on different platforms from ex-269 periment design such that they can be executed on any supported platform -from laptops to national HPC

293
In the following sections, we introduce the openCARP simulation framework by covering common workflows 294 for use cases ranging from the cellular to the organ level. Specifically, we elucidate the key processing steps 295 to implement a human biatrial model of persistent atrial fibrillation. An overview of a standardized processing 296 workflow is given in Fig. 3.     Figure 3: Overview of typical steps in an advanced CEP simulation study. Single Cell: AP phenotypes of different types of tissues are defined, paced to a stable limit cycle for a given set of cycle lengths, and dynamic properties such as APD restitution are evaluated. Initial state vectors y 0 are stored for each phenotype. Tissue: Conductivities σ ζ are determined for the mean spatial resolution ∆x of the organ-scale mesh, given surface-to-volume ratio, β, and numerical settings, ξ, by simulating uniform wavefront propagation in 1D along an eigenaxis, ζ, to obtain the desired CVs along fiber, f , sheet, s, and sheet-normal, n, direction, and anisotropy ratios between intra-and extracellular domain. CV restitution is evaluated then by measuring CV under increasingly shorter diastolic intervals. Organ: Organ models are generated using anatomical modeling pipelines, currently not included in openCARP, consisting of mesh generation, definition of fiber architecture, labeling of regions, computation of anatomical reference frames [95][96][97] and possibly the incorporation of a cardiac conduction system. Location and geometry of electrodes is defined, as are the pulse shapes used for stimulation and the pacing protocol. The organ model is then populated by assigning the ionic model initial states y 0 , as computed for each phenotype, to the respective tissues, and conductivities are assigned to the various regions to control CV. A pre-pacing protocol is applied to ascertain that the organ-scale model is as close as possible to a limit cycle for the given cycle length. Observations: Additional model components are set up to simulate observable data such as optical transmembrane voltages, V opt , invasively recorded electrograms Φ e , and non-invasive ECGs recorded from the body surface.
can easily be implemented in the .model files directly. An automated way to produce shared libraries that can 320 be loaded at run time allows using these custom-built models or adapt numerical time integration without having 321 to recompile the entire simulator. Additional models can be included using CellML, the XML-based community  vulnerable window or alternans can also be easily investigated in simple 1D geometries, for example, to extract 351 arrhythmia predictors [28]. Additionally, rate dependent changes (restitution) of parameters provide insight into 352 tissue behavior at fibrillatory activation rates. CV restitution is for example investigated in the carputils example 353 "CV Restitution".

354
Simple 2D geometries can be used, for example, to investigate the effects of spatially heterogeneous tissue 355 properties on arrhythmia dynamics. Spatial AP heterogeneity plays an import role in CEP as key features such as  In CEP modeling, two different approaches exist to account for spatial heterogeneity: either distinct regions are Figure 5: A: Activation times (t act ) in a model with four regions of varying excitability. From the bottom to the top region, the conductance of the fast sodium channel (g N a ) is set to 1x, 2x, 4x, and 8x g N a of the nominal value, respectively. Planar wave fronts initiated along the left edge of the sheet gradually distort due to these differences in CV. B: Initiation of a rotating wave in a ring model in a stylized representation of an atrial slice. The initial stimulus (delivered at 10 ms, marked by a star) induces bidirectional propagation (80 ms). At the end of the refractory period (303 ms), a second stimulus delivered at a different site located at a critical recovery isoline initiates a wave front that is blocked from propagating downwards where tissue is still refractory (rectangle). This leads to unidirectional propagation upwards (360 ms), setting up a sustained anatomical reentrant activation pattern (440 ms and 560 ms). This simulation was performed with ionic model settings corresponding to the persistent atrial fibrillation variant of the Courtemanche et al. model referred to above. In a healthy model, reentry cannot persist as the wavelength is too large for the given ring dimension. sheet models can also be used to trace functional reentries, but their induction is less simple compared to the ring.

382
The carputils example "Induction Protocols" presents four different methods to induce reentry in a sheet. ready to be used for openCARP simulation, are publicly available [110,111]. It is anticipated and foreseeable 398 that the number of publicly available anatomical twin models will further increase, hopefully in part due to the  between computation and accuracy desired: i) The bidomain setting, which considers bath-loading effects [127] 437 and allows for bidirectional interplay between intracellular and extracellular potential fields; ii) Alternatively, 438 extracellular potential can be recovered in a post-processing step from a given spatiotemporal transmembrane 439 voltage distribution obtained through, a monodomain simulation. Bishop & Plank [128] showed that the latter 440 approach (referred to as pseudo bidomain) retains accuracy in most cases, particularly with augmentation techniques 441 to recover bath-loading effects close to the tissue-bath interface [129], while drastically reducing the computational 442 cost; and iii) An even more simplistic approach is to assume that the cardiac tissue is immersed in a homogeneous 443 volume conductor of infinite size, which allows recovering the extracellular potential Φ e at specific points in space    to automate the extraction of all relevant information for a specific experiment, and create packages suitable for 497 archiving and sharing. A convenient interface to upload these simulation packages to an openCARP specific section 498 of the RADAR4KIT research data repository [133] will be provided in the near future. RADAR4KIT is a long-term 499 research data repository that adheres to the Open Archival Information System (OAIS) standard [134]. It provides 500 access control (public, private sharing via link), persistent DOI identifiers, standardized interfaces facilitating data 501 harvesting, and is integrated with research data meta repositories like re3data [135]. In this way, the carputils 502 experiment can be further evaluated by the scientific community, and future research can build upon it. Errors or 503 previously undiscovered artifacts can be found and described, leading to improved data and research quality in the