Mathematical model of a serine integrase-controlled toggle switch with a single input

Dual-state genetic switches that can change their state in response to input signals can be used in synthetic biology to encode memory and control gene expression. A transcriptional toggle switch (TTS), with two mutually repressing transcription regulators, was previously used for switching between two expression states. In other studies, serine integrases have been used to control DNA inversion switches that can alternate between two different states. Both of these switches use two different inputs to switch ON or OFF. Here, we use mathematical modelling to design a robust one-input binary switch, which combines a TTS with a DNA inversion switch. This combined circuit switches between the two states every time it receives a pulse of a single-input signal. The robustness of the switch is based on the bistability of its TTS, while integrase recombination allows single-input control. Unidirectional integrase-RDF-mediated recombination is provided by a recently developed integrase-RDF fusion protein. We show that the switch is stable against parameter variations and molecular noise, making it a promising candidate for further use as a basic element of binary counting devices.


Introduction
Genetic switches with two states (ON/OFF) are essential components of synthetic biology memory and counting devices, with potential application in biotechnology, biosensors and biocomputing [1][2][3]. The creation of these binary switches is, therefore, an important goal of synthetic biology. Here, we design a synthetic genetic switch, which switches between two states in response to a single-input signal. The response of the switch depends on its current state. If it is OFF when it receives an input signal, it switches to ON; if it is ON, it switches to OFF. An orthogonal set of single-input state-based toggle switches with this behaviour could be used to encode the digits in a binary ripple counter [2]. In such a counter, each switch represents a single binary digit, and N interconnected switches would be able to count up to 2 N 21 occurrences of the same repeated signal. The counting of various intracellular or extracellular events can then be used to control intracellular processes, to track genetic lineage, or to count the occurrences of events [2,4]. No singleinput switch capable of robust toggling between two states has been implemented to date.
The best-characterized bistable switch is the toggle switch, based on mutual repression of two inhibitors [5 -8]. Transcriptional toggle switches (hereafter called TTS) are constructed in vivo and, therefore, can be directly used for intracellular applications. A TTS is based on the expression of two transcriptional repressors I 1 and I 2 [5,6,8]. Each repressor is expressed from a promoter repressed by the other repressor (P 1 or P 2 ) (figure 1a), so that when I 1 is expressed, transcription of I 2 is turned off and vice versa. There are two steady states, with either I 1 or I 2 expressed. The switch between these two steady states can be brought about using two different inducers (input signals), such as IPTG and anhydrotetracycline (aTc), inducing transcription of the unexpressed repressor (figure 1a) [5]. Experimentally implemented TTS shows robust switching with two inputs [5,6]. However, the only single-input switch implemented to date, which combines a TTS and a logic gate, showed a damped response to repeated induction of the circuit [8].
Another class of genetic switch uses site-specific recombinases, enzymes that cut and re-join DNA at specific recombination sites. Depending on the arrangement of these sites in the DNA, recombinases carry out fusion, deletion or inversion reactions. Inversion of a DNA segment flanked by two recombination sites in a 'head-to-head' orientation allows repeated switching between two alternative states. Placing a promoter on the invertible segment allows switching between expressions of two different genes (figure 1b). This has been used to make simple inversion switches that control gene expression, encode memory or carry out logical calculations [3,4,[9][10][11]. Using serine integrases (int) for these genetic switches has the advantage of unidirectional recombination, and the ability to reverse this directionality by the addition of a recombination directionality factor (RDF) [10,12,13]. Int on its own carries out recombination on two specific DNA sequences called attP and attB sites (PB), producing attL and attR product sites (LR), each consisting of half of a P and half of a B site (figure 1b). The presence of the RDF reverses int directionality, so that LR recombines back to PB.
Previous switches used two inputs to control separate expression of int and intþRDF [10]. In this paper, we aim to design a robust single-input switch, which can be further used as a basic element of counters and memory devices. Our switch is based on a combination of two doubleinput switches (a TTS and a DNA inversion switch). The TTS, based on two mutually repressing inhibitors, controls whether int or intþRDF is synthesized (figure 1c). Expression of int or intþRDF in turn operates a DNA inversion switch, changing the orientation of an inducible promoter. Activation of the promoter by inducer (ind) provides a single-input signal, inducing expression of the currently inactive inhibitor and thus changing the state of  Figure 1. Gene circuit of integrase-controllable inversion-and-transcriptional toggle switch (ITTS). (a,b). Basic elements of the switch. (a) Two states of the bistable transcriptional toggle switch (TTS), expressing I 1 (left) or I 2 (right). The TTS is regulated by mutual repression of expression of I 1 and I 2 inhibitors from I 2 -and I 1regulated promoters (P 1 and P 2 ). Two different input signals (inducer 1 and 2) initiate the transition between the two states, by de-repressing the respective promoters. (b) A DNA inversion switch that can switch between two DNA states (PB and LR), mediated by serine integrase int and its fusion protein with RDF (intRDF), which invert the DNA fragment located between P and B, or L and R attachment sites. (c) Scheme of the one-input ITTS, illustrating the two states of the switch, expressing I 1 and intRDF in the PB state (blue box) and I 2 and int in the LR state (red box). The switch between states is initiated by a pulse of an inducer, activating the inducible promoter P ind . This results in the expression of the currently unexpressed inhibitor, followed by the expression of int (or intRDF) and changing of the DNA state.
the switch. We use mathematical modelling to demonstrate that the inversion-and-transcriptional toggle switch (ITTS) is capable of robust switching between two DNA states over a broad range of parameters and is stable against molecular noise. We anticipate that the robustness of the switch should make it useful for further experimental implementations of single-input memory devices.

Model description
Here, we use mathematical modelling to develop a singleinput DNA switch, the ITTS. Similar to previous work, our switch is designed to be implemented in Escherichia coli cells bearing plasmids with the switch gene circuit [10]. The ITTS integrates a TTS (figure 1a) and a DNA inversion switch operated by int and its RDF (figure 1b). It has been shown recently that LR-to-PB recombination is more efficient with an integrase-RDF fusion protein (intRDF). This fusion protein improves directionality compared to a mixture of separate int and RDF proteins, and expression of a single protein simplifies the switch design [14] (figure 1b). Our ITTS, therefore, uses intRDF to switch from LR to PB, and int to switch from PB to LR. The TTS consists of two mutually repressing transcriptional inhibitors I 1 and I 2 expressed from P 1 and P 2 promoters (figure 1a). The int and intRDF genes are expressed from their own copies of the P 2 and P 1 promoters respectively, thus coupling the state of the inversion switch to the state of the TTS (figure 1c). When I 1 is expressed and I 2 is not, only intRDF will be expressed, putting the switch in the PB state (figure 1c, top). Similarly, when I 2 is expressed, only int will be expressed and the switch will be in the LR state (figure 1c, bottom). Our switch design is not specific to any particular types of repressors I 1 and I 2 . However, an essential requirement is that in order for the toggle switch to be bistable, the repressors have to bind their target promoters with cooperativity [5].
Switching between the two states of the ITTS is provided by periodic pulses of inducer ind, activating an inducible promoter P ind located between att sites of the DNA inversion switch (figure 1c). For example, the sugar arabinose could be used as ind to induce the arabinose-inducible P BAD promoter [15]. Experimentally, we envision testing the system using short 1 -4 h pulses of inducer every 24 h. Therefore, we model ind mathematically using a suitable periodic function.
The orientation of P ind depends on the state of the inversion switch, which in turn is governed by the TTS (figure 1c). When I 1 is on, induction of P ind will turn on expression of I 2 ; when I 2 is on P ind will express I 1 . Each pulse of inducer results in a cycle of events: (i) P ind -mediated transient expression of the currently repressed inhibitor; (ii) a change in the state of the TTS (switch from I 1 to I 2 or I 2 to I 1 expression); and (iii) a switch between int and intRDF expression, and thus a change in the orientation of the invertible DNA segment.

Model equations
The intracellular kinetics of int, intRDF, I 1 and I 2 protein production and decay is described by four ordinary differential equations (ODEs), corresponding to the scheme of figure 1c. Based on fast mRNA degradation [16,17], we assumed that mRNA levels are proportional to promoter activities. Therefore, the rates of protein expression are simply proportional to promoter activities. All proteins were assumed to be diluted due to cell growth and division. The equations for int, intRDF, I 1 and I 2 proteins are as follows: . v P1 , v P2 and v P ind are the rates of protein expression from P 1 , P 2 and P ind , respectively. Orthogonal inhibitors from the TetR family [18] represent likely candidates for I 1 and I 2 in future experimental implementation of the ITTS. Therefore, based on the reported dimeric structure of TetR complexes [19], we used a Hill coefficient of 2 for the inhibition of P 1 and P 2 by I 2 and I 1 .
The recombination reactions implementing the conversion between the PB and LR states are described based on our minimal model of in vitro recombination by fC31 integrase with or without RDF (electronic supplementary material, figure S1) [20]. To describe in vivo recombination, we have included in the present model the dilution of int and intRDF proteins from their complexes with DNA upon DNA replication (equations (2.5) and (2.6)). Additionally, because we use intRDF fusion protein instead of a mixture of int with RDF, our model does not have the equation for the formation of the complex between int and RDF, which was used in [20].
The equations for recombination reactions were derived in [20] assuming that recombination steps (r1, r2) and synaptic conformational change steps (syn, synr) are much slower compared to other steps. The slow-changing variables LRint 1 , PBintRDF 1 and PB tot (sum of all PB-containing complexes) are described by three ODEs (electronic supplementary material, figure S1): rsif.royalsocietypublishing.org J. R. Soc. Interface 15: 20180160 The algebraic equations for fast-changing variables were derived using rapid equilibrium approximations [20]: and Free PB and LR concentrations were expressed from the mass balance equation for the PB-and LR-containing species [20]: respectively. K bI1 , K bI2 , K bI3 , K bI4 , K LRi are the dissociation constants for the respective complexes (K bI1 , K bI2 , K bI3 , K bI4 are assumed to be equal to K bI ). The parameters k þr , k þsyn , k þsynr , and k 2r1 , k 2r2 , k 2syn , k 2synr stand for the forward and reverse rate constants of the slow recombination and synapsis (syn, synr) steps [20] (assuming k þr1 ¼ k þr2 ¼ k þr ), with the forward direction defined as PB ! LR for the int reaction and as LR ! PB for the intRDF reaction (electronic supplementary material, figure S1) [20]. All concentrations are expressed in mM; the time units are hours.

Behaviour of the model components
I 1 and intRDF proteins are expressed from copies of P 1 , while I 2 and int are expressed from P 2 promoters (figure 1c, equations (2.1) -(2.4)). The activities of P 1 and P 2 (v P1 and v P2 ) are sums of two terms: the main activity, which is inhibited by I 2 and I 1 , respectively, and the promoter leakages (background activities in the presence of saturated concentrations of inhibitors). The expression of I 1 and I 2 is also transiently induced from P ind during pulses of the external signal ind(t). Expression of I 1 and I 2 is described as a sum of the expression from P ind and from P 1 or P 2 (equations (2.3) and (2.4)). This assumption is based on observations of additive gene expression from tandem promoters [21,22]. We assume that transcription initiated by P ind can read through the repressor-bound P 1 and P 2 [21]. The recombination mechanisms are described in detail in [20]. Briefly, PB-to-LR recombination starts from binding of four molecules of int to the PB substrate (binding step bI 1 ; electronic supplementary material, figure S1), followed by recombination (strand exchange, step r1) leading to formation of the product synaptic complex LRint 1 . The LRint 1 complex can also slowly de-synapse to form LRint 2 complex (step syn), which can dissociate and release free LR product (step bI 2 ). The last two steps are unfavourable (electronic supplementary material, figure S1) and LRint 1 represents the main form of the LR product in vitro [20]. However, in vivo dissociation of integrase from this stable product during DNA replication might increase the amount of free DNA. In our model, this is described through a dilution of int from LRint 1 (equation (2.5)), which decreases LRint 1 concentration and thus increases free LR product (equation (2.15)). This increases the recombination efficiency of in vivo reactions ( §3.1). Similarly, LR-to-PB recombination starts from binding of four molecules of intRDF to the LR substrate (step bI 3 ), followed by recombination (step r2) and the formation of the product synaptic complex PBintRDF 1 . The unfavourable steps include de-synapsis of PBintRDF 1 , producing PBintRDF 2 (step synr) and release of the free PB product (step bI 4 ). Dilution of intRDF from PBintRDF 1 (equation (2.6)) decreases PBintRDF 1 concentration and thus increases free PB product (equation (2.14)). The model also includes unproductive complexes LRintRDF i and PBintRDF i (equations (2.12), (2.13)), which form due to competition between int and intRDF dimers [20].

Simulation of the inversion-and-transcriptional toggle switch model
The system of ODEs was solved using MATLAB, integrated with the stiff solver ode15 s (MathWorks, Cambridge, UK). The MATLAB code of the model is provided in electronic supplementary material, text S1). The total DNA concentration was taken to be 10 nM, based on a typical plasmid copy number (approx. 10 plasmids cell 21 ) and an estimated concentration of approximately 1 nM for one molecule/cell (based on a typical cell volume of approx. 1.6 Â 10 215 l). The K i of promoter inhibition is set at 10 nM [23]. The effective rate constant of maximal protein production is estimated as k tr ¼ 360 h 21 [16,17]. The rate constant of background protein production due to leakages from repressed promoters (in the presence of a saturated concentration of the inhibitor) was assumed to be k tr0 ¼ 3.6 h 21 [16,17]. As transcription and translation are described by a single step in our model, the effects of promoter and ribosome-binding site strengths are not distinguishable and were varied in the model by changing the rate constant of protein production. The rate constants of I 1 , I 2 , int and intRDF protein production were assumed to be equal to k tr in all simulations, except those where the rates of int or intRDF production were separately varied, as stated in the text. k dil was determined from the characteristic doubling time of 20 min for fast-growing culture.
The input signal was simulated using a previously developed periodic step function ind(t) [24], mimicking periodic addition and withdrawal (e.g. by dilution of the cell culture) rsif.royalsocietypublishing.org J. R. Soc. Interface 15: 20180160 of the inducer where ind on and ind off determine the times of the beginning and end of each pulse of inducer, administrated with a period per ( per is chosen to be 24 h for the convenience of the future experimental design); k t is a characteristic time of the inducer's decay (k t ¼ 0.3 h based on a 20 min cell doubling time). The equilibrium constants of recombination reactions satisfy the energy conservation equations for PB-to-LR and LR-to-PB transitions (electronic supplementary material, figure S1) [20]: where K r1 , K r2 , K syn , K synr are the equilibrium constants (k þ /k 2 ) of the respective steps and K bI1 , K bI2 , K bI3 , K bI4 are the dissociation constants (k 2 /k þ , where k þ and k 2 are rate constants of binding and dissociation of integrase or intRDF from DNA). The modelling of int with reduced efficiency ( §3.2) was done by decreasing the equilibrium constants of the recombination steps K r1 , K r2 10-fold, with compensating 10-fold increases of the dissociation constants K bI2 , K bI4 of int binding to DNA products, to comply with energy conservation (equation (2.17)). The model parameters are presented in electronic supplementary material, table S1.

Results and discussion
During the construction of the ITTS, we initially considered a simpler scheme with int and intRDF expressed from a constitutive promoter in an invertible DNA segment (electronic supplementary material, figure S2). The switch was expected to be bistable due to the expression of intRDF in the PB state, converting any LR product back to PB and expression of int in the LR state, maintaining the DNA in the LR state. This switch would operate by induction of expression of int or intRDF from an oppositely oriented inducible promoter within the invertible DNA segment. However, we found that the switch could not alternate between the two states in response to inducer pulses. Instead, over a broad parameter range, the switch always ends up in the LR state, due to the higher efficiency of PBto-LR conversion. The inability to switch state was caused by rapid initiation of recombination during the inducer pulse, leading to overlapping production of int and intRDF proteins. In order for the switch to make reliable transitions on inducer pulse, expression of int and intRDF from the inducible promoter must be temporally distinct from integrase-mediated inversion. This is difficult to achieve due to the rapid nature of transcriptional induction and sitespecific recombination. The simultaneous expression of int and intRDF is avoided in our final design (figure 1c) due to the tight control of int and intRDF expression by the TTS, as described below.

The kinetics of the inversion-and-transcriptional toggle switch
The model of our single-input switch ITTS is described in §2 (figure 1c). The switch has two steady states ( §3.2) and is capable of robust switching between the two states, as we show below. The single-input signal to the ITTS is provided by pulses of an external inducer, described by periodic step function ind(t) (equation (2.16)). Surprisingly, the model predicts that the switch of the DNA state is completed only after the inducer pulse finishes, due to the interactions between the ITTS components. Thus, if the switch was initially in the PB state, expressing I 1 and intRDF ( figure 1c top; figure 2a), then the addition of inducer causes an increase of I 2 , which downregulates I 1 and intRDF expression from the I 2 -inhibited P 1 promoters. Decreased expression results in decreased protein levels, due to protein dilution during cell growth and division. The initial decrease in I 1 initiates a minor increase of int ( figure 2a). The decrease of the intRDF/int ratio causes slight increase of LR (at approx. 2 h on figure 2a, when int intRDF), but in the presence of inducer this leads to a secondary wave of I 1 expression from the P ind promoter in the LR state. This prevents further increase of the int concentration and thus PB-to-LR conversion (figure 2a). Under induction with relatively strong P ind (figure 2), concentrations of both inhibitors are high enough during the pulse to prevent production of int and intRDF. Therefore, the PBto-LR transition is completed only after the inducer pulse finishes (figure 2a). I 1 and I 2 both decrease after the pulse, but the TTS falls into the I 2 steady state because I 2 ) I 1 ( figure 2a). The concentration of int is initially low after the pulse; it starts to increase only when I 1 falls below the critical level required for the release of the repressed P 2 promoter (half-released at 0.01 mM [23]). The inversion switch follows the TTS after the minimal int concentration required for recombination (0.1 mM [25]) is achieved (approx. 5 h on figure 2a). When the ITTS is in the LR state, a pulse of inducer produces a switch to PB by a similar mechanism due to the symmetry of the ITTS design (figure 1c, figure 2b-d).
Int recombination efficiencies observed experimentally in vivo [14] are typically higher than those observed in vitro [25]. Our previous models for int recombination [20,25] fit the in vitro data, predicting 80% and 70% recombination of PB-to-LR and LR-to-PB, respectively. To mimic the in vivo situation, the model was modified to include stripping of int and intRDF from DNA during DNA replication, accelerating the release of free DNA from reaction products ( §2; electronic supplementary material, figure S1). The modified model predicts highly efficient intracellular conversion of PB-to-LR and LR-to-PB (100% and 97%, respectively) (figure 2c), in agreement with the in vivo data.

The robustness of the inversion-and-transcriptional toggle switch to parameter variations
Two characteristics are important for the ITTS operation: (i) coexistence of two steady states in the absence of inducer (bistability) and (ii) ability to switch between the two states in response to the inducer pulse. The bistability of the ITTS is determined by the TTS parameters, while the ability to switch depends on the parameters of P ind induction ( pulse duration and P ind strength) and parameters of the inversion switch, as discussed below.
rsif.royalsocietypublishing.org J. R. Soc. Interface 15: 20180160 The bistability of the ITTS is based on the bistability of its TTS. Figure 3a shows the ITTS dynamics in the absence of inducer on a phase diagram, showing trajectories in the I 1 /I 2 phase plane. Different initial concentrations of I 1 and I 2 produce different trajectories, and all the trajectories end up in one of the two stable steady states with high I 1 (blue) or high I 2 (orange) concentrations. We used the model to explore the dependence of the bistability range on the    rsif.royalsocietypublishing.org J. R. Soc. Interface 15: 20180160 strengths of P 1 and P 2 promoters. The simulations were run in the absence of inducer, starting from different initial concentrations of I 1 and I 2 (as on figure 3a). Both maximal activities and leakages (background expression from fully repressed promoter) affect the bistability range. When leakages in P 1 and P 2 promoters are relatively high (1% of the activities of unrepressed promoters), bistability is observed only for relatively similar promoter strengths (up to 2.5-fold difference in P 1 and P 2 strengths; figure 3b). The promoters of the TetR family have relatively high leakages and similar strengths [18], and so could be appropriate. Additionally, the ITTS is predicted to maintain its bistability when the promoters have substantially different strengths, providing that leakages are low. Thus, a 10-fold decrease in P 1 and P 2 leakages extends the bistability range up to 10-fold difference in P 1 and P 2 strengths (figure 3c). We conclude that the ITTS is bistable over a broad parameter range of promoter strengths and leakages. In addition to being bistable, the ITTS is able to switch between the two states in response to the addition of inducer, as shown in figure 3a by black and red dashed lines. Figure 4 shows that the ITTS is capable of operating over a broad range of inducer pulse lengths and strengths of P ind . Thus, for a relatively high strength of the P ind promoter (P ind strength greater than 20% of P 1 strength, with equal strengths of P 1 and P 2 ), the ITTS operates in both directions with any duration of inducer pulse longer than 4 min (figure 4a) and the DNA transitions happen only after the inducer pulse finishes, as described in §3.1. Therefore, a switch with strong P ind promoter is not sensitive to pulse duration. However, reduction of the P ind strength narrows the range of useful inducer pulses. Thus, for a P ind with 10% of the strength of P 1 and P 2 , the inducer pulse duration required for the efficient switching is between 0.5 and 9 h (figure 4b). For a P ind with 2% of the P 1 strength, the range of effective pulses narrows to 3 -5 h ( figure 4c).
The narrower range of permitted pulse lengths with a weak P ind is due to low and comparable concentrations of the induced inhibitors during the pulse ( figure 5a,b). Thus, if the ITTS was initially in the PB state, I 2 is induced by ind (figure 5a), but to much lower levels than with the strong P ind (figure 5b). I 1 slowly decreases, increasing the int to intRDF ratio and initiating the PB-to-LR transition (figure 5a). I 1 is expressed from P ind in the LR state, but only to low levels compared to the strong P ind (figure 5a,b), allowing near-complete transition to the LR state during a long pulse (figure 5a,e). The conversion to LR causes I 1 concentration to increase again (figure 5c,d). For long enough pulses, I 1 eventually becomes higher than I 2 (figure 5d), reverting the transition back to the PB state (figure 5f ). For shorter pulses, I 1 remains lower than I 2 throughout the pulse (figure 5a), allowing the TTS to complete the transition to LR after the pulse (figure 5e).
Next, we explored the effect of the parameters of DNA inversion on the ITTS operation. Figure 6a shows the operation of the ITTS with low-efficiency int and intRDF, simulated by 10-fold decreases in the equilibrium constants of the recombination steps (K r1 and K r2 ). The efficiency of conversion from LR to PB with these altered parameters is reduced to 79% (compared with 97% with the high-efficiency int and intRDF), while the PB-to-LR conversion is reduced from 100 to 97% (figure 6a). However, switching between the two states is still robust over a broad range of pulse durations (figure 6a).
In addition to the variations in the efficiency of int-mediated recombination, the inversion switch might be affected by the expression rates of int and intRDF. However, our analysis demonstrates that the ITTS operates over a broad range (approx. 100-fold variation) of int and intRDF production rates (figure 6b). Very low rates of int and intRDF expression were insufficient to promote transition between the PB and LR states. Excessive levels of int and intRDF expression led to more than 50% transition during the pulse (electronic supplementary material, figure S3). This reduced the working range of pulse durations by the same mechanism as for low P ind (figure 5), due to competition between the two inhibitors expressed from P ind in the PB and LR states.
We conclude that the ITTS is very stable against variation in the parameters of the recombination reactions, in contrast to a previously developed inversion switch [10]. This is due  Figure 4. Dependence of the ITTS kinetics on the duration of inducer pulse and P ind strength. The inducer kinetics is shown in magenta dotted lines, and LR kinetics is shown with a colour gradient (values are on colour bars), for different pulse durations. Computations were done for 100% (a), 10% (b) and 2% (c) strength of P ind relative to P 1 and equal strengths of P 1 and P 2 . The strength of P ind (relative to P 1 ) is shown on each panel. The duration of the first, shortest pulse is 6 min, with subsequent plots for pulse lengths increasing at 1 h intervals. rsif.royalsocietypublishing.org J. R. Soc. Interface 15: 20180160 to the coupling of the inversion switch to the bistable TTS in our ITTS design, ensuring that only one of int and intRDF proteins is expressed ( figure 2d). In addition, the inversion switch is stabilized by the use of the intRDF fusion protein, increasing the efficiency of the LR-to-PB transition compared to a mixture of integrase and RDF [10].    The ITTS is designed to be implemented in Escherichia coli cells. In each cell, the circuit is predicted to switch efficiently between the two states in response to each inducer pulse. However, due to potential differences in initial conditions when the circuit is first introduced into cells, the switch might start in the PB state in some cells and the LR state in others. Therefore, in future experimental implementations of the ITTS, the cells might need to be synchronized initially by adding an inducer to activate either P 1 or P 2 [26] (figure 1a).
The switch can be used to express different genes, depending on the desired applications. For example, expression of two different fluorescent reporters (e.g. GFP and RFP) in the two switch states would allow monitoring of the switch kinetics. Alternatively, the switch could be used to control expression of further integrases to build more complex circuits, for instance, a ripple counter as discussed in the Introduction and Conclusion.

Effects of molecular noise
Our simulations demonstrate that ITTS behaviour is very robust to variations in the P ind strength (figure 4) and recombination efficiency (figure 6), while changes in P 1 and P 2 cause more drastic changes in the working range of the ITTS (figure 3). In particular, the leakages in P 1 and P 2 (i.e. expression from fully repressed promoters) strongly affect the bistability range of the ITTS (figure 3c). The levels of these leakages in P 1 and P 2 are expected to be noisy due to the low probability of RNA polymerase binding to P 1 or P 2 in the presence of high repressor concentrations. To simulate the potential effects of the noise on the ITTS kinetics, we replaced the leakages in P 1 and P 2 (parameter k tr0 in equations (2.1)-(2.4)) with the Poisson-distributed variables with a mean of 3.6 h 21 (equal to the leakages in the deterministic system) or 7.2 h 21 (in simulations with twofold increased noise). The noise was applied every minute. This results in noisy expression of I 1 , I 2 , int and intRDF proteins from P 1 and P 2 . Our simulations demonstrate that even with relatively noisy leakages (with a mean of 3.6 h 21 , figure 7a) the switch between the PB and LR states is robust to the noise (figure 7b). However, a further increase of the noise destabilizes the switching (figure 7c), leading to unpredictable switching when the noise is twofold higher than leakages in the deterministic system (figure 7d).

Conclusion
We present here a mathematical model of a single-input binary switch (ITTS), formed by combining a TTS and an inversion switch based on serine integrase-mediated sitespecific recombination. The model predicts that the combined bistability of the TTS and unidirectionality of integrasemediated recombination ensures nearly 100% efficiency of switching between two DNA states using repeated pulses of a single inducer. The ITTS is predicted to be robust to parameter perturbations and molecular noise. We envision that several ITTS modules built with orthogonal recombinases and repressors could be connected together sequentially to form a binary 'ripple counter'. Each module represents a single binary digit and would signal the next module with