Why put up with immunity when there is resistance: an excursion into the population and evolutionary dynamics of restriction–modification and CRISPR-Cas

Bacteria can readily generate mutations that prevent bacteriophage (phage) adsorption and thus make bacteria resistant to infections with these viruses. Nevertheless, the majority of bacteria carry complex innate and/or adaptive immune systems: restriction–modification (RM) and CRISPR-Cas, respectively. Both RM and CRISPR-Cas are commonly assumed to have evolved and be maintained to protect bacteria from succumbing to infections with lytic phage. Using mathematical models and computer simulations, we explore the conditions under which selection mediated by lytic phage will favour such complex innate and adaptive immune systems, as opposed to simple envelope resistance. The results of our analysis suggest that when populations of bacteria are confronted with lytic phage: (i) In the absence of immunity, resistance to even multiple bacteriophage species with independent receptors can evolve readily. (ii) RM immunity can benefit bacteria by preventing phage from invading established bacterial populations and particularly so when there are multiple bacteriophage species adsorbing to different receptors. (iii) Whether CRISPR-Cas immunity will prevail over envelope resistance depends critically on the number of steps in the coevolutionary arms race between the bacteria-acquiring spacers and the phage-generating CRISPR-escape mutants. We discuss the implications of these results in the context of the evolution and maintenance of RM and CRISPR-Cas and highlight fundamental questions that remain unanswered. This article is part of a discussion meeting issue ‘The ecology and evolution of prokaryotic CRISPR-Cas adaptive immune systems’.


Introduction
The two most widely used tools for manipulating and editing DNA-restriction and Cas9 endonucleases-both originate from studies of mechanisms that provide bacteria with immunity to infections with lytic bacteriophage ( phage): restriction modification (RM) originally identified in Escherichia coli [1,2] and CRISPR-Cas found in Streptococcus thermophilus [3], respectively.
RM systems allow bacteria to distinguish self DNA from non-self DNA by methylating specific DNA sequences called restriction sites. When phage bearing DNA with unmethylated restriction sites infect bacteria carrying an RM system that recognizes these sites, the bacterial restriction endonuclease cleaves the phage DNA and aborts the infection [4]. However, with a probability in the range of 10 22 to 10 28 [5], the infecting DNA can be erroneously methylated by the host's DNA methyltransferase and thus escape restriction. Such 'restriction escape' allows the infecting phage to bypass the immunity conferred by RM, resulting in progeny phage whose restriction sites specific to that RM system are methylated and thus protected from restriction by the same RM system [4]. The phage thus modified can therefore freely replicate on bacteria carrying that RM system.
Because the restriction sites recognized by the majority of RM systems are relatively short (4 -12 base pairs), the genomes of most phage are expected to carry multiple restriction sites. RM systems can thus be described as an innate immune system, since they protect bacteria without the need for a prior exposure to the infecting phage. CRISPR-Cas, on the other hand, is commonly described as an adaptive immune system in that it requires prior exposure to the phage in order to protect bacteria from infection with that specific phage [6]. Upon infection of a CRISPR-Cas carrying bacterium, presumably with a phage that is defective and incapable of replication [7], 23 to 55 base pairs-long DNA fragments from the infecting phage are incorporated as 'spacers' between the short palindromic repeats located in the CRISPR-Cas region of the infected bacteria. When bacteria bearing such spacers are then infected by phage with DNA homologous to that of the acquired spacers, that DNA is recognized as foreign by an RNA-mediated mechanism and cut by the Cas endonuclease, which aborts the infection [8]. Analogous to the adaptive immune system of vertebrates, CRISPR-Cas can thus retain memory of prior exposures to pathogens.
As is the case with RM, the protection provided by CRISPR-Cas is not absolute; phage can escape targeting by CRISPR-Cas via mutations in the spacer-homologous ( protospacer) regions and generate CRISPR-escape mutants [9]. Contrary to RM systems, which have no means to prevent infection once the phage escape restriction and become modified, bacteria with effective CRISPR-Cas systems can acquire new spacers from the escaped phage and regain immunity. A coevolutionary arms race, in which bacteria acquire new spacers and phage respond by evolving protospacer mutations, ensues [10,11]. However, such arms races are not indefinite and can terminate when the bacteria acquire spacers to which the phage are unable to, or fail to, generate protospacer mutations [12][13][14] (For a more detailed review of RM and CRISPR-Cas immunity, see [15] and [16] for a consideration of the evolution of different immune mechanisms.) On first consideration, it would seem that both RM and CRISPR-Cas evolved and are maintained by some form of phage-mediated selection. There is, however, a potential caveat to this hypothesis: envelope resistance. Bacteria can readily generate mutants that prevent (or significantly limit) adsorption of the phage by eliminating, modifying, or reducing the expression levels of the motifs (receptors), to which phage must bind before they can successfully enter the host cell [15]. In most experimental cultures, such resistant mutants commonly emerge and become the dominant bacterial population shortly after exposure to lytic phage [17 -21]. Unlike RM, which is readily defeated by hostmediated modification of escaped phage, and CRISPR-Cas, to which the phage can generate protospacer mutants, resistance is relatively permanent. Within short order, bacteria generate resistant mutants, to which the phage are incapable of evolving host-range mutations [22]. To be sure, by modifying tail fibres or other structures used to adsorb to the bacteria, the phage can generate host-range mutants that overcome resistance by adsorbing to different receptors [23].
How common this is and for how long such an arms race can continue is, however, currently unclear.
Why would bacteria evolve and maintain dedicated molecular mechanisms like RM and CRISPR-Cas to prevent phage infections if mutations leading to envelope resistance can be readily generated? Here, we address this question with the aid of mathematical and computer simulation models of the population and evolutionary dynamics of bacteria confronted with lytic phage. Based on our analysis, we make three predictions: (i) In the absence of immunity, even when confronted with multiple phage species recognizing different receptors and thereby requiring multiple independent mutations for envelope resistance, mutants resistant to all three phage species can evolve readily. (ii) RM protects established populations of bacteria from invasion with multiple phage species. If, however, the phage escape restriction and are modified, envelope resistant mutants are likely to ascend. (iii) If mutations leading to envelope resistance can be generated, the contribution of CRISPR-Cas-mediated immunity to protecting the bacteria from phage depends on a number of factors, most important of which is the number of steps in the arms race between bacteria acquiring new spacers and the phage generating escape mutants.

(a) Population dynamics of envelope resistance in the absence of immunity
We open this consideration with a simple base model describing the population dynamics of a single species of phage and two species of bacteria, in which there is neither RM, nor CRISPR-Cas immunity. This model is derived from that described in [24]. Phage-sensitive and phage-resistant bacteria are present at densities B S and B R (cells per ml), respectively. A single population of phage is present at a density P ( particles per ml). The sensitive and resistant bacteria grow at maximum rates v S and v R ( per hour), respectively, scaled by a hyperbolic function of the concentration of the limiting resource r (mg per ml) (c(r) ¼ r/(r þ k)), where k (mg) is the concentration of the limiting resource, at which the bacteria grow at a half of their maximum rate [25].
Resources are consumed at a rate jointly proportional to the net growth rate of the bacteria and a conversion efficiency parameter e (mg per cell) [26]. At a rate m ( per cell per hour), sensitive cells generate resistant mutants (B S ! B R mutation). For the sake of simplicity, we do not account for the possibility of a reverse mutation or phenotypic transitioning from resistance to sensitivity [27]. The phage adsorb to sensitive bacteria with a rate constant d ( per cell per phage per hour) and produce b phage particles instantaneously (we neglect the latent periods). In our models, phage do not adsorb to envelope resistant bacteria, neither are the phage able to generate host-range mutants. At a rate w ( per hour), a limiting resource enters the habitat of unit volume from a reservoir, where it is maintained at a concentration c (mg per ml). At the same rate, resources, bacteria and phage are removed from the habitat [26]. With these definitions and assumptions, the rates of change in the densities of bacteria, phage and the concentration of the resource are given by a set of coupled royalsocietypublishing.org/journal/rstb Phil. Trans. R. Soc. B 374: 20180096 differential equations [24].
We simulated the population dynamics anticipated from this model and the models that follow using the Berkeley Madonna TM software. We employed parameters in the ranges estimated for E. coli, S. thermophilus and Pseudomonas aeruginosa [11,17,24,26 -28] and their phage. Unlike in the above equations, where mutations are assumed to be deterministic and occur at a constant rate, mutations in our simulations were modelled stochastically. At each step of the numerical integration, a random number was drawn from a binomial distribution D(n(t),m), where m is the mutation rate and n(t) ¼ c(r) . v S . B S . dt (dt being the step size of the numerical integration) is the number of bacterial doublings occurring at the time step t. We assumed a refuge density B refuge ¼ 100, below which the phage were unable to adsorb to the bacteria [29]. The definitions and values of the parameters used for this model and the models to follow are listed in table 1. The code for the Berkeley Madonna program used for this and the subsequent simulations are readily available from the authors or can be downloaded from www.eclf.net.
The numerical solutions of the above-presented base model are shown in figure 1. As a result of the stochastic nature of mutations, two qualitatively different outcomes were observed: (i) Envelope resistance did not evolve. The bacteria and phage coexisted and their densities oscillated until the end of the simulation (figure 1a). As indicated by the high concentration of the resource, the bacteria were limited by the phage. (ii) Envelope resistant mutants appeared and increased in density until fixation. The phage population declined (figure 1b) and the bacterial population became resource-limited. We estimated the likelihood of envelope resistant bacteria evolving and becoming the dominant population of bacteria by performing repeated runs of 100 simulations, each simulating the population dynamics for 1000 h. The results of these simulations are presented in figure 1c. With the standard set of parameters, envelope resistant mutants dominated the bacterial population in nearly all of the runs and these populations were limited by the resource. This was also the case when resistance engendered a 20% fitness cost (v R ¼ 0.8), when the adsorption rate was low (d ¼ 10 29 ) and when the concentration of the limiting resource (and thereby the total density attainable by the bacteria) was reduced (c ¼ 100 and c ¼ 10). A lower rate of mutation to resistance (m ¼ 10 29 ) resulted in a reduced fraction of runs, in which resistance prevailed. Similarly, a higher rate of adsorption (d ¼ 10 27 ) resulted in only a bit more than 20% of simulations yielding bacterial populations dominated by envelope resistant bacteria. In the remaining simulations, envelope resistance did not evolve and the bacterial populations were phage-limited.
To explore how the presence of multiple phage species affects the population dynamics of bacteria in the absence of immunity, we constructed a model analogous to that described above, but with three different phage species. The three species of phage have designations and densities O, P, and Q (particles per ml). The bacteria are of eight states with respect to resistance to these three phage: B S,S,S is sensitive to all three phage; B R,S,S , B S,R,S , and B S,S,R are resistant to O, P, and Q, respectively. B R,R,S is resistant to O and P, but sensitive to Q and analogously for B R,S,R and B S,R,R . Finally, B R,R,R is resistant to all three phage. All mutations to resistance are generated at the same rate of m per hour. The phage are unable to generate host range mutations to overcome resistance.
While the simulated dynamics predicted by the model with three species of phage were complex, qualitatively there were four outcomes; mutants resistant to none, one, two or all three phage species emerged and ascended to dominance before the end of the simulation. Representative dynamics of a simulation, in which mutants resistant to one phage evolved and ascended to dominance are shown in figure 2a. In figure 2b, we show representative dynamics of a simulation, in which resistance to all three phage (B R,R,R ) evolved. In figure 2c, we summarize the results of repeated runs for different sets of parameters. With the standard set of parameters, cells resistant to all three phage species evolved and dominated the bacterial population by 1000 h in the majority of runs. In these simulations, the bacteria became limited by the resource. In the remaining 10% of the simulations, envelope resistance to only one or two of the three phage species evolved and the bacteria were limited by phage to which they remained sensitive. Comparable results were obtained when the concentration of the limiting resource was reduced (c ¼ 100 and c ¼ 10). When the mutation rate was low (m ¼ 10 29 ), triple-resistant bacteria ascended in only 2% of runs. Triple envelope resistance evolved and dominated all 100 simulations when the adsorption rate was low (d ¼ 10 29 ) and the opposite was true when the adsorption rate was high (d ¼ 10 27 ). Finally, triple resistance evolved in roughly a half of the simulations when resistance engendered a fitness cost (v R ¼ 0.8).

(b) Population dynamics of restriction modification immunity and envelope resistance
We constructed and analysed a model of the population dynamics of phage and bacteria that are RM-immune by extending the above-presented model (equations (2.1) -(2.4)) in a manner similar to what is presented in [5,30 -32]. In this model, the phage can be present either in an unmodified or a modified state at densities P and P M ( particles per ml), respectively. There are two possible types of bacteria: RMimmune and resistant bacteria, which are present at densities B RM and B R , respectively. Upon adsorption, the unmodified P phage are restricted by B RM in the majority of cases. However, in a fraction of infections specified by the parameter x, the phage escapes restriction and produces b modified phage particles. Modified phage can replicate on the RM immune bacteria as if these were sensitive. RM-immune bacteria can mutate into envelope resistant as described in the base model. Neither P, nor P M phage can adsorb to resistant bacteria or generate host-range mutants. With these definitions and assumptions, the rates of change in the densities of the bacteria, phage and concentration of the resource can be described by a set of differential equations.  royalsocietypublishing.org/journal/rstb Phil. Trans. R. Soc. B 374: 20180096 To capture the stochastic nature of mutations and phage modification, we modelled both as stochastic processes. At each time step of numerical integration, a random number corresponding to the number of escaping phage was drawn from a binomial distribution D(n(t),x), where x is the modification probability and n(t) ¼ c(r) Á d Á B RM Á P Á dt is the number of infections occurring at the time step t. Mutation to resistance was modelled as described above.
In figure 3a,b, we present the results of two representative simulations of the population dynamics of RM-immune bacteria challenged with unmodified phage. In these simulations, we set the initial density of unmodified phage P(t ¼ 0) to 10 5 phage particles per ml, which is equal to 1/x, where x ¼ 10 25 is the probability of phage escaping the RM system and being modified. With this set of initial conditions, three quantitatively different results were obtained. With the standard set of parameters, the phage did not escape restriction and the modified phage were not produced in approximately one half of the simulations. In these simulations, RM-immune bacteria increased in density and the phage were eliminated by restriction (figure 3a). In the remaining fraction of simulations, the phage did escape restriction and became modified. In these simulations, envelope resistant bacteria often emerged and fixed in the population, which was followed by phage loss (figure 3b). In both of these cases, the populations were resource-limited. In addition to the dynamics presented in figure 3a,b, resistance did not ascend following the phage escape in a small number of simulations. In these simulations, the bacteria remained limited by the phage until the end of the simulation (not shown).
In figure 3c we show how the key parameters of the model affect the relative likelihood of the three different outcomes. In agreement with the results shown in figure 2c, the likelihood of resistance dominating was reduced when the mutation rate was low (m ¼ 10 29 ), or when the adsorption rate was high (d ¼ 10 27 ). Decreasing the adsorption rate (d ¼ 10 29 ) resulted in an increased likelihood of envelope resistance dominating. In all cases, the likelihood of phage escaping restriction was relatively insensitive to changing the reaction rates included in the model. The likelihood of phage escaping, on the other hand strongly depended on the initial number of phage present. The results of repeated simulations in which the initial phage density was varied are shown in figure 3d. When the number of invading phage was low, RM immunity completely protected the bacteria from invasion and resistance never ascended. When the number of invading phage was comparable to the inverse of  the modification probability x, the phage invaded that RM-immune population in approximately 50% cases and this was typically followed by ascent of envelope resistance. The protective capacity of RM systems further declined as the number of invading phage increased. We extended the above-presented model of population dynamics of RM-immune bacteria to three distinct phage species in a manner similar to the model with three species of phage and no immunity. Here, we assume that all three phage species (O, P, and Q) have an equal probability of modification x ¼ 10 25 and bacteria can acquire envelope resistance to these three phage species by individual mutations, each of which occurs at the same rate (m ¼ 10 28 ) The RM-immune bacteria (B RM ) can thus, through mutation, acquire resistance to any of the three phage species and eventually become resistant to all three phage (B R,R,R ). In these simulations, each phage species was introduced at the initial density of 10 5 phage particles per ml.
In figure 4, we present results of simulations with RMimmune bacteria and three, initially unmodified, phage species. Five qualitatively different outcomes were observed.
In a fraction of simulations, all three phage were restricted by the bacteria carrying the RM system and envelope resistance to any of the three phage species did not evolve (figure 4a). In the remaining fraction of simulations, one, two, or all three phage escaped restriction and became modified, which was followed by ascent of bacteria resistant to one, two or all three phage species (figure 4b). In a small fraction of simulations, phage escape was not followed by ascent of envelope resistant mutants (representative dynamics not shown).
As was the case with the model of RM-immune bacteria and a single species of phage, most parameters of the model had little effect on the number of simulations, in which phage escaped restriction (figure 4c). However, RM was more likely to prevent invasion by any of the three phage species when adsorption rate was low (d ¼10 29 ) and vice versa when the adsorption rate was high (d ¼ 10 28 ). Triple resistance was unlikely to ascend regardless of the parameter set used, indicating that RM represents an efficient mechanism of defending bacterial populations, in particular when multiple phage species are present.  The model of the population dynamics of a single phage and bacteria with CRISPR-Cas immunity described in this section is similar to the models employed in [11,33,34]. In this model, we assume maximum seven possible types of bacteria with CRISPR-Cas immunity (B 0,1..6 ), one type of envelope resistant bacteria (B R ), and maximum six types of phage (P 0,1..5 ). For bacteria with CRISPR-Cas, the integer subscripts denote the number of spacers targeting the phage. For phage, the integer subscripts denote the number of protospacer mutations carried by the phage. For example, B 0 bacteria have no spacers and are susceptible to all phage. B 1 bacteria have a single spacer which makes them immune to P 0 , but does not prevent infections by phage with one (P 1 ) or more protospacer mutations (P 2..5 ). In our model, B 6 bacteria are immune to all phage and there is no possibility for the P 5 phage to evolve an additional protospacer mutation. B R is envelope resistant to all six phage and it is impossible for any phage to overcome this resistance. When CRISPR-Cas-carrying bacteria get infected with phage to which they are immune, the adsorbed phage are lost. We assume that a new spacer can be acquired by all bacteria (except for B 6 and B R ) during an infection by any phage with a probability g per infection. With a probability a per successful infection, the phage acquire protospacer mutations that enable them to replicate on bacteria with the number of spacers equal to or lower than the number of protospacer mutations. All CRISPR-Cas-carrying bacteria, regardless of the number of spacers, can mutate into resistant bacteria at a rate m. With these assumptions, the rates of change in the populations of bacteria, phage and the concentration of the resource are given by a set of coupled differential equations (equations (2.10) -(2.15)): j¼0 P j |fflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl ffl{zfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflfflffl ffl}   for i ¼ f0,1,2..5g for i ¼ f1,2..5g In our models, mutations from sensitivity to resistance, as well as protospacer mutations and spacer acquisition are modelled as stochastic processes. Mutations to resistance are modelled as described above in the base model with no immunity. For spacer acquisition, a random number of newly appearing B i (where i ¼ f1, 2..6g) bacteria is drawn from a binomial distribution D(n(t),g) at each step of the numerical integration. Here, g is the spacer acquisition probability and n(t) ¼ c(r) Á d Á B iÀ1 Á P 5 j¼0 P j Á dt is the number of infections occurring at the time step t. At the same time, a random number of newly appearing P i (where i ¼ f1,2..5g) phage is drawn from a binomial distribution D(n(t),a), where a is the protospacer mutation probability and n(t) ¼ c(r) Á d Á P iÀ1 j¼0 B j Á P iÀ1 Á dt is the number of successful infections occurring at the time step t.
In figure 5, we present the results of simulations obtained with the above-described model of CRISPR-Cas-immune bacteria and a single species of phage. As a result of the stochastic nature of mutation and spacer acquisition, two qualitatively different results were obtained: (i) Spacers were acquired sequentially and the phage responded with protospacer mutations until bacteria reached the state with the maximum number of spacers (B 6 ). Envelop resistance did not ascend (figure 5a). (ii) At some point during the coevolutionary arms race between bacteria acquiring spacers and phage evolving protospacer mutations, envelope resistant bacteria appeared and ascended to dominance. The CRISPR-Cas bacteria were maintained as a minority population (figure 5b). In both cases, the phage were lost and the bacterial populations were limited by resources.
With the standard set of parameters the bacterial populations were dominated by envelope resistant, rather than CRISPR-Cas-immune cells in 75% of simulations (figure 5c). The relative frequency of runs in which resistance trumped (the verb) CRISPR-Cas was relatively insensitive to reducing the likelihood of acquiring a spacer (g ¼ 10 27 ), increasing the rate of protospacer mutation (a ¼ 10 25 ) and reducing the concentration of the limiting resource by an order of magnitude (c ¼ 100). A two order of magnitude reduction in the resource concentration (c ¼ 10), corresponding to a two order of magnitude reduction the total cell density, led to a substantial decline in the frequency of runs, in which envelope resistance prevailed. A reduction in the number of runs in which envelope resistance dominated was also observed when resistance was associated with a significant fitness cost (v R ¼ 0.8), or when the mutation rate to resistance was low (m ¼ 10 29 ). However, it would seem that the single most important factor determining whether resistance or CRISPR-Cas immunity will prevail, is the length of the spacer-protospacer coevolutionary arms race between bacteria and phage. To demonstrate this, we altered the maximum possible number of steps in the coevolutionary arms race by changing the number of maximum possible number of protospacer mutations that can be evolved by the phage before the bacteria acquire a 'terminating' spacer, to which the phage cannot generate viable protospacer mutants. As the number of steps in the spacer-protospacer coevolutionary arms race decreased, the frequency of runs with CRISPR-Cas bacteria dominating the population increased (figure 5d).
To explore the population dynamics of CRISPR-immunity in the presence of multiple phage species, we constructed a model capturing the population dynamics of interactions between CRISPR-Cas-immune bacteria and two distinct phage species. In this model, two rather than three phage species were considered in order to limit the number of equations. We assume that the two phage species, P and Q, have separate adsorption sites requiring two different mutations for double resistance and also genome differences great enough so that spacers acquired from phage P do not target phage Q and vice versa. The CRISPR-Cas-carrying bacteria, designated as B i,j , acquire spacers from these phage. The subscript i designates the number of spacers acquired from phage P, and j designates the number of spacers acquired from phage Q. The subscripts i and j can take values 0, 1, 2, 3, 4, and R. The subscript R denotes that the bacteria are envelope resistant to the respective phage (B R,j bacteria are envelope resistant to P, B i,R are resistant to Q and B R,R are resistant to both P and Q). Both P and Q can acquire protospacer mutations that allow them to replicate on bacteria with the number of spacers equal to or lower than the number of protospacer mutations that these phage carry. Bacteria designated as B 1,0 have one spacer for the phage P and none for Q. The phage P 0 cannot replicate on these bacteria, but P 1 , P 2 , and P 3 , as well as all Q phage can. Bacteria designated as B R,1 are resistant to all P phage, irrespective of the number of protospacer mutations in their genome, but can support growth of Q phage with one or more protospacer mutations. Importantly, we assume that both P and Q can generate at most three protospacer mutations-i.e. they are unable to overcome immunity conferred by four spacers. The remaining assumptions are identical to those presented in the model of population dynamics with CRISPR-immunity and one phage species.
In figure 6, we present simulation results obtained using the above-described model. In these simulations, three qualitatively different outcomes were observed. (i) Spacers were acquired sequentially for both phage and both phage responded with protospacer mutations until bacteria with CRISPR-Cas immunity against both phage emerged and ascended to dominance (figure 6a). (ii) In the course of the spacer-protospacer coevolution, bacteria with envelope royalsocietypublishing.org/journal/rstb Phil. Trans. R. Soc. B 374: 20180096 resistance against one of the phage emerged and dominated the population (representative dynamics not shown). (iii) The dominating population at the end of the simulation was envelope resistant to both phage (figure 6b).
To explore how the relative likelihood of the individual outcomes depends on the parameters of the model, we performed series of repeated simulations with altered parameters (figure 6c). With the standard set of parameters, the most frequent outcome was emergence of bacteria that were immune to one phage and resistant to the other. CRISPR-Cas immunity to both phage species prevailed more often in simulations in which resistance carried a fitness cost for the host (v R ¼ 0.8), as well as in simulations with a lowered rate of mutation to resistance (m ¼ 10 29 ). In contrast, resistance was more likely to dominate when the probability of spacer acquisition was low g ¼ 10 27 . We observed no apparent difference in the frequency of outcomes when the resource concentration was lowered (c ¼ 100 and c ¼ 10). Unlike for the model with CRISPR-Cas immunity and a single species of phage, we did not explore the relationship between the length of the coevolutionary spacer-protospacer arms race and the likelihood of resistance/CRISPR-Cas dominating. The number of equations to do so would be unwieldy. In these simulations the maximum number of protospacer mutations accessible to the phage was limited to three. It seems reasonable to assume that, similarly to what was the case for the simulations with a single species of phage, the likelihood of resistance ascending will increase with the increasing length of the coevolutionary arms race.

Discussion
'The most that can be expected from any model is that it can supply a useful approximation to reality: All models are wrong; some models are useful'. We agree with this perspective by George Box and colleagues about mathematical and computer simulation models. As complex as our models may be, at best they are pale approximations of the complexity of the natural communities of bacteria and phage about which we are drawing inferences. Most importantly, our models do not consider the spatial, temporal and biological diversity of these natural communities, which is also a limitation of most experimental systems used to study the population and evolutionary biology of bacteria and phage (for some exceptions see [35 -37]). Be that as it may, these models make a number of predictions about the conditions under which RM and St. par. g = 10 -9 µ = 10 -9 a = 10 -9 c = 100 c = 10 v R = 0.8

(a) Envelope resistance
It is not at all surprising that our models predict that when populations of bacteria without an innate or adaptive immune system are confronted with lytic phage, there are conditions under which resistant cells will evolve and become the dominant population of bacteria. This is what has been commonly observed experimentally [17][18][19][20][21]. Our results identify the rate of mutation to resistance and the phage adsorption rate as the key parameters determining whether, in the absence of immunity, envelope resistance will evolve and the bacterial populations will become limited by resources, or on the contrary, whether resistance will not evolve and the bacterial populations will be limited by phage.
Our models further suggest that, in the absence of immunity, envelope resistance to even multiple phage species with separate adsorption sites can evolve within a relatively short time. Some 25 years ago, Korona & Levin [32] observed rapid evolution of resistance to three phage species with separate receptor sites in experimental populations of E. coli. The authors showed that this surprisingly fast evolution of triple resistance can be attributed to a hierarchy of phage replication, where infection with one phage suppressed the replication of the other phage [38]. In the simulations presented here, albeit at a longer time scale, resistance to multiple phage species evolved even in the absence of such hierarchy. At this juncture, the question of how commonly resistance to multiple phage species will evolve in the absence of infection hierarchy remains unknown but could be addressed experimentally.

(b) Restriction -Modification immunity
Our models of the population dynamics of RM-immune bacteria confronted by one and three phage species make quantitative predictions about the relationship between the probability of modification, the densities of phage, and the conditions under which phage will invade and become established in populations of initially RM-immune bacteria. The qualitative prediction that RM can prevent phage from invading and becoming established in bacterial populations is intuitive. Also apparent without the aid of mathematical or computer simulation models is the recognition that unlike resistance, which is commonly specific for a single phage species, RM can offer a first line of protection from multiple phage species, with different receptor sites and thereby requiring different mutations for resistance. Our models predict that when challenged with multiple phage species, RM can reduce the effective number of phage species able to invade and thus reduce the number of necessary envelope resistance mutations. Such property could be a virtue  especially if we consider that unlike envelope resistance, which is commonly associated with a high fitness cost, the cost of RM is typically low [39]. Importantly, even in cases in which phage do escape restriction and envelope resistance evolves, the originally RM-immune bacteria retain their RM system, since envelope resistance and RM immunity are not exclusive. Curiously, despite the ubiquity of RM systems in the bacteria and archaea and the obvious ecological importance of these innate immune systems, there have been few empirical considerations of the contribution of RM to the ecology and evolution of bacteria, archaea and the phage that prey on them. Currently, we know little about the nature and magnitude of the contribution of RM to the ecology and evolution of natural communities of bacteria, archaea and phage. From the perspective of the phage, there would be selection for evading RM, and it is not at all clear how commonly extant phage are susceptible to RM. As a consequence of naturally methylated DNA, the E. coli phages like T2 and T4 are not susceptible to many RM systems. Moreover, many phage have other mechanisms that make them immune to RM, including a dearth of restriction sites [40][41][42][43].

(c) CRISPR-Cas Immunity
In the absence of resistance, CRISPR-Cas immunity will be maintained by lytic-phage -mediated selection under broad conditions. If, however, resistance can be generated by mutation, our models predict that the conditions for CRISPR-Cas to evolve and be maintained as the dominant mechanism of protecting bacteria against lytic phage are restrictive. Our models indicate that, if envelope resistance can be generated by a single mutation, the most important factor in determining whether resistance will evolve is the number of steps in the arms race between bacteria acquiring phage-targeting spacers and phage responding by protospacer mutations. The longer this arms race, i.e. the more rounds of the acquisition of spacers by the bacteria and protospacer mutations by the phage occur, the greater the likelihood that envelope resistant mutants will ascend to dominate the bacterial population. In our models, the arms race terminated when bacteria acquired spacers for which the phage could not evolve protospacer mutations. In practice, this could occur when bacteria acquire spacers for which the probability of the phage evolving escape mutations is very low ( possibly because the spacers target genes essential for bacteriophage growth), or when two spacers are acquired simultaneously by one bacterium. In such cases, the number of steps in the arms race between the phage and the spacer-acquiring bacteria will be determined by the probability that the next spacer acquisition will be terminating. To our knowledge, the frequency of such terminating spacer acquisitions is yet to be measured.
Our models indicate that CRISPR-Cas would be favoured over envelope resistance under conditions where the mutation rate to resistance is low, or where envelope resistance carries a significant cost for the host. Such conditions could be met in environments, where presence of the receptor recognized by the lytic phage is under strong selective pressures. Furthermore, in all our simulations, envelope resistance was more likely to dominate in bacterial populations when phage adsorption rate was low. This effect can be explained by realizing that low adsorption rates result in less frequent killing by the phage, which increases the size of the bacterial population and thus also the likelihood of envelope resistance mutations evolving.
In our models, we focused primarily on the question of conditions, under which complex innate and/or adaptive immunity conferred by either RM or CRISPR-Cas, respectively will prevail over simple envelope resistance. We did not explore the conditions under which the phage will be stably maintained in a population dominated by bacteria upon which the phage cannot replicate. Nor did we explore adaptive or stochastic phenotypic changes to a fluctuating environment as in [44]. Whether the phage will be maintained following the ascent of resistance/immunity will depend on whether there is a mechanism maintaining a sufficiently high density of susceptible bacteria to maintain the phage. Several such mechanisms have been previously experimentally demonstrated, including a high rate of reversion from resistance (or immunity) to sensitivity [14,27,[45][46][47], a refuge of susceptible bacteria in structured habitats [29], and fitness cost of resistance [17,22,[48][49][50][51].
It is again important to note that, despite the recent extraordinary interest in CRISPR-Cas biology, we are aware of only one empirical study that explored the conditions under which this adaptive immune system will prevail over envelope resistance when a population of bacteria with a functional CRISPR-Cas is confronted with a phage to which bacteria can generate envelope resistant mutants [52]. This jointly theoretical and experimental study with Pseudomonas aeruginosa PA14 and a virulent mutant of the temperate, mu-like phage DMS3, DMS3-vir presented evidence that when resistance can be generated by bacteria which also carry a functional (able to acquire spacers) CRISPR-Cas system, whether resistance or CRISPR-Cas immunity dominates depends on the nutrient composition of the media.
It would be enlightening to perform these experiments with another experimental system consisting of phage and bacteria (or archaea), which can become either immune to the phage by incorporating spacers in their functional CRISPR-Cas system, or resistant by means of envelope resistance. But are there such experimental systems? To our knowledge, currently there are only two well-established, laboratory-amenable, bacteria-phage systems, in which the bacteria with a functional CRISPR-Cas can naturally acquire spacers when infected with lytic phage: (i) P. aeruginosa PA14 and the DMS3 phage employed in [52]. (ii) S. thermophilus and phage 2972 used by [3,11,12,14]. Unfortunately, it is not clear whether S. thermophilus can generate mutants with envelope resistance against phage 2972.
If indeed CRISPR-Cas commonly serves as an adaptive immune system that protects bacteria from lytic phage, why are there so few experimental systems available to study this phenomenon? Could it be, that the quest of finding new experimental systems has not been intensive enough? Why go through the trouble developing and working on new experimental systems, if the systems available are sufficient to address the questions of interest? Or could it be that despite the retrospective evidence for CRISPR-Cas functioning as an adaptive immune system-spacer sequences being homologous to phage DNA [53], CRISPR-Cas systems rarely serve as an adaptive immune system protecting extant bacteria and archaea from infections with phage?
To us, this latter possibility is worthy of more extensive consideration. Once the phage are eliminated by bacteria with an effective CRISPR-Cas system, there would no royalsocietypublishing.org/journal/rstb Phil. Trans. R. Soc. B 374: 20180096 longer be selection for maintaining CRISPR-Cas -mediated immunity by those phage. If such ascent of resistance is followed by phage extinction, as was suggested by the Pseudomonas PA14 -DMS3-vir studies by van Houte and colleagues [37], rather that the continuous arms race seen for S. thermophilus and phage 2972 [12,14], selection for CRISPR-Cas-mediated immunity may be transient and thus not sufficient to maintain a fully functional CRISPR-Cas system. Even when the CRISPR-Cas system is no longer functional, the signature of past encounters with phage would, however, remain in the genome as spacers deposited between the palindromic repeats. Stated another way, there would be abundance of retrospective evidence for CRISPR-Cas being an immune system to protect bacteria against phage and, at any time, few fully function CRISPR-Cas systems.
Data accessibility. The computer programs used to generate the results presented in this work are available at www.eclf.net Competing interests. We declare we have no competing interests. Funding. This endeavour was supported by a grant from the Simons Foundation (396001), J.G., and a grant from the US National Institutes of Health, R01-GM091875, B.R.L.