## Abstract

The existence of cooperation, or the production of public goods, is an evolutionary problem. Cooperation is not favoured because the Prisoner's Dilemma (PD) game drives cooperators to extinction. We have re-analysed this problem by using RNA viruses to motivate a model for the evolution of cooperation. Gene products are the public goods and group size is the number of virions co-infecting the same host cell. Our results show that if the trade-off between replication and production of gene products is linear, PD is observed. However, if the trade-off is nonlinear, the viruses evolve into separate lineages of ultra-defectors and ultra-cooperators as group size is increased. The nonlinearity was justified by the existence of real viral ultra-defectors, known as defective interfering particles, which gain a nonlinear advantage by being smaller. The evolution of ultra-defectors and ultra-cooperators creates the Snowdrift game, which promotes high-level production of public goods.

## 1. Introduction

RNA viruses are ideal organisms for modelling the evolution of cooperation. Besides providing some of the more accurate information on the dynamics of the process, the molecular mechanisms that drive it have been elucidated to great detail. They are as simple as possible, but not simpler than a general case. All viruses are parasites that need to infect a host cell to reproduce. If a single virion infects a cell, kin selection is the agent of evolution because the progeny viruses are clonal. Kin selection may be uniquely important, if not actively enforced, in many RNA viruses because the first one or few viruses to infect a cell may exclude the entry of others, a phenomenon known as superinfection exclusion [1–3]. However, if a larger number of viruses are able to co-infect the same cell, groups of genetically unrelated viruses are created and opportunities for the evolution of cooperation and defection arise. The interaction between unrelated viruses in a mixed co-infection group creates pay-off matrices at the fitness level that correspond to many standard game theory outcomes such as Prisoner's Dilemma (PD) and Snowdrift (SD; also known as the Hawk–Dove or the Chicken games) [4–9]. By increasing the group size of viruses co-infecting the same host cell, it has been possible to experimentally demonstrate that RNA viruses can evolve to be trapped by PD [10], yet escaping from this game is still possible if kin selection is restored [11].

A particularly appealing example of the interaction between cooperators and defectors in the virosphere are replicator-defective mutants known as defective interfering (DI) particles and the wild-type viruses from which they evolve and depend for their replication and transmission [12–14]. Almost all viruses produce DIs, deleted forms of the genome of the wild-type virus, during replication. DIs are encapsidated into virus particles produced by a wild-type co-infecting virus and can be transmitted in a manner identical to the wild-type virus. Obviously, as DIs need the assistance of the wild-type virus to replicate and encapsidate, they can only persist in the long term at high multiplicity of infections (MOIs), when more than one particle enters into susceptible cells [14,15]. Within co-infected cells, DI and wild-type virus genomes compete for resources, including binding to the viral replicase and packaging proteins. This competition results in a reduced accumulation of the wild-type virus, a process known as interference [13,16–25]. The interest in DIs has been revitalized in recent years mainly for three reasons: (i) they may be involved in triggering antiviral immunity during acute viral replication [26], (ii) they negatively impact the biotechnological production of vaccines and viral vectors [27], and (iii) their possible application as transmissible antivirals to control viral infections at the host-population level [28], the so-called therapeutic interfering particles.

One of the best studied DI–virus systems was the molecular control of replication and transcription in *Vesicular stomatitis virus* (VSV; genus *Rhabdovirus*, family Rhabdoviridae) (figure 1*a*), which we have taken as our idealized virus to model. This system offers a near perfect mechanism for modelling the trade-off between defection and producing public goods [13]. The molecular control in VSV DI particles was also key for evaluating the nonlinearity of the trade-off in ultra-defectors (figure 1*b*).

## 2. Results and discussion

Our model accommodates a viral population of size *N* that is randomly divided into *N*/*m* groups of size *m* ≥ 1, where each group represents viruses that co-infect the same host cell. For virologists, *m* would correspond to MOI [29–31]. Once inside a cell, a virus must trade-off between replicating its own genome and producing gene products. This aspect of the trade-off was assumed to be linear because replication and transcription in VSV compete for the same initiation site (figure 1*a*). Thus, let *i* and 1 − *i* represent the effort an individual virus allocates to replicating its own genome and making public goods (e.g. proteins), respectively (with *i* ∈ [0, 1]). We assumed additionally that an individual virus *n* in a group of size *m* has access to 1/*m* of the host's resources and therefore is able to make only *i _{n}*/

*m*public goods and (1 −

*i*)/

_{n}*m*genomes, where the subscript

*n*is here and hereafter used to denote the effort by of the

*n*th virus and

*n*= 1, 2, 3, … ,

*m*. This assumption is justified because many viral DIs, as per their name, interfere by reducing the total yield of wild-type and defective genomes produced by a co-infection group [16–25]. The reduction has also been shown to be linear, e.g. it is

*i*= ½ when co-infections groups are 50% wild-type and 50% DI viruses [17]. After genomes and gene products are assembled into virions, a progeny of

*b*number of viruses is released and the model determines the final fitness of an individual virus as 2.1where is the total number of genomes produced by the group of size

*m.*To determine the value of

*b*, we note that while its value could be equal to the total amount of public goods produced by the group, namely , it could be less than

*h*(

*m*) if insufficient genomes are made. If both

*g*(

*m*) and

*h*(

*m*) are scaled in molar units required to assemble a viable virus, then

*b*= min[

*g*(

*m*),

*h*(

*m*)]. If

*g*(

*m*) >

*h*(

*m*), the excess genomes are wasted and

*h*(

*m*) caps the number of viruses produced. Vice versa if

*g*(

*m*) <

*h*(

*m*) and then genomes are the limiting factor and public goods are produced in excess. Equation (2.1) is formally equivalent to the fitness equations developed by Frank [7,8] to study the evolution of parasites and protocells.

We modelled evolution by Monte Carlo simulations (see §4a) of a parent population of size *N* with known or assigned values of *i* and assembling *N*/*m* random groups. By using equation (2.1), the fitness of each virus was determined. A progeny population was then created by sampling *N* viruses from the parent population. Selection was imposed because the fitness values were used to weight the sampling process. The progeny was then re-assembled into *N*/*m* groups to create the parent population for the next generation. By using equation (2.1) and the weighted sampling, the process can be repeated to create new progeny and parent populations for as many generations as needed. If desired, the values of *i* were mutated before selection, in which case changes in the values of *i* over time in a population could be monitored to track the evolutionary dynamics of cooperation and to search for steady-state outcomes.

### (a) Evolution is trapped by Prisoner's Dilemma with a linear trade-off

Used as presented above, equation (2.1) represents a linear trade-off between replication *i* and transcription 1 − *i*. In a later section, nonlinear trade-offs are introduced by changing the relationship of replication and transcription. A first test was to model evolution with *m* = 1, for which an evolved optimum *i _{k}* = ½ was anticipated, and observed, because each group is clonal and kin selection between groups favours viruses that make equi-molar amounts of genomes and gene products (figure 2

*a*). Thus, we used

*i*= ½ as the evolutionary starting point and examined the effect of increasing

_{k}*m*. In all cases,

*i*evolved dynamically to higher steady-state values as

*m*was increased (figure 2

*b*). Because all of the populations remained monomorphic, we were able to determine analytically the steady-state values by solving for the

*i*that maximized individual fitness in a group of

*mi*identical viruses (see §4b for the analytical derivation). The solution 2.2matched closely all of the steady-state values evolved with the model (figure 2

*c*). It is also an evolutionarily stable strategy (ESS) because mutants with either higher or lower values of

*i*have a lower fitness and cannot invade. Indeed, noticing that 1/

*m*is equivalent to a coefficient of relatedness between viruses within a host, this result is formally identical to the ESS condition previously derived by Frank [7,8]. Note that if

*m*= 2,

*i*=

_{a}*i*= ½ and selection for cooperation is as optimal as kin selection. However, evolution was trapped by PD for

_{k}*m*≥ 3. By constructing the individual fitness of

*i*and

_{k}*i*viruses in pure and mixed groups of size

_{a}*m*≥ 3, we found that the resulting fitness values conformed to a PD pay-off matrix (figure 2

*d–f*). Thus, our first model with linear trade-offs remained trapped by the PD domain. Replication effort

*i*evolved to high values, while the production of public goods 1 −

*i*evolved to low levels. Only clonal or kin selection (

*m*= 1) was able to select for high levels of cooperation with 1 −

*i*= ½.

### (b) A nonlinear fitness trade-off allows for an evolutionary transition from Prisoner's Dilemma to Snowdrift

Our examination of a nonlinear trade-off was motivated by the molecular biology of VSV DI particles described above [13]. Although a linear trade-off was justified for replication and transcription (figure 1*a*), DI particles are more than just defectors with *i* = 1 and producing no public goods (1 − *i* = 0). Once a defector evolves to produce zero public goods, it can delete the coding sequences and replace its replication and transcription site with a replication-only site (figure 1*b*). These changes introduce a nonlinear trade-off because such an ultra-defector is able to make *i* *=* 1 *+* *e* copies of its genome, where *e* is the amount gained by having to replicate a smaller genome and not having to spend time on transcription (figure 1*c*). The value of *e* is a constant representing a cap to the nonlinear gain. Thus, *i* is now able to evolve in the interval *i* ∈ [0, 1 + *e*] through mutations. Because it is now also possible that *i* > 1, the new constraint 1 − *i* ≥ 0 was added to the model to prevent public goods from being produced at a negative rate. By incorporating this nonlinearity in the fitness trade-off, we have expanded the scope of models previously proposed by Frank [7,8].

Equation (2.1) can still be used with the nonlinear modifications, although fitness *W _{n}* is now determined by two discrete and discontinuous functions. We considered modelling the nonlinearity with a single continuous concave up function (e.g. exponential or parabolic), but chose to use our formulation because we deemed it to be more accurate. When a virus trade-offs by allocating more effort to either transcription or replication, a linear trade-off is realistic. However, once the trade-off evolves to allocate

*i*= 1 into replication, the virus is free to delete coding regions. As more and more regions are deleted, the replication fitness of the virus increases, but its transcription effort remains unchanged because it is already equal to zero. Thus, the fitness trade-off of a real virus is actually determined by two discrete molecular mechanisms, initially one that affects transcription and a later one that does not. A single continuous function would force a trade-off when there is none, or assume none when there is one.

The addition of a nonlinear trade-off and *i* > 1, altered qualitatively the evolutionary dynamics of our model (figure 3*a*). As an illustrative example, letting *m* = 8 and *e* = ½, we started with a monomorphic population with *i* = ½ and allowed evolution to proceed with mutations. The population quickly evolved to a steady state of *i _{a}* (equation (2.2)) as we had reported for a linear model and PD (cf. figure 2

*b*;

*m*= 8). However, as mutations accumulated, the population bifurcated into a lineage of ultra-defectors and one of ultra-cooperators. In the ultra-defectors,

*i*evolved upwards until it equalled the cap of 1 +

*e*, while in the ultra-cooperators, it evolved downwards to the clonal selected optimum of

*i*= ½. Note that the evolution of ultra-cooperators occurs only after the ultra-defectors begin to increase in frequency. Thus, a mutant ultra-defector must have a minimum value of

_{k}*i*in order to invade the steady-state

*i*population. By using equation (2.1) to estimate the fitness of the DI mutant in the

_{a}*i*population, and assuming that the mutant is at a low frequency, the minimum

_{a}*i*valued needed by the ultra-defector was found to be 2.3(see §4c for the analytical derivation). The bifurcation and the evolution of the ultra-defector also allow the population finally to escape PD and transition into SD. By determining the individual fitness of

*i*and

_{k}*i*viruses in pure and mixed groups of size

_{d}*m*≥ 3, there are again only two competitors and the resulting fitness values can be represented by a 2 × 2 fitness pay-off matrix. The results conformed to the SD pay-off matrix (figure 3

*b,c*).

Equations (2.2) and (2.3) can be used to partition parameter space and constructing a landscape for the evolution of cooperation. As the model has only two parameters, let 1 + *e* and *m* be the *y* and *x* axes, in which case equation (2.3) delineates the boundary between PD and SD (figure 4*a*). Thus, for all values of *m* ≥ 3, PD evolves if 1 + *e* < *i _{d}*, and SD evolves if 1 +

*e*>

*i*. For

_{d}*m*values as low as 1 or 2, clonal selection is sufficiently strong and the optimum

*i*= ½ evolves. Note that when

_{k}*e*= 0, the model reverts to the linear form and the outcome is PD as described by equation (2.2). By plotting the amount of public goods produced as the response variable on the

*z*-axis, a landscape for the evolved level of cooperation as a function of 1 +

*e*and

*m*is generated (figure 4

*b*). Public goods are produced maximally by clonal selection, but nearly equivalent amounts are produced by SD. Moreover, as 1 +

*e*and

*m*are increased in SD, ultra-cooperators are selected to make even more public goods to make up for consumption of the progressively stronger and more numerous ultra-defectors. Indeed, it can be shown mathematically that as 1 +

*e*increases,

*i*tends to

_{a}*i*= ½ (see §4e). However, because the frequency of individuals producing public goods is not equal (figure 4

_{k}*c*), we also examined the landscape for the mean production of public goods as a response variable (figure 4

*d*). Because the frequency is low for high values of 1 +

*e*and

*m*, the highest mean production, outside of clonal selection regime, is situated centrally, in the SD region, and just beyond the

*i*boundary.

_{d}## 3. Concluding remarks

The evolution of cooperation remains a problem partly because it has been easier to identify the barriers to the process rather than solutions. PD presents an obstacle, but it is not clear that escaping PD promotes cooperation. The cooperator could evolve to resist the defector more effectively, but that only makes the goods less public, as did reciprocation and kin selection. SD was recognized as promoting more cooperation [9], but we know little about its evolutionary maintenance, origin and link to PD and kin or clonal selection. Our model resolves many of these issues by mapping the evolution of cooperation onto two parameters, group size and the magnitude of the nonlinear gain to an ultra-defector. On this parametric space, increasing group size alone is sufficient for driving the evolution of cooperation from clonal (kin) selection to PD and to SD. We show that the transition to SD results from the splitting of the population into lineages of ultra-defectors and ultra-cooperators. However, the split is triggered by the initial evolution of more defection, rather than more cooperation. If the trade-off between defection and cooperation is linear, PD traps the population because the evolution of more defection, and the split, is prevented. With a nonlinear trade-off, more defection and the ultra-defector are able to evolve. Once the ultra-defector increases in frequency, the cooperator is selected to make even more public goods and to evolve into the ultra-cooperator of SD. The best ultra-cooperators make nearly as much public goods as clonally selected individuals. The numerical analysis of equation (4.7) supports this latter conclusion: for any given value of *m*, one can explore which values should take *i* to hold the equilibrium frequency of wild-types, constant if the DIs take increasingly large values of 1 + *e*. It turns out that at the limit when 1 + *e* → ∞, then *i* → ½. This means that the optimal solution for a wild-type virus in the presence of an ultra-defector DI would be to become itself and ultra-cooperator and invest 50% of its resources in the production of common goods.

The effect of increasing group size on the evolution of cooperation has been observed in laboratory studies with RNA viruses. The first transition from clonal selection to PD was seen in the bacteriophage φ6, where cheaters spontaneously arose when group size was increased to *m* = 5 [10,11,32]. This was a reversible process, as cheaters were outcompeted when a regime of clonal selection () was imposed [11]. The second transition, from PD to SD, has been documented in many RNA viruses by the evolution of DIs in dense cultures when large viral groups are able to co-infect the same host cell [33–37]. Subsequent evolution in some of these dense cultures often result in population cycles during which wild-type viruses become resistant to the effects of the DIs [18,19,38–41] and the DIs evolve in turn the ability to overcome the resistance [15,16,39–41]. Such cycles are driven by the evolution of new wild-type RNA replicases that no longer recognize the replication signals of the DIs, followed by the coevolution of DIs with altered signals that are recognized [39]. Because the aim of our model was to analyse the evolutionary dynamics of cooperation between a given pair of wild-type and DI, such coevolutionary races for novel replicases were not considered. In other words, our model focuses on the period of stasis between cycles. Periods of stasis can be long, and evolutionarily important, because the start of a new cycle requires a double mutation in the wild-type virus. One mutation must change the replicase to provide resistance, but a second one is needed to change the wild-type replication signal, so that it recognizes the mutated replicase. Double mutants will be rare and less likely to appear if population size is small. While laboratory populations can be large, wild populations may be much smaller because of bottlenecks or other ecological stresses.

Although our model was motivated by viral biology, there are clear overlaps between our approach and previous studies. At the mathematical and the theoretical level, viruses, prebiotic replicons and humans can sometimes be modelled equivalently [4,5,7–9]. SD was recognized as favouring the evolution of higher cooperation levels [8], but because the games had been studied as separate games played in isolation, there was no evolutionary connection between them. For a population to evolve more cooperation by transitioning from PD to SD, the pay-off matrix had to be changed. However, the rules controlling the matrices and their changes were not apparent, or at least assumed to be too complex to be derived from known ecological and evolutionary processes. Our finding that varying group size alone, so long as the trade-offs between replication and the production of public goods are nonlinear, controls the transition between PD and SD, and greatly simplifies the conditions required for the evolution of cooperation. Our pay-off matrices were able to evolve freely, and the ones emerging as ESS conformed to PD and SD as group size changed. Because all organisms experience a group size, the results of our model show that the evolution of cooperation may not need much more than changing one ecological parameter. We hope that our work will stimulate additional work on RNA viruses or other organisms that produce public goods as model systems to explore social evolution.

## 4. Material and methods

### (a) Monte Carlo model for simulating of evolution in viral populations

A population of size *N* viruses was constructed by assigning a starting value of *i* to each virus. The assigned value could be randomly or deliberately chosen to explore different starting scenarios. The population was then divided into *N*/*m* groups of size *m* and the fitness of individual viruses was determined with equation (2.1). To create the population for the next generation, the current population was sampled *N* times with replacement to ensure a constant population size. The sampling was biased by using the normalized fitness values of each virus as their probability of being chosen. Fitness was determined using equation (2.1) with the appropriate linear and nonlinear values of *i* and 1 − *i*. This sampling bias introduces natural selection and evolution could thus be modelled and followed over generations. Whenever desired, mutations were introduced by changing individual values of *i* with a probability of 0 < *u* < 1. If mutations were not desired, a value of *u* = 0 was used instead. If a virus was to be mutated, its *i* value was changed by an amount randomly drawn from a Gaussian distribution with a mean zero and a specified standard deviation, *σ*. All simulations were coded in R v. 3.2.4 computer language.

### (b) Analytical solution of equation (2.2)

Let *j* and *i* be the replication effort of a mutant and wild-type virus, and *j* > *i*. The fitness of a wild-type virus in a population all formed by wild-type viruses can be computed using equation (2.1). In such case, the burst size would be and the total replication effort because the co-infection group has a uniform composition. Thus,
4.1Now let us imagine that a defector mutant that invests *j* > *i* into replication appears in a population of *m* − 1 wild-type viruses. The fitness of this mutant can be calculated using equation (2.1) but now considering that and :
4.2

Coexistence of both genotypes would occur if, and only if, *W*_{wt} = *W*_{def}. If *W*_{wt} < *W*_{def}, the defector mutant will invade, whereas the opposite condition means that invasion is not possible. Combining equations (4.1) and (4.2) and simplifying, we found that there are two different values of *j* that satisfy the coexistence condition: *j* = *i* and *j* = (1 − *i*)(*m* − 1). These two lines correspond to pairs of values (*i*, *j*) in which defector mutant and wild-type have equal fitness. The intersection of these two fitness isoclines results in the equilibrium condition shown in equation (2.2)
The linear stability of this fixed point was evaluated by constructing the Jacobian matrix of the system formed by equations (4.1) and (4.2), which is given by
The two eigenvalues for the fix point are *λ*_{1} = 1/*m*^{3} and *λ*_{2} = −1/*m*. As *λ*_{1} > 0 and *λ*_{2} < 0 ∀ *m* > 0, the fix point takes the form of a saddle and is thus unstable.

### (c) Analytical solution of equation (2.3)

The solution is obtained by exploring the conditions in which a DI mutant will invade a population at the equilibrium specified by equation (2.2). Substituting *i* by the equilibrium condition given by equation (2.2) into equations (4.1) and (4.2) and recalling that DIs do not contribute to the production of common goods and have an investment in reproductive effort 1 + *e* > *i*, we obtain after some algebraic work the following fitness equations for wild-type and DI, respectively:
4.3and
4.4By making *W*_{wt} = *W*_{DI} and solving for 1 + *e*, we found the 1 + *e* value at which wild-type and DI viruses will coexist (equation (2.3))

### (d) Constructing pay-off matrixes for Prisoner's Dilemma and Snowdrift

Pay-off values in a game theory matrix traditionally represent interactions between two individuals rather than between many in a large group. Because our models consider groups of size *m* that can be much larger than two, we adapted the pay-off matrix to represent individual fitness values in populations with only cooperators, only defectors, one cooperator invading a large population of defectors and one defector invading a large population of cooperators. The fitness of the invading cooperator, which equals the value the virus has when it is alone in a group with *m* − 1 defectors, represents *S*. The fitness of the invading defector represents *T*, or the value when it is alone in a group of *m* − 1 cooperators. The fitness of a cooperator in a population with only cooperators represents *R*, or the value when it is in a group with *m* cooperators. The fitness of a defector in a population with only defectors represents *P*, or the value when it is in a group with *m* defectors. A pay-off matrix adapted to larger groups retains the predictive properties for an ESS analysis. If *T* > *R*, a defector is able to invade a population of cooperators. If *S* > *P*, a cooperator is able to invade a population of defectors, which is one of the requirements for SD. All fitness values were based on equation (2.1) and using the appropriate linear and nonlinear values of *i* and 1 − *i*.

Although we can potentially have *m* players in a group, the interaction can be reduced to a two-player game for the construction of a 2 × 2 play-off matrix. In an ESS analysis, the resident population (even if it is polymorphic) is always held constant, in which case the two players are the resident(s) and the invader.

### (e) Equilibrium frequencies of defective interfering and wild-type viruses in Snowdrift

With SD, the trade-off is necessarily nonlinear and both DIs and wild-type viruses are present in the population. We calculate here the equilibrium frequencies of DI and wild-type viruses in the population for a given set of values for group size *m*, DI replication fitness 1 + *e* and wild-type replication fitness *i*.

Let *p* and 1 − *p* represent, respectively, the frequency of wild-type and DI viruses in the population. Assuming that the viruses are distributed by a binomial process into groups of size *m*, the probability of getting *x* wild-types is . The mean individual fitness of the viruses in the population is then given by
4.5and
4.6where *b*(*x*) = *x*(1 − *i*)/*m* is the total production of common goods by a group of size *m* that contains *x* wild-types, and *g*(*x*) = *xi*/[*xi* + (*m* − *x*)(1 + *e*)] is the relative individual replication effort by the wild-type virus in the same group. Because DIs do not make public goods, they do not contribute but have access to *b*(*x*). On the other hand, because DIs replicate, their relative individual replication rate is 1 − *g*(*x*).

Noting that the denominators of equations (4.5) and (4.6) are the expectations of the binomial distribution *mp* and *m*(1 − *p*), the frequency of DIs and wild-types will be unchanging and at their equilibria and when *W*_{wt} = *W*_{DI,} or
After replacing *P*(*x*), *b*(*x*) and *g*(*x*) by their actual values, we obtain the following expression:
4.7Equation (4.7) can be solved analytically for any value of *m* ≥ 2 to obtain the equilibrium frequency of the cooperator virus as a function of *i* and *e*, namely . For instance, in the case *m* = 3, the equilibrium frequency for the cooperator virus is given by , which takes positive values for any *i* < 1 + *e* value. Linear stability analysis shows that the two eigenvalues of the Jacobian matrix evaluated at the fix point are *λ*_{1} < 0 and *λ*_{2} > 0, as corresponds to an unstable saddle fix point. For *m* ≥ 4, is a complex polynomic function of *i* and *e*, with at least one root in the interval [0, 1] that in every case corresponds to an unstable saddle point. Equation (4.7) can also be solved numerically for every value of *m* to find the frequency *p* of wild-types in the population as a function of values of *i* and *e*.

### (f) Numerical solutions for the evolved values of replication fitness *i* and of the frequency of ultra-cooperators in a Snowdrift parameter space

From equation (4.7), we first obtained the equilibrium frequency of wild-type and DI viruses in a population, and , for a given group size of *m*, a DI replication fitness of 1 + *e* and a wild-type replication fitness of *i*. These equilibrium values are not necessarily the ones that will evolve by natural selection in a population. To determine if they could be the evolved values, we evaluated whether a population with these frequencies of and could be invaded by a mutant wild-type virus. Invasion by mutant DI was not examined because we had found in our Monte Carlo simulations that 1 + *e* would evolve to be infinitely large and thus had to be capped at its chosen value (figure 3*a*). The capping is justified on the basis of physiological limit to replication speed in the host cell. The evolution of the wild-type replication fitness was frequency dependent, which is why we need to evaluate using an invasion criterion and searching for an ESS value.

To assess the invasion, we first estimated the individual fitness of DI and wild-type viruses distributed by a binomial process in groups of size *m*. By knowing the binomial composition of each group, the individual fitness of DI and wild-type viruses in the group could be determined with equation (2.1). To test invasiveness, we then introduced one mutant wild-type with a replication fitness of *i* ± *δ*. The individual fitness of the mutant was estimated by adding it to all binomially distributed groups of size *m* − 1. The mutant was judged to be able to invade if it had an individual fitness, again estimated by equation (2.1), greater than the wild-type virus. A value of *δ* = 0.001 was used for all evaluations. The evolved value of *i* was found by searching over a range of [0, 1], a value that was not invasible. The and values corresponding to the evolved *i* were then used as the evolved frequencies of the DI and wild-type viruses. These evolved values are depicted in the SD parameter space of figure 4*b*–*d*. Estimates of these evolved values were also obtained from our Monte Carlo simulations. Our numerical and Monte Carlo estimates were highly correlated (see electronic supplementary material, figure S1). The search code was written in R v. 3.2.4 computer language.

## Authors' contributions

L.C. and S.F.E. are responsible for conception and design, acquisition of data, analysis and interpretation of data and drafting or revising the article.

## Competing interests

We declare we have no competing interests.

## Funding

Work was supported by grants to L.C. from the National Science Foundation (DEB-1354253) and to S.F.E. from Spain's Ministries of Education, Culture and Sport (*Salvador de Madariaga* Programme PRX15/00149) and Economy, Industry and Competitiveness (BFU2015-65037-P), Generalitat Valenciana (PROMETEOII/2014/021) and the European Commission 7th Framework Programme EvoEvo Project (grant ICT-610427).

## Acknowledgements

We dedicate this paper to the memory of John J. Holland, who first brought the authors to UCSD and taught us so much about defective viral genomes and virus evolution.

## Footnotes

Electronic supplementary material is available online at https://dx.doi.org/10.6084/m9.figshare.c.3749936.

- Received February 3, 2017.
- Accepted April 10, 2017.

- © 2017 The Author(s)

Published by the Royal Society. All rights reserved.