ARTICLE

https://doi.org/10.1038/s41467-021-21700-8 OPEN Nonlinear delay differential equations and their application to modeling biological network motifs ✉ David S. Glass 1, Xiaofan Jin 2 & Ingmar H. Riedel-Kruse 3

Biological regulatory systems, such as cell signaling networks, nervous systems and ecolo- gical webs, consist of complex dynamical interactions among many components. Network motif models focus on small sub-networks to provide quantitative insight into overall

1234567890():,; behavior. However, such models often overlook time delays either inherent to biological processes or associated with multi-step interactions. Here we systematically examine explicit-delay versions of the most common network motifs via delay differential equation (DDE) models, both analytically and numerically. We find many broadly applicable results, including parameter reduction versus canonical ordinary differential equation (ODE) models, analytical relations for converting between ODE and DDE models, criteria for when delays may be ignored, a complete phase space for autoregulation, universal behaviors of feedforward loops, a unified Hill-function logic framework, and conditions for oscillations and chaos. We conclude that explicit-delay modeling simplifies the phenomenology of many biological networks and may aid in discovering new functional motifs.

1 Department of Molecular Cell Biology, Weizmann Institute of Science, Rehovot, Israel. 2 Gladstone Institutes, San Francisco, CA, USA. 3 Department of Molecular and Cellular Biology, and (by courtesy) Departments of Applied Mathematics and Biomedical Engineering, University of Arizona, Tucson, AZ, USA. ✉ email: [email protected]

NATURE COMMUNICATIONS | (2021) 12:1788 | https://doi.org/10.1038/s41467-021-21700-8 | www.nature.com/naturecommunications 1 ARTICLE NATURE COMMUNICATIONS | https://doi.org/10.1038/s41467-021-21700-8

iological regulation consists of complex networks of is a corresponding DDE, where x(t − τ) represents the value of x dynamical interactions1–5. Transcription factors control at a time τ units in the past, making the effect of x on the current B 6,7 production of other transcription factors , kinases the rate of change of x delayed by a time τ. The time scales and delays activation of other kinases1,3,4, cells the growth of other cells8,9, are thus explicit (Fig. 1), better capturing dynamics where and species the population size of other species10. “Network intermediate steps are not fast, as compared to ODE models, motifs” describe particularly important substructures in biological which may fail to capture real delays, hide their effects by over- networks, such as negative feedback, feedforward regulation and simplification, or require additional variables and parameters to cascades2,6,11. The function of network motifs often depends on predict complex phenomena17,23,32. Such delay models have been emergent properties of many parameters, notably delays7,12,13, productive in a variety of biological scenarios, such as processes and previous work showed that delays can lead to dramatic with many intermediate but unimportant steps33,34 and age- biological changes, such as sustained oscillations12,14–17. Delays structured populations34,35. Network models with delays have are crucial to behavior in natural18–20 and synthetic21,22 genetic also been explored in various contexts36–39. Intercellular signal oscillators, in development and disease2,7,14,16,17,23–31, and in transduction, for example, requires multiple time-consuming ecological booms and busts8. Despite such examples, there has steps that are not negligible23,32. been no thorough treatment of network motifs with delays With DDEs, multiple steps (“cascades”) within a network can included explicitly. be rigorously simplified into a single step with delay (see Here we provide a theoretical and practical basis for analyzing below), an approach which has been explored in a variety of network motifs with explicit delays, and we demonstrate the biological contexts18,33,34,40–42. This makes interpretation of utility of this approach in a variety of biological contexts. the phenomenology simpler than with ODEs and reduces the Whereas network motifs are typically modeled using ordinary number of equations and parameters in the model18,23.This differential equations (ODEs) with variables reacting to one idea can be visualized by depicting regulatory networks as another instantaneously (timed by rate constants), we explore directed graphs, with nodes representing biological species, and network motif modeling using delay differential equations pointed vs. blunt arrows indicating activation vs. repression, (DDEs), which have derivatives depending explicitly on the value respectively (Fig. 1). DDE models allow a single arrow to of variables at times in the past. For example, faithfully capture many biochemical steps18,33,43,expandingthe available dynamics in a model with a reduced set of equations x_ðtÞ¼αxðtÞð1Þ and parameters. DDE regulatory models have in fact been used is an ODE, and widely to model a range of biological phenomena such 17,44 30,31 _ð Þ¼α ð À τÞðÞ as development and hematopoiesis . For instance, a 1- x t x t 2 variable ODE such as Eq. (1) can only produce exponential

ODE Model DDE Model a τ τ Z XX Y Z X X Z

b

c 1.0 1.0

0.8 0.8

0.6 0.6

Concentration 0.4 Concentration 0.4

0.2 0.2 x y z

0.0 0.0 0 5 10 15 20 25 30 35 40 0 5 10 15 20 25 30 35 40 Time (t ) Time (t )

Fig. 1 Explicit inclusion of time delays in mathematical models of network motifs can reproduce non-delay models using fewer variables and parameters, but can also lead to more complex behavior. a An example genetic regulatory network including genes X, Y, and Z, regulated by one another either positively (activation, pointed arrow) or negatively (repression, blunt arrow). The model on the left incorporates no explicit delay terms, whereas the model on the right incorporates explicit delay terms τx and τz. b Ordinary differential equations (ODEs) and delay differential equations (DDEs) corresponding to (a) with regulation strengths αi, removal rates βi and cooperativities ni. c Numerical simulations of equations in (b) for one set of initial conditions using parameters αx = 1, αy = 1.2, αz = 1.2, βx = βy = βz = 1, nx = ny = nz = 2 for the ODE simulation, and αx = 0.5, αz = 0.3529, βx = βz = 0.5, nx = nz = 2 for the DDE simulations (dashed curves: τx = 0.8, τz = 0.1; solid curves: τx = 3, τz = 4). Note that delays can cause more complex dynamics (e.g., transient oscillations) compared to models in which effects are instantaneous, and where both models give the same long-term steady state behavior. Left: instantaneous effects modeled using ODEs, Right: delayed effects modeled using DDEs.

2 NATURE COMMUNICATIONS | (2021) 12:1788 | https://doi.org/10.1038/s41467-021-21700-8 | www.nature.com/naturecommunications NATURE COMMUNICATIONS | https://doi.org/10.1038/s41467-021-21700-8 ARTICLE growth or decay45,46. A corresponding DDE, such as Eq. (2), a fi can also oscillate (with amplitude approaching zero or in nity) X Y and, if nonlinear, lead to stable oscillations, bistability and chaos13,26,47–49. A key challenge in using DDEs is their mathematical com- b plexity relative to ODEs50,51. For example, while Eq. (1)is1- dimensional because one initial condition (x at t = 0) determines X Y X Y all future behavior, Eq. (2)isinfinite-dimensional, because x must be specified at all times − τ ≤ t ≤ 0 to predict a unique c 6 6 solution50,51. Concretely, the solution to Eq. (1) can be written as a single exponential, while Eq. (2) generally must be specified as a 5 5 sum of an infinite number of exponential terms to satisfy initial 4 4 conditions. 3 3 Despite the challenges, much progress has been made in 46,52,53 2 2 Concentration analytical understanding of DDEs , and numerical Concentration 54,55 methods exist for simulation . We thus see an opportunity to 1 1 use DDEs to recapitulate dynamics found in ODE solutions of X Y network motif behavior with fewer genes and thus fewer mod- 0 0 eling parameters and equations (Fig. 1), a type of “modeling 0 2 4 6 8 10 0 2 4 6 8 10 Time (T) Time (T) simplicity.” In this work, we thoroughly examine the most common net- Fig. 2 Direct regulation by activators and inhibitors can be captured work motifs2,6 with explicit delays and present an approachable, using a unified delay model. a The simplest regulation network consists of step-by-step view of the mathematical analysis (applying estab- a single input X directly regulating a single output Y. We use a dotted arrow lished DDE methods34,51) in order to make such delay equations to represent either activation or repression, with an implied explicit delay. easy to use for biologists and others. We show the essential role of b Direct activation (left) is represented by a pointed arrow and direct delays in autoregulation, feedforward loops, feedback loops, repression (right) by a blunt arrow. c Time response (Eq. (7)) of activated multiple feedback, and complex networks, as well as instances (left) and repressed (right) Y following a rise in X that exponentially where delays may be ignored. A reference summary is provided at approaches a new steady state (ηX = 6) from zero (governed by _ the end in Table 2. Finally, we discuss how these results can be XðTÞ¼ηX À XðTÞ). Note that the finite value of ηX leads to an effective applied to understanding fundamental design principles of var- leakage slightly greater than ϵ for the repressor case. For the activator ious natural biological systems. (n = −2), we chose η = 5.6528 to match esthetically between the X and n Y steady states, such that ηX ¼ ϵ þ η=ð1 þ ηXÞ. For the repressor (n = 2), we similarly chose η = 5.5 to match esthetically between the X steady state Results and Y initial condition, such that ηX = η + ϵ. In both cases, γ = 2, ϵ = 0.5, Our results are divided up into 7 sections corresponding to 7 and ηX = 6. Initial conditions were X = Y = Z = 0.01 for all T ≤ 0. different regulatory networks of increasing complexity. An overall reference table (Table 2) is included in the discussion. Together these can be written as: α nð Þ Motif 0: direct Hill regulation.Wefirst describe how we use _ð Þ¼α þ x t À β ð Þð Þ: ð Þ y t 0 n y t activator 3 DDEs to model simple regulation of a gene Y by a gene X as the k þ xnðtÞ fi most basic motif, and then provide a simple yet uni ed mathe- If x instead “represses” y instead of activating it, the form is matical framework for both activation and inhibition with delay. similar: Activation and inhibition can both be modeled with a single αkn y_ðtÞ¼α þ À βyðtÞðrepressorÞ: ð4Þ unified function. We consider a transcription factor x regulating 0 kn þ xnðtÞ the production of a protein y (Fig. 2). If x activates y, the pro- duction rate of y increases with increasing x, generally saturating For biologically meaningful results, all variables and parameters at a maximum rate α. Often there is an additional cooperativity in these equations should be real and non-negative. Note, parameter n which determines how steeply y increases with x in however, that the activator case is equivalent to the repressor the vicinity of the half-maximal x input value k. In this framework, case with n < 0. In this paper we will therefore allow n to be fi n = 0 is constitutive production, n = 1 is a Michaelis-Menten negative, which is simply a notational modi cation used in order regulation, 1 < n < 5 is a typical biological range of cooperativity, to combine the two cases. With this notation, the effective → ∞ cooperativity is ∣n∣. Thus, we have: and n is a step-function regulation. If x represses y, the same 8 conditions hold except that the production rate of y then decreases <> À1 many regulatory phenotypes in biology, including transcription 0

NATURE COMMUNICATIONS | (2021) 12:1788 | https://doi.org/10.1038/s41467-021-21700-8 | www.nature.com/naturecommunications 3 ARTICLE NATURE COMMUNICATIONS | https://doi.org/10.1038/s41467-021-21700-8

a X Y Z

b ODE model 1.5

1.0 X Y Z 0.5

0.0

Equivalent DDE model 1.5

τ 1.0 X Z 0.5

Concentration 0.0

Multi-delay DDE model 1.5

ττ 1.0 X Y Z 0.5

0.0 0 1 2 3 4 5 6 Time (T )

X Y Z

Fig. 3 A delayed model of cascades recapitulates the implicit delays in ODE models. a A cascade is a linear sequence of regulation steps, here X regulating Y regulating Z. b Standard models of cascades use ODEs (top), in which each step leads to a characteristic delay in the products Y and Z, which increases with each step based on the half-maximal inputs and degradation rates for each step. In an equivalent DDE model (middle), similar behavior is accomplished by replacing the explicit cascade of implicit delays with a single-step regulation including an explicit delay. A cascade in which each step contains an explicit delay (bottom) behaves analogously to delayed direct regulation (as in middle), with the final step delayed by the sum of delays in each step. ηX = 1.5, ηY = ηZ = 2.17, βX = βY = 1, βZ = 0.667, nX = nY = − 2. For the bottom graph in (b), each step is governed by Eq. (9) with identical parameters. literature60, which in our notation would refer strictly to a negative concentrations in units of k and times in units of 1/β. This yields: value of n with magnitude less than one (i.e., − 1 À1 1, which allows there to η < be 3 fixed points for n < 0 when feedback is introduced below Y_ ðTÞ¼ϵ þ À YðTÞ n ¼ 0 ðconstitutiveÞ ; 1 þ XnðT À γÞ :> (Supplementary Fig. 1). 0 À1 ≤ fi 0

4 NATURE COMMUNICATIONS | (2021) 12:1788 | https://doi.org/10.1038/s41467-021-21700-8 | www.nature.com/naturecommunications NATURE COMMUNICATIONS | https://doi.org/10.1038/s41467-021-21700-8 ARTICLE falls within a range of methods used to replace intermediate steps The total delay in a cascade equals the sum of individual delays. with a delay18,41,42. Forcascadeswithdelaysateachstep,thesameanalysisimpliesthat β β + γ + γ total delay equals the sum of individual delays ( z/ y y z,with γ γ Delayed direct regulation approximates cascades of non-delayed y the intrinsic delay between X and Y and z the intrinsic delay regulation. For a non-delayed cascade motif in which X regulates between Y and Z). Figure 3 shows simulations of ODE, equivalent Y, which in turn regulates Z (Fig. 3), one can write down a DDE, and multi-delay DDE cascade models, matching the above nondimensional set of governing equations as follows: analytical results. β z _ ð Þ¼ η À ð Þ Motif II: autoregulation. Autoregulation, one of the most β X T X X T x common biological motifs2,63, describes a single biological species β η that regulates its own production (Figs. 4a–c). z Y_ ðTÞ¼ Y À YðTÞ ð8Þ β þ nX ð Þ y 1 X T η The complete phase space for autoregulation demonstrates the Z_ ðTÞ¼ Z À ZðTÞ; quantitative and qualitative importance of delays. Based on Eq. þ nY ð Þ 1 Y T (5), the governing equation for such a system with delayed reg- β β β ulation is given by setting Y = X (output equals input) in Eq. (7): in which x, y, and z are the dimensional degradation rates of X, Y, and Z, respectively (Supplementary Note 1). We have included _ η XðTÞ¼ϵ þ À XðTÞ: ð11Þ here an explicit input function X for concreteness, but more 1 þ XnðT À γÞ generally we can consider any input X(T) with characteristic β This equation has four parameters (η, γ, ϵ, and n). timescale 1/ x. β β ≪ fi Since leakage must be small relative to regulation (i.e., ϵ/η ≪ 1) If Y changes quickly compared to X (i.e., x/ y 1), a rst fi for regulation to be strongly effective (“activated” rate much approximation to arriving at a simpli ed model that ignores Y is “ ” _ ð Þ greater than non-activated rate), we will focus here on the case to replace the appearance in Z T of Y(T) with the X-dependent with no leakage (ϵ = 0). We treat non-negligible leakage in the _ ð Þ¼ pseudo-steady state Ypss(X(T)) found by setting Y T 0. A supplements (Supplementary Note 3). Note that in general Eq. ðβ =β Þ2  more precise estimate with the looser demand that x y 1 (11) has no closed-form solution. can be found by using the same pseudo-steady state, but delayed − γ γ = β β = * in time as Ypss(X(T )), with z/ y (Supplementary Note 1). Fixed points do not depend on delays. Fixed points X(T) X do Intuitively, this delay takes into account the fact that on the not change with time, implying X_ ðTÞ¼0andX(T) = slower timescale of X, Y effectively follows the dynamics of X, but X(T − γ) = X*.InEq.(11), this implies that production must β β the delay accounts for the non-zero time z/ y that it takes for Y balance degradation (Fig. 4d). For repressors (n >0)thereis β to respond to such changes in X (the z deriving merely from only a single fixed point for biologically relevant parameter = β normalizing time T t z). By removing Y we lose certain values. For activators (n < 0), there can be 1, 2, or 3 fixed points information, such as the ratio of Z or X to Y, but the inclusion of (2 fixed points is a border case for −n > 1). Explicitly, the fixed a delay provides for a reasonably quantitative approximation of point values are given by ’ the output Z s dynamics as a function of the input X. ÃðÞ¼þ Ãn η ð Þ After plugging the delayed pseudo-steady state of Y into Z_ ðTÞ, X 1 X 12 one can match the values of the composite Hill-within-Hill or X* = 0 (for activators only). Again, we assumed ϵ = 0for = = → ∞ = function at X 0, X 1, and X as well its the slope at X 1 simplicity. Note that these fixed points only depend on 1/η = βk/α compared to a single Hill function with leakage, and thereby ϵ η = α α τ and / 0/ , and have no dependence on the delay time . approximate the cascade as a single-step regulation of Z by X (Supplementary Note 1): Linearization is sufficient to determine bifurcations in qualitative fi δ = − α h behavior. Small disturbances from xed points X(T) X(T) _ ð Þα þ k À ð Þ: ð Þ X* ≪ 1 linearize Eq. (11) (Supplementary Note 2). Assuming a Z T 0 Z T 9 kh þ XhðT À γÞ solution δXðTÞ¼A expðλTÞ yields a transcendental “character- istic equation” for the eigenvalues λ of Eq. (11): where the combined regulation parameters are (Supplementary Àγλ Note 1) λ þ ηMe þ 1 ¼ 0: ð13Þ

j j * η ÀÁþ η η nY The constant function of the fixed point value M(X )is Z sgn nY 1 Z Y α ¼ n α ¼ j j 0 þη Y 2 nY fi 1 Y 1þη de ned as  Y : ð Þ sgn nY 10 ÃnÀ1 jn jÀ jn j h ¼ 2 Y 1 ¼ÀnX nY 2 Y à nX k jn j h jn j MðX Þ¼ ; ð14Þ 1þη Y 2 2 Y À1 Ãn 2 Y ðÞ1 þ X The k can be removed by renormalization of X. whose sign is given by n (positive for repressors and negative for Equation (10) has several biological consequences. First, the activators). overall Hill coefficient h is negatively proportional to the product To determine stability of the fixed points, we solve for λ λ ¼ of individual cooperativities nX, nY. This makes the cascade conditions in which crosses the imaginary axis (Re 0), activating for either two activators or two repressors, and occuring at either λ = 0 (a saddle-node bifurcation) or λ = iω (a repressive otherwise. It also makes the cascade more cooperative Hopf bifurcation). than its components, in line with past analyses62 and as found 61 experimentally . Third, the leakage is zero for nY < 0 and Saddle-node bifurcations determine bistability in autoactivators. α ≪ α η ≫ λ = negligible (i.e., 0 ) for nY >0if Y 1. This means Y must be For the saddle-node case ( 0), Eqs. (13) and (12) reduce to produced in sufficient amount during the delay to repress Z.We (Supplementary Note 2): generally ignore leakage in the main text; for a more detailed ÀÀnÀ1 η ¼À ðÀ À Þ Àn : ð Þ discussion see Supplementary Note 3 and Supplementary Fig. 2. n n 1 15

NATURE COMMUNICATIONS | (2021) 12:1788 | https://doi.org/10.1038/s41467-021-21700-8 | www.nature.com/naturecommunications 5 ARTICLE NATURE COMMUNICATIONS | https://doi.org/10.1038/s41467-021-21700-8

Fig. 4 The complete phase diagram for the autoregulation network motif has analytically derivable parameter regions for bistability, monostablility, monostablility with damped oscillations, and oscillations. a The autoregulation network motif, with a dotted arrow indicating either (b) self-activation or (c) self-repression. The two cases are given by n <0 (activation) and n > 0 (repression). d Stable (black circles) and unstable (white circles) fixed points for activator and repressor cases are given by the intersection of the regulation (solid) and degradation+leakage (dashed) lines. Note that activators can have 1, 2, or 3 fixed points, whereas repressors always just have one. e Parameter space showing all possible behaviors for autoregulation with delay. Shading shows simulation results (with an interval of 0.1 for both γ and η axes) and curves show the analytically derived bifurcation boundaries. See Supplementary Fig. 3a for cases −3 ≤ n ≤ 3 and Supplementary Fig. 3b for boundaries in η vs. n parameter space. f Representative simulation curves for the four qualitatively different behaviors, with different colors representing different initial conditions (see “Methods”). ϵ = 0.

one otherwise. For −1 0. Note that this boundary does not depend on delay; however, that does not preclude other features such as basins of attraction from depending on delay64. Viewed as a function of n, Eq. (15) limits bistability to −n >1 and the boundary to 1 ≤ η ≤ 2 (Supplementary Fig. 1b). Since this function is non-monotonic, it is also possible (although biologically perhaps unrealistic except on an evolutionary time- scale), to hold a value of 1 < η < 2 and decrease n to a point where the bistability is lost, and then decrease n still further until bistability is gained again.

Hopf bifurcations determine oscillatory behavior in autorepressors. For the Hopf bifurcation (λ = iω), Eqs. (13) and (12) result in two equations, one for the real parts of Eq. (13) and one for the imaginary parts (Supplementary Note 2):

1 À1 γ ¼ ω ðÞÀtan ω þ πk ; k ¼ 0; 1; ¼ Ànþ1 ð Þ j j j j n 16 η ¼ pffiffiffiffiffiffiffiffin pffiffiffiffiffiffiffiffin À 1 : 1þω2 1þω2

Equation (16) represent a series of curves parameterized by ω, and is biologically meaningful (γ >0, η > 0) for k ≥ 1. For autoactivation (n < 0), these curves all lie above the bistability boundary (Eq. (15)), and thus have no qualitative effect on behavior. For autorepression (n > 0), however, the outermost curve (k = 1) dictates the onset of oscillations for any n >1. This boundary has both horizontal (η) and vertical (γ) asymptotes, given as:

Ànþ1 η ¼jjðj jÀ Þ n lim Hopf n n 1 ω!0 ÀÁ À1 Àj jÀ1 ð17Þ γ ¼ cospffiffiffiffiffiffiffiffiffiffiffiffiffin : limpffiffiffiffiffiffiffiffi Hopf ω! n2À1 n2 À 1 Thus oscillations require both a minimal regulation strength and a minimum delay. The vertical (γ) asymptote approaches zero as n → ∞, so large regulatory strength can achieve oscillations even with minuscule delay if cooperativity is extremely steep. which is biologically meaningful (η > 0; Im η ¼ 0) only for auto- The oscillation period can be approximated by linearization activation (n < 0), where − n is the biologically relevant quantity. near consecutive maxima and minima of the oscillation We can see that Eq. (15) separates monostability from bistability (Supplementary Note 2). This method yields a period of by noting that the production and removal curves (Fig. 4d) are approximately 2(γ + 1), or 2(τ + 1/β) in dimensionful terms tangent when Eq. (15) holds (Supplementary Note 2), yielding (compare also to17). Biologically, this means that the concentra- two stable fixed points when η is above this boundary and only tion X is pushed from high to low (or vice versa) after the delay

6 NATURE COMMUNICATIONS | (2021) 12:1788 | https://doi.org/10.1038/s41467-021-21700-8 | www.nature.com/naturecommunications NATURE COMMUNICATIONS | https://doi.org/10.1038/s41467-021-21700-8 ARTICLE

τ * ≡ η time ( ) has elapsed and the concentration has equilibrated to its Let us say that X and Y settle on steady-state values X X, β * ≡ η η η new value via degradation (1/ ). Y Y, as inputs to our . A value of X or Y Damped oscillations are expected when the largest eigenvalue significantly greater than 1 is then “high” (true, 1), and “low” satisfying Eq. (13) has non-zero imaginary part. This is never true (, 0) if much less than 1. We then want to determine for n < 0, and is true for n > 0 above the curve denoted “spiral whether Z* is greater than (true) or less than (false) 1. For ” boundary in Fig. 1e and Supplementary Fig. 3. This curve is example, if n1,2 > 0 (two repressors), Table 1 gives the possible given as follows: steady states of Z.IfηZ1 and ηZ2 are greater than 1, these steady NAND ÀÁþ states approximate a gate. If they are less than 1, but sum to γþ γþ Àn 1 η ¼ nγe 1 nγe 1 À 1 n ; ð18Þ greater than 1, the steady states instead approximate a NOR gate. η η η Equivalent calculations for all variations of n1, n2, X, Y, Z1, η = which is derived in Supplementary Note 4. It approaches 0 and ηZ2 (Supplementary Table 2) show that logic is dependent on γ γ+1 = ð Þη ð Þη for large delay and has a vertical asymptote at n e 1, so only two parameters, sgn n1 Z1 and sgn n2 Z2. These form a there is some non-zero delay that has non-oscillating decay for 2D parameter space that summarize the logic into a convenient any strength η and finite n. chart (Fig. 5b). This implies evolution or other tuning can Putting together the derived boundary curves yields an η-γ smoothly convert between logic gates (see also66,67). The chart is η ↔ η ↔ phase space for each n, displayed in Fig. 4e and Supplementary symmetric on interchange of the two inputs ( 1 2, n1 n2), Fig. 3a-b along with simulations showing that this analytical and anti-symmetric (that is, application of logical NOT)by → − treatment matches the dynamical behavior. conversion of an activator to a repressor or vice versa (ni ni). Fourteen of the 16 possible two-input logic functions are Leakage prevents oscillations and bistability. Autoregulation with represented. All fourteen are monotonic in that Z(X, Y = 1) > leakage (Supplementary Note 3) adds the extra parameter ϵ ≠ 0. Z(X, Y = 0) and Z(X = 1, Y)>Z(X = 0, Y). The two non- Small leakage ϵ ≪ η does not change the qualitative results while monotonic gates, XOR and XNOR, are not represented by this large leakage effectively overwhelms the regulation term, pre- simple logic motif, because summation (addition of Hill terms) is venting both oscillations (for autorepression) and bistability (for monotonic. However, they can be constructed by connecting autoactivation). The full treatment with leakage and the corre- several of these gates70,72. sponding phase portraits are presented in the supplements (Supplementary Note 3, Supplementary Fig. 2). The logic parameter space can be divided into AND-type, OR-type, and single-input functions. Only the 8 regulatory functions on the Motif III: logic. A general class of functions used to describe diagonals of Fig. 5 (excluding FALSE and TRUE) make use of natural2,58,65–67 and synthetic68,69 biological networks are logic both inputs. These eight can be further divided into positive or gates, which have two inputs regulating a single output (Fig. 5). negative regulation on each arm (4 possibilities) in conjunction Gates exhibit either high (“on”) or low (“off”) output depending with an AND or OR gate (8 possibilities total). Specifically, “OR- ” η η OR NAND on whether inputs are on or off. For example, the AND gate type logic applies when both Z1 > 1 and Z2 >1 ( , , specifies high output only if both inputs are on. In this section we and both IMPLY gates), and “AND-type” logic applies when both η η AND NOR NIMPLY provide a specific DDE-based framework that covers 14 out of 16 Z1 < 1 and Z2 <1( , , and both gates). This can possible 2-input logic operations, and show that these operations be seen mathematically by using Boolean logic simplification. For form a continuous 2D parameter space. example, X NOR Y = NOT X AND NOT Y. Similarly, X NAND Y = NOT X OR NOT Y. A two-parameter summing function reproduces all 2-input It is important to note that this logic scheme is an monotonic logic gates.Wefirst write out nondimensionalized approximation, and in reality the sum of two Hill terms provides equations corresponding to the logic gate motif as depicted in a form of fuzzy logic73. That is, if the inputs X or Y are close to 1, η Fig. 5a. We assume that the degradation constants (β) for Z and R or if the regulatory strengths Z1,2 are close to 1, then Z will also are equal for simplicity, and that there is no leakage. be close to 1 for some input combinations (Supplementary η η Note 5). _ ð Þ¼ Z1 þ Z2 À ð Þ Z T þ n1 ð Àγ Þ þ n2 ð Àγ Þ Z T Note that if X(T) and Y(T) are independent, they can be time- 1 X T 1 1 Y T 2 ð Þ η 19 shifted in Eq. (19)byγ and γ , respectively, showing that the _ ð Þ¼ R À ð Þ; 1 2 R T þ n3 ð Àγ Þ R T 1 Z T Z dynamics do not depend on delays. This is not true if X and Y are dependent (e.g., X = Y), which leads to interesting dynamics that We describe the regulation of Z by X and Y using a sum of Hill we examine below in feedforward loops and double feedback. terms. Logic gate behavior can be captured with other approaches such as a product of Hill terms, or summation within a single Hill 58,66,67,71 term , each representing subtly different biology. We Motif IV: feedforward loop. Equipped with a multivariable choose the separate Hill term approach as it describes many logic generalization of 1-variable Hill regulation (Eq. (19)), we turn our functions simply by tuning regulatory strengths, and can be attention to the feedforward motif (Fig. 6), a non-cyclic regulation extended to include multiplicative terms (Supplementary Note 5). network in which an input, X, regulates an output, Z, via two Caveats include multiple states for Z, requiring additional separate regulation arms. One arm is “direct”, in which X reg- binarization via R (Fig. 5c), as well as poor response to ratiometric ulates Z in a single step, while the second arm is “indirect”, with X inputs, discussed in the next section on feedforward motifs. regulating an intermediate Y, which in turn regulates Z. In this Using Eq. (19), we can characterize the motif logic based on the fi “ ” – 72 way, the rst arm feeds forward past the cascade (Fig. 6a b). idea of dynamic range matching . Every regulator in Eq. (19)is The motif is found commonly in biological networks6,74, com- effectively compared against unity in the denominator of the Hill prising about 30% of three-gene regulatory interactions in tran- function for its corresponding output. For instance, Z provides an scriptional circuits75. Feedforward loops are conventionally “on” or “off” signal to R if Z >1orZ < 1 respectively. Z can take “ ” j j described as incoherent if X activates Z through one arm but η  ð n1 Þ on values below 1 as long as Z1 max X and represses through the other, and “coherent” otherwise (Supple- j j η  ð n2 Þ Z2 max Y , otherwise Z will always activate R, as indicated mentary Table 3). In this section, we show that the essential by the areas marked TRUE in Fig. 5. behaviors of feedforward loops are due to a difference in delays

NATURE COMMUNICATIONS | (2021) 12:1788 | https://doi.org/10.1038/s41467-021-21700-8 | www.nature.com/naturecommunications 7 ARTICLE NATURE COMMUNICATIONS | https://doi.org/10.1038/s41467-021-21700-8

a

X Z R Y

b X X

Y sgn(n2)ηZ2 Y −X−n1 +X+n1 −1 max +1 max

Z Z TRUE TRUE +n2 +Ymax

Y IMPLY X NOT Y NOT Y X NAND Y TRUE −1 TRUE Y X NOR Y

X NOT X sgn(n X NIMPLY FALSE FALSE 1 )η

FALSE FALSE Z1 X X X AND LY NOT X Y

Y NIMP TRUE +1 TRUE

X OR Y Y Y X IMPLY Y

−n2 −Ymax TRUE TRUE Z Z

X X

Y Y

c X AND Y X OR Y 1 X

0

1 R η Y

0

1 Z

0 Concentration / 1 R

0 0 10 20 30 40 0 10 20 30 40 Time (T ) between the two inputs to Z and the logic function between the delays (Fig. 6a, b). Looking at Fig. 6a,wecanthenwritedowna two inputs to the output Z. simple equation for the regulation of Z, by setting Y = X in Eq. (19) (Supplementary Note 6): Feedforward dynamics depend only on the difference in time delay _ η η between two regulatory arms and their 2-input logic. With a DDE ZðTÞ¼ 1 þ 2 À ZðTÞ: ð20Þ 1 þ Xn1 ðT À γ Þ 1 þ Kn2 Xn2 ðT À γ Þ model, we can drop the cascaded intermediate Y,focusing 1 2 solely on Z as regulated by X via two arms that have unequal Because each regulation term is controlled by the same input

8 NATURE COMMUNICATIONS | (2021) 12:1788 | https://doi.org/10.1038/s41467-021-21700-8 | www.nature.com/naturecommunications NATURE COMMUNICATIONS | https://doi.org/10.1038/s41467-021-21700-8 ARTICLE

Fig. 5 A simple approximation for digital logic using a sum of Hill terms recapitulates all monotonic logic functions in a single parameter space. a A prototypical regulatory network involving logic where X and Y both regulate Z, which must integrate the two signals using some logic before it can in turn activate a downstream reporter R. b Parameter space showing regions where regulation approximately follows 14 of the 16 possible 2-input logic functions depending on the strength of two single-variable Hill regulation terms (ηZ1: regulation of Z by X, ηZ2: regulation of Z by Y). Network logic can be smoothly altered by varying the parameters (ηZ1, ηZ2), with a change of sign in (n1, n2) required to switch quadrants. The bottom-left quadrant shows that very weak regulation in both terms leads to an always-off (FALSE) function, weak regulation in one arm only leads to single-input (X, Y) functions, strong regulation in both arms leads to an OR function, and regulation too weak in either arm alone to activate an output but strong enough in sum leads to an AND function. The other three quadrants are related by applying NOT to one or both inputs, with function names related by de Morgan’s law70 NOT(X OR Y) = NOT X AND NOT Y. In particular, X IMPLY Y = NOT(X) OR Y, X NIMPLY Y = X AND NOT(Y), X NOR Y = NOT X AND NOT Y, and X NAND Y = NOT X OR NOT Y. Truth tables for all 16 logic gates are provided in Supplementary Table 1 for reference. The two non-monotonic logic functions, X XOR Y and X XNOR Y, are those 2 of 16 not reproduced directly using this summing approximation. They can be produced by layering, e.g., NAND gates70. c Representative time traces for AND (ηZ1 = ηZ2 = 0.9) and OR (ηZ1 = ηZ2 = 1.8) gates with n1 = n2 = −2, n3 = −20, ηR = ηZ1 + ηZ2. The function sgn ðnÞ¼þ1 when n >0, sgn ðnÞ¼À1 when n <0.

NAND in which Table 1 Logic function for two repressors based on ÀÁ  À Àð ÀωÞ Eq. (19). f ðTÞ¼ 1 À e T ΘðTÞÀ 1 À e T ΘðT À ωÞ η η η η Z* Z* η 1 2 X Y for Z1,2 >1 Z ¼ þ ss þ n1 þ ðÞn2 ð Þ 1 X 1 KX0 24 ≪ 1 ≪ 1 ηZ1 + ηZ2 >1 0 n 2 ≪ 1 ≫ 1 ηZ þ ηZ =ηY >1 n 1 1 1 n 2 Z ¼ ÀÁÀ : ≫ 1 ≪ 1 η =η 1 þ η >1 κ jnj jnj Z1 X Z2 1 þ κη 1 þ ðÞκX ≫ 1 ≫ 10 <1 X 0 n Here, Zss is the steady-state value of Z, Zκ are the magnitudes of deviation from steady state due to each arm, and f(T) specifies (X), we cannot in general normalize the half-maximal input to 1 where the responses from the two regulation arms are active. In in both terms as we did for logic (Eq. (19)); K = k /k represents 1 2 terms of the original X (as opposed to the time-shifted X^), the the ratio of the two input scales. Likewise, we cannot entirely γ time-shift out the delays; instead, shifting X backwards in time output in Eq. (24) is shifted to the right in time by 1 relative to the original input X(T). by γ (X^ðTÞ¼XðT þ γ Þ), we see that the behavior of the 1 1 There are several interesting results to note in this equation. feedforward equation actually depends only on the difference in First, the cooperativities (n , n ) and thresholds (K) affect the regulatory delays, Δγ = γ − γ rather than each delay inde- 1 2 2 1 response magnitude, but not the dynamics (f), because the input pendently: signal is already infinitely steep. η η η Second, the values only affect the steady-state Zss and the Z_ ðTÞ¼ 1 þ 2 À ZðTÞ: ð Þ ð Þη n1 n2 21 response logic (as sgn ni , see logic discussion). Only 8 logic gates þ ^ ð Þ þ n2 ^ ð À ΔγÞ i 1 X T 1 K X T correspond to feedforward loops, in that they respond to both AND OR ^ inputs: the four -type functions and four -type functions. For clarity we will from now on refer to X as X without the hat Third, f indicates where responses are active, varying from 0 far unless specified. outside a pulse, aprroaching 1 inside for wide pulses (ω ≫ 0). The To understand the behavior of Eq. (21), we will analyze the output then has four responses (pulse start and pulse end for each n output of Z to two types of input X: a step input, and a arm), in which Z moves away from Zss by as much as Zκ (pulse continuous oscillation. Termed the step and frequency responses, on) before returning (pulse off). Responses must be driven respectively, these are often used in control theory to characterize externally, unlike autoregulation. 76 input-output relations . For coherent feedforward motifs, input pulses must be sufficiently wide (ω ≫ 1) to fully activate the output R.Thisimplies Step-pulse response of feedforward motifs can be solved analytically that coherent feedforward motifs act as filters against short signals, fi and demonstrates ltering and pulse-generation behaviors.We either short on signals (AND and NAND)orshortoffsignals(OR and considered a step input (Fig. 6c) to include both a step on (from NOR). The delay difference Δγ determines how quickly the response low to high X) as well as a step off (from high to low X): starts (AND and NOR logic) or returns to baseline once the pulse is over (for OR and NAND logic), so that large Δγ maintains a response ð Þ¼ þðη À ÞðÞðΘð ÞÀΘð À ωÞ Þ X T X0 X X0 T T 22 long after the input pulse has subsided. For incoherent feedforward motifs, the output R is only fully where the Heaviside function is defined such that Θ(T) = 0 for activated if the pulse is wide (ω ≫ 1) and the delay difference is T < 0 and Θ(T) = 1 for T > 0. Eq. (22) represents a square input also wide (Δγ ≫ 1), in which case a pulse of output is formed. The ω η IMPLY pulse of width starting at X0 and reaching to X. This is an on- output pulse is formed on either the on-step (slow arm η η NIMPLY pulse if X > X0 and an off-pulse if X < X0. fast arm, and slow arm fast arm) or the off-step (fast The lack of feedback in feedforward loops and the fact that the arm IMPLY slow arm, and fast arm NIMPLY slow arm). This square-pulse input of Eq. (22) takes on only two values simplify means that incoherent feedforward motifs act as pulse generators. the form of Eq. (20) significantly, allowing it to be solved The delay difference Δγ determines the minimum width of input explicitly (Supplementary Note 6). The solution is: pulse that will produce a response in R. Many of the feedforward behaviors described in this section 2,2,58,74,75,77,77,78 ZðTÞ¼Z þ sgn ðn Þη Zn1 f ðTÞþsgn ðn Þη Zn2 f ðT À ΔγÞ corroborate earlier results from ODE models ,butare ss 1 1 1 2 2 K derived here with just a single equation. In particular, it is well known ð Þ 23 that coherent feedforward loops have filter capabilities and that

NATURE COMMUNICATIONS | (2021) 12:1788 | https://doi.org/10.1038/s41467-021-21700-8 | www.nature.com/naturecommunications 9 ARTICLE NATURE COMMUNICATIONS | https://doi.org/10.1038/s41467-021-21700-8

a b Y

X Z R X Z R

c AND-type logic OR-type logic AND OR 1.0

X Z 0.5

0.0 NOR NAND 1.0 X Z X 0.5 η

0.0 direct arm NIMPLY indirect arm indirect arm IMPLY direct arm 1.0 X Z 0.5 Concentration / 0.0 indirect arm NIMPLY direct arm direct arm IMPLY indirect arm 1.0 X Z 0.5

0.0 0 20 40 60 80 100 0 20 40 60 80 100 X R Time (T ) d e 2.00 1.0

1 Theoretical I 1.75 Fit 0.5 1.50

1.25 Magnitude ( ) 0.0 1.00 X −0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 Z 2π 0.75 Z3 R

1 3π/2 Concentration / a.u. 0.50 φ π 0.25

Phase ( ) π/2

0.00 0 460 465 470 475 480 485 490 495 500 −0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5

Time (T ) Frequency (k=fZ /f )

f 0 g 10 0.7 f(Imax ) 1 1 I −1 Imax 10 0.6 1 1−I0 −2 10 0.5 Magnitude ( ) −3 10 0.4 Δγ = 10.0 Δγ = 1.0 Δγ = 0.1 Envelope 2π 0.3

1 3π/2

φ 0.2 π 0.1 Amplitude, Frequency / arb. units

Phase ( ) π/2

0 0.0 −3 −2 −1 0 1 −3 0 3 10 10 10 10 10 10 10 10 Frequency (f ) Delay difference (Δγ ) incoherent feedforward loops can act as pulse generators entirely on the difference of delaysinthetworegulationarms,afact (temporal2,58,77 or spatial79). We did not demonstrate fold-change that can only be seen indirectly with ODE models58. detection (FCD)78 because of our use of sum-like logic; an alternative logic formulation does show FCD, implying that FCD has certain Frequency response of feedforward motifs can be solved analytically mechanistic requirements (Supplementary Note 6). Furthermore, we and demonstrates low- and band-pass filtering capabilities. Biological clearly demonstrated that the feedforward loop dynamics depend regulatory networks often encode information as the change in

10 NATURE COMMUNICATIONS | (2021) 12:1788 | https://doi.org/10.1038/s41467-021-21700-8 | www.nature.com/naturecommunications NATURE COMMUNICATIONS | https://doi.org/10.1038/s41467-021-21700-8 ARTICLE

Fig. 6 The feedforward network motif owes its primary functions to a difference in regulatory delays. a The feedforward motif with delays, in which a single output Z is controlled by an input X via two regulatory arms with differing delays. The straight, short arrow represents the “direct arm” with delay γ1 and the longer, curved arrow represents the “indirect arm” with delay γ2 > γ1. b The ODE model for an incoherent (type 1) feedforward motif, one of 8 possible networks in which the intermediate gene Y is modeled explicitly in the indirect arm. c Simulations of the four feedforward motifs with AND-type and OR-type logic (Fig. 5 and Supplementary Table 1) in response to short and long gain and loss of input signal. Blue curves: inputs (X), orange curves: reporter R activated with high cooperativity by Z. Note that the bottom two rows demonstrate pulse generation, while the top two rows filter short signals. d Response of an incoherent feedforward motif to oscillatory input after initial transients have died away. Z3 is a 3-frequency Fourier approximation of Z (see E). e Fourier decomposition of Z from (d) by Eq. (26) and by a numerical fit to the data in (d). f Frequency scan (Bode plot) of (d) for 3 values of Δγ, with the theoretical envelopes from Eq. (28). g The maximum amplitude of the motif in (d) over a range of Δγ and the corresponding frequencies at which the maxima occur. Z goes above 1 (activation threshold for R) for a small range of Δγ. For (c–f), η1 = 0.9, η2 = 0.7, n1 = 2, n2 = −2, n3 = −20, ηR = 2, A = 1. For d, f = 0.05, Δγ = 4.

80 frequency of an oscillating input , which has been suggested to be Supplementary Note 6), the output magnitude Ik then increases more robust to noise than encoding information in absolute con- to a local maximum for coherent feedforward motifs 81–83 fi ð Þ¼ ð Þ centration . That feedforward loops lter short square pulses (sgn n1 sgn n2 ) and decreases to a local minimum for fi ð Þ¼À ð Þ suggests more general frequency- ltering capabilities. We therefore incoherent feedforward motifs (sgn n1 sgn n2 ). The analyze feedforward frequency response to sinusoidal input opposite holds for frequencies that are half-integer multiples of (Fig. 6d–g). We show that the response follows the outline of a 1/kΔγ. For the special case of perfectly balanced incoherent universal transfer function curve, independent of the logic or delay feedforward motifs (η1 = η2, n1 = −n2, K = 1), the magnitudes Ik difference. decrease to zero for frequencies that are half-integer multiple of 1/ Instead of the step input analyzed above, here we consider a Δγ; otherwise, the maxima (for coherent) and minima (for = sinusoidal input incoherent) equal Ik(f 0). Incredibly, the envelopes (relative to f = 0) have zero parameters, XðTÞ¼Að1 þ cosð2πfTÞÞ ð25Þ making them universal to all feedforward loops. The frequency at which oscillates between zero and 2A (twice the amplitude) at a which thepffiffiffi magnitude decreases to one-half its value at f = 0 occurs frequency f > 0. Taking the Fourier decomposition of each Hill- at f ¼ 3=2πk,withaphaseshiftof−π/3. regulated term 1/[1 + Xn(T)] and plugging into the governing Eq. Despite the non-dependence on Δγ, the absolute maximum (21) (Supplementary Note 6) provides the output Z(T) in terms of magnitude obtained for incoherent feedforward motifs does ϕ its magnitude Ik and phase k as a function of frequency: depend on Δγ, as does the frequency at which this maximum x;n x;n X1 η a 1 þ η a 2 response occurs. The dependence on delay difference is ZðTÞ¼ 1 0 2 0 þ I cosð2πkfT À ϕ Þ Δγ = 2 k k particularly strong near 1 (Fig. 6g). This is because for sffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffik¼1 Δγ ≫ 1, the envelope decreases by half when f is many multiples x;n 2 x;n x;n x;n 2 Δγ ðη a 1 Þ þ 2η η cosð2πkf ΔγÞa 1 a 2 þðη a 2 Þ of , and thus past many local maxima. The local maximum I ¼ 1 k 1 2 k k 2 k ≪ = k 1 þð2πkf Þ2 then occurs at 0 < f 1 with a maximum above Ik(f 0). For À ; ; Δγ ≪ 1, on the other hand, the envelope decreases by half before ϕ ¼ π η x n1 þ η ð π ð π ΔγÞþ ð π ΔγÞÞ x n2 ; k atan2 2 kf 1ak 2 2 kf cos 2 kf sin 2 kf ak → ; ; Á a single sinusoid is complete, so the maximum is at f 0. η x n1 þ η ð ð π ΔγÞÀ π ð π ΔγÞÞ x n2 ; 1ak 2 cos 2 kf 2 kf sin 2 kf ak At Δγ ≈ 1, the first sinusoid reaches its maximum while the ð26Þ envelope is descending most steeply, and the maximum occurs at f ≈ 1 with a value highly dependent on Δγ. To activate R, X must x;n fi + where ak are Fourier coef cients of Hill-regulated terms 1/[1 go above 1 for at least part of the output oscillation, meaning that Xn(T)] at integer multiples k of the fundamental frequency f: I must go above 1 − 〈I〉 = 1 − I . Looking at Fig. 6g, we see that Z 1 0 2π Δγ ≫ ; 1 cosðkTÞ for large 1, this occurs for small frequencies, and the x n ¼ ; ð27Þ fi ak π þ nð þ ð ÞÞn dT feedforward loop acts as a low-pass lter. However, there is a 0 1 A 1 cos T Δγ ≈ − window of 1 in which 1 I0 is large, at modest frequencies for all f > 0. Note that the magnitudes are symmetric to (0.1 < f < 10), corresponding to the hump in magnitude, e.g., = Δγ = interchange of the two regulation arms (η1 ↔ η2, n1 ↔ n2), while around f 0.5 for 1 in Fig. 6f. The incoherent feedforward the phases are not. motif thus acts as a bandpass filter for Δγ ≈ 1, with ineffective Looking at frequencies that are integer multiples of 1/Δγ,we regulation outside of modest frequencies. can see that both the magnitudes and phases follow a universal For coherent feedforward motifs, the frequency at which the envelope not dependent on delays or logic (i.e., no dependence on first minimum in output response occurs follows the same logic, γ or η values): but the maximum response is always found at f → 0. Since the qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi maximum response is at low frequencies, coherent feedforward ¼ = þð π Þ2 fi Ik;env I0 1 2 kf ð Þ motifs act as low-pass lters, as has been shown to be a basic 28 84 ϕ ¼ À1ðÞÀπ ϕ expected behavior of chemical networks . k;env tan 2 kf 0 ; ; = → ¼ η x n1 þ η x n2 where (from Eq. (26), at k 0orf 0) I0 1ak 2ak and ϕ ¼ πð þ Þ= 0 sgn I0 1 2. The actual magnitudes and phases are then Motif V: multi-component feedback. The common two- modulated from these envelopes with period 1/kΔγ. The component feedback motif58 is the equivalent of a cascade with fundamental-frequency (k = 1) response (the largest magnitude, feedback (Fig. 7a). We can write down the governing equations see Fig. 6d, e) are shown compared to the envelopes in Fig. 6f for such a system, using the same normalizations as before (see (known as Bode plots76). Supplementary Note 7), assuming for simplicity zero leakage and At frequencies f that are integer multiples of 1/kΔγ, the cosine that x and y have the same degradation rates β. This is equivalent x;Àn ¼À x;n to the 3-step cascade Eq. (8) with equal degradation rates and in Ik equals ±1. Because ak ak (see Eq. (27),

NATURE COMMUNICATIONS | (2021) 12:1788 | https://doi.org/10.1038/s41467-021-21700-8 | www.nature.com/naturecommunications 11 ARTICLE NATURE COMMUNICATIONS | https://doi.org/10.1038/s41467-021-21700-8

a X Y

b c 10 10

β 8 2 3 (2, 2) α/k 6

222 1

η= 0

4

X Y 12 10 nn

strength 2 (2 ) 5 6 (-2, -2) X high Bistable 0 4 Y high X=Y 05100 Cooperativity ( , ) strength 1 (η=α/kβ111 ) 10 10 8 2 η (-2, 2)

β 8 7 0 6 0 η 10 0 10 0 10 0 10 0 10 222 1 η=α/k 0.25 1.25 2.25 3.25 4.25 4 γ=γ X Y Delay (12 )

strength 2 (2 )

Low monostable 0 Bistable 0510

strength 1 (η=α/kβ111 )

d Two-repressor monostability Two-repressor bistability Two-repressor oscillations ()γ=γ=0.25,η=1,η=112 1 2 ()γ12 = γ = 1.25, η 1 = 5, η 2 = 5 ()γ12 = γ = 3.25, η 1 = 5, η 2 = 5

1 2 3 1.00

0.75 X Y 0.50

0.25

0.00 Two-activator monostability Two-activator bistability Two-activator oscillations

η ()γ=γ=0.25,η=1,η=112 1 2 ()γ12 = γ = 1.25, η 1 = 3, η 2 = 3 ()γ12 = γ = 3.25, η 1 = 3, η 2 = 3

4 5 6 1.00

0.75 X Y 0.50

0.25

0.00 0 25 50 75 100 Concentration / average Act./Inh damped oscillations Act./Inh oscillations ()γ=γ=0.25,η=1,η=112 1 2 ()γ12 = γ = 3.25, η 1 = 5, η 2 = 5

7 8 1.00

0.75 X X Y 0.50 Y

0.25

0.00 0 25 50 75 100 0 25 50 75 100 Time (T )

= fi η ¼ ð þ n1 Þ η ¼ ð þ setting Z X to form the loop. The xed points are given by 1 X 1 Y , 2 Y 1 η Xn2 Þ or (for two activators) X = Y = 0. Linearizing around these _ ð Þ¼ 1 À ð Þ X T þ n1 ð Àγ Þ X T 1 Y T 1 fixed points and assuming ansatz solutions of the form η ; ð29Þ _ ð Þ¼ 2 À ð Þ: δXðTÞ¼A expðλ TÞ; δYðTÞ¼B expðλ TÞ,wefind the set of Y T þ n2 ð Àγ Þ Y T 1 2 1 X T 2

12 NATURE COMMUNICATIONS | (2021) 12:1788 | https://doi.org/10.1038/s41467-021-21700-8 | www.nature.com/naturecommunications NATURE COMMUNICATIONS | https://doi.org/10.1038/s41467-021-21700-8 ARTICLE

Fig. 7 Two-component autoregulatory loops reproduce behaviors of autoregulation, but have additional behaviors describing the relative dynamics of the components. a A two-component loop network motif, which is similar to autoregulation but with two explicitly modeled genes instead of one. b Parameter space of the two regulatory strength parameters showing phase diagram for a loop composed of two activators (cross-activating) or two repressors (cross-inhibitory). Shading shows results of simulations (with an interval of 0.1 for both γ and η axes); blue curve is the analytically derived phase (bifurcation) boundary from Eq. (32). c Parameter space varying both strength parameters. Because the Hopf bifurcations depend only on the total delay and transient oscillations most prominent for equal delays, we show only the cases γ1 = γ2. Blue curves show analytically derived Hopf bifurcations. Black dashed curves are the bifurcation boundaries from (b). Except for the activator/repressor case, all these curves lie above the bistability boundary given by the black curve in (b), meaning oscillations are always transient. d Representative simulations for specific initial conditions showing all possible qualitative behaviors for a two-component loop with two activators, two repressors, or one activator and one repressor. For two-activator bistability and oscillations, a second set of initial conditions is shown in dashed lines to demonstrate the bistability. Hill coefficients equal 2 for repressors, −2 for activators. characteristic equations eigenmodes by (Supplementary Note 7) hiπ Àλγ 1 À1 ðλ þ Þþη 1 ¼ γ ¼ Àtan ω þ ϕ þ ð1 À sgn n Þþπk ; k ¼ 0; 1; ¼ A 1 1M1Be 0 ð Þ 1 ω 2 1 Àλγ 30 hi Bðλ þ 1Þþη M Ae 2 ¼ 0: 1 À π 2 2 γ ¼ Àtan 1ω À ϕ þ ð1 À sgn n Þþπk ; k ¼ 0; 1; ¼ 2 ω 2 2 þ where λ = λ ≡ λ must hold for the ansatz to be true for all time. j j n2 1 1 2 η ¼ n1n2 Á X This can be rewritten in matrix form, with a matrix J times the 1 þ ω2 jn n j ⊤ 1 1 2 À n2 À vector (A, B) . 1þω2 1 X 1 þ Diagonalizing J results in two characteristic equations (Sup- jn n j Yn1 1 plementary Note 7) η ¼ 1 2 Á  2 þ ω2 jn n j 1 1 2 À 1 Yn1 À 1 pffiffiffiffiffiffiffiffiffiffiffip ffiffiffiffiffiffiffiffiffiffiffi 1þω2 Àλðγ þγ Þ= Λ  λ η η 1 2 2 þ ¼ ð Þ n n ± ± 1M1 2M2e 1 0 31 jn n j X 2 Y 1 f ðX; YÞ 1 2 Á ¼ 1 1 þ ω2 ðÞ1 þ Xn2 ðÞ1 þ Yn1 > iϕ for two corresponding eigenmodes vþ ¼ð1; Re Þ and ð Þ > 33 ¼ðÀ ; iϕÞ = iϕ vÀ 1 Re , respectively, where B/A Re is the ratio of = η δ δ where again f 1 provides an implicit monotonic mapping 1(X) X to Y components in magnitude-phase notation (Supplemen- η tary Note 7). Overall, the eigenvectors indicate a phase difference and 2(Y). These curves lie above the bistability boundary, so oscillations in between X and Y of ϕ for v+ and ϕ + π for v−. When the Λ+ v+ are not observed for two activators nor in v− for two repressors. version of Eq. (31) is satisfied for Re λ ¼ 0, v+ bifurcates and The alternate eigenmode does show oscillations in each case (k = 0, when the Λ− version is satisfied for Re λ ¼ 0, v− bifurcates. v− foractivatorsandk = 1, v+ for repressors), but these oscillations Saddle-node bifurcations determine bistability modes. For saddle- are transient due to existence of bistability-induced, distant stable λ = fixed points. For one repressor and one activator, sustained node bifurcations, at which bistability begin, we set 0. This = ϕ = −π fi Λ oscillations begin at k 0forv−,with /2 if n1 >0,n2 <0 can only be satis ed by the + version of Eq. (31)ifn1 <0,n2 <0 ϕ = π Λ (Y leads X)and /2 if n1 <0,n2 >0 (Y lags X). (two activators), and by the − version if n1 >0,n2 > 0 (two repressors). A feedback loop of an odd number of repressors Based on Eq. (33), we can see that the primary Hopf cannot have a saddle-node bifurcation. As for linear cascades bifurcations are equivalent for differing values of the delays as long as the average delay is equal, because the oscillation (Fig. 3), the overall autoregulation is repressive only if it contains ω an odd number of repressors. The bistability boundary for both frequency of the eigenmodes only depends (implicitly) on the cases is then given by (Supplementary Note 7): average delay: ÀÁ 1 1 À π hγi γ þ γ ¼ Àtan 1ω þ ð2 À sgn n À sgn n Þþπk : n þ1 1 2 ω 1 2 X 2 2 4 η ¼ n n ð Þ 1 1 2 ð À Þ n2 À 34 n1n2 1 X 1 þ Yn1 1 In particular, oscillations are possible for activator-repressor η ¼ n n ð32Þ 2 1 2 ð À Þ n1 À loops even when one delay is zero, as long as the sum of delays is n1n2 1 Y 1 greater than zero. On the other hand, the phase difference n n Xn2 Yn1 f ðX; YÞ 1 2 ¼þ1 between the oscillations depends only on the difference in delays ðÞþ n2 ðÞþ n1 1 X 1 Y given the value ω: ω π = ϕ ¼ ðγ À γ Þþ ðÞÀ ð Þ where f 1 provides an implicit monotonic mapping between X sgn n1 sgn n2 35 η η 2 1 2 4 and Y that restricts 1(X) with respect to 2(Y). The phase difference ϕ = 0, implying that two-activator loops Together with the additional phase difference of π for v−, this show bistability with X and Y either both high or both low, implies that for equal delays, there are synchronous oscillations because the components of v+ are of like sign, whereas two- for two-repressor loops, anti-synchronous oscillations for two- repressor loops (v−) show bistability with X high and Y low or activator loops, and π/2-shifted oscillations for activator-repressor vice versa (Fig. 7b, d). loops. This phase relation also holds off the bifurcation boundary, where λ = μ + iω,asϕ does not depend on μ (Supplementary Hopf bifurcations determine transient oscillations in modes Note 7). Note also that the overall phase in the expressions for γ restricted by bistability. For Hopf bifurcations, at which oscilla- are 0 for two repressors, π for two activators, and π/2 for tions begin, we set λ = iω. The boundaries are given for both activator-repressor loops.

NATURE COMMUNICATIONS | (2021) 12:1788 | https://doi.org/10.1038/s41467-021-21700-8 | www.nature.com/naturecommunications 13 ARTICLE NATURE COMMUNICATIONS | https://doi.org/10.1038/s41467-021-21700-8

Fig. 8 Positive/negative dual feedback can induce chaotic behavior when the difference in delay times is significant. a The double feedback motif, in which two regulation arms feed back directly, each with its own explicit delay. Here we show one arm activating and one repressing; for double repressive feedback, see Supplementary Fig. 5. b Time trace of chaotic dynamics after initial transients. c Trace of dynamics in phase space, with the derivative on the vertical axis. While a simple oscillator would trace a loop (possibly with multiple sub-loops if the waveform is complicated), the chaotic dynamics appear to trace out a fractal attractor. Consistent with chaos, a reconstructed phase space with coordinates (X(T), X(T − 10), X(T − 20)) traces out a fractal attractor, with box dimension 1.81 with 95% confidence interval (1.76, 1.87) and a positive dominant Lyapunov exponent (0.0040 ± 0.00055 bits), see “Methods” for details. d Fourier transform of chaotic dynamics show many peaks, indicating that there is no simple set of frequencies underlying the dynamics. e Bifurcation diagram for double positive/negative feedback, with local maxima plotted. Simple oscillations intersperse regimes with complex dynamics, where local maxima with a range of values are found. η1 = 15, η2 = 1, n1 = 11, n2 = −3, and γ1 = 1. For (b–d), γ2 = 11.

Finally, one can also conclude from Eq. (30) that (Supplemen- biological function88–91. Mathematical models with71,92,93 and tary Note 7) without86,94 delays can be chaotic.  1 η M B2 λ ¼ 1 1 ; ð Þ Chaotic behaviors are prevented in monotonic regulation with γ À γ ln η 2 36 2 1 2M2A linear or cyclic network topology. Due to cyclic network topology which holds for both the real and imaginary parts of λ.Thisimplies (no more than one loop) and monotonic regulation, none of the that the oscillations grow most quickly and have the highest motifs so far can yield chaotic dynamics46. Either non-monotonic γ = γ 26 frequency when the delays are nearly equal ( 1 2). This feedback (as in the Mackey-Glass equation ) or non-cyclic consequently makes the transients most noticeable for equal delays. topology71 is required for chaos. Double feedback (Fig. 8a) is a All these results can be seen in the simulated data (Fig. 7b,d). minimal motif fulfilling both requirements, although the non- monotonicity is sufficient (Supplementary Note 8). Motif VI: double feedback. Multiple feedback (Fig. 8) has been The governing equation for such a double feedback motif is 85 thus given by setting the output and both inputs of the logic described to lead to interesting dynamics, such as excitablity , = quasiperiodicity71, and chaos71. A full analysis of this motif is equation (Eq. (19)) to X (and letting K 1 for simplicity): η η beyond the scope of this work, for reasons described below. _ 1 2 XðTÞ¼ þ À XðTÞ: ð37Þ We focus on chaos, a dynamical behavior characterized by 1 þ Xn1 ðT À γ Þ 1 þ Xn2 ðT À γ Þ irregular, unpredictable oscillations45. It has been suggested that 1 2 biological systems avoid chaos86,87, but also that chaos can Chaotic behavior is possible for non-monotonic feedback with describe pathological dynamics such as irregular breathing26 and multiple feedback and disparate delays. Simulation of Eq. (37) epilepsy27. There may also be cases where chaos is important to demonstrates chaos for some parameters of positive/negative

14 NATURE COMMUNICATIONS | (2021) 12:1788 | https://doi.org/10.1038/s41467-021-21700-8 | www.nature.com/naturecommunications NATURE COMMUNICATIONS | https://doi.org/10.1038/s41467-021-21700-8 ARTICLE mixed feedback, as evidenced by sustained oscillations with biological delays as resulting from multi-step processes, and variable maxima (Fig. 8b), occupying an apparently fractal region establishing analytical relationships for converting between in phase space (Fig. 8c), and a large number of peaks in frequency parameters of the corresponding ODE and DDE models. Sec- space (Fig. 8d). To confirm that the dynamics are in fact chaotic, ond, delays determine many key motif properties, such as the we calculated the dominant Lyapunov exponent using the Wolf oscillation period in negative autoregulation, and pulse width method95 (see “Methods”), finding a positive (i.e., chaotic) value and frequency cutoff in feedforward motifs. Interplay of mul- of 0.0040 ± 0.00055 bits (mean ± standard deviation). We also tiple delays plays a similar role in multi-component feedback calculated the box dimension of a reconstructed phase space with for determining absolute and relative oscillation periods, and in coordinates (X(T), X(T − 10), X(T − 20)) used by the Wolf multiple feedback for determining chaotic dynamics. Third, we method, yielding fractional dimension ~1.81, with 95% con- showed quantitatively not only when delays are crucial to fidence interval (1.76, 1.87). These results indicate chaos (see behavior, as in oscillations, but also when they may be safely Supplementary Fig. 4). ignored. Delays do not affect steady states or logic of inde- γ γ = Varying 2 relative to 1 1 (Fig. 8e) shows regions of pendent inputs, only a difference of delays between regulation presumably chaotic dynamics interspersed with simple oscilla- arms is important in determining feedforward behavior, and tion, as found in many chaotic systems45. In particular, we only only the sum of delays determines the onset of transient find chaos if the delays in the two arms differ substantially. Both oscillations in feedback loops. delays appear to be important, not only their ratio or difference, Using DDE models to contract a network into a much since no oscillations exist when both delays are less than one. A smaller network with equivalent topology (replacing all cas- full exploration of the two-delay parameter space is left to cades with delayed, direct regulation) may aid in discovery of future work. large-scale motifs that have important functions or that might In constrast, we found quasiperiodic dynamics for dual otherwise be perceived as statistically insignificant. The motifs negative feedback (Supplementary Fig. 5). Qualitatively, the time in this paper were originally discovered by scanning biological dynamics appear less pulsatile (Supplementary Fig. 5b) than dual networks for subnetworks of N nodes that occur more fre- positive/negative feedback, in line with reports that dual positive/ quently than expected by chance6,11 (this in fact being the negative feedback demonstrates excitability85. The attractor also original definition of network motifs). However, this discovery has a somewhat different profile (Supplementary Fig. 5c) that in method becomes increasingly difficult for N ≳ 5 due to the reconstructed space (X(T), X(T − 10), X(T − 20)) traces out a combinatorial scaling of the number of possible motifs96.Per- torus with box dimension ~2 and near-zero Lyapunov exponent forming a similar search on contracted networks would be (see Supplementary Fig. 4), indicating quasiperiodic rather than equivalent to searching the original network for larger motifs, chaotic dynamics. The Fourier spectrum also exhibits a less dense and places a stronger emphasis on topology than on number of set of peaks (Supplementary Fig. 5d). components involved (e.g., X → Z being equivalent to X → Many parameter choices can prevent chaos in dual feedback. Y → Z). While this can be done without DDEs, the introduction Double autoactivation (n1 <0, n2 < 0) prevents chaos via a of delays allows one to perform the contraction while main- stable fixed point (X = 0)45. Identical regulation strength and taining key information about the original dynamics of retained η = η = cooperativity ( 1 2, n1 n2) behaves like autoregulation close components. fi γ = γ + γ γ = γ to xed points, with 1 2, as do identical delays ( 1 2), While our work has focused on the most basic network motif η = η + η with M 1M1 2M2 (Supplementary Note 8). Thus, for topologies (Table 2), the same techniques can be applied to other chaotic solutions to occur via double feedback, there must be at more complex networks. Expanding on the eigenmode analysis least one negative feedback arm, the delays must differ, and either we performed for multi-component feedback loops, one can the cooperativities or strengths must differ. If biological systems describe the linear behavior of an arbitrary network near its fixed evolved to avoid chaos86,87, it may be that these conditions are points by a matrix form of the characteristic equation Ja ¼ 0 with Àγ λ selected against, even if the double-feedback motif is not. ¼ðλ þ Þδ þ η ij Jij 1 ij jMje (Supplementary note 9, Supplemen- The complete parameter space for double feedback is likely to tary Fig. 6). This approach allows simple models to provide be highly complex, with boundaries possibly formed via an infinite 48 detailed predictions of complex biological phenomena such as number of bifurcation curves . In particular, while we demon- 23 fi pattern formation . strated chaotic and quasiperiodic dynamics for speci c parameter Toclarifythebasicroleofdelaysinnetworkmotifs,we values, a more in-depth exploration is warranted to fully ignored several phenomena which we suggest that future understand the dynamics for all parameters. For further explora- work explore. These include: (1) Noise, which is intrinsic to tion of double negative feedback and more complex delayed 97 71 many biological systems and known to affect dynamics of network motifs that exhibit chaotic dynamics, see Suzuki et al. . delay equations15,92,98,99. (2) Time-varying and stochastic delays42,47,98,100. (3) Non-constant initial conditions (“his- Discussion tories”)forT < 0; for example, autorepression shows in-phase In this work, we systematically studied the most common net- and anti-phase locking with constant histories, while sine-wave work motifs (Table 2) by use of DDEs. Compared to the more histories with randomized phase do not (Supplementary Fig. 7). widely used mechanistic ODE descriptions, we demonstrated (4) Non-Hill regulation and complex degradation numerous instances where inclusion of explicit delays simplifies functions26,78, such as zeroth-order101,nonlinear102, or delayed complex systems into smaller motifs while continuing to capture removal, as well as diffusion or spatial effects103. (5) Feedback their key dynamics that are otherwise lost in simplifying complex with multiple delays, which we only briefly analyzed in the systems as small motifs. To further modeling simplicity, we double feedback motif, and likely have very complicated para- also identified unifying descriptions for activators and repressors meter spaces48,49. (Eq. (7)) and for boolean Hill function logic (Fig. 5) that are Overall, we believe that our work may help resolve funda- useful for both DDE and ODE models. mental biological and engineering questions regarding a variety There are multiple findings to highlight. First, multistep of phenomena, including transcription factor networks6,17,77, cascades with and without feedback reduce effectively to direct, cell cycles87, other biological clocks14,18,25, and pattern delayed regulation, providing an intuitive interpretation of formation23,44. Multiple feedback analysis may determine

NATURE COMMUNICATIONS | (2021) 12:1788 | https://doi.org/10.1038/s41467-021-21700-8 | www.nature.com/naturecommunications 15 ARTICLE NATURE COMMUNICATIONS | https://doi.org/10.1038/s41467-021-21700-8

Table 2 Summary of differences between ODE and DDE network regulation models and key findings, and where each DDE cartoon provides a simplified, unified model for several ODE cartoons.

Motif ODE Cartoons DDE Cartoons Equations Key Findings 0: Direct Eq. (5) Activators and inhibitors combined via negative Hill regulation coefficient. Delay provides explicit timescale. Figure 2.

I: Cascade Eq. (9) ODE cascades can be reduced to simple DDE regulation. Delays sum. Figure 3.

II: Autoregulation Eq. (11) Full parameter space derived. Delays matter only for negative autoregulation. Figure 4, Supplementary Fig. 3, Supplementary Fig. 1, Supplementary Fig. 2.

III: Logic Eq. (19) Sum of Hill terms yields all monotonic logic gates in one parameter space. Delays not important for steady states, only strengths. Figure 5, Supplementary Table 2, Supplementary Table 1.

IV: Feedforward Eqs (20), Capable of pulsing, signal filtering by input pulse width loop (21) or frequency. All signal processing behavior is due to logic and difference in delays between arms. Figure 6.

V: Feedback loop Eq. (29) Delay sum governs presence of oscillations, which are transient for two repressors (synchronous) and two activators (anti-synchronous). Delay difference governs phase. Full parameter space derived. Figure 7.

VI: Double Eq. (37) Chaos and quasiperiodicity possible for two-delay feedback feedback and not for simpler motifs46,71. Figure 8, Supplementary Fig. 5. Future work.

Complex Eqs S84, Matrix analysis available (Supplementary note 9, networks S85, S87 Glass, et al.23). Complex dynamics and spatial behaviors possible. Future work. Supplementary Fig. 6.

whether chaos affects the cell cycle87, or whether biology avoids goes to zero causes the regulation term to be zero, which is the same result as possibly chaotic motifs. Delays in multicellular signaling23,32 may assumed by our notation. An initial value of exactly zero for x can thus lead to a 16,24,32,103,104 divide-by-zero error in simulations, and so initial conditions of exactly zero were distinguish among models of pattern formation . fi “ ” not used, as that case is an uninteresting xed point for activators in any case. Note Finally, exploring contracted networks with delays may uncover also that the consitutive case for Eq. (5) is degenerate, in that n = 0, α ≠ 0is ≠ α = α → α + α entirely new functional network motifs that are larger and more equivalent to n 0, 0 with 0 0 /2. complex than currently known96.

Phase plot simulations and analysis. For autoregulation phase plots, simulations Methods were run with 100 constant-history initial conditions spread logarithmically Analytics and numerical simulation. Analytics were in general performed by between 10−4 and 2η and run from T = 0toT = 100(γ + 1). Solutions were hand, and checked for validity using Mathematica. Numerical simulations were run considered stable if for all 100 simulations the maximum absolute value of the in Matlab using the dde23 delay differential equation solver for DDEs and ode45 discrete derivative in the last three-quarters of the simulation time was less than for ODEs. Simulating activators as repressors with n < 0 technically fails when x is 0.1. Stable solutions were sub-categorized as bistable if a histogram of final values identically zero (Eq. (5)), since that would imply division by zero, but the limit as x over all 100 solutions had more than 1 peak. Solutions were considered oscillatory

16 NATURE COMMUNICATIONS | (2021) 12:1788 | https://doi.org/10.1038/s41467-021-21700-8 | www.nature.com/naturecommunications NATURE COMMUNICATIONS | https://doi.org/10.1038/s41467-021-21700-8 ARTICLE if the average Fourier transform of the last three-quarters of the simulation time for 13. Gupta, C., López, J. M., Ott, W., Josić, K. & Bennett, M. R. Transcriptional all 100 solutions had more than zero peaks with amplitude (square root of power) delay stabilizes bistable gene networks. Phys. Rev. Lett. 111, 058104 (2013). greater than 100. Solutions were considered spiral if this oscillation condition held 14. Morelli, L. G. et al. Delayed coupling theory of vertebrate segmentation. HFSP for the first one-quarter of the simulation time only. For two-component loops, J. 3,55–66 (2009). ðη ; η Þ initial conditions were used that ranged between 0 and max 1 2 , for equal X and 15. Bratsun, D., Volfson, D., Tsimring, L. S. & Hasty, J. Delay-induced stochastic Y and for apposing X and Y. Bistability was determined as for autoregulation, and a oscillations in gene regulation. Proc. Natl Acad. Sci. USA 102, 14593–14598 cutoff of 0.05 was used to determine “low” values. All simulation histories were (2005). constant except where indicated in Supplementary Fig. 7. Specific parameter values 16. Bratsun, D. & Zakharov, A. Spatial effects of delay-induced stochastic and simulation details are given in the figures and/or made explicit in the oscillations in a multi-scale cellular system. Proceedings of ECCS 2014, MATLAB code in Supplementary Data 1. European Conference on Complex Systems 93–103 (2016). 17. Lewis, J. Autoinhibition with transcriptional delay a simple mechanism for the Lyapunov exponents and box dimensions. For calculating dominant Lyapunov zebrafish somitogenesis oscillator. Curr. Biol. 13, 1398–408 (2003). exponents, we used the Wolf method95 with recommended parameters from the 18. Morelli, L. G. & Jülicher, F. Precision of genetic oscillators and clocks. Phys. MATLAB script “Wolf Lyapunov exponent estimation from a time series” (version Rev. Lett. 98, 228101 (2007). 1.2.0.1) provided by the authors on the Mathworks FileExchange (https://www. 19. Ferrell, J. E., Tsai, T. Y.-C. & Yang, Q. Modeling the cell cycle: why do certain mathworks.com/matlabcentral/fileexchange/48084-wolf-lyapunov-exponent- circuits oscillate? Cell 144, 874—85 (2011). estimation-from-a-time-series). In particular, we used an embedding dimension of 20. Monk, N. A. Oscillatory expression of hes1, p53, and nf-κb driven by 3 and a phase space reconstruction delay of 10 for a dataset with ~350 orbits of transcriptional time delays. Curr. Biol. 13, 1409–1413 (2003). ~50–60 data points per orbit. The last 50 iterations of the algorithm were used to 21. Elowitz, M. & Leibler, S. A synthetic oscillatory network of transcriptional generate a mean and standard deviation of the estimated dominant Lyapunov regulators. Nature 403, 335–8 (2000). exponent. A full set of parameters can be found in the included code. For calculating 22. Stricker, J. et al. A fast, robust and tunable synthetic gene oscillator. Nature attractor dimensions, we used the box-counting method, whose code is also pro- 456, 516 (2008). vided in Supplementary Data 1, on the reconstructed phase space (X(T), X(T − 10), 23. Glass, D. S., Jin, X. & Riedel-Kruse, I. H. Signaling delays preclude defects in X(T − 20)) used for calculating Lyapunov exponents. A linear regression was per- lateral inhibition patterning. Phys. Rev. Lett. 116, 128102 (2016). ’ fit formed using MATLAB s function on half the linear domain to generate a mean 24. Collier, J., Monk, N., Maini, P. & Lewis, J. Pattern formation by lateral fi ’ confint and con dence interval (using MATLAB s ) for the slope (i.e., box inhibition with feedback: a mathematical model of delta-notch intercellular dimension) between numbers of boxes covering the attractor versus length of signalling. J. Theor. Biol. 183, 429–46 (1996). each box. 25. Riedel-Kruse, I. H., Müller, C. & Oates, A. C. Synchrony dynamics during initiation, failure, and rescue of the segmentation clock. Science 317, 1911–5 Reporting summary. Further information on research design is available in the Nature (2007). Research Reporting Summary linked to this article. 26. Mackey, M. & Glass, L. Oscillation and chaos in physiological control systems. Science 197, 287–289 (1977). 27. Iasemidis, L. D. & Sackellares, J. C. Chaos theory and epilepsy. Neuroscientist Data availability 2, 118–126 (1996). All raw data is included in the supplementary material (Supplementary Data 1). The 28. Eurich, C. W. et al. Delay adaptation in the nervous system. Neurocomputing fi authors can con rm that all relevant data are included in the paper and/or its 32-33, 741–748 (2000). fi supplementary information les. Source data are provided with this paper. 29. Roelfsema, P. R., Engel, A. K., König, P. & Singer, W. Visuomotor integration is associated with zero time-lag synchronization among cortical areas. Nature Code availability 385, 157–161 (1997). All code used to generate data for this work is included in the supplementary material 30. Foley, C. & Mackey, M. C. Dynamic hematological disease: a review. J. Math. – (Supplementary Data 1). The authors can confirm that all relevant code is included in the Biol. 58, 285 322 (2009). paper and/or its supplementary information files. 31. Colijn, C. & Mackey, M. C. A mathematical model of hematopoiesis-i. periodic chronic myelogenous leukemia. J. Theor. Biol. 237, 117–132 (2005). Received: 19 October 2020; Accepted: 1 February 2021; 32. Barad, O., Rosin, D., Hornstein, E. & Barkai, N. Error minimization in lateral inhibition circuits. Sci. Signal. 3, ra51 (2010). 33. Roussel, M. R. The use of delay differential equations in chemical kinetics. J. Phys. Chem. 100, 8323–8330 (1996). 34. MacDonald, N. Biological delay systems (Cambridge University Press, Cambridge, Great Brittain, 1989). References 35. M’Kendrick, A. G. Applications of mathematics to medical problems. Proc. 1. Strogatz, S. Exploring complex networks. Nature 410, 268–76 (2001). Edinb. Math. Soc. 44,98–130 (1925). 2. Alon, U. Network motifs: theory and experimental approaches. Nat. Rev. 36. Atay, F. M., Jost, J. & Wende, A. Delays, connection topology, and Genet. 8, 450–461 (2007). synchronization of coupled chaotic maps. Phys. Rev. Lett. 92, 144101 (2004). 3. Jeong, H., Tombor, B., Albert, R., Oltvai, Z. & Barabási, A. The large-scale 37. Atay, F. M. Delayed feedback control near hopf bifurcation. Discret. organization of metabolic networks. Nature 407, 651–4 (2000). Continuous Dynamical Syst. - S 1, 197–205 (2008). 4. Zaman, S., Lippman, S. I., Zhao, X. & Broach, J. R. How saccharomyces 38. Shayer, L. P. & Campbell, S. A. Stability, bifurcation, and multistability in a responds to nutrients. Genetics 42,27–81 (2008). system of two coupled neurons with multiple time delays. SIAM J. Appl. Math 5. Coyte, K. Z., Schluter, J. & Foster, K. R. The ecology of the microbiome: 2, 673–700 (2000). networks, competition, and stability. Science 350, 663–666 (2015). 39. Campbell, S. A. Stability and bifurcation of a simple neural network with 6. Shen-Orr, S. S., Milo, R., Mangan, S. & Alon, U. Network motifs in the multiple time delays. Fields Inst. Commun. 21,65–78 (1999). transcriptional regulation network of escherichia coli. Nat. Genet. 31, ng881 40. MacDonald, N. Time lag in a model of a biochemical reaction sequence with (2002). end product inhibition. J. Theor. Biol. 67, 549–556 (1977). 7. Rosenfeld, N. & Alon, U. Response delays and the structure of transcription 41. Roussel, C. J. & Roussel, M. R. Delay-differential equations and the model networks. J. Mol. Biol. 329, 645–54 (2003). equivalence problem in chemical kinetics. Phy. Can. 114–120 (2001). 8. Balagaddé, F. K. et al. A synthetic escherichia coli predator-prey ecosystem. 42. Feng, J., Sevier, S. A., Huang, B., Jia, D. & Levine, H. Modeling delayed Mol. Syst. Biol. 4, 187 (2008). processes in biological systems. Phys. Rev. E 94, 032408 (2016). 9. Karin, O., Swisa, A., Glaser, B., Dor, Y. & Alon, U. Dynamical compensation 43. Zhu, R., Ribeiro, A. S., Salahub, D. & Kauffman, S. A. Studying genetic in physiological circuits. Mol. Syst. Biol. 12, 886 (2016). regulatory networks at the molecular level: delayed reaction stochastic models. 10. Landi, P., Minoarivelo, H. O., Brännström, Å, Hui, C. & Dieckmann, U. J. Theor. Biol. 246, 725–745 (2007). Complexity and stability of ecological networks: a review of the theory. Popul. 44. Jiang, Y.-J. et al. Notch signalling and the synchronization of the somite Ecol. 60, 319–345 (2018). segmentation clock. Nature 408, 475–479 (2000). 11. Milo, R. et al. Network motifs: simple building blocks of complex networks. 45. Strogatz, S. Nonlinear dynamics and chaos: with applications to physics, Science 298, 824–827 (2002). biology, chemistry, and engineering (CRC Press, 2000). 12. D’Huys, O., Vicente, R., Erneux, T., Danckaert, J. & Fischer, I. 46. Mallet-Paret, J. & Sell, G. R. The Poincaré-Bendixson theorem for monotone Synchronization properties of network motifs: influence of coupling delay and cyclic feedback systems with delay. J. Differ. Equ. 125, 441–489 (1996). symmetry. Chaos 18, 037116 (2008). 47. Cooke, K. L. & Grossman, Z. Discrete delay, distributed delay and stability switches. J. Math. Anal. Appl. 86, 592–627 (1982).

NATURE COMMUNICATIONS | (2021) 12:1788 | https://doi.org/10.1038/s41467-021-21700-8 | www.nature.com/naturecommunications 17 ARTICLE NATURE COMMUNICATIONS | https://doi.org/10.1038/s41467-021-21700-8

48. Mahaffy, J. M., Joiner, K. M. & Zak, P. J. A geometric analysis of stability 80. Novák, B. & Tyson, J. J. Design principles of biochemical oscillators. Nat. Rev. regions for a linear differential equation with two delays. Int. J. Bifurc. Chaos Mol. cell Biol. 9, 981–91 (2008). 05, 779–796 (1995). 81. Sonnen, K. F. & Aulehla, A. Dynamic signal encoding–from cells to 49. Bélair, J. & Campbell, S. A. Stability and bifurcations of equilibria in a organisms. Semin. Cell Developmental Biol. 34,91–98 (2014). multiple-delayed differential equation. SIAM J. Appl. Math. 54, 1402–1424 82. Rapp, P. E., Mees, A. I. & Sparrow, C. T. Frequency encoded biochemical (1994). regulation is more accurate than amplitude dependent control. J. Theor. Biol. 50. Bellman, R. & Cooke, K. L. Differential-difference equations (Academic Press, 90, 531–544 (1981). 1963). 83. Cai, L., Dalal, C. K. & Elowitz, M. B. Frequency-modulated nuclear 51. Smith, H. An Introduction to Delay Differential Equations with Applications to localization bursts coordinate gene regulation. Nature 455, 485–90 the Life Sciences. No. 57 in Texts in Applied Mathematics (Springer, New (2008). York, 2010). 84. Samoilov, M., Arkin, A. & Ross, J. Signal processing by simple chemical 52. Lipshutz, D. & Lipshutz, R. J. Stability of synchronous slowly oscillating systems. J. Phys. Chem. A 106, 10205–10221 (2002). periodic solutions for systems of delay differential equations with coupled 85. Süel, G. M., Garcia-Ojalvo, J., Liberman, L. M. & Elowitz, M. B. An excitable nonlinearity. ArXiv. 1810.13398 (2018). gene regulatory circuit induces transient cellular differentiation. Nature 440, 53. Asl, F. & Ulsoy, G. A. Analysis of a system of linear delay differential 545 (2006). equations. J. Dyn. Syst., Meas. Control 125 (2003). 86. Zhang, Z. et al. Chaotic motifs in gene regulatory networks. PLoS ONE 7, 54. Oberle, H. J. & Pesch, H. J. Numerical treatment of delay differential equations e39355 (2012). by hermite interpolation. Numerische Mathematik 37, 235–255 (1981). 87. McIsaac, R. S., Huang, K. C., Sengupta, A. & Wingreen, N. S. Does the 55. Bellen, A. & Zennaro, M. Numerical methods for delay differential equations potential for chaos constrain the embryonic cell-cycle oscillator? PLoS (Clarendon Press, 2003). Comput. Biol. 7, e1002109 (2011). 56. Hill, A. V. The combinations of haemoglobin with oxygen and with carbon 88. Reynolds, A. M., Bartumeus, F., Kölzsch, A. & Koppel, Jvd Signatures of chaos monoxide. i. Biochemical J. 7, 471–480 (1913). in animal search patterns. Sci. Rep. 6, 23492 (2016). 57. Weiss, J. N. The Hill equation revisited: uses and misuses. FASEB J. 11, 89. Wilden, I., Herzel, H., Peters, G. & Terock, G. Subharmonics, biphonation, 835–841 (1997). and deterministic chaos in mammal vocalization. Bioacoustics 9, 171–196 58. Alon, U. An Introduction to Systems Biology: Design Principles of Biological (1998). Circuits (CRC Press, 2006). 90. Toker, D., Sommer, F. T. & D’Esposito, M. A simple method for detecting 59. Polka, J. K., Hays, S. G. & Silver, P. A. Building spatial synthetic biology with chaos in nature. Commun. Biol. 3, 11 (2020). compartments, scaffolds, and communities. Cold Spring Harbor Perspectives in 91. Goldberger, A. Is the normal heartbeat chaotic or homeostatic? Physiology 6, Biology a024018 (2016). 87–91 (1991). 60. Abeliovich, H. An empirical extremum principle for the hill coefficient in 92. Mackey, M. C. & Nechaeva, I. G. Solution moment stability in stochastic ligand-protein interactions showing negative cooperativity. Biophysical J. 89, differential delay equations. Phys. Rev. E 52, 3366–3376 (1995). 76–79 (2005). 93. Figueiredo, J. C. Bd, Diambra, L., Glass, L. & Malta, C. P. Chaos in two-loop 61. Hooshangi, S., Thiberge, S. & Weiss, R. Ultrasensitivity and noise propagation negative feedback systems. Phys. Rev. E 65, 051905 (2002). in a synthetic transcriptional cascade. Proc. Natl Acad. Sci. USA 102, 94. Sevim, V. & Rikvold, P. A. Chaotic gene regulatory networks can be robust 3581–3586 (2005). against mutations and noise. J. Theor. Biol. 253, 323–332 (2008). 62. Ferrell, J. E. How responses get more switch-like as you move down a protein 95. Wolf, A., Swift, J. B., Swinney, H. L. & Vastano, J. A. Determining lyapunov kinase cascade. Trends Biochemical Sci. 22, 288–289 (1997). exponents from a time series. Phys. D: Nonlinear Phenom. 16,285–317 63. Rosenfeld,N.,Elowitz,M.B.&Alon,U.Negativeautoregulationspeeds (1985). the response times of transcription networks. J. Mol. Biol. 323, 785–793 96. Tran, N. T. L., Mohan, S., Xu, Z. & Huang, C.-H. Current innovations and (2002). future challenges of network motif detection. Brief. Bioinforma. 16, 497–525 64. Huang, C., Yang, Z., Yi, T. & Zou, X. On the basins of attraction for a class of (2015). delay differential equations with non-monotone bistable nonlinearities. J. 97. Elowitz, M. B., Levine, A. J., Siggia, E. D. & Swain, P. S. Stochastic gene Differential Equ. 256, 2101–2114 (2014). expression in a single cell. Science 297, 1183–6 (2002). 65. McAdams, H. & Shapiro, L. Circuit simulation of genetic networks. Science 98. Tian, T., Burrage, K., Burrage, P. M. & Carletti, M. Stochastic delay differential 269, 650–656 (1995). equations for genetic regulatory networks. J. Computational Appl. Math. 205, 66. Mayo, A. E., Setty, Y., Shavit, S., Zaslaver, A. & Alon, U. Plasticity of the cis- 696—707 (2007). regulatory input function of a gene. PLoS Biol. 4, e45 (2006). 99. Rappaport, N., Winter, S. & Barkai, N. The ups and downs of biological 67. Setty, Y., Mayo, A. E., Surette, M. G. & Alon, U. Detailed map of a cis- timers. Theor. Biol. Med. Model. 2, 22 (2005). regulatory input function. Proc. Natl Acad. Sci. 100, 7702–7707 (2003). 100. Zhang, B. Fixed points and stability in differential equations with variable 68. Bonnet, J., Yin, P., Ortiz, M. E., Subsoontorn, P. & Endy, D. Amplifying delays. Nonlinear Anal.: Theory, Methods Appl. 63, e233–e242 (2015). genetic logic gates. Science 340, 599–603 (2013). 101. Rondelez, Y. Competition for catalytic resources alters biological network 69. Moon, T. S., Lou, C., Tamsir, A., Stanton, B. C. & Voigt, C. A. Genetic dynamics. Phys. Rev. Lett. 108, 018102 (2012). programs constructed from layered logic gates in single cells. Nature 491, 102. Eldar, A., Rosin, D., Shilo, B.-Z. & Barkai, N. Self-enhanced ligand degradation 249–53 (2012). underlies robustness of morphogen gradients. Developmental Cell 5, 635–646 70. Vahid, F. Digital design (Wiley, 2006). (2003). 71. Suzuki, Y., Lu, M., Ben-Jacob, E. & Onuchic, J. N. Periodic, quasi-periodic and 103. Meinhardt, H. Models of biological pattern formation (Academic Press chaotic dynamics in simple gene elements with time delays. Sci. Rep. 6, 21037 (London), 1982). (2016). 104. Kim, H., Jin, X., Glass, D. S. & Riedel-Kruse, I. H. Engineering and modeling 72. Nielsen, A. A. K. et al. Genetic circuit design automation. Science 352, aac7341 of multicellular morphologies and patterns. Curr. Opin. Genet. Dev. 63, (2016). 95–102 (2020). 73. Hájek, P. Metamathematics of Fuzzy Logic, vol. 4 of Trends in Logic (Studia Logica Library), chap. Many-Valued Predicate Logics, 109–147 (Springer, Dordrecht, 1998). Acknowledgements 74. Bleris, L. et al. Synthetic incoherent feedforward circuits show adaptation to We would like to thank A. Choksi, J. Prine, M. Aktas, Y. Yang, A. Mayo, A. Woller, U. the amount of their genetic template. Mol. Syst. Biol. 7, 519 (2011). Alon, and the Riedel-Kruse lab for their feedback and discussions. This work was sup- 75. Mangan, S. & Alon, U. Structure and function of the feed-forward loop ported in part by the Davies Family Engineering Fellowship, the Bio-X Bowes Graduate – network motif. Proc. Natl Acad. Sci. USA 100, 11980 5 (2003). Student Fellowship, and the NSERC PGS fellowship. D.S.G is currently a member of the 76. Franklin, G. F., Powell, J. D. & Emami-Naeini, A. Feedback Control of Dynamic Zuckerman Postdoctoral Scholars Program. Systems (Pearson Prentice-Hall, Upper Saddle River, NJ, 2010), 6 edn. 77. Shoval, O. & Alon, U. Snapshot: network motifs. Cell 143, 326–326.e1 (2010). Author contributions 78. Goentoro, L., Shoval, O., Kirschner, M. W. & Alon, U. The incoherent D.S.G., X.J., and I.H.R.K. all contributed to conception, analysis, and writing of this feedforward loop can provide fold-change detection in gene regulation. Mol. manuscript. cell 36, 894–9 (2009). 79. Basu, S., Mehreja, R., Thiberge, S., Chen, M.-T. T. & Weiss, R. Spatiotemporal control of gene expression with pulse-generating networks. Proc. Natl Acad. Competing interests – Sci. USA 101, 6355 60 (2004). The authors declare no competing interests.

18 NATURE COMMUNICATIONS | (2021) 12:1788 | https://doi.org/10.1038/s41467-021-21700-8 | www.nature.com/naturecommunications NATURE COMMUNICATIONS | https://doi.org/10.1038/s41467-021-21700-8 ARTICLE

Additional information Open Access This article is licensed under a Creative Commons Supplementary information The online version contains supplementary material Attribution 4.0 International License, which permits use, sharing, available at https://doi.org/10.1038/s41467-021-21700-8. adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Correspondence and requests for materials should be addressed to I.H.R.-K. Commons license, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons license, unless Peer review information Nature Communications thanks Marc Roussel, Moisés indicated otherwise in a credit line to the material. If material is not included in the Santillán and the other, anonymous, reviewer(s) for their contribution to the peer review article’s Creative Commons license and your intended use is not permitted by statutory of this work. regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this license, visit http://creativecommons.org/ Reprints and permission information is available at http://www.nature.com/reprints licenses/by/4.0/.

Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. © The Author(s) 2021

NATURE COMMUNICATIONS | (2021) 12:1788 | https://doi.org/10.1038/s41467-021-21700-8 | www.nature.com/naturecommunications 19