Phylodynamic theory of persistence, extinction and speciation of rapidly adapting pathogens

Rapidly evolving pathogens like influenza viruses can persist by changing their antigenic properties fast enough to evade the adaptive immunity, yet they rarely split into diverging lineages. By mapping the multi-strain Susceptible-Infected-Recovered model onto the traveling wave model of adapting populations, we demonstrate that persistence of a rapidly evolving, Red-Queen-like state of the pathogen population requires long-ranged cross-immunity and sufficiently large population sizes. This state is unstable and the population goes extinct or ‘speciates’ into two pathogen strains with antigenic divergence beyond the range of cross-inhibition. However, in a certain range of evolutionary parameters, a single cross-inhibiting population can exist for times long compared to the time to the most recent common ancestor (TM⁢R⁢C⁢A) and gives rise to phylogenetic patterns typical of influenza virus. We demonstrate that the rate of speciation is related to fluctuations of TM⁢R⁢C⁢A and construct a ‘phase diagram’ identifying different phylodynamic regimes as a function of evolutionary parameters.


Introduction
In a host population that develops long-lasting immunity, a pathogen can persist by infecting immunological naive individuals such as children, or through rapid antigenic evolution that enables the pathogen to evade immunity and re-infect individuals. Childhood diseases like measles or chicken pox fall into the former category, while influenza virus adapts rapidly and re-infects most humans multiple times during their lifespan. The continuous adaptation of influenza is facilitated by high mutation rates resulting in diverse populations of co-circulating viral strains. Nevertheless, almost always a single variant eventually outcompetes the others such that diversity within one subtype or lineage remains limited (Petrova and Russell, 2018).
The contrast of rapid evolution while maintaining limited genetic diversity is most pronounced for the influenza virus subtype A/H3N2. Figure 1 shows a phylogenetic tree of HA sequences of type A/ H3N2 with the characteristic 'spindly' shape. The most recent common ancestor of the population is rarely more than 3-5 years in the past (Rambaut et al., 2008). Other pathogenic RNA viruses that typically do not reinfect the same individual, (measles, mumps, HCV, or HIV) diversify for decades or centuries (Grenfell et al., 2004). Interestingly, influenza B has split into two co-circulating lineages in the 1970s which by now are antigenically distinct (Rota et al., 1990) and maintain intermediate levels of diversity (see Figure 1).
Influenza virus infections elicit lasting immunity rendering most individuals non-susceptible to viruses that circulated during their lifetime (Fonville et al., 2014). The virus population escapes collective human immunity by accumulating amino acid substitutions in its surface glycoproteins (Koel et al., 2013;Wilson and Cox, 1990). Extensive genetic characterizations have shown that within each subtype many HA sequence variants co-circulate (Rambaut et al., 2008;Fitch et al., 1997). These variants differ from each other by~10 substitutions and compete for susceptible hosts (Strelkowa and Lässig, 2012). The rapid sequence evolution results in a decay of immune crossreactivity over~10 years (Smith et al., 2004;Bedford et al., 2014;Fonville et al., 2014;Neher et al., 2016).
Epidemiological dynamics of influenza is often modeled using generalizations of the classic Susceptible-Infected-Recovered (SIR) model to multiple antigenically distinct viral strains (Kermack and McKendrick, 1927;Gog and Grenfell, 2002). Such models need to capture (i) how the infection with one strain affects susceptibility to other strains and (ii) how novel strains are generated from existing strains by mutations. A common approach has been to impose a discrete one-dimensional strain space in which new strains are generated by mutation of adjacent strains. Infection results in a reduction of susceptibility in a manner that depends on the distance in this one-dimensional strain space (Andreasen et al., 1996;Gog and Grenfell, 2002). Such models naturally result in 'traveling waves' in the sense that the pathogen population moves through strain space by recurrent emergence of antigenically advanced variants produced by mutation from neighboring strains (Lin et al., 2003).
These models of antigenically evolving populations are related to general models of rapid adaptation in which populations form a traveling wave moving towards higher fitness (Tsimring et al., 1996;Rouzine et al., 2003;Desai and Fisher, 2007;Neher et al., 2014), reviewed in Neher (2013a). Recently, Rouzine and Rozhnova (2018) described an explicit mapping between a SIR model in a one-dimensional antigenic space and traveling wave models in fitness. 1970 1980 In uenza A/H3N2 2000 2010 1990 1960 1980 2000 1940 In uenza B Traveling wave (TW) models in a one-dimensional antigenic space naturally result in spindly phylogenies: There is only one possible direction for immune escape and the fastest growing most antigenically advanced strain grows drives all other strains extinct. Influenza viruses, however, can escape immunity by mutations at a large number of positions (Wilson and Cox, 1990), suggesting antigenic space is high dimensional (Perelson and Oster, 1979). In many dimensions, different viral strains can escape immunity via different paths and diverge sufficiently from each other until they no longer compete for hosts and thereafter propagate independently evolve. A satisfactory explanation of spindly phylogenies therefore has to describe how evolution in a high dimensional space reduces to an effectively one-dimensional path without persistent branching or rapid extinction. Several computational studies have addressed this question and identified cross-immunity (Bedford et al., 2012;Tria et al., 2005;Koelle et al., 2011;Ferguson et al., 2003;Sasaki and Haraguchi, 2000) as well as deleterious mutations (Koelle and Rasmussen, 2015;Gog and Grenfell, 2002) as critical parameters. We will discuss this earlier work at greater length below.
Our work aims to examine the conditions under which the evolving pathogen can maintain a spindly phylogeny with an approximately constant level of diversity -sufficient to avoid extinction, yet constrained from further branching by cross-inhibition between not too distant strains. We show that long range cross immunity in generic stochastic models of antigenic evolution generates such phylogenies. However, in the long term the viral population either 'speciates' into weakly interacting diverging lineages or goes extinct with rates that are controlled by three dimensionless combinations of model parameters. While the relation of these parameters to the known characteristics of influenza epidemiology and evolution is not direct, the general 'phase diagram' captured by the parameters of the simple model illustrates the key competing factors governing expected long-term dynamics.

Model
A model of an antigenically evolving pathogen population needs to account for cross-immunity between strains and the evolution of antigenically novel strains. We use an extension of the standard multi-strain SIR model (Gog and Grenfell, 2002). The fraction of individuals I a infected with viral strain a changes according to where b is the transmissibility, S a is the population averaged susceptible to strain a, n is the recovery rate, and g is the population turnover rate. The fraction R a of the population recovered from infection with strain a changes according to Our focus here is on antigenically evolving pathogens that reinfect an individual multiple times during its life-time, we shall ignore population turnover and set g ¼ 0 right away to simplify presentation.
The dynamics of I a depends on the average susceptibility of the host population S a ¼ hS a ðiÞi i , while the susceptibility S a ðiÞ of host i depends on the host's history of previous infections. A plausible representation of the history dependence of susceptibility at the level of individuals has a product form (Wikramaratna et al., 2015) S ðsÞ a ¼ h where s b ðiÞ is one or zero depending on whether host i has or has not been previously infected with strain b. Matrix K ab 1 quantifies the cross-immunity to strain a due to prior infection with strain b. Thus, Equation 3 expresses the susceptibility S a in terms of a product of attenuation factors each arising from a prior infection by a different strain b. A simple, but adequate approximation for the population averaged susceptibility is provided by replacing s b ðiÞ in the product in Equation 3 by the fraction of the population R b that recovered from infection with strain b: This corresponds to the 'order one independence closure' by Kryazhimskiy et al. (2007) and is known as Mean-Field approximation in physics (Weiss, 1907;Landau and Lifshitz, 2013). The Mean-Field approximation here corresponds to ignoring correlations between subsequent infection in the individual histories. Approximating the product by the exponential is justified because the total fraction of the host population infected by any single strain in the endemic regime is typically small (Yang et al., 2015). A detailed derivation of Equation 4 and more detailed discussion of approximations is given in Appendix 1. While the original formulation of immunity in Equation 3 is based on the infection history of individuals (Andreasen et al., 1997), the population average over the factorized distribution of histories relates the model to status based formulations (Gog and Grenfell, 2002). While some differences between status and history-based models have been reported (Ballesteros et al., 2009), others have shown that different model types have similar properties (Ferguson and Andreasen, 2002). The differences between these models and approximations are small compared to the crudeness with which these simple mathematical models capture the complex immunity profile of the human population. A model similar to ours has been successfully applied to influenza virus evolution (Luksza and Lässig, 2014).
We note that differentiating Equation 4 with respect to time defines the equation governing the dynamics of population average susceptibility which is exactly the same as the dynamics of susceptibility in Gog and Grenfell (2002) and Luksza and Lässig (2014) in the limit of negligible population turnover g=n ( 1. New strains are constantly produced by mutation with rate m. The novel strain will differ from its parent at one position in its genome. Following Luksza and Lässig (2014), we assume that crossimmunity decays exponentially with the number of mutations that separate two strains: where ja À bj denotes the mutational distance between the two strains, d denotes the radius of cross-immunity measured in units of mutations. Antigenic space is thereby assumed to be high dimensional and antigenic distance is proportional to genetic distance in the phylogenetic tree (Neher et al., 2016). The parameter a 1 quantifies the reduction of susceptibility to reinfection by the same strain and hence the overall strength of protective immunity. We shall set a ¼ 1 corresponding to perfect protection here for simplicity of presentation. Our analysis below applies equally well to the more realistic case of a<1, since in our approximation this parameter can be eliminated by rescaling R a and I a and ultimately merely renormalizes the host population size, which serves as one of the 'control parameters' in our analysis.
Cross-immunity and the mutation/diversification process are illustrated in Figure 2. An infection with a particular strain (center of the graph) . Viral populations escape adaptive immunity by accumulating antigenic mutations. Via crossreactivity, the immunity foot-print of ancestral variants (center of the graph) mediates competition between related emerging viral strains and can drive all but one of the competing lineages extinct. At high mutation rates and relatively short range of antigenic crossreactivity, different viral lineages can escape inhibition and continue to evolve independently. DOI: https://doi.org/10.7554/eLife.44205.003 generates a cross-immunity footprint (shaded circles). Mutation away from the focal strain reduces the effect of existing immunity in the host population, but complete escape requires many mutations. Hence closely related viruses compete against each other for susceptible individuals.
The above model was formulated in terms of the deterministic Equations 1-4. The actual dynamics, however, is stochastic in two respects: (i) antigenic mutations are generated at random with rate m and (ii) stochasticity of infection and transmission. The latter can be captured by interpreting the terms in Equation 1 as rates of discrete transitions in a total population of N h hosts. This stochasticity is particularly important for novel mutant strains that are rare. Most rare strains are quickly lost by chance even if they have a growth advantage due to antigenic novelty. To account for stochasticity in a computationally efficient way, we employ a clone-based hybrid scheme where mutation and the dynamics of rare mutants are modeled stochastically, while common strains follow deterministic dynamics, see Materials and methods (Clone-based simulations).
We will use the recovery rate n to set the unit of time, fixing n ¼ 1 in rescaled units. The remaining parameters of the model are (1) the transmission rate b -in our units the number of transmission events per infection and hence equal to the basic reproduction number R 0 , (2) the mutation rate m, (3) the range of cross-immunity d measured as the typical number of mutations needed for an e-fold drop of cross-inhibition, and (4) the host population size N h .

Phenomenology
Before proceeding with a quantitative analysis we discuss different behaviors qualitatively. Figure 3A shows several trajectories of prevalence I tot ¼ P a I a (i.e. total actively infected fraction) for several different parameters. Depending on the range of cross-immunity, the pathogen either goes extinct after a single pandemic (red line) or settles into a persistently evolving state, the Red Queen State (RQS) traveling wave (Van Valen, 1973 In large populations the RQS exhibits oscillations in prevalence. As we will discuss further below, the RQS state is transient and either goes extinct after some time or splits into multiple antigenically diverging lineages that propagate independently. To quantitatively understand the dependence on parameters, we will further simplify the model and establish a connection to models of rapid adaptation in population genetics. Figure 3BC shows parameter regimes corresponding to distinct qualitative behaviors. The relevant parameters are three combinations of the population size N h , the selection coefficient of novel mutations s, the mutation rate m, and the radius of cross-immunity d. A long-lived but transient RQS regime is flanked be the regime of deterministic extinction (red) and the regime of continuous branching and diversification -the 'speciation' regime (blue). The RQS regime itself undergoes a transition from a steady traveling wave (yellow) to a limit cycle oscillation (green) with increasing population size. The location of the boundaries depend on the time scale of observation as the cumulative probability of extinction and speciation increases with time.
Large effect antigenic mutations allow transition from pandemic to seasonal dynamics A novel virus in a completely susceptible population will initially spread with rate b À 1 and the pandemic peaks when susceptible fraction falls to b À1 . The trajectory of such a pandemic strain in the time-susceptibility plane is indicated in red in Figure 3D. Further infections in the contracting epidemic will then push susceptibility below b À1 -the propagation threshold for the virus -and without rapid antigenic evolution the pathogen will go extinct after a time t~b À1 log N h . Such boom-bust epidemics are reminiscent of the recent Zika virus outbreak in French Polynesia and the Americas where in a short time a large fraction of the population was infected and developed protective immunity (O'Reilly et al., 2018).
Persistence and transition to an endemic state is only possible if the pathogen can evade the rapid build-up of immunity via a small number of large effect antigenic mutations. This process is indicated in Figure 3D by horizontal arrows leading to antigenically evolved strains of higher susceptibility and bears similarity to the concept of 'evolutionary rescue' in population genetics (Gomulkiewicz, 1995). The parameter range of the idealized SIR model that avoid extinction after a pandemic resulting in persistent endemic disease is relatively small. Yet, various factors like geographic structure, heterogeneity of host adaptation and population turn-over slow down the pandemic and extinction, thereby increasing the chances of sufficient antigenic evolution to enter the endemic, RQS-type, regime. The 2009 pandemic influenza A/H1N1 has undergone such a transition from a pandemic to a seasonal/endemic state. We shall not investigate the transition process in detail here, but will assume that endemic regime has been reached.

Long-range cross-immunity results in evolving but low diversity pathogen populations
Once the pathogen population has established an endemic circulation through continuous antigenic evolution (green and yellow regimes in Figure 3BC), the average rate of new infections b P a I a S a =I tot fluctuates around the rate of recovery n ¼ 1 (in our time units). This balance is maintained by the steady decrease in susceptibility due to rising immunity against resident strains and the emergence of antigenically novel strains, see Figure 3D. If the typical mutational distance between strains is small compared to the cross-immunity range d, the rate at which susceptibility decreases is similar for all strains. To see this we expand K ab in Equation 5 S À1 a d dt S a ðtÞ ¼ À where we have used that ja À bj ( d for all pairs of strains with substantial prevalence. In fact it will suffice to keep only the first, leading, term on the right hand side. Close to a steady state, prevalent strains obey bS a » 1. We can hence define the instantaneous growth rate of strain x a ¼ ðbS a À 1Þ ( 1 as its effective fitness. In this limit, the model can be simplified to The second equation means that effective fitness of all strains a decreases approximately at the same rate since the pathogen population is dominated by antigenically similar strains.
If a new strain c emerged from strain a by a single antigenic mutation, its mutational distance from a strain b is jc À bj ¼ ja À bj þ 1 and K cb ¼ K ab e Àd À1 » K ab ð1 À d À1 Þ. The population susceptibility of strain c is therefore increased to Since the typical susceptibility is of order b À1 , the growth rate of the mutant strain c is s ¼ d À1 log b higher than that of its parent. The growth rate increment, s, plays the role of a selection coefficient in typical population genetic models and corresponds to the step size of the fitness distribution in Figure 3D. In such models, individuals within a fitness class (bin of the histogram) are equivalent and different classes can be modeled as homogeneous populations which greatly accelerates numerical analysis of the model, see Materials and methods.
Rouzine and Rozhnova (2018) have recently formulated a similar model of antigenic evolution of rapidly adapting pathogens. Analogously to our model, Rouzine and Rozhnova couple strain dynamics to antigenic adaptation through mutations, albeit assuming a one-dimensional antigenic space. In agreement with Rouzine and Rozhnova, we find that selection coefficients of novel mutations are inversely proportional to the cross-immunity rate d and increase with infectivity b, see Equation 9. Rouzine and Rozhnova, however, do not consider oscillations, extinction, and speciation (see below).
The simplified model in Equation 8, along with the model developed by Rouzine and Rozhnova (2018), is analogous to the traveling wave (TW) models of rapidly adapting asexual populations that have been studied extensively over the past two decades (Tsimring et al., 1996;Desai and Fisher, 2007;Rouzine et al., 2003;Hallatschek, 2011), see Neher (2013a) for a review. These models describe large populations that generate beneficial mutations rapidly enough that many strains cocirculate and compete against each other. The fittest (most antigenically advanced) strains are often multiple mutational steps, q, ahead of the most common strains, see Figure 3D. This 'nose' of the fitness distributions contains the strains that dominate in the future and the only adaptive mutations that fixate in the population arise in pioneer strains in the nose. Consequently, the rate with which antigenic mutations establish in the population is controlled by the rate at which they arise in the nose (Desai and Fisher, 2007). If the growth rate at the nose of the distribution, x n , is much higher than antigenic mutation rate, x n ) m, it takes typically generations before a novel antigenic mutation arises in a newly arisen pioneer strain that grows exponentially with rate x n . The advancement of the nose is balanced rapidly by the increasing population mean fitness. If beneficial mutations have comparable effects on fitness and population sizes are sufficiently large (Nm ) 1), the fitness distribution has an approximately Gaussian shape with a variance s 2 » 2s 2 logðNsÞ= log 2 ðx n =mÞ. The wave is s=s mutations wide, while the most advanced strains are approximately q ¼ 2 logðNsÞ= logðx n =mÞ ahead of the mean (Desai and Fisher, 2007). Two contemporaneous lineages coalesce on a time scale t sw ¼ sq=s 2 ¼ s À1 logðx n =mÞ and the branching patterns of the tree resemble a Bolthausen-Sznitman coalescent rather than a Kingman coalescent (Desai et al., 2013;Neher and Hallatschek, 2013b).
In circulating influenza viruses, typically around 3-10 adaptive mutations separate pioneer strains from the most common variants (Strelkowa and Lässig, 2012;Neher and Bedford, 2015). While this clearly corresponds to a regime where multiple stains compete, it does not necessarily mean that asymptotic formulae assuming q ) 1 are accurate. Nevertheless, many qualitative features of TW models have been shown to qualitatively extend into regimes where q takes intermediate values (Neher and Hallatschek, 2013b).
While parameter N in the TW models summarized above is a fixed population size, the corresponding entity in our SIR model is the fluctuating pathogen population size N p which is related to the (fixed) host population size N h by N p ¼ N h I tot . The average I tot depends on other parameters of the model, scaling in particular with I~s 2 . Hence, it will be convenient for us to use N h s 2 as one of the relevant 'control parameters', replacing N of the standard TW model.

Stability and fluctuations of the RQS
In contrast to most population genetic models of rapid adaptation, our epidemiological model does not control the total population size directly. Instead, the pathogen population size (or prevalence) depends on the host susceptibility, which in itself is determined by recent antigenic evolution of the pathogen. The coupling of these two different effects results in a rich and complicated dynamics (see Figure 4A for an example trajectory): The first effect is ecological: a bloom of the pathogen depletes susceptible hosts leading to a crash in pathogen population and a tendency of the population size to oscillate London and Yorke, 1973 (blue line in Figure 4A). The second effect is evolutionary: higher nose fitness x n begets faster antigenic evolution and vice versa, resulting in an apparent instability in the advancement of the antigenic pioneer strains (Fisher, 2013) (yellow line and inset in Figure 4A). In our epidemiological model, as we shall show below, fluctuations in the rate of antigenic advance of the pioneer strains couple with a delay of t sw to the ecological oscillation.
To recognize the ecological aspect of the oscillatory tendency, consider the total prevalence I tot and the mean fitness of the pathogen X ¼ P a x a I a =I tot d dt which follows directly from Equation (8). Selection on fitness variance s 2 increases X, while prevalence I tot reduces susceptibility and hence X. At fixed variance s ¼ s this system is equivalent to a non-linear oscillator describing a family of limit cycles oscillating about I tot ¼ s 2 and X ¼ 0 as shown in Figure 4B.
While Equation (11) describes the behavior of common strains, the mutation driven dynamics of the antigenic pioneer strains is governed by the equation for x n that in a continuum limit (suitable for the limit of high mutation rate) reads: The first term on the right hand side represents the rate at which antigenic pioneer strains enter the population, t À1 a , advancing the nose fitness by an increment s (with t À1 a s ¼ t À1 sw x n ). The second term on the right hand side of Equation (12) represents gradual reduction of susceptibility of the host population, and ðtÞ is a random noise variable representing the stochasticity of the establishment of new strains. The Gaussian white noise ðtÞ is defined statistically by its correlation function hðtÞð0Þi ¼ t À1 a dðtÞ, see Materials and methods (Stochastic differential-delay simulation). The first term of Equation (12) captures the apparent instability of the nose: an advance of the nose to higher x n accelerates its rate of advancement. The stabilizing factor is the subsequent increase in I tot , but to see how that comes about we must connect Equation (12) to Equation (11). The connection is provided by s 2 since it is controlled by the emergence of novel strains, that is the dynamics of the 'nose' x n , which impacts the bulk of the distribution after a delay t sw . Based on the analysis detailed in the Appendix 2, we approximate s 2 ðtÞ » t À1 sw x n ðt À t sw Þ relating population dynamics, Equation (11), to antigenic evolution of pioneer strains described by Equation (12). Taken together Equations (11-13) define a Differential Delay (DD) system of equations. Sample simulations of this stochastic DD system are shown in Figure 4 BC. The delay approximation Equation (13) is supported by the cross-correlation of x n ðtÞ and s 2 ðt 0 Þ measured using fitness-class simulations (see Figure 4A Inset). The deterministic limit of the DD system (obtained by omitting the noise term in Equation (12)) has a fixed point at . For !t sw >2p, the system fails to recover from a deviation of the nose in a single period and the steady state becomes unstable to a limit cycle oscillation. The nonlinearity of Equation (11) implies a longer period with increasing amplitude and the system is stabilized at a limit cycle with the period long enough compared to the feedback delay t sw . In Appendix 3, we derive the threshold of oscillatory instability to lie at logðN h I osc sÞ » 8:3 (leading to limit cycle period T » 1:5t sw , see Figure 4-figure supplement 1). We also find that the amplitude of the oscillation logðI max = IÞ scales as logðN h IÞ for large values of the later. This transition defines quantitatively the boundary between the TW RQS and the Oscillatory RQS regimes that appear on the phase diagrams in Figure 3 (BC). The validity of the predictions of standard TW theory for our adapting SIR system are explored in Figure 4-figure supplement 2.
The distinction between the TW and Oscillatory RQS is obscured by the stochasticity of antigenic advance, Equation (12), which continuously feeds the underdamped relaxation mode, generating a noisy oscillation with the frequency ! defined above. The difference between the two regimes is illustrated by Figure 4C: in the TW RQS noisy oscillation is about the fixed point, whereas in the Oscillatory RQS it is about deterministic limit cycle.
Interestingly, the dynamics of the Oscillatory RQS, as shown in Figure 4A, can be understood in terms of a non-linear relaxation oscillator. At relatively low infection prevalence nose fitness x n increases until rising I tot catches up with it (when I tot ¼ t À1 sw x n ) driving it down rapidly. Once this 'mini-pandemic' burns out, the population returns to the low prevalence part of the cycle I tot <t À1 sw x n , when x n begins to increase again. A particularly large fluctuation about t sw prior to the end, caused a large spike in prevalence, followed by the collapse of x n below zero and complete extinction. Inset (red) shows the cross-correlation between x n and s 2 which peaks with the delay t ¼ t sw (additional peaks reflect the oscillatory nature of the state and are displaced by integer multiples of mean period). (B) A family of limit cycles in the infection prevalence/mean fitness plane as described by Equation (11) with fixed variance. The variation of s governed by the Equations 11 and 12 (in the deterministic limit) reduces the family to a single limit cycle (red); (C) Trajectories in the infection prevalence/nose fitness generated by the stochastic DD system in the regime above (right panel) and below (left panel) the oscillatory instability of the deterministic DD system. DOI: https://doi.org/10.7554/eLife.44205.007 The following figure supplements are available for figure 4: The rate of extinction While in the deterministic limit the differential-delay system predicts a stable steady TW for q>q ex ; I< I osc and a limit cycle above I osc , fluctuations in the establishment of the antigenic pioneer strains (Equation (12)) can lead to stochastic extinction. In fact, both the TW and Oscillatory RQS (see Figure 3BC) are transient, subject to extinction due to a sufficiently large stochastic fluctuation. (Note however the contrast with the 'extinction' state in Figure 3BC, where extinction is deterministic and rapid.) The rate of extinction depends on q and logðN h IÞ as shown in Figure 5A. The time to extinction increases dramatically in the range of q~1 À 2 and more slowly thereafter. Although extinction is fluctuation driven, the mechanism of extinction in the oscillatory state is related closely to the deterministic dynamics, according to which large amplitude excursion in infection prevalence can lead to extinction. A large x n advance leads, after a time t sw to a rise in prevalence I tot , followed by the rapid fall in the number of susceptible hosts and hence loss of viral fitness. This turns out to be the main mode of fluctuation driven extinction as illustrated by Figure 4C. One expects extinction to take place when a fluctuation induced deviation dx of the fitness of pioneer strains becomes of the order of the mean x n . New mutations at the nose accumulate with rate 1=t a such that at short times t we expect dx » s ffiffiffiffiffiffiffiffi t=t a p . Hence dx becomes of the order of the mean x n at times t ext~q t sw . However the probability of extinction will also depend on the shape of the oscillatory limit cycle (as it depends on the minimum of infection prevalence during the cycle), which in turn depends on logðN h IÞ. Numerical simulations, Figure 5B, confirm the dependence of t ext on q and logðN h IÞ. We note that the rate increase in t ext with increasing q slows down in the oscillatory regime and appears to approach a power law dependence t ext =t sw~q 2:5 (albeit over a limited accessible range): presently we do not have an analytic understanding of this specific functional form.

The rate of speciation
The correspondence of the multi-strain SIR and the TW models discussed above assumes that crossimmunity decays slowly compared to the coalescent time of the population, that is d=q ) 1. In this case, all members of the population compete against each other for the same susceptible hosts. Conversely, if the viral population were to split into two sub-populations separated by antigenic distance greater than the range of cross-inhibition d, these sub-population would no-longer compete for the hosts, becoming effectively distinct viral 'species' that propagate (or fail) independently of each other. Such a split has for example occurred among influenza B viruses, see Figure 1.
A 'speciation' event corresponds to a deep split in the viral phylogeny, with the T MRCA growing without bounds, see Figure 1 and Figure 6A. This situation contrasts the phylogeny of the single competing population, where T MRCA fluctuates with a characteristic ramp-like structure generated by stochastic extinction of one of the two oldest clades. In each such extinction event the MRCA jumps forward by dT. Hence the probability of speciation depends on the probability of the two oldest clades to persist without extinction for a time long enough to accumulate antigenic divergence in excess of d. The combined carrying capacity of the resulting independent lineages is then twice their original carrying capacity as observed in simulations, see Figure 6B.
To gain better intuition into this process let's follow two most antigenically advanced 'pioneer strains'. In the TW approximation one of these will with high probability belong to the backbone giving the rise to the persisting clade, while the other clade will become extinct, unless it persist long enough to diverge antigenically beyond d, becoming a speciation event. As their antigenic distance gradually increases, the two clades are evolving to evade immunity built up against the common ancestor. The less advanced of the two clades is growing less rapidly and takes longer to generate antigenic advance mutations, resulting in still slower growth and slower antigenic advance. Deep splits are hence unstable and it is rare for a split to persist long enough for speciation. In Appendix 5, we reformulate this intuition mathematically as a 'first passage'-type problem which shows that T MRCA distribution has an exponential tail which governs the probability of speciation events.  Figure 6. Speciation into antigenically distinct lineages. (A) To speciate, two lineage have to diverge enough to substantially reduce cross-reactivity, that is T needs to be comparable to d. Inset: Illustration of the definition of time to most recent common ancestor T and the time interval dT by which T advances. (B) If such speciation happens, the host capacity -the average number of infected individuals increases two-fold. (C) The probability of such deep divergences decreases exponentially with the ratio d=q Ã , where effective antigenic diversity is q Ã ¼ 2 logðN h s 2 Þ= logðs=mÞ. In the presence of deleterious mutations, the relevant q is not necessarily the total advance of the pioneer strains, but only the antigenic contribution. This antigenic advance q Ã can be computed as q Ã ¼ ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi 2 logðN h s 2 Þs 2 ag q with antigenic variance s 2 ag ¼ s 2 À s 2 b , where s 2 b is fitness variance due to deleterious mutations. With this correction, speciation times agree with the predicted dependence (colored lines). DOI: https://doi.org/10.7554/eLife.44205.011 Figure 6C shows that the time to speciation increases approximately exponentially with the ratio d=q. More precisely we found that average simulated speciation time behaves as t Ã sw e f ðCI=q Ã Þ with 'effective' t Ã sw ¼ t sw =ð1 þ log q= logðs=mÞÞ and q Ã ¼ qð1 þ log q= logðs=mÞÞ picking up an additional logarithmic dependence on parameters, the exact origin of which is beyond our current approximations. This correction plausibly suggests rapid speciation, t Ã sw ! 0, when mutation rate become comparable to the selection strength m=s ! 1.

Red Queen State is transient
We emphasize that the RQS regime in Figure 3BC is only transient. For any given q and d, the RQS is likely to persist for a time given by the smaller of t ext and t sp , before undergoing either extinction or speciation. These two processes limit the range of q corresponding to the RQS from both sides in a time-dependent manner. Figure 7 shows the likely state of an RQS system after time t as a function of genetic diversity q for the case of d ¼ 50 and logðN h IÞ ¼ 6:5.
The regime of a single persistent lineage shrinks with increasing t, for example after t ¼ 10t sw the RQS state likely prevails between q ¼ 1:5 and » 4, while (for d ¼ 50 and logðN h IÞ ¼ 6:5) it is unlikely to persist beyond t » 100t sw for any q. Both the maximal RQS lifetime and corresponding critical q c , increase with increasing d.

Discussion
The epidemiological and evolutionary dynamics of human RNA viruses show a number of qualitatively distinct patterns (Grenfell et al., 2004;Koelle et al., 2011). Agents of classical childhood diseases like measles or mumps virus show little antigenic evolution, other viruses like dengue-or norovirus exist in distinct serotypes, while seasonal influenza viruses undergo continuous antigenic evolution enabling viruses of the same lineage to reinfect the same individual.
Here, we have integrated classical multi-strain SIR models with stochastic models of adaptation to understand the interplay between the epidemiological dynamics and the accumulation of antigenic novelty. The former is dominated by the most prevalent strains, while the latter depends critically on rare pioneer strains that become dominant at later times. Our model differs from that of Rouzine and Rozhnova (2018) in two aspects that are crucial to questions addressed here: To meaningfully study speciation and diversification, the model needs to allow for an high dimensional antigenic space. Similarly, fluctuations in pathogen population size determine the dynamics of extinction and this aspect can not be studied in models with constant population size. Including these aspects of the epi-evolutionary dynamics allowed to define a 'phase' diagram that summarizes qualitatively different behavior as a function of the relevant parameter combinations, see Figure 3B and C.
The phase diagram shows which combinations of key parameters lead to three distinct outcomes: (1) extinction (red), (2) an evolving but low diversity pathogen population (yellow and green), (3) a deeply branching and continuously diversifying pathogen population (blue). The key parameters are the size of the population logðN h s 2 Þ, the ratio of mutational effects to mutation rate logðs=mÞ, and the cross-immunity range d. In particular, large d prevents speciation, while rapid mutation and large population sizes facilitate speciation.
In regime (2) of a low diversity but rapidly evolving pathogen population, incidence is determined by the range of cross-immunity d and by the speed of antigenic evolution which itself depends on the pathogen population size, mutation rates, and the fitness effect of novel mutations. A consistent solution of these dependencies shows that average incidence I tot decreases as d À2 , while weakly depending on population size and mutation rates (see Equation A2.11), consistent with results by Rouzine and Rozhnova (2018). Typical values of the coalescent time of influenza A (2-4y), an infectious period of 5d, and a human population size~10 10 result in an average annual incidence of 3-10%. This number is consistent with previous estimates of the annual attack rate of influenza (Yang et al., 2015) (which typically do not differentiate the different influenza lineages).
Of the different regimes, only extinction (1) and speciation (3) are truly asymptotic. The intermediate regimes of continuously evolving low diversity pathogen population -the Red Queen State (RQS) -are strictly speaking metastable states which eventually either go extinct or undergo branching, but in a certain regime of parameters are very long lived. In our simple model, stability against speciation on the time scale >10t sw required d~10q (while stability against extinction requires q>2). These results are consistent with earlier studies that have shown that competition between lineages mediated by long-range crossimmunity can prevent diversification, effectively canalizing the population into a single lineage (Tria et al., 2005;Ferguson et al., 2003).
In practice, the range of cross-immunity required to prevent speciation might be smaller than the idealized model. Our model assumes that the pathogen population can escape immunity via many equivalent mutational path. But in reality, the number of path to escape will be limited and some path more accessible than others, which will reduce the tendency to speciate and the necessity for large d. Similarly, other factors such as population turn over and geographic heterogeneity can delay extinction.
Previous studies have shown that the rate of branching in the speciation regime increases with population size and mutation rate consistent with the phase diagram (Sasaki and Haraguchi, 2000;Koelle et al., 2011). Bedford et al. (2012) have used large-scale individual-based simulations to explore structure of influenza viruses phylogenies. Consistent with our results, they found that the speciation rate increases with the mutation rate (lowering log s=m and thereby facilitating speciation) and increasing standard deviation of mutational effects. The latter increases the typical antigenic effect of successful mutations, which decreases the radius of cross-immunity when measured in units of mutations making the population more prone to speciate. Koelle and Rasmussen (2015) have implicated deleterious mutation load as a cause of spindly phylogenies. Deleterious mutations increase fitness variation, which results in more rapid coalescence and less antigenic diversity, which in turn reduces speciation rates. Our model can readily incorporate deleterious effects of antigenic mutations on transmission b. Such deleterious mutations reduce the selection coefficient of antigenic mutations, which in turn reduces the fitness variance s 2 , see Appendix 6. After subtracting the contribution of deleterious mutations from the the fitness variance, the times to speciation follow the predicted dependence on q and d, see Figure 6C.
Outbreaks of emerging viruses that quickly infect a large fraction of the population, as for example the recent Zika virus outbreak in the Americas, fall into regime (1): In 2-3 years, large fractions of the population were infected and have developed long-lasting immunity. As far as we know, the viral population did not evolve antigenically to escape this build up of herd immunity and the virus population is not expected to continue to circulate in the Americas (O'Reilly et al., 2018).
Different influenza virus lineages, in contrast, persist in the human population, suggesting that they correspond to parameters that fall into the RQS region of the phase diagram. Furthermore, the different subtypes display quantitatively different circulation and diversity patterns that allow for a direct, albeit limited, comparison to theoretical models: subtype A/H1N1 circulated with interruption from 1918 to 2009, A(H2N2) circulated for about 10 years until 1968, A/H3N2 emerged in 1968 and is still circulating today, and the triple reassortant 2009 H1N1 lineage, called A(H1N1pdm), settled into a seasonal pattern following the pandemic in 2009. Influenza B viruses have split into two separate lineages (B/Victoria and B/Yamagata) in the 1970s (Rota et al., 1990). Phylogenetic trees of A/ H3N2 and the influenza B lineages are shown in Figure 1.
The influenza B lineages tend to be more genetically diverse than the influenza A lineages with a typical time to the most recent common ancestor of around 6 compared to 3 years, see Figure 1. Influenza A/H3N2 tends to have the lowest diversity and most rapid population turnover. This difference in diversity is consistent with influenza B lineages being more prone to speciation.  Figure 5A defines the 'boundaries' of the transient RQS q ext ðtÞ (red line) and q sp ðtÞ (blue line). q ext ðtÞ gives the value of q for which the average time to extinction is equal to t is defined similarly but for the speciation process. Average times to speciation and extinction become equal at the critical value q c at which RQS persists the longest. The typical diversity of these viruses needs to be compared to their rate of antigenic evolution. Hemagglutination inhibition titers drop by about 0.7-1 log2 per year in A/H3N2 compared to 0.1-0.4 log2 per year for influenza B lineages (Smith et al., 2004;Bedford et al., 2014;Neher et al., 2016). Hence the ratio of the time required to lose immunity and T MRCA is similar for the different lineages, suggesting that the distinct rates of genetic and antigenic evolution can not be used as a straight forward rationalization of the speciation event of Influenza B and the lack of speciation of influenza A lineages. Nor should such an explanation be expected as there is only a single observation of speciation. We note that currently circulating A/H3N2 viruses are exceptionally diverse with a common ancestor that existed about 8 years in the past. Furthermore, the cocirculating 3c.3a and 3c.2a are antigenically distinct and it is conceivable that further antigenic evolution will result in speciation of A/H3N2 viruses.
While we have shown that the natural tendency of SIR models to oscillate couples to the instability of the nose of the pathogen fitness distribution, making a quantitative link to the observed epidemiological dynamics of the flu is difficult on account of seasonal oscillation in transmissivity. The latter confounding factor is widely believed to be the cause behind observed seasonality of the flu. Including explicit temporal variation (in b) in our model would lock the frequency of the prevalence oscillation to the seasonal cycle, possibly resulting in subharmonic modulation, yet distinguishing such a modulation on top of an already stochastic process is hard. Much remains to be done: finite birth rates, distinct age distributions (as for example is the case for the two influenza B lineages), realistic distribution of antigenic effect sizes, or very long range T-cell-mediated immunity would all be interesting avenues for future work.

Clone-based simulations
We simulate the original model on a genealogical tree by combining the deterministic update of SIR-type equations and the stochastic step introducing mutated strains. In each time step Dt<1, we apply the mid-point method to advance SIR equations Equations (1,2,4). We then generate a random number uniformly sampled between zero and one for each surviving strain with N h I a ! 1. If the random number is smaller than mN h I a Dt for strain a, we append a new strain b as a descendent to a. The susceptibility to strain b is related to susceptibility to strain a via S b ¼ ðS a Þ e À1=d . In most of the simulations, the transmissibility of different strains is held constant b. Otherwise we allow for a strain specific transmissibility that is to its parent: b b ¼ b a À db with db>0 for the deleterious effect of antigenic mutations and b b ¼ b max if the mutation is compensatory. The new strain grows deterministically only if b b S b >1.
This simplified model contains six relevant parameters: transmissibility b, recovery rate n, mutation rate of the virus m, birth/death rate of the hosts g, the effective cross-immunity range d, and the effective size of the hosts N h , whose empirical ranges are summarized in the Table 1. For flu and other asexual systems in RQS, b > n ) m; g, d ) 1, and N h ) 1.

Fitness-class-based simulations
The stability of the RQS and the extinction dynamics is fully captured by the traveling wave Equation (8). We simulate the traveling wave by discretizing the fitness space x into bins of step size s around zero. The number of individuals infected by different strains correspond to integers in each bin x i . At each time step, the population in each bin I i updates to a number sampled from the Poisson distribution with parameter l i ¼ N h I i ð1 þ ðx i À xÞDtÞ determined by mean fitness x i and a dynamic mean fitness x, which increases by DtI tot , where I tot is the total infected fraction summed over all bins. When x becomes larger than one bin size s, we shift the all populations to left by one bin and reset x to , a trick to keep only a finite number of bins in the simulation. At the same time, antigenic mutation is represented by moving the mutated fraction in each bin to the adjacent bin on the right. The fraction is determined by a random number drawn from the Poisson distribution with the mean mI i Dt. The typical ranges of the three parameters s, m, and N h follow the parameters in the genealogical simulation, as documented also in Table 1.

Stochastic differential-delay simulation
To simulate the differential delay equations Equations (11-13), we discretize time in increments of Dt ¼ t sw =k and update the dynamical variables i ¼ x n ðt i Þ and h i ¼ I tot ðt i Þ via the simple Euler scheme: where i is a Gaussian random variable with zero mean and unit variance. Mean prevalence, I, enters as the control parameter (which defines the time average of h i ).

Influenza phylogenies
Influenza virus HA sequences for the subtypes A/H3N2, A/H1N1, A/H1N1pdm, as well as influenza B lineages Victoria and Yamagata were downloaded from fludb.org. We aligned HA sequences using mafft (Katoh et al., 2002) and reconstructed phylogenies with IQ-Tree (Nguyen et al., 2015). Phylogenies were further processed and time-scaled with the augur (Hadfield et al., 2018) and TreeTime . The analysis pipeline and scripts are available on github in repository 2019_Yan_flu_analysis of the neherlab organization.

Additional information
Competing interests Richard A Neher: Reviewing editor, eLife. The other authors declare that no competing interests exist.

Approximation of susceptibility
A microscopic model that tracks the infection history of every individual in population is computationally costly and impossible to analyze analytically. To gain insight, we and other authors before us have used approximations that reduce the exploding combinatorial complexity of the state space (Kryazhimskiy et al., 2007). Here, we explore and justify the two separate approximations we have made to arrive at Equation 2: We ignore correlations between subsequent infections of the same individual and approximate the multiplicative effect of all subsequent infections by an exponential term.
To derive Equation 4 we start with Equation 3 and expand it in powers of K K ab K ac hs b ðiÞs c ðiÞi þ ::: where angular brackets denote the average over all individuals i in the population and s b ðiÞ 2 ½0; 1 denotes whether individuals i was infected with strain b in the past. This expansion assumes jK ab j ( 1 which would hold uniformly for weak inhibition a ( 1 but also holds for perfect inhibition for sufficiently distant strains a; b. For a » 1 the greatest cause of concern is the contribution of the most proximal strain, to which we shall return later. To evaluate the terms on the right-hand-side we note that hs b ðiÞi ¼ R b , that is the fraction of the population recovered from b, and hs b ðiÞs c ðiÞi ¼ R b R c þ bc where bc , by definition, is the correlation between infection with b and c at the level of individuals. Our approximation -following the well established logic of 'Mean Field' theories -neglects bc compared to R b R c (Landau and Lifshitz, 2013;Weiss, 1907). In this case, correct to order jKj 2 , we can re-exponentiate the right-hand-side obtaining Equation 4. This simple derivation effectively captures the content of the 'order-1 independence closure' in Kryazhimskiy et al. (2007). Several facts about influenza in human populations suggest that the weak-correlation approximation is a reasonable starting point for modeling population scale behavior. (i) Seasonal flu epidemics involve a large number of strains, a particular strain infects only a small fraction of the population. Hence the R a are small and correlation effects are of minor importance. (ii) Challenge studies have shown that protection through vaccination or infection with antigenically similar strains is moderate and a large fraction of challenged individuals still shed virus (Clements et al., 1991). This possibility of homotypic re-infection shows that all K ab are substantially smaller than 1, supporting our approximation of population wide susceptibility, as discussed above. (iii) Antibody responses are polyclonal and differ between individuals such that the cross-immunity matrix is stochastic at the level of individuals. This variation in the cross-immunity matrix further reduces correlations in infection history at the population level and justifies the mean field approach taken here (Lee et al., 2019). (iv) Correlation in infection history induced by immunity are further reduced by the variation in exposure history through geography and variation in contact networks.
To quantify the error made by these approximations in the worst case scenario, we explore the case of a one-dimensional strain space with strictly periodic re-infection as soon as the virus population as evolved by d -the case of maximal correlation. The susceptibility of an individual last infected with a strain x<d mutations away from the current strain has susceptibility where we separated the most recent infection from previous infections to explicitly compare our approximations to that of Rouzine and Rozhnova (2018). The only approximation so far happened between step 2 and 3. In the following, we will include the most recent infection in sum in the exponential to obtain the weak-inhibition approximation log S WI ¼ Àae À x dð1Àe À Þ . Rouzine and Rozhnova (2018) follow Lin et al. (2003) in approximating an individual's susceptibility by ignoring all but the most recent infection S » 1 À KðxÞ, thus keeping only the smallest term of the product representation of S a ðiÞ in Equation 3. This approximation is referred to as 'minimum' cross-immunity in Wikramaratna et al. (2015). Appendix 1-figure 1 compares the full expression and different approximations of SðxÞ for different values of a and ¼ 1. For a ¼ 1, the 'most recent' approximation is better than the 'weak inhibition' approximation for x<d=2 but worse otherwise. For a<1, the weak inhibition approximation improves further. To investigate the effect of ignoring correlations, we now compare the most correlated case of strictly periodic re-infection as soon as the pathogen has evolved by d. For simplicity, we assume a time invariant density of recovered 1=d (as in the analysis by Rouzine and Rozhnova, 2018). To calculate the population susceptibility, we integrate the expression for SðxÞ for the full model and the 'most recent' approximation over the interval ½0; d and compare it to the mean field approximation in Equation 4 with constant R b ¼ 1=d.
Appendix 1- figure 1B shows that the 'mean-field' approximation is closer to the full model across the entire range of relevant <1. Note that has to be determined self-consistently and will typically be of the order of the susceptibility.
Real-world influenza population are much less correlated then the extreme 'periodic infection' assumption used here for reasons listed above. The linearized mean-field approximation in Equation 4 is therefore justified and can be expected to give a qualitatively correct approximation to a full model that tracks all infection histories.
Here we derive the differential delay system of equations that relate the behavior of the pioneer strains to the bulk of the population. Let us consider the generating function associated with the virus fitness distribution at time t: Gðl; tÞ ¼ X i I i ðtÞe lxiðtÞ (A2.1) where x i ðtÞ ¼ x n ðt i Þ À R t ti dt 0 I tot ðt 0 Þ is the current fitness of the pioneer strain that first appeared at time t i and I i ðtÞ is the fraction of the hosts infected by it: We next take a coarse grained view of pioneer strain establishment replacing the sum in Equation (13) by an integral over initial times t i ! t À t where 1=t a ðt À tÞ is the rate at which new clones are seeded at time t À t. Let us evaluate the integral in the saddle approximation which is dominated by t ¼ t Ã corresponding to the maximum in the exponential where we have used the deterministic limit of Equation 12. To simplify presentation we shall ignore the time dependence of t sw ¼ s À1 logðx n =mÞ replacing x n ðt À t Ã Þ in the logarithm by the time average x n . Within the saddle approximation we then have log N h Gðl; tÞ » x n ðt À t sw þ lÞt sw À Z tswÀl 0 dt 0 ðt 0 þ lÞI tot ðt À t 0 Þ ; (A2.5) where we have omitted the logarithmic corrections for simplicity. Note that by definition Gð0; tÞ ¼ I tot ðtÞ.
We can now estimate fitness mean xðtÞ ¼ d dl log Gðl; tÞj l¼0 ¼ t sw ½x 0 n ðt À t sw Þ þ I tot ðt À t sw Þ À Z tsw 0 dt 0 I tot ðt À t 0 Þ ¼ x n ðt À t sw Þ À Z tsw 0 dt 0 I t ðt À t 0 Þ (A2.6) and variance s 2 ðtÞ ¼ d 2 dl 2 log Gðl; tÞj l¼0 ¼ t sw ½x 00 n ðt À t sw Þ þ I 0 tot ðt À t sw Þ þ I tot ðt À t sw Þ (A2.7) Equation (A2.7) involves the second derivative x 00 n and we therefore expect fluctuations in the establishment of new lineages (which contribute to x 0 n ) to be quite important. Yet we can get useful insight by using the deterministic approximation to x n dynamics in Equation 12, in which case we arrive at simple delay relation between the variance and x n s 2 ðtÞ ¼ t À1 sw x n ðt À t sw Þ (A2.8) which is consistent with the variance calculated for the case of the steady TW and also satisfies the generalized Fisher theorem d dt x ¼ x 0 n ðt À t sw Þ þ I t ðt À t sw Þ À I t ðtÞ ¼ s 2 ðtÞ À I t ðtÞ (A2.9) Combining Equations 11, 12 and A2.8 we arrive at the deterministic dynamical system approximating coupled 'ecological' SIR dynamics with the evolutionary dynamics of antigenic innovation due to the pioneer strains. d 2 dt 2 log IðtÞ ¼ t À1 sw x n ðt À t sw Þ À I tot ðtÞ d dt x n ðtÞ ¼ t À1 sw x n ðtÞ À I tot ðtÞ (A2.10) This system admits a family of fixed points of the form t sw I tot ¼ x n ¼ x n , but as we show in C, the corresponding steady TW states are not always stable giving rise to limit cycle oscillations or leading to rapid extinction. The self-consistency condition relating x n and I tot for the steady traveling wave is readily generalized to limit cycle states. Integrating the differential-delay system over one cycle yields hx n i ¼ t sw hIi. An additional relation is provided by integrating log N h Gð0; tÞ over the cycle: A great deal of insight into the behavior of the (deterministic) differential delay system defined above is provided by its deterministic limit (see Appendix 3) which defines the stability 'phase diagram' shown in Figure 3 (BC) that correctly captures key aspects of the behavior observed in fully stochastic simulations.
which is basically unchanged in the presence of infectivity mutations except for the expected reduction in the magnitude of s 2 factor inside the logarithm. Therefore, speciation rate would be reduced, but rather weakly, via a contribution subleading in oðlog N h Þ