Self-restoration of cardiac excitation rhythm by anti-arrhythmic ion channel gating

Homeostatic regulation protects organisms against hazardous physiological changes. However, such regulation is limited in certain organs and associated biological processes. For example, the heart fails to self-restore its normal electrical activity once disturbed, as with sustained arrhythmias. Here we present proof-of-concept of a biological self-restoring system that allows automatic detection and correction of such abnormal excitation rhythms. For the heart, its realization involves the integration of ion channels with newly designed gating properties into cardiomyocytes. This allows cardiac tissue to i) discriminate between normal rhythm and arrhythmia based on frequency-dependent gating and ii) generate an ionic current for termination of the detected arrhythmia. We show in silico, that for both human atrial and ventricular arrhythmias, activation of these channels leads to rapid and repeated restoration of normal excitation rhythm. Experimental validation is provided by injecting the designed channel current for arrhythmia termination in human atrial myocytes using dynamic clamp.


Introduction
Living organisms strive to maintain a stable internal environment through continuous regulation of the body's physiological processes. Such homeostatic regulation involves three principal mechanisms: detection, processing and effectuation. The 'detector' senses a change in the environment, communicates it to a 'processor', which processes the information and commands the 'effector' to react appropriately (Horrobin, 1970). Given their highly conserved nature, these 'detector-effector' (DE) systems are considered to be effective means to respond to changes that, if sustained, may cause harm to the organism. Light sensitivity coupled to movement is an example of a detectoreffector mechanism for the full scale of evolved organisms, as exemplified by phototaxis in unicellular organisms (Nagel et al., 2002) and pupil reflex in higher order vertebrates (Sherman and Stark, 1957). At the cellular level, many DE systems operate through ion channels, which may act as functional detector-effector units. These channels can detect changes in, for example, voltage, hormones or light to which they respond by activation to generate a flow of ions (i.e. an electrical current) or by inactivation to stop a flow of ions (Catterall, 2000;Stojilkovic et al., 2010;Govorunova et al., 2015). Although the human body maintains a multitude of DE systems that contribute to its every day function, a DE system responding specifically to sustained hazardous heart rhythm disturbances seems not to have been evolved. Nevertheless, under natural cardiac electrophysiological conditions, heart rhythm disorders can terminate spontaneously, resulting in non-sustained arrhythmias (Bub et al., 2003;Katritsis et al., 2012). For those that are sustained, the most effective means for acute restoration of sinus rhythm, especially in atrial and ventricular fibrillation (AF and VF), consists of delivery of high-voltage shocks to the heart for arrhythmia termination (i.e. defibrillation) (Wellens et al., 1998;Link et al., 2010;Laslett et al., 2012;Borne et al., 2013;Kumar and Schwartz, 2014). This therapy is based on an electronic detector (i.e. sensor of electrical activity) and effector (i.e. electroshock generator), which are incorporated into a single device. Implantation of this device (the implantable cardioverter defibrillator or ICD) allows continuous monitoring of cardiac rhythm in order to ensure rapid arrhythmia detection for automatic delivery of electroshocks. Due to their non-biological nature, these electronic DE systems have a number of shortcomings including limited battery lives, technical malfunction and inappropriate shock deliveries. However, from a patient's perspective, major concerns are the severe pain, anxiety and depression resulting from the electroshocks (Sears et al., 2011), not to mention the possibility of permanent tissue damage (Ashihara and Trayanova, 2005). Now imagine that the mammalian heart itself would be able to detect and terminate an arrhythmia in an automatic and repetitive manner just like the ICD, thereby eliminating the need for traumatizing electroshocks. In this article, we present the theoretical fingerprints of a biological DE system that is tailored to detect and terminate cardiac arrhythmias. We refer to it as the Biologically Integrated Cardiac Defibrillator, or BioICD. We envision the BioICD as an ion channel of which the gating is customized to differentiate between sinus rhythm and arrhythmia, and to act accordingly. Conceptually, such an ion channel could be implemented by proper choice of frequency-dependent activation-inactivation kinetics. We use computer modelling to design the kinetics of this channel via three different approaches and demonstrate the possibility for human cardiac tissue to auto-detect and terminate tachyarrhythmias and fibrillation in both atria and ventricles once this type of channel has been integrated. We prove the concept of our study in simulated monolayers of human cardiomyocytes and in anatomically realistic in silico models of the human atrial and ventricular musculature, by showing that in each case considered, the arrhythmia can be detected and terminated to restore sinus rhythm, within seconds of its initiation, on a fully biological basis. In order to provide experimental evidence of the validity of the BioICD concept, we exploited the dynamic clamp technique (Wilders, 2006) to realise the designed BioICD function with the use of optogenetically modified human atrial myocytes that are optically stimulated at arrhythmic frequencies.

Results
Our concept of the BioICD involves the introduction of a new type of ion channel with specific properties into the sarcolemma of cardiac muscle cells, which is possible through genetic modification (Nyns et al., 2016). We explored the properties of this ion channel in silico and found that in order to provide the basis for a DE system, such channel should have the ability to sense the frequency of electrical activation through gating mechanisms that are controlled by the cell's membrane potential (voltage difference across the cell membrane). In the subsequent sections, we show the behaviour of a heart endowed with the new ion channel (referred to as 'BioICD'), and compare it with the normal 'Control' situation.

Principle
In order to show the behaviour of the BioICD ion channel, we first demonstrate how it works in a simplified controllable system, that is tachyarrhythmias in a 2D in silico model consisting exclusively of isotropically arranged human ventricular myocytes. Three possible realisations of this ion channel are provided, each of them relying on a different ionic mechanism: Model I is a minimal model that allows frequency-dependent gating, Model II has a different inactivation mechanism, and Model III has a gating mechanism insensitive to the shape of the action potential (AP). The results of Model II and III can be found in the Supporting Information (Appendix 1 Figures 1, 2, 3). The detailed description of Model I together with its results is provided below. Figure 1A illustrates the control situation for a simulation experiment in a monolayer without expression of the BioICD channel. In this situation, induction of a figure-of-eight reentrant source, via an extrasystole during sinus rhythm, results in a sustained reentrant tachyarrhythmia. In monolayers expressing the BioICD channel (see section BioICD model I below), the exact same stimulation first leads to the development of the same reentrant pattern, however then, because of the concurrent increase in activation frequency, the BioICD channel is activated, resulting in termination of the figure-of-eight reentry and restoration of sinus rhythm ( Figure 1B). Representative voltage traces ( Figure 1C) demonstrate how the action of the BioICD channel can be recognized in the membrane potential behaviour of a single cardiomyocyte. Of note, the presence of the BioICD channel exerts no influence on wave propagation during sinus rhythm, both before and after the arrhythmia.

BioICD model I
The schematic representation of Model I is presented in Figure 2A. The ion channel comprises a group of subunits that exhibit two states: open (O) and closed (C), with voltage-dependent transitions between these states, indicated by arrows in Figure 2A. The ion channel subunits slowly move to the open state O when voltage (V) exceeds V threshold , (V threshold is typically around À60 mV). When V<V threshold , the channel subunits move back to the closed state C. Thus, at any given moment in time, the number of open subunits increases with the total time spent by the cardiomyocyte in the suprathreshold (depolarized) state. This ensures that at low activation frequencies the subunits alternate between open and closed states (black line in Figure 2B), whereas at high frequencies, temporal summation of activation leads to a higher number of subunits in the open state (black line in Figure 2C). We assumed that the ion channel can produce current only if all of its identical subunits are in an open state. Such collective kinetics is required to render the current amplitude sensitive to changes in the activation frequency. In this case, the conductivity of the whole collection of n independent, non-cooperative subunits is proportional to the n th power of O (the fraction of subunits in the open state O). Higher values of n provide higher selectivity to the frequency changes, bringing it closer to the all-or-nothing response. Given these conditions, we found that a good intermediate solution for effective collective behaviour, which ensures simplicity (low n) and accuracy (high n), is n ¼ 8. Because we require the BioICD channel to produce a depolarizing current upon activation (in line with classical defibrillation), its reversal potential was set close to 0 mV, thus assuming a simple pore without selectivity for any specific ion.
As channel activation occurs at high frequency, it only produces current after the onset of a tachyarrhythmia (i.e. after a substantial and sustained increase in activation frequency). Activation of this channel raises the membrane potential everywhere in the tissue to » 0 mV, and the ion channel subunits continue to stay in the open state unless they are influenced to move back to the closed state by some separate, yet integrated mechanism. Thus, we included an additional deactivation mechanism to restore the initial closed state of the BioICD channel. A 'deactivating agent' a is designed to accumulate in the a 1 state if the membrane potential is close to 0 mV for a substantial amount of time. Accumulation of a 1 potentiates the deactivation of the BioICD channel (transition from open state O to closed state C).
In electrophysiological terms, only if the cell stays depolarized longer than the normal duration of the plateau in an AP, a 1 accumulates and facilitates the closure of the BioICD channel. A complete mathematical description and equations of this channel are given in the Materials and methods section (Equations 1-6), and the anti-arrhythmic action of this ion channel at the tissue level is illustrated in Figure 1.

Self-restoration of excitation rhythm in different virtual pathological substrates
Sustained cardiac arrhythmias typically occur in diseased myocardial tissue. Our simulations of human ventricular monolayers with BioICD channels demonstrate that abnormally fast rhythms can be detected and terminated successfully in a variety of pathological substrates. This is illustrated in Figure 3 (and also in Supporting Videos 1-4) for rotor-driven arrhythmias in substrates for (i) ventricular tachycardia (VT) ( Figure 3A and E), (ii) VF ( Figure 3B and F), (iii) VT in fibrotic tissue ( Figure 3C and G) and (iv) VT in the presence of an anatomical scar ( Figure 3D and H). In each case, the BioICD channel activates within 1 s after initiation of the arrhythmias, thereby electrically synchronizing the whole simulation domain within 300 ms and resetting all activity within 700 ms for VT based on functional reentry ( Figure 3A and E), 1000 ms for VF ( Figure 3B and F) and VT in fibrosis (Figure 3C  and G), and 600 ms for anatomical reentry ( Figure 3D and H). Sinus rhythm resumes in all cases, once the electrophysiological steady state has been restored. Thus, the entire process from arrhythmia initiation to restoration of sinus rhythm takes about 2 s in the ventricular monolayers. In substrates with more fibrosis (30% instead of 20% fibroblasts as in Figure 3C and G), our BioICD model is still able to auto-detect and terminate VT albeit somewhat slower (data not shown).
As shown in Figure 3I, the presence of the BioICD channel exerts no significant influence on the AP at sinus rhythm (1.2 Hz) (the black and orange traces coincide), but slightly increases the APD at close-to-arrhythmic frequencies. This is also accounted for in the APD restitution curve of Figure 3J, which shows that the BioICD channel effectively increases the minimal APD of the cardiomyocytes. As a consequence of their sensitivity to frequency, the BioICD channels are unable to detect and eliminate reentrant activity anchored to scars if the activation frequency is too low, for example in substrates with large scars (see Video 5 in the Supporting Information).

Self-restoration of excitation rhythm in the virtual human heart with sustained fibrillation
Next, we incorporated the BioICD channel in cardiomyocytes of anatomically realistic human atria and ventricles. We find that the same channel successfully detects and terminates sustained fibrillation in both ventricles and atria to restore sinus rhythm, as illustrated in Figure 4A and B (the corresponding videos can be found in Supporting Information Videos 6-7). The mechanism of defibrillation is similar to that in monolayers. Arrhythmia-triggered activation of the BioICD channel in some regions leads to complete reset of the cells, whereas in others it prolongs APD, leading to extinction of the arrhythmia sources. With our choice of parameters, the BioICD channels in human atria could detect ongoing AF within 1.7 s and terminate it within 1.2 s to restore sinus rhythm. The corresponding channels in the ventricles could detect VF within 3 s and terminate it within 500 ms to restore sinus rhythm.

Figure 3 continued
the AP duration in the tail (APD 90 ) at close-to-arrhythmic frequencies (right AP traces). The dotted line of the widest AP in the right traces shows the AP at 1.2 Hz for reference. The orange lines show the APs without BioICD current (control). (J) APD restitution curve for the original parameters of the human ventricular cardiomyocyte model, with and without BioICD channel. Orange shading is used to indicate the region of the restitution curve where the slope exceeds 1. DI, diastolic interval.
Video 1. Self-restoration of cardiac excitation rhythm after VT in monolayers of human ventricular tissue. The activation of the BioICD current is shown in grey, as an overlay on the voltage map in the BioICD case. https://elifesciences.org/articles/55921#video1 Video 2. Self-restoration of cardiac excitation rhythm after VF in monolayers of human ventricular tissue. The activation of the BioICD current is shown in grey, as an overlay on the voltage map in the BioICD case. https://elifesciences.org/articles/55921#video2

Self-restoration of excitation rhythm in human atrial myocytes
In order to assess, in actual cardiomyocytes, the anti-arrhythmic effect of the BioICD channel, the BioICD current was mimicked in vitro using dynamic patch-clamping (Wilders, 2006). This technique can be used to introduce virtual voltage-gated ion channels (like the BioICD channel) into electrically excitable cells such as cardiomyocytes, in this case human atrial myocytes derived from a conditionally immortalized cell line (Harlaar et al., 2019; Figure 5A). These cells were optogenetically modified (Feola et al., 2016; Figure 5E) to control their excitation rhythm by light using a dynamically controlled LED source. The dynamic clamp experiment was carried out in current clamp mode, which allowed the unbiased recording of the membrane potential as it develops as the net result of the activity of all endogenous ion channels and the BioICD channel. The realtime measured membrane potential was used to calculate the amplitude of the BioICD current, which was injected into the cell via the recording electrode. A real-time interface between the patch-clamp amplifier and a computer constituted the feedback loop ( Figure 5B) that allowed us to mimic the presence of the BioICD channel, and to observe the effects of BioICD channel activity in cardiomyocytes ( Figure 5C-D).
To simulate arrhythmia conditions, light pacing was switched from 1 Hz to high frequency pacing ( Figure 5C-D). We found that the same ion channel gating properties used for the in silico studies Video 3. Self-restoration of cardiac excitation rhythm after VT in monolayers of human ventricular tissue, in the presence of 20% fibroblasts. The activation of the BioICD current is shown in grey, as an overlay on the voltage map in the BioICD case. https://elifesciences.org/articles/55921#video3 Video 4. Self-restoration of cardiac excitation rhythm after VT in monolayers of human ventricular tissue, in the presence of an anatomically realistic scar (3.4 cm long), surrounded by a grey zone, where I Ks was reduced by 80%, I Kr by 70%, I CaL by 69% and I Na by 62%. The activation of the BioICD current is shown in purple, as an overlay on the voltage map in the BioICD case.
https://elifesciences.org/articles/55921#video4 Video 5. Failure of self-restoration of cardiac excitation rhythm after VT in monolayers of human ventricular tissue, in the presence of a large anatomically realistic scar (5.8 cm long), surrounded by a grey zone, where I Ks was reduced by 80%, I Kr by 70%, I CaL by 69% and I Na by 62%. The activation of the BioICD current is shown in grey, as an overlay on the voltage map in the BioICD case.
https://elifesciences.org/articles/55921#video5 successfully detected fast pacing rhythms in a living cell. While no significant distortions of AP were registered at 1 Hz (the black and orange traces coincide), the depolarizing current produced by the BioICD channel at high frequencies built up resulting in APD prolongation. In tissue, the cells depolarised by the BioICD current would create conduction block to 'defibrillate'. In order to simulate this tissue-level feedback in a single-cell set-up, the light-pacing protocol was augmented with a feedback mechanism that detected pacing block (simulating conduction block in tissue) and subsequently lowered the pacing frequency, leading to restoration of the original cardiac excitation rhythm. Figure 5F shows a zoom-in of panel 5C focussing on the termination phase.
This process of arrhythmia detection, current accumulation, and pacing block is frequency-dependent, as evidenced by the smaller time until termination following 8 Hz optical pacing (1.16 s, Figure 5D) versus 7 Hz pacing (1.92 s, Figure 5C) within the same cell. The frequency at which termination occurs is also dependent on the baseline APD ( Figure 5G). For a total of 7 cells showing different baseline APDs (APD at 90% of repolarization (APD 90 ) measured at 1 Hz), basic cycle length (BCL) was decreased slowly (frequency was increased) to find the maximal BCL at which self-restoration of excitation rhythm would occur. Upon an increase in baseline APD, the BioICD channel is activated earlier, namely at longer BCLs. Collectively, these findings show that the proposed ionic gating mechanism is able to restore cardiac excitation rhythm in living excitable cells.

Discussion
In this study we present evidence that the heart itself may be empowered to detect and terminate arrhythmias. This is achieved by adding only one additional type of customized ion channel, with tailored frequency-dependent gating properties, to the existing repertoire of ion channels. In virtual . Induction, during sinus rhythm, of reentrant activity by giving an extra external stimulus leads to sustained AF and VF in atria and ventricles, respectively. The lower panels show the exact same situation, but in atria and ventricles expressing the BioICD channel. Once the arrhythmia is induced, the heart itself is able to detect and terminate fibrillation in order to restore sinus rhythm.
hearts equipped with this so-called BioICD channel, sinus rhythm is rapidly restored after arrhythmia initiation, in a fully automatic and shock-free manner without the need of a non-biological factor.
Regarding the customized gating properties of the BioICD ion channel, we show that, amongst the parameters characteristic for tachyarrhythmia or fibrillation, even an obvious one like its frequency can already provide a basis for the detection mechanism. Here, arrhythmia detection relies on positive feedback upon frequency increase. We propose three possible realisations of such anti-arrhythmic gating, as described in the different BioICD models I-III. However, these should not be viewed as the ultimate designs of a BioICD channel, but more as a first set of rigorous outlines that can serve as a basis for additional research now that the concept has been proven in the virtual human heart. Our model can be further improved or modified in several aspects (see Supplementary Information), for example the power n can be lowered. In proteins, this can result in a good trade-off between the detecting-terminating abilities of the BioICD ion channels and their complexity. Also, changing time constants will alter the activation time course of the channel, which can result in a shorter or longer delay preceding arrhythmia termination. Indeed, the structure of our BioICD model allows ample freedom to choose kinetic as well as threshold parameters for the channel within certain limits. As proof-of-principle in the virtual human heart, we tested the BioICD channels in homogeneous, anatomically realistic atria and ventricles. Based on our dynamic patch-clamp experiments, we conjecture that the model should also work for pathological substrates where the arrhythmia comes with an increase in activation frequency. This is based on the notion that the mechanism for self-restoration of cardiac excitation rhythm relies only on the detection of high-frequency signals, irrespective of the nature and underlying cause of the arrhythmia.
Having explained the guiding principles behind the functioning of BioICD channels at the cellular level, we find it fascinating to consider the resemblance between functioning of these ion channels at the organ level and 'spontaneous termination' of arrhythmias. Note that, in nature, not all highfrequency arrhythmias are sustained. A significant fraction does get self-terminated (Josephson and Kastor, 1977), although the mechanisms behind such spontaneous termination are still up for speculation. For example, reentrant circuits can act as feedback systems in which changes in the duration of one cycle have the potential to affect conduction in the subsequent cycles (Frame and Rhee, 1991). Cycle length was found to oscillate with progressively increasing alternations of long and short periods until a sufficiently short cycle led to conduction block (Ortiz et al., 1993;Frame and Simson, 1988;Quan and Rudy, 1990). A feedback system with the aforementioned characteristic was studied in silico and in vivo in the atrioventricular-node (Simson et al., 1981;Sun et al., 1995). Also, a frequency-based feedback system exists in the atrioventricular and sinoatrial nodes in the heart, where overdrive suppression creates block of nodal activation (Kunysz et al., 1995;Vassalle, 1970;Kunysz et al., 1997). In addition, Nagai et al., 2000 demonstrated a way to end paroxysmal arrhythmias based on overdrive suppression in a circular ring of regular cardiac cells interspersed with two pacemakers. Interestingly, whereas unstable tachycardias demonstrate cycle length oscillations that can lead to spontaneous termination of the tachycardia, stable tachycardias exhibit damped oscillations when perturbed. Despite the phenomena discussed above, these damped oscillations can still lead to sustained reentry. In the present study, we focused on developing a DE system capable of handling Video 6. Self-restoration of cardiac excitation rhythm after VF in anatomically realistic human ventricles. https://elifesciences.org/articles/55921#video6 Video 7. Self-restoration of cardiac excitation rhythm after AF in anatomically realistic human atria.
https://elifesciences.org/articles/55921#video7 Source data 1. Dynamic clamp reading 1: CSV-file containing the raw data for the C-panel in Figure 5. Source data 2. Dynamic clamp reading 2: CSV-file containing the raw data for the D-panel in Figure 5. Source data 3. Dynamic clamp summary table: Table containing the experimental datapoints that were plotted in Figure 5G.
sustained arrhythmias, including the most hazardous ones like fibrillation. This concept came to expression in the design of anti-arrhythmic ion channel gating, that is the BioICD channel. As a consequence of the design, this particular BioICD model allows for the detection and elimination of relatively fast sustained rhythms, thereby targeting those arrhythmias that require intervention for acute termination. This means that relatively low frequency arrhythmias are not detected by the BioICD channel and are therefore also not terminated. An example is a reentrant wave anchored to an anatomical obstacle (i.e. a scar) with a large perimeter (see Supporting Information, Video 5). In this case, the period of rotation, which is determined by the perimeter of the scar and directly related to the activation frequency, stays below the detection threshold. Thus, the abnormal electrical activity sustains in the cardiac tissue, despite the presence of the BioICD channel. However, as low-frequency arrhythmias are considered to be less hazardous than those with a high frequency, like fibrillation, they can be managed otherwise (Cho and Marbán, 2010;Stevenson, 2013;Nattel et al., 2014;Bongianino and Priori, 2015). Alternatively, other biological arrhythmia detection mechanisms could be explored and developed if needed.
Additional next steps in developing the BioICD channel, from a computational point of view, should be (i) extending the space of synthetic models, together with (ii) modifying existing in silico models of known ion channels to propose a candidate for experimental realization. Indeed, future research should lead to identification of the most robust and broadly applicable BioICD channel with the highest translational potential. We believe that, for the construction of a BioICD channel, all the essential knowledge about ion channel structure-function relationships (Bö rjesson and Elinder, 2008;Catterall, 2010;Moreau et al., 2014), as well as the molecular tools to manipulate these relationships in a systemic and rational manner are available (Bayley and Jayasinghe, 2004;Subramanyam and Colecraft, 2015). The ion channels from which functions can serve as a blueprint are not limited to eukaryotic organisms only, but encompass prokaryotic ones as well (Ren et al., 2001;Martinac et al., 2008) and can be searched for in extensive databases, such as the IUPHAR/ BPS (Southan et al., 2016). Also, the field of optogenetics has allowed the study of biological arrhythmia termination and could thereby add to the translation of our findings (Boyle et al., 2018;Entcheva and Bub, 2016;Boyden et al., 2005). Here, cardiomyocytes are genetically modified to express light-gated ion channels, allowing control of electric current generation in these cells by light. In earlier work from our group and others, it was shown that cardiomyocytes are indeed able to generate sufficient electrical current, based on the natural electrochemical gradients, for biological auto-termination of both atrial and ventricular arrhythmias, including fibrillation. This was shown in vitro using monolayers of neonatal atrial myocytes (Bingen et al., 2014), but later also in the whole heart of adult rodents (Bruegmann et al., 2016;Crocini et al., 2016;Nyns et al., 2016), and most recently also integrated in a hybrid bio-electronic system (Nyns et al., 2019). In these studies, the gating of ion channels was controlled by light to terminate cardiac arrhythmias. As a next step, we now show how such gating could be controlled by the arrhythmia itself, thereby giving rise to a new fully biological DE system.
In this study, we used optogenetics to provide experimental proof of the aforementioned concept with the use of human atrial myocytes. These atrial myocytes were optogenetically modified and used in dynamic patch-clamp experiments to separate the pacing mechanism (optical) from the rhythm restoration mechanism (chemical/electrical) in order to improve signal interpretation, that is stimulation block at depolarised membrane potentials. Our studies reveal that the in vitro data ( Figure 5C-D) show the same phenomenological phases as visible in the traces coming from the in silico simulations (Figure 1). Because the BioICD channel is capable of restoring normal excitation rhythm in cells with short baseline APDs under high frequency, the design of the gating properties makes that such restoration will work also for cells with long baseline APDs (Figures 2 and 5G), like those found in ventricular myocytes. This motivated our decision to use an atrial cell line for the experimental validation of our proposed concept.
Taken together, our study presents insight into acquired homeostatic regulation of excitation rhythm under disturbed conditions, including cardiac fibrillation. It is shown, by a combination of theoretical and experimental studies, that such regulation can be established by creation of a biologically engineered DE system for arrhythmias through expression of customized ion channels. Selfresetting of an acutely disturbed heart rhythm by an engineered biological DE system may yield unique insight into arrhythmia management and may lay the foundation for the development of distinctively innovative treatment options by the creation of new biology for therapeutic purposes, ultimately leading to acute, yet trauma-free termination of arrhythmias. This would stretch the field of synthetic biology into cardiology and also provide a radically new perspective for other medical fields, given the general nature and versatility of biological DE systems. This perspective involves that a diseased organ, begets its own remedy, for example a Biologically Integrated Cardiac Defibrillator (BioICD) in case of the heart. Detailed formulations for our BioICD ion channel model, based on a Markov chain formalism (Hermanns, 2002;Rudy and Silva, 2006), are provided below.

BioICD model I
Total BioICD current is expressed as: where G BioICD ¼ 150 nS=pF is the maximal conductance, and E BioICD ¼ 0 mV denotes the reversal potential of the BioICD channel. There is a frequency-sensing channel subunit with 2 states: open (O) and closed (C). Eight subunits together compose a BioICD channel. Deactivation of the channel is facilitated with a catalytic agent (a), which has 2 states: inactive a 0 and active a 1 . These states evolve according to Equations 2, 3, 4, 5, 6: (2) (3) where t o ¼ t a ¼ 1400 ms is the characteristic time, K OC ða 1 Þ ¼ 2 Á 10 4 a 1 5 , and k CO , k OC , k 01 , and k 10 are functions of voltage that determine the opening and closing rates: Here, we assume that the number of catalyst molecules in the cell is much higher than the number of BioICD channels, such that the binding between them does not significantly change the number of active catalysts a 1 . The fifth power of a 1 in K OC ða 1 Þ stands for the non-cooperative binding of 5 catalyst molecules to the BioICD channel. The full detailed Markov chain model for this process requires a large number of catalyst-bound states. This type of models can often be reduced to lower dimensions, as described by Keener, 2009. We thus substituted the complex catalyst-binding process with an extra facilitated flow from state O to state C. The reduced model reproduces the same overall kinetics of the O ! C catalysed reaction and is more suitable for whole-heart simulations due to its simplicity.

Human cardiac tissue model
To study the effect of the BioICD channel in human cardiac tissue, we integrated the BioICD channel model as a conductance into the electrophysiological model of each cardiomyocyte. For human ventricular tissue, the mathematical model proposed by Ten Tusscher et al., 2009 was used, where the transmembrane voltage (V) is calculated in millivolts (mV) according to Equation 11: where t is time in milliseconds (ms), I ion is the total ionic current density in micro-amperes per square centimetre (mA/cm 2 ), I stim is the external stimulus current, C m is the specific membrane capacitance in microfarad per square centimetre (mF/cm 2 ), andD is the diffusion tensor, whose components are related to the electrical conductivity of cardiac tissue in each direction of propagation.
I ion ¼ I Na þ I CaL þ I K1 þ I to þ I NaCa þI NaK þ I Kr þ I Ks þ I bNa þ I bCa þ I pCa þ I pK þI BioICD : Here, the different cardiac currents are represented as follows: I Na : the fast Na þ current, I CaL : the L-type Ca 2þ current, I K1 : the inward-rectifier K + current, I to : the transient outward K + current, I NaCa : the Na þ =Ca 2þ exchanger current, I NaK : the Na þ =K þ pump current, I Kr : the rapid delayed rectifier K + current, I Ks : the slow delayed rectifier K + current, I bNa : the background Na þ current, I bCa : the background Ca 2þ current, I pCa : the plateau Ca 2þ current, and I pK : the plateau K + current. Units for conductance measurements (G X ) and measurements of intracellular and extracellular ionic concentrations (½X i and ½X o ), are in nanosiemens per picofarad (nS/pF) and millimole per litre (mM), respectively.
For simulations of Figure 3, we used a monolayer model, containing 512 Â 512 grid points, such that the physical size of the simulated tissue was 12.8 Â 12.8 cm. Our model for fibrosis contained 20% randomly distributed fibroblasts, which did not couple electrotonically to the neighbouring cardiomyocytes (Ten Tusscher and Panfilov, 2007). For simulations with the realistic scar, a grey border zone (GZ) was taken into consideration. In the GZ, I Ks was reduced by 80%, I Kr by 70%, I CaL by 69% and I Na by 62% (Arevalo et al., 2013).
For human atrial tissue, data and fibre directions were obtained from Dö ssel et al., 2011. The ionic cell model that was used is the AF-induced electrically remodelled human atrial Courtemanche et al., 1999model (adapted from Courtemanche et al., 1998, which was taken from CellML (Yu et al., 2011) with the use of Myokit (Clerx et al., 2016) and transformed to graphics processing unit-usable code). The transmembrane voltage (V) is described in millivolts (mV) according to Equation 12 with I pK replaced by I Kur , an ultra-rapid delayed rectifier K + current.
We used an S1-S2 cross-field protocol to generate spiral and scroll waves (ten Tusscher and Panfilov, 2006). In human ventricular monolayers, we assumed isotropy. Thus, the diffusion tensor of Equation 11 could be replaced by a scalar coefficient D. However, in 3D, owing to the natural anisotropy of realistic cardiac tissue, the elements were computed on the basis of a reconstructed fibre direction field as described by Ten Tusscher et al., 2009. The transverse diffusion coefficient (D t , for signal propagation across the fibers) was assumed to be 4 (ventricles) or 6 (atria) times less than the longitudinal diffusion coefficient (D l , for signal propagation along the fibers). Elements of the diffusion tensor were computed as follows: where a i are components of the unit vector that is oriented along the direction of a fibre. We used D l ¼ 1:54 cm 2 =s for ventricles and D l ¼ 1:6 cm 2 =s for atria. We integrated Equation 11 in time using the forward Euler method with time step dt ¼ 0:02 ms (ventricular model) or dt ¼ 0:01 ms (atrial model), and in space, using the centred finite-differencing scheme with space step dx ¼ dy ¼ 0:025 cm in monolayers, 0.05 cm in whole ventricles and 0.0330 cm in whole atria, subject to 'no flux' boundary conditions. The simulation domains for the whole ventricles and atria contained 1, 693, 010 and 2, 173, 891 grid points, respectively. The gating variables in the electrophysiological model for the human cardiomyocyte were integrated using the Rush and Larsen, 1978 scheme.

Cell lines
The cell line used in this study has recently been generated by transducing human foetal atrial myocytes with a human immunodeficiency virus type 1-based vector conferring doxycycline-controlled expression of simian virus 40 large tumour antigen as described in Harlaar et al., 2019. The cells were tested negative for the presence of mycoplasma by the MycoAlert mycoplasma detection kit (Lonza, Basel, Switzerland), as well as by Hoechst 33342 (Life Technologies Europe, Bleiswijk, the Netherlands) staining of Vero cells cultured with conditioned human atrial myocyte medium.
Preparation of ChR2(H134R)-expressing human atrial myocytes Self-inactivating lentiviral vector particles encoding an eYFP-tagged version of the H134R mutant of Chlamydomonas reinhardtii channelrhodopsin 2 (LVV-ChR2(H134R)), were created by standard laboratory procedures (Feola et al., 2016) and used to transduce human atrial myocytes differentiated from a conditionally immortalised cell line (Harlaar et al., 2019). On the day before the patch-clamp experiments, cells were dissociated and re-plated on fibronectin-coated glass coverslips at 2.5 Â 10 4 cells per well in 24-well culture plates (Greiner Bio-One, Alphen aan den Rijn, the Netherlands).

Electrophysiological analysis
APs were recorded in single cells or small clusters of cells using the amphotericin-B perforated patch-clamp technique (Wilders, 2006). Voltage control, data acquisition, and analysis were accomplished with custom-made software. Potentials were corrected for the calculated liquid junction potential (Barry and Lynch, 1991). Signals were low-pass-filtered (cut-off of 5 kHz) and digitized at 5 kHz. Cell membrane capacitance (C m ) was estimated by dividing the time constant of the decay of the capacitive transient in response to 5 mV hyperpolarizing voltage clamp steps from À40 mV by the series resistance.

Dynamic clamp protocol
A Linux computer running RTXI dynamic clamp software (Patel et al., 2017) with a time step Dt ¼ 50 s allowed real-time dynamic interaction between the input and output channels of the patch-clamp amplifier. At a variety of frequencies, an optical stimulus train was applied that consisted of the following phases: i) 7 pulses of pre-pacing are applied at 1 Hz with the BioICD channel enabled, ii) 8 pulses are applied at 1 Hz with the BioICD channel still enabled, iii) an undetermined number of pulses is applied at increased frequency with the BioICD channel enabled, either until termination occurs due to the feedback mechanism, or until a stable state has been achieved (in which case the protocol is terminated), iv) after restoration of excitation rhythm, another 7 pulses are applied at 1 Hz with the BioICD channel enabled, v) 8 pulses are applied at 1 Hz with the BioICD channel disabled, vi) an undetermined number of pulses is applied at increased frequency with the BioICD channel still disabled until the stimulus train is stopped externally. The feedback mechanism detected refractory beats as defined by membrane potential values more positive than À20 mV during the entire pulse duration.

Data and software availability
The key component of the graphics processing unit-usable code that is sufficient for reproduction of the results was made readily available. More detailed information about the data and software that support the findings of this study are available from the corresponding author upon reasonable request. The funders had no role in study design, data collection and interpretation, or the decision to submit the work for publication.
qa 1 qt ¼ k 01 a 0 À k 10 a 1 : Transition rates between them are the following:

Model III
This model comprises six identical subunits with four states each (see Appendix 1- figure  2A): I (inactive state), C 1 (1st closed state), C 2 (2nd closed state) and O (open state). The mechanism is less sensitive to the changes in AP shape or duration by design, but requires more states in a Markov chain model. Initially, all subunits are in the first closed state C 1 . When the cell depolarizes (V> À 25 mV), most of the subunits of the channel transit to the inactive state I, whereas the remaining fraction of subunits change conformation to the other closed state C 2 . The number of subunits in the second closed state (C 2 ) always increases approximately to the same value after each upstroke (see green spikes of C 2 in Appendix 1- figure 2B and C). The channel can then open from the C 2 state, but not from C 1 or I. The opening and inactivation from the C 2 state occurs slowly and independent of the voltage (k 4 , k 5 ), which slows down the overall kinetics of the channel. Therefore, the number of open channels (O) reflects the average/integrated number of upstrokes in a unit of time (see Appendix 1- figure 2B and C, black lines). The channels recover from inactivation mainly during the late phase of the AP, when the transmembrane voltage ranges from À60 mV to À25 mV (as can be seen in Appendix 1- figure 2B and C by an increase of C 1 during the final phase of the AP). At high frequencies, the number of channels in the second closed state C 2 and in the open state O increases. The channels with all subunits in the open state contribute to the defibrillation current. After arrhythmia termination, in the absence of new upstrokes, the subunits of the channels recover fast to the first closed state C 1 (see Appendix 1- figure 2B and C, orange line). The Markov diagram for this model is shown in Appendix 1- figure 2A. A detailed mathematical description of the state variables is provided in Equations 27,28,29,30,31).