Sylvain Billiard
email: sylvain.billiard@univ-lille1.fr

Pierre Collet
email: collet@cpht.polytechnique.fr

Régis Ferrière
email: ferriere@biologie.ens.fr

Sylvie Méléard
email: sylvie.meleard@polytechnique.edu

Viet Chi Tran

The effect of competition and horizontal trait inheritance on invasion, fixation and polymorphism

Keywords: horizontal gene transfer, stochastic individual-based models and their limits, mobile genetic elements, plasmid, bacterial conjugation, fixation probability MSC 2000 subject classification: 92D25, 92D10, 60J80, 60J75, 60F05

Horizontal transfer (HT) of heritable information or 'traits' (carried by genetic elements, plasmids, endosymbionts, or culture) is widespread among living organisms. Yet current ecological and evolutionary theory addressing HT is scant. We present a modeling framework for the dynamics of two populations that compete for resources and horizontally exchange (transfer) an otherwise vertically inherited trait. Competition infuences individual demographics, thereby affecting population size, which feeds back on the dynamics of transfer. This feedback is captured in a stochastic individual-based model, from which we derive a general model for the contact rate, with frequency-dependent (FD) and density-dependent (DD) rates as special cases. Taking a large-population limit on the stochastic individual-level model yields a deterministic Lotka-Volterra competition system with additional terms accounting for HT. The stability analysis of this system shows that HT can revert the direction of selection: HT can drive invasion of a deleterious trait, or prevent invasion of an advantageous trait. Due to HT, invasion does not necessarily imply fixation. Two trait values may coexist in a stable polymorphism even if their invasion fitnesses have opposite signs, or both are negative. Adressing the question of how the stochasticity of individual processes influences population fluctuations, we identify conditions on competition and mode of transfer (FD versus DD) under which the stochasticity of transfer events overwhelms demographic stochasticity. Assuming that one trait is initially rare, we derive invasion and fixation probabilities and time. In the case of costly plasmids, which are transfered unilaterally, invasion is always possible if the transfer rate is large enough; under DD and for intermediate values of the transfer rate, maintenance of the plasmid in a polymorphic population is possible. In conclusion, HT interacts with ecology (competition) in non-trivial ways. Our model provides a basis to study the influence of HT on evolutionary adaptation.

Introduction

In a large range of species across the tree of life, horizontal transfer (HT) of information, such as genetic mobile elements, plasmids, endosymbionts or cultural traits, affects the adaptation of populations and the evolution of species [START_REF] Ochman | Lateral gene transfer and the nature of bacterial innovation[END_REF][START_REF] Tettelin | Comparative genomics: the bacterial pan-genome[END_REF][START_REF] Keeling | Horizontal gene transfer in eukaryotic evolution[END_REF][START_REF] Moran | Lateral transfer of genes from fungi underlies carotenoid production in aphids[END_REF][START_REF] Hoppitt | Social Learning: An Introduction to Mechanisms, Methods, and Models[END_REF]. For example, plasmids are known to carry genetic factors that can affect their host's fitness dramatically (e.g. [START_REF] Stewart | The population biology of bacterial plasmids: phA priori conditions for the existence of conjugationally transmitted factors[END_REF][START_REF] Romanchuk | Bigger is not always better: Transmission and fitness burden of \1 mb Pseudomonas syringae megaplasmid pmppla107[END_REF][START_REF] Getino | Synthetic fatty acids prevent plasmid-mediated horizontal gene transfer[END_REF]). Horizontal transfer of plasmids plays a major role in the evolution of bacterial virulence and resistance to antibiotics, heavy metals, and other pollutants. In eukaryotes, endosymbionts that have major physiological and ecological effects on their hosts can be transferred horizontally between individuals (e.g. several facultative bacterial species in aphids [START_REF] Henry | Horizontally transmitted symbionts and host colonization of ecological niches[END_REF][START_REF] Gonella | Horizontal transmission of the symbiotic bacterium Asaia sp. in the leafhopper Scaphoideus titanus ball (hemiptera: Cicadellidae)[END_REF]). Plasmids and endosymbionts can bring fitness benefits to their hosts [START_REF] Oliver | Population dynamics of defensive symbionts in aphids[END_REF]; they also come with fitness costs, such as reduced reproduction rate or increased predation risk [START_REF] Baltrus | Exploring the costs of horizontal gene transfer[END_REF][START_REF] Jaenike | Population genetics of beneficial heritable symbionts[END_REF]. Given their potential costs and benefits, how mobile elements such as plasmids and endosymbionts evolve and persist is not yet fully understood, and we only have limited theory to predict the conditions under which stable polymorphic populations of hosts carrying or not the mobile elements should be expected (e.g. the giant plasmids in Pseudomonas syringae [START_REF] Romanchuk | Bigger is not always better: Transmission and fitness burden of \1 mb Pseudomonas syringae megaplasmid pmppla107[END_REF] or the inherited facultative symbiont of the pea aphid Hamiltonella defensa [START_REF] Oliver | Population dynamics of defensive symbionts in aphids[END_REF], see e.g. [START_REF] Slater | Progress towards understanding the fate of plasmids in bacterial communities[END_REF] for other examples). Behaviors or cultural traits can also be socially trasmitted between non-kin individuals in animals and have effect on fitness (e.g. in insects regarding egg-laying preference [START_REF] Battesti | Ecology of information: social transmission dynamics within groups of non-social insects[END_REF]), which raises similar questions [START_REF] Cavalli-Sforza | Cultural transmission and evolution: A quantitative approach[END_REF].

The impact of HT on ecological dynamics has been studied with two different types of models. A first class of models was spawned in the late 1970's by the seminal contribution of Anderson and May on host-pathogen population dynamics [START_REF] Anderson | Population biology of infectious diseases: Part i[END_REF]. The primary motivation for these models was to investigate whether and how a pathogen might drive its host to extinction. These models highlighted the importance of whether horizontal transmission depends upon the density versus frequency of infected hosts. Models have been constructed in the May-Anderson's framework specifically to investigate the impact of HT on the dynamics of plasmids in bacteria (e.g. [START_REF] Stewart | The population biology of bacterial plasmids: phA priori conditions for the existence of conjugationally transmitted factors[END_REF][START_REF] Levin | Kinetics of conjugative plasmid transmission: fit of a simple mass action model[END_REF][START_REF] Lili | The persistence of parasitic plasmids[END_REF]). These models face several limitations: i) All models derived in the Anderson-May framework, and especially those concerned with plasmid transfer, are deterministic; however, even in an ideal constant environment, demographic stochasticity can be a strong influence of population persistence, invasion, and coexistence, and thus a critical factor of evolution. ii) The models make highly simplified ecological assumptions, especially regarding competition -competition between hosts is at best highly simplified, or ignored altogether. iii) In models addressing plasmid transmission, only density-dependent transmission rates have been considered, even though we know from the general host-pathogen framework that the transmission regime (density-vs frequency-dependence) can affect the population dynamics dramatically [START_REF] Anderson | Population biology of infectious diseases: Part i[END_REF][START_REF] Boots | Parasite evolution and extinctions[END_REF]. In general, what type of transfer best describes a given system is not trivial, but it seems clear that density-dependent transfer rates do not generally fit the case of plasmids [START_REF] Stewart | The population biology of bacterial plasmids: phA priori conditions for the existence of conjugationally transmitted factors[END_REF][START_REF] Slater | Progress towards understanding the fate of plasmids in bacterial communities[END_REF][START_REF] Getino | Synthetic fatty acids prevent plasmid-mediated horizontal gene transfer[END_REF].

A second class of models was developed in a population genetics framework to address the effect of HT on the fixation of beneficial mutations [START_REF] Cavalli-Sforza | Cultural transmission and evolution: A quantitative approach[END_REF][START_REF] Novozhilov | Mathematical modeling of evolution of horizontally transferred genes[END_REF][START_REF] Tazzyman | Fixation probability of mobile elements such as plasmids[END_REF]) and on the evolution of specific traits (e.g. cooperation [START_REF] Dimitriu | Genetic information transfer promotes cooperation in bacteria[END_REF][START_REF] Ginty | The interplay between relatedness and horizontal gene transfer drives the evolution of plasmid-carried public goods[END_REF]). Baumdicker and Pfaffelhuber [START_REF] Baumdicker | The infinitely many genes model with horizontal gene transfer[END_REF] also took a population genetics approach to HT. All these models make strong simplifying assumptions on the ecology (e.g., competition) that further restrict their representation of transfer: there is no explicit demography and population size is kept constant thus obliterating the important distinction between frequency and density-dependent transfer.

Finally to our knowledge, all models developed so far assume HT to be unilateral; in these models, the population is subdivided into two classes, the class of donors (e.g. infected hosts or plasmids carriers) and the class of recipients (e.g. susceptible hosts, bacteria devoid of plasmids), with HT occurring unilaterally from the former to the latter. While this assumption is certainly justified in the case of horizontal transfer of symbionts or plasmids, it is not general. For instance, Battesti et al. [START_REF] Battesti | Ecology of information: social transmission dynamics within groups of non-social insects[END_REF] showed that information about the preference for a medium where to deposit eggs is transmitted in both directions between trained individuals, which prefered a medium, to naive individuals, which did not. Trained inviduals transmitted preference, naive individuals transmitted the absence of preference. If we consider that the population is subdivided in two classes of individuals with different traits, then one can expect in general that HT occurs in both directions between the two classes, and not necessarily symmetrically.

Our aim is to relax most of the previous limitations, by developing a mathematically rigorous stochastic model of population dynamics with both vertical transmission and HT of traits. We consider a population of individuals undergoing a basic process of birth, interaction, and death. Interactions among individuals are ecological (competition) and also drive the transfer of information which otherwise is inherited vertically. Our modeling framework is individual-based and stochastic; population size and dynamics are thus emergent properties that the model predicts rather than assumes. We call 'trait' an entity such as an allele, a mobile genetic element, or a plasmid, which can be inherited vertically and also transferred horizontally upon contact between individuals.

We focus on the simplest case of two traits, A and a, and address three general questions: In large populations, what are the deterministic dynamics of the subpopulations of traits A and a? How does the stochasticity of HT, relative to the demographic stochasticity of the birth-death process, contribute to the population fluctuations around its deterministic equilibrium? When one trait is initially rare in the population (e.g. a mutation of the common trait), how does HT influence its probability of invasion and time to fixation? Our theory covers both cases of frequency-and density-dependent HT rates; these dependencies appear as special cases of a more general form of transfer rate, that we call Beddington-DeAngelis by analogy with a similar model used to describe contact between predators and prey ( [START_REF] Beddington | Mutual interference between parasites or predators and its effect on searching efficiency[END_REF][START_REF] Deangelis | A model for trophic interaction[END_REF]).

A general stochastic model of two-type population dynamics with horizontal transfer

We consider a population of clonal haploid individuals. The population changes in continuous time with the random occurrence of birth and death. We assume that the initial population size is of order K. K will be used to scale individual-level parameters when we examine the case of large system size (K → ∞). We denote N u,K t the number of individuals with trait u ∈ {A, a} at time t. The population size is also scaled by parameter K, and we define population densities of traits A and a, respectively, as

(X K t , Y K t ) = 1 K (N A,K t , N a,K t ).
Modeling death, competition and reproduction An individual with trait u ∈ {A, a} gives birth to an individual with trait u at rate b K (u). The death rate of an individual with trait u at time t is

d K (u) + C K (u, A)N A,K t + C K (u, a)N a,K t = d K (u) + KC K (u, A)X K t + KC K (u, a)Y K t ,
where C K (u, v) measures the effect of competition from an individual with trait v upon an individual with trait u. d K (u) is the natural death rate; competition adds a logistic death term, proportional to the density X K t or Y K t of competitors. We will denote r K (u) = b K (u) -d K (u) the natural growth rate of the sub-population of trait u in the absence of competition. We assume that competition affects death rather than reproduction for mathematical tractability. We do not expect that the qualitative results of our study would change assuming that competition affects reproduction rather than mortality.

Horizontal transfer

The trait (A or a) can be horizontally transferred between individuals. We assume that when a transfer occurs, the recipient v acquires the trait u of the donor (u = v). This occurs for instance during bacterial conjugation where the donor transmits a copy of its plasmid to individuals devoid of plasmid. Transfers can occur in both directions: from individuals A to a or the reverse, possibly at different rates. In a population with renormalized abundances of traits A and a given by

(X K t , Y K t ) = (x, y) ∈ N K 2 ,
a donor transfers its trait u to a recipient with trait v at rate h K (u, v, x, y). In the special case of bacterial conjugation and plasmid transfer (see Section 4), HT is unilateral only; some empirical data then suggest that the HT rate is not constant and depends on population densities [START_REF] Stewart | The population biology of bacterial plasmids: phA priori conditions for the existence of conjugationally transmitted factors[END_REF]. Since we assume that the effect of horizontal transfer is the replacement of the recipient trait v by the trait of the donor u, we do not study the dynamics of coexistence of both traits in a single individual. Considering the dynamics of more than two classes of individuals would be an interesting extension of the present model.

Generator of the stochastic process The birth, death and HT stochastic events affecting the dynamics of the process (X K t , Y K t ) t≥0 and their respective rates are summarized in Figure 2. [START_REF] Ochman | Lateral gene transfer and the nature of bacterial innovation[END_REF] The combination of these events can also be described mathematically by writing out the infinitesimal generator L K of the Markov process (X K t , Y K t ) t≥0 , which highlights the roles of each parameter in the population dynamics and the different scalings. For (x, y) Parameter K scales the size of the population and is used to re-scale the stochastic process of birth, death and transfer. There are two types of individuals, A and a, with population densities x and y, respectively. Individuals reproduce at rate b K (.), and die at a rate that compounds an intrinsinc death rate d K (.) and the effect of competitive interactions C K (., .). Horizontal transfer of the trait from a donor u to a recipient v depends on the function h K (u, v, x, y) and can occur in both directions.

∈ A a b K (A ) b K (a) d K (a)+ K C K (a , A) x + K C K (a , a) y d K ( A)+ K C K ( A , A) x + K C K ( A , a) y K h K (a , A , x , y ) y K h K ( A ,
(N/K) 2 and F continuous and bounded from R 2 to R, we have

L K F (x, y) = K b K (A)x F x + 1 K , y) -F (x, y) + K b K (a)y F x, y + 1 K -F (x, y) + K d K (A) + KC K (A, A) x + KC K (A, a) y x F x - 1 K , y -F (x, y) + K d K (a) + KC K (a, A) x + KC K (a, a) y y F x, y - 1 K -F (x, y) + K 2 h K (A, a, x, y) x y F x + 1 K , y - 1 K -F (x, y) + K 2 h K (a, A, x, y) x y F x - 1 K , y + 1 K -F (x, y) .
(2.1)

The first two terms of (2.1) refer to the birth of an individual with trait A or a. The next two terms refer to the death of an individual with trait A or a, due to natural death or competition for resources. The last two terms refer to the change of the trait of an individual a → A or A → a due to HT. Note that the competition and transfer terms are of order K 2 , which is the order of the number of interacting pairs of individuals in a population of size K.

The information contained in (2.1) allows exact simulations of the process (X K t , Y K t ) t≥0 as described in [START_REF] Champagnat | Unifying evolutionary dynamics: from individual stochastic processes to macroscopic models via timescale separation[END_REF].

When K → ∞, the terms within square brackets of (2.1) are all to be approximated at order 1/K. As a consequence we need all factors in front to be kept at order K. For the birth and death terms, this is the case provided that b K (.) → b(.), d K (.) → d(.) and KC K (., .) → C(., .). For the HT terms, we need Kh K to go to a finite limit h(., ., ., .). This limit depends on alternate assumptions about the mechanism of transfer. For the sake of simplicity, we take

h(u, v, x, y) = τ (u, v) β + µ (x + y) , (2.2)
which is derived from the so-called Beddington-DeAngelis functional response in the ecological literature ( [START_REF] Beddington | Mutual interference between parasites or predators and its effect on searching efficiency[END_REF][START_REF] Deangelis | A model for trophic interaction[END_REF]). This function covers different interesting cases regarding HT. Assuming µ = 0 or x + y very small gives a density-dependent HT rate (denoted DD): the HT rate is proportional to the density of the donors in the population. Assuming β = 0 or x + y very large gives a frequency-dependent HT rate (denoted FD): the total HT rate is proportional to the frequency of the donor. Finally, assuming β = 0 and µ = 0 gives a mixed HT rate between frequency and density-dependent HT rates (denoted BDA). This general case can describe some experimental observations for plasmids, for which a correlation between the form (density-versus frequency-dependent) of the transfer rate and the size of the population (low size versus close to carrying capacity) (Raul Fernandez-Lopez, pers. com.) was suggested. We will show that the form chosen for h(u, v, x, y) has important consequences for the population dynamics.

3 Large population limit and the impact of horizontal transfer on the maintenance of polymorphism

We study deterministic approximations of the stochastic population dynamics on the ecological timescale of birth, interaction (competition and transfer), and death. This allows us to investigate how HT might affect the coexistence of traits A and a, and the conditions of invasion of a trait that is initially rare. With this aim in view, we consider the following scalings: the initial population sizes are such that

(X K 0 , Y K 0 ) → (x 0 , y 0 ) ∈ R 2 + in probability with sup K E (X K 0 + Y K 0 ) 3 < +∞, and b K (u) → b(u), d K (u) → d(u), KC K (u, v) → C(u, v) and lim K→∞ Kh K (u, v, x, y) = h(u, v, x, y) whose explicit form is given in Eq. 2.2.
Below we show that the behavior of the deterministic dynamical system is influenced by HT only through the 'horizontal flux' rate

α(A, a) = τ (A, a) -τ (a, A).
The horizontal flux rate quantifies the asymmetry between transfers in either direction and can be positive or negative (or zero in the case of perfectly symmetrical transfer). In the subsequent section we will show that the stochastic population process depends not only on the flux α but also on τ itself.

Deterministic approximations and stability analysis When K → ∞ the sequence of stochastic processes (X K . , Y K . ) K∈N * converges in probability to the unique solution of the following system (x . , y . ) of ordinary differential equations (ODEs):

dx dt = r(A) -C(A, A)x -C(A, a)y + α(A, a) β + µ (x + y) y x dy dt = r(a) -C(a, A)x -C(a, a)y - α(A, a) β + µ (x + y) x y, (3.1)
where r = b -d.

Figure 3.1 shows eight possible phase diagrams for the dynamical system (3.1), where the circles and stars indicate stable and unstable fixed points, respectively. In the case where A and a are sufficiently similar, the phase diagrams of Figure 3.1 are the only possible ones (see mathematical proofs in the Electronic Supplementary Materials (ESM) [START_REF] Billiard | The effect of competition and horizontal trait inheritance on invasion, fixation and polymorphism[END_REF]).

The phase diagrams in Figure 3.1 show that both stable polymorphic or monomorphic populations are possible, depending on the parameter values and the form of HT rates. The boundary fixed points on the x-and y-axes correspond to the monomorphic populations of A and a, respectively. The dynamics close to the y-axis are driven by the so-called invasion fitness, denoted by S(A, a), of individuals with trait A in a resident population of trait a. A fixed point on the x-or y-axis is stable against invasion by the alternative type if the associated invasion fitness is negative; it is unstable if the invasion fitness is positive. Standard stability analysis of the boundary equilibria yields 7)-( 8) can only be obtained in the general BDA case. (cf. proof in Supp. Mat. [START_REF] Billiard | The effect of competition and horizontal trait inheritance on invasion, fixation and polymorphism[END_REF]). Then except in the case of density-dependent transfer, our analysis of HT reveals a new picture, since stable polymorphic states can exist whatever the sign of the two invasion fitnesses. More precisely, in cases ( 5) and ( 6), one type invades the other but the latter does not invade the former, and yet both types can coexist at a stable equilibrium. In case [START_REF] Romanchuk | Bigger is not always better: Transmission and fitness burden of \1 mb Pseudomonas syringae megaplasmid pmppla107[END_REF] there is mutual invasibility and coexistence occurs at either one of two possible equilibria, depending on which type was common when the alternate type entered the population. In case [START_REF] Getino | Synthetic fatty acids prevent plasmid-mediated horizontal gene transfer[END_REF] neither type is invadable, and yet stable coexistence is possible provided the initial mix contains enough of both types. 2)). Therefore there is no polymorphic fixed point and we get a very simple "Invasionimplies-Fixation" criterion: trait A will invade a resident population of trait a if and only if This underscores that HT can drive a deleterious allele to fixation, even though the population dynamics are deterministic and there is no frequency-dependent selection (because C is constant here).

S(A, a) = r(A) + α(A, a) β + µȳ -C(A,
S(A, a) = f (A, a) + α(A, a) = -S(a, A) > 0. ( 3
Density-dependent or BDA horizontal transfer rate. When β = 0, there exists a polymorphic fixed point when In contrast to the classical Lotka-Volterra competition model in which constant competition prevents stable coexistence, HT with DD or BDA transfer rates allows the maintenance of a deleterious trait (f (A, a) < 0) in a stable polymorphic state; this requires that the flux rate (α(A, a)) be positive and large enough in favor of A to a. This result is reminiscent of a deleterious mutation being maintained by mutation-selection balance in a large population (i.e. with drift being negligible), with the role of 'mutation' here being played by transfer -a major difference being, however, that production of new deleterioustrait individuals by transfer requires contact, the likelihood of which decreases when the density of deleterious types becomes lower. Special case 2: Traits A and a have nearly equal phenotypic effects We now consider the case where types A and a have similar phenotypic effects, such that variation between a and A brings only little changes in ecological parameters, assuming FD and BDA modes of HT rates (i.e. µ = 0). We assume that r(a) = r, set C(a, a) = C and recall that by definition α(a, a) = 0. We assume that there is a small ε > 0 such that r

0 < p = - f (A, a)(βC + µr(a)) + α(A, a)r(a) µf (A, a) 2 + α(A, a) f (A, a) < 1. (3.5)
(A) = r + κ ε, C(A, a) = C + d 1 ε, C(a, A) = C + d 2 ε, C(A, A) = C + d 1 ε + d 2 ε, α(A, a) = λ ε. We also assume the parameter values κ, d 1 , d 2 , λ to be drawn uniformly in [-1, 1].
Under FD horizontal transfer rates (β = 0), only cases ( 1)-( 6) can occur. We fall in cases ( 1)-(4) of Fig. 3.1 with probability (in the parameter space) of order 1 -O(ε 4 ) and with probability O(ε 4 ) in cases ( 5)- [START_REF] Stewart | The population biology of bacterial plasmids: phA priori conditions for the existence of conjugationally transmitted factors[END_REF]. In contrast, under BDA horizontal transfer rates (β = 0), all cases (1)-( 8) can occur. With probability of order 1 -O(ε 4 ), we fall in cases (1)-(4) of Fig. 3.1, with probability O(ε 4 ) in cases ( 5)-( 6), with probability O(ε 7 ) in case [START_REF] Romanchuk | Bigger is not always better: Transmission and fitness burden of \1 mb Pseudomonas syringae megaplasmid pmppla107[END_REF], and with probability smaller than O(ε 8 ) in case [START_REF] Getino | Synthetic fatty acids prevent plasmid-mediated horizontal gene transfer[END_REF] (see ESM [START_REF] Billiard | The effect of competition and horizontal trait inheritance on invasion, fixation and polymorphism[END_REF]). This shows that if trait A is introduced in a population by mutation with small phenotypic effects, then HT will most likely not affect the dynamics in comparison to a classical Lotka-Volterra model. Note, however, that this does not imply that cases ( 5)-( 8) will never occur due to their extremely small likelihood. In fact, a trait substitution sequence (whereby a sequence of mutation and selection events govern changes in the trait value, hence in the values of κ, d 1 , d 2 , and/or λ) may well drive the trait towards a value where ( 5), ( 6), [START_REF] Romanchuk | Bigger is not always better: Transmission and fitness burden of \1 mb Pseudomonas syringae megaplasmid pmppla107[END_REF], or [START_REF] Getino | Synthetic fatty acids prevent plasmid-mediated horizontal gene transfer[END_REF] happens. Thus, a trait value around which one of the scenarios ( 5)-( 8) occurs may be observed with a non-negligible probability if that trait value is an attractor for some set of trait substitution sequences.

Population stochastic fluctuations due to demographic stochasticity and stochasticity of horizontal transfer

Even if the environment is constant, as we assume throughout this study, stochastic fluctuations in the size of the sub-populations of trait A and a are expected from the demographic stochasticity inherent to the individual processes of birth and death, and from the stochasticity of the HT process. Hereafter we evaluate the latter and compare the contributions of demographic stochasticity and transfer stochasticity to population fluctuations. The Central Limit Theorem and diffusion theory allow us to study population fluctuations on two different timescales, although the limits take similar forms: the ecological timescale of the dynamical system that we derived in the previous section; and a much longer timescale which is relevant when the population is 'almost critical', i.e. when the intrinsic growth rates and competition coefficients of both subpopulations are very close to zero, which causes the population only to change on a very slow time scale.

Stochastic fluctuations around the deterministic population dynamics

We consider the following parameter scaling, such that the convergence to the dynamical system (3.1) holds (see Section 3

): b K (u) = b(u), d K (u) = d(u), C K (u, v) = C(u, v)/K and Kh K (u, v, x, y) = τ (u, v)/(β + µ(x + y)).
To gain insights into the magnitude of the stochastic fluctuations around the deterministic dynamics, we use the central limit theorem associated to the convergence of (X K , Y K ) K∈N * to the deterministic solution of (3.1). For this we introduce the sequence η

K . = (η K,A . , η K,a . ) = √ K(X K . -x . , Y K . -y .
) K∈N * , where (x . , y . ) is the solution of the ODE (3.1). Assume that η K 0 converges in distribution to η 0 . When K → ∞, the process η K . converges in distribution to a generalized Ornstein-Uhlenbeck process (Brownian plus linear terms) η and we have in distribution

(X K , Y K ) d = (x . , y . ) + 1 √ K (η A . , η a . ) + o( 1 √ K ).
The Ornstein-Uhlenbeck process is the solution of the following stochastic differential equation:

η A t =η A 0 + t 0 r(A) -2C(A, A)x s -C(A, a)y s + α(A, a) βy s + µy 2 s (β + µ(x s + y s )) 2 η A s + -C(A, a)x s + α(A, a) βx s + µx 2 s β + µ(x s + y s ) 2 η a s ds + t 0 b(A) + d(A) + C(A, A)x s + C(A, a)y s ) x s dW A s + t 0 (τ (A, a) + τ (a, A))x s y s β + µ(x s + y s ) dW h s η a t =η a 0 + t 0 r(a) -C(a, A)x s -2C(a, a)y s -α(A, a) βx s + µx 2 s (β + µ(x s + y s )) 2 η a s -C(a, A)y s + α(A, a) βy s + µy 2 s (β + µ(x s + y s )) 2 η A s ds + t 0 b(a) + d(a) + C(a, A)x s + C(a, a)y s ) y s dW a s - t 0 (τ (A, a) + τ (a, A))x s y s β + µ(x s + y s ) dW h s (4.1)
where W A , W a and W h are three independent Brownian motions. The deterministic dynamical system (3.1) approximates (X K , Y K ) with an error of order 1/ √ K. The process η is centered as soon as the initial conditions η A 0 and η a 0 are. The fluctuations can be decomposed into two random terms. The integral in ds varies regularly with time (this integral defines a predictable finite variation process) whereas the stochastic integrals with respect to the Brownian motions are additional Gaussian noises (with only finite quadratic variation). Notice that the first stochastic integrals in W A and W a correspond to the stochastic fluctuations due to birth and death, whereas the integrals in W h correspond to fluctuations due to transfer. This shows that the effect of HT stochasticity on population fluctuations is determined by the sum of transfer rates in both directions (τ (A, a) and τ (a, A)); thus fast transfers that balance out (small α) may nonetheless cause large stochastic fluctuations in the size of both subpopulations. Furthermore, because HT implies opposite effects on the donor and recipient sub-populations, the integrals in W h appear in both equations with opposite signs. This result has statistical implications. For instance, confidence intervals for X K t , Y K t or confidence ellipsoids for (X K t , Y K t ) can be constructed from the variance of η K , which can be computed from the above expressions.

Stochastic fluctuations for 'quasi critical' populations on a long timescale

Diffusion approximations are obtained by accelerating time in 'quasi critical' populations, in which the intrinsic growth rates (birth rate minus death rate) and the horizontal flux rate are of order 1/K. As we let K → +∞, changes in the population are apparent only when considering the time scale Kt. This is similar to the renormalization leading to the classical Wright-Fisher diffusion [START_REF] Kimura | Cultural transmission and evolution: A quantitative approach[END_REF].

Let γ(.), ν(.), ρ(.) be continuous positive functions. Let us consider a population where an individual with trait u in the population (x, y) ∈ (N/K) 2 has birth rate γ(u) + ν(u) K and death rate

γ(u) + ρ(u) K + C(u, A)x K + C(u, a)y K .
The transfer rate is of taken the form

Kh K (u, v, x, y) = ζ + 1 K θ(u, v) β + µ(x + y) (4.2)
where ζ is a positive constant and θ can be positive or negative. Under these assumptions, the processes are close to criticality and to get a non-trivial limit, we need to study the processes in the long time scale Kt. The limit is essentially composed of fluctuations plus the selection part. Precisely, we prove that the process (X K Kt , Y K Kt ) t∈[0,T ] is approximated (as K tends to infinity) by the solution of the stochastic differential equations B A , B a and B h are three independent Brownian motions which respectively capture the stochasticity of the birth and death processes in the A sub-population, the stochasticity of the birth and death processes in the a sub-population, and the stochasticity of the transfer process. In these equations, the integrals in ds correspond to the regular (finite variation) part, due to the terms of order 1/K in the birth, death, and transfer rates. These terms become visible only because we consider the time scale Kt. The stochastic integrals with respect to B A , B a and B h correspond to the irregular variations created by the succession of very rapid birth, death and transfer events, due to the constant part of the rates (i.e. the part that is independent of 1/K).

Xt =x 0 + t 0 ν(A) -ρ(A) -C(A, A) Xs -C(A, a) Ȳs Xs + θ(A, a) -θ(a, A) β + µ( Xs + Ȳs ) Xs Ȳs ds + t 0 2γ(A) Xs dB A s + t 0 2ζ Xs Ȳs β + µ( Xs + Ȳs ) dB h s , (4.3
Link to the Wright-Fisher diffusion approximation of population genetics. In order to link these results with the Wright-Fisher model of population genetics, we first rewrite the diffusion approximation in (4.3) in terms of the total population size N s = Xs + Ȳs and frequency of the traits P s = Xs /( Xs + Ȳs ):

N t =N 0 + t 0 (ν(A) -ρ(A))P s + (ν(a) -ρ(a))(1 -P s ) -N s C(A, A)P 2 s + C(a, a)(1 -P s ) 2 + (C(A, a) + C(a, A))P s (1 -P s ) N s ds + t 0 2N s γ(A)P s + γ(a)(1 -P s ) d B s (4.4) P t =P 0 + t 0 P s (1 -P s ) (ν(A) -ρ(A)) -(ν(a) -ρ(a)) + N s (C(a, A) -C(A, A))P s + (C(a, a) -C(A, a))(1 -P s ) + (θ(A, a) -θ(a, A)) β + µN s - 2 N s γ(A) -γ(a) ds + t 0 2P s (1 -P s ) N s γ(A)(1 -P s ) + γ(a)P s + ζN s β + µN s d B s (4.5)
where B is a Brownian motion.

Assuming γ(A) = γ(a) = γ, the total demographic rate 2γ is the same for both traits. Then (4.5) writes

P t =P 0 + t 0 P s (1 -P s ) (ν(A) -ρ(A)) -(ν(a) -ρ(a)) + θ(A, a) -θ(a, A) β + µN s N s + N s (C(a, A) -C(A, A))P s + (C(a, a) -C(A, a))(1 -P s ) ds + t 0 2 γ + ζ N s β + µN s P s (1 -P s ) N s d B s . (4.6)
We recover a generalization of the Wright-Fisher diffusion for P t , with the classical term P s (1 -P s )/N s in the variance. In the case of frequency-dependence with β = 0 and µ = 1, the variance of the stochastic integral with respect to B reduces to 2(γ + ζ)P s (1 -P s )/N s where the effect of variation due to demography and transfer are additive and contribute equally. Thus, when transfer rates are FD, HT makes the same quantitative contribution to genetic drift as demographic stochasticity. In the case of density-dependence with β = 1 and µ = 0, the factor in front of P s (1 -P s )/N s is 2 γ + ζ N s ; as a consequence, depending on the population size N s , the variance due to transfer can be negligible or very large compared to the variance due to the birth and death process. A similar result is true for BDA.

If additionally, the competition kernel C is assumed constant and the transfer almost critical and unilateral (ζ = 0, θ(a, A) = 0, and θ(A, a) = θ = 0), we obtain

P t =P 0 + t 0 P s (1 -P s ) (ν(A) -ρ(A)) -(ν(a) -ρ(a)) + θ β + µN s N s ds + t 0 2γ P s (1 -P s ) N s d B s . (4.7)
We recover the equation established by Tazzyman and Bonhoeffer [START_REF] Tazzyman | Fixation probability of mobile elements such as plasmids[END_REF], who specifically studied the dynamics of plasmid transfer under the assumptions that time was discrete, population size was fixed, and HT was unilateral (only A could be transferred to a and not the reverse). Equation (4.6) provides a generalization in which population size is dynamical, transfers are bilateral, and transfer rates can have a general form (given by Eq. 2.2).

Probability and time of invasion and fixation under competition with horizontal transfer

In this section, we investigate the fate of a newly introduced individual with trait A in a resident population in which trait a is common; introduction of trait A may be due to mutation or migration. We assume that the invasion fitness of trait A is positive, S(A, a) > 0. According to Table 1, this includes both cases of an advantageous trait (f (A, a) > 0), or a deleterious trait (f (A, a) < 0) provided that the HT rate from A to a is high enough. Figure 5 gives illustration of the different stochastic dynamics one can obtain under frequency or density-dependent HT, in the simple case of unilateral transfer.

Figure 5 shows that a trait can invade a resident population and go to fixation (Fig. 5(b) and (c)) or traits can stably coexist (Fig. 5(a) and (d)). Fig. 5(a) especially shows that both traits stably coexist even though competition is constant, which is made possible by density-dependent HT.

The stochastic dynamics can be decomposed in up to three phrases, as illustrated in Fig. 5.

The first phase begins with the introduction of an individual A in the population, and ends when the size of the A population either reaches a fixed threshold or vanishes. If trait A goes to fixation, the second phase can be approximated by the dynamical system given by (3.1) and has a duration of order O(1). The third phase begins when the size of the a population reaches the threshold and ends when a is lost. If both traits A and a stably coexist, there is coexistence during a time of order in exponential K. In all cases, the system goes to extinction on a time scale of order in exponential K.

Probability of invasion and fixation

During the first phase, N A,K can be approximated by a linear birth-death branching stochastic process, which shows that the phase ends with X K reaching the threshold ε with probability (e.g. [START_REF] Champagnat | A microscopic interpretation for adaptative dynamics trait substitution sequence models[END_REF][START_REF] Champagnat | Unifying evolutionary dynamics: from individual stochastic processes to macroscopic models via timescale separation[END_REF])

P (A, a) = S(A, a) b(A) + h(A, a, 0, y) y = b(A) -d(A) + α(A,a) β+µy -C(A, a) y b(A) + τ (A,a) y β+µy .
(5.1)

In Table 1, this probability of invasion is expounded for each form of HT rate. Recall that without transfer, the probability of invasion is [f (A, a)] + /b(A) where f (A, a) = r(A) -C(A, a) y is the fitness function in the absence of transfer.

Comparing the probability of invasion with and without transfer, (5.1) shows that HT increases the probability of invasion of a mutant if

f (A, a) b(A) < 1 - τ (a, A) τ (A, a) .
If transfer is symmetrical (τ (a, A) = τ (A, a)) this condition is always satisfied for a deleterious mutation and never satisfied for a beneficial mutation. Thus, symmetrical transfer always facilitates the invasion of a deleterious mutation and always hampers invasion of a beneficial mutation. The latter is because HT increases stochasticity and variance of population fluctuations: a beneficial trait A that just appeared in a population can not only be lost because of the death of the new mutant, but also because of a HT event from an a individual to the initial A individual. This result is relevant to evaluate the importance of HT in the case of cultural traits that are tramsmitted in both directions, as for example in the case of egg-laying preference in Drosophila [START_REF] Battesti | Ecology of information: social transmission dynamics within groups of non-social insects[END_REF]. If Drosophila flies socially learn on which medium to lay their eggs in natural populations, maladaptive behaviors can invade more easily because of HT. The course of evolution of complex behavior, determined both by genetic and cognitive factors, can thus be dramatically affected by social learning [START_REF] Cavalli-Sforza | Cultural transmission and evolution: A quantitative approach[END_REF].

From Section 3 we know that invasion does not necessarily imply fixation, even when the invasion fitnesses of the two types have opposite signs, as shown by Fig. 3.1 ( 5) and [START_REF] Stewart | The population biology of bacterial plasmids: phA priori conditions for the existence of conjugationally transmitted factors[END_REF]. In these cases, fixation depends on initial conditions and is usually not achieved when the invading type starts from a small density. Considering the special case of constant competition (C(u, v) ≡ C), however, invasion does imply fixation (Fig. 3.1 (1)) if HT rates are FD or when condition (3.5) is not satisfied if HT rates are DD or BDA. In these cases, the probability of fixation is equal to the probability of invasion, given by Table 1.

Transfer rate model

Invasion fitness S(A, a) Table 1: Invasion fitness and invasion probability for each model of transfer rates and compared to the case of no transfer. DD and FD are special cases of BDA with β = 1, µ = 0 and β = 0, µ = 1 respectively.

Invasion probability P (A, a) No transfer f (A, a) = r(A) -r(a)C(A,a) C(a,a) [f (A,a)]+ b(A) DD : τ (A, a) f (A, a) + α(A,a) r(a) C(a,a) f (A,a)+ α(A,a)r(a) C(a,a) + b(A)+ τ (A,a)r(a) C(a,a

Times of invasion and fixation

As the selectively advantageous trait A increases from rare, the first phase of the A population growth has a duration of order log K/S(A, a). If X K reaches the threshold ε, then the second phase begins, where the processes (X K , Y K ) stay close to the dynamical system (3.1). The deterministic trajectory, which has a duration of order 1, can reach one of two final states: either both types of individuals stably coexist, or individuals with trait A invade the population and the a population reaches the threshold ε (i.e. N a,K t < ε K). Should the latter happens, the third phase begins and N a,K can be approximated by a linear birth-death branching process, until A is fixed and a is lost. In this birth-death process, the transfer A → a acts as a birth term and the transfer a → A as a death term. The third phase has an expected duration E ε K [T 0 ] of (see [START_REF] Méléard | Modèles aléatoires en Ecologie et Evolution[END_REF]Section 5.5.3,p.190])

E ε K [T 0 ] = 1 b j≥1 b d j εK-1 k=1 1 k + j where b = b(a) + τ (a, A)r(A) βC(A, A) + µr(A) d = d(a) + C(a, A)r(A) C(A, A) + τ (A, a)r(A) βC(A, A) + µr(A)
.

Note, this is a case where the intensities of directional transfers, as measured by τ (A, a) and τ (a, A), matter -not just the flux α(A, a).

When K → ∞, E ε K [T 0 ] log K d-b
, which means that the third phase is of order log K/|S(a, A)| in duration. Summing up, the fixation time of an initially rare trait A going to fixation is of order

T f ix = log K 1/S(A, a) + 1/|S(a, A)| + O(1), (5.2)
where the expressions for S(A, a) and S(a, A) are given in Table 1 and O( 1) is a negligible term.

Equation (5.2) shows that if the HT rate is biased towards the transfer of A to a (α(A, a) > 0), then the fixation time decreases with α(A, a). In the DD and BDA cases, this effect is amplified by a larger value of the equilibrium population sizes ȳ = r(a)/C(a, a) and x = r(A)/C(A, a).

Case of unilateral horizontal transfer, such as for plasmids

In this section, we focus on the special case of unilateral transfer, which is relevant to address the question of fixation of mobile genetic elements such as plasmids. Plasmid transfer is unilateral: individuals containing a specific plasmid can transmit one copy to another individual which does not carry this plasmid. Let us assume that trait A indicates that the individual carries the plasmid of interest; individuals with trait a are devoid of this plasmid. Unilateral transfer then means τ (A, a) > 0 and τ (a, A) = 0, hence α(A, a) = τ (A, a).

Unilateral transfer has been modelled in a stochastic two-type population genetics framework by Novozhilov et al. [START_REF] Novozhilov | Mathematical modeling of evolution of horizontally transferred genes[END_REF] and Tazzyman and Bonhoeffer [START_REF] Tazzyman | Fixation probability of mobile elements such as plasmids[END_REF]. These studies focused on FD transfer rates, and assumed constant population size (Novozhilov et al. used a Moran's model, and Tazzyman and Bonhoeffer used a Wright-Fisher model with non-overlapping generations). To compare our results with theirs, we focus on constant competition coefficients (C(u, v) ≡ C) in the rest of the section.

Invasion and fixation of a plasmid By definition, invasion of A into a requires S(A, a) > 0. According to Table 1, invasion occurs under BDA if

τ (A, a) > - β ȳ + µ f (A, a), (5.3)
where ȳ is the equilibrium size of a monomorphic population a. Invasion is always possible if f (A, a) > 0 but for f (A, a) < 0, the plasmid can only invade if the transfer rate is high enough. Under FD (β = 0), the invasion of the plasmid does not depend on the equilibrium population size. Under DD and BDA (β > 0), the larger the resident population a, the easier the invasion of the plasmid.

We saw that FD transfer rates and constant competition result in 'invasion implying fixation' (section 3). Under these conditions, Novozhilov et al. [START_REF] Novozhilov | Mathematical modeling of evolution of horizontally transferred genes[END_REF] found that the probability of fixation is f (A, a) + τ (A, a); Tazzyman and Bonhoeffer [START_REF] Tazzyman | Fixation probability of mobile elements such as plasmids[END_REF] found an additional two-fold factor due to the difference between Moran and Wright-Fisher models. Tazzyman and Bonhoeffer concluded that horizontal transfer and vertical transmission of a trait under selection have similar effects on the fate of the trait, hence on the adaptation process. Our results show that this conclusion does not hold if the influence of demography and ecological competition on population size are taken into account. Our model predicts the probability of fixation to be f (A, a) + τ (A, a) b(A) + τ (A, a) .

(5.4)

The probability of fixation of trait A thus increases linearly with its fitness f (A, a) through vertical transmission, in accordance with previous results ( [START_REF] Novozhilov | Mathematical modeling of evolution of horizontally transferred genes[END_REF][START_REF] Tazzyman | Fixation probability of mobile elements such as plasmids[END_REF]). In contrast, the probability of fixation grows in a decelerating and saturating manner with the HT rate τ (A, a); the relationship becomes closer to the linear one predicted by Novozhilov et al. [START_REF] Novozhilov | Mathematical modeling of evolution of horizontally transferred genes[END_REF] and Tazzyman and Bonhoeffer [START_REF] Tazzyman | Fixation probability of mobile elements such as plasmids[END_REF] only when the horizontal transmission rate is small relatively to the birth rate. Otherwise, it is possible for HT to have major effects on the distribution of mutational effects that are fixed and contribute to adaptation (see e.g. [START_REF] Orr | The population genetics of adaptation: The distribution of factors fixed during adaptive evolution[END_REF][START_REF] Eyre-Walker | The distribution of fitness effects of new mutations[END_REF]).

Case of costly plasmids Mobile genetic elements such as plasmids generally impose a high cost to the carrier [START_REF] Baltrus | Exploring the costs of horizontal gene transfer[END_REF], i.e. r(A) < r(a). Without HT, the invasion fitness would be f (A, a) = r(A) -r(a) < 0, and the deleterious trait A (i.e. carrying the plasmid) cannot be maintained. We investigate the conditions under which HT can facilitate the invasion, maintenance and fixation of a costly plasmid. The possible dynamics are illustrated in Fig. 3.1.

Equation (5.3) shows that however large the reproductive cost (f (A, a) < 0) of the plasmid, invasion will always happen provided the transfer rate is high enough. How high the transfer rate can be in reality may be constrained by additional factors such as the intrinsic cost of transfer events.

The invading plasmid will then go to fixation under FD (cf Section 3). Under DD, the possibility of polymorphism maintenance of the plasmid was shown in [START_REF] Stewart | The population biology of bacterial plasmids: phA priori conditions for the existence of conjugationally transmitted factors[END_REF]. Our model provides an explicit condition (see (3.5)):

- f (A, a) ȳ < τ (A, a) < - f (A, a) x .
When the transfer rate is too small, the costly plasmid may not invade, as noted above.

When the transfer rate is too high, the plasmid invades and goes to fixation: no polymorphism occurs. Similar results can be obtained in the general BDA case.

A necessary (but not sufficient) condition for the fixation of a plasmid is S(a, A) < 0 and S(A, a) > 0; in Fig. 3.1 this corresponds to cases [START_REF] Ochman | Lateral gene transfer and the nature of bacterial innovation[END_REF] and [START_REF] Stewart | The population biology of bacterial plasmids: phA priori conditions for the existence of conjugationally transmitted factors[END_REF]. The realization of these conditions is favored by a large transfer rate τ (A, a). However, the final outcome -fixation or polymorphism -may depend on the initial density of plasmids. This can be seen in case [START_REF] Stewart | The population biology of bacterial plasmids: phA priori conditions for the existence of conjugationally transmitted factors[END_REF] of Fig. 3.1 where fixation only occurs if the initial density of plasmid carriers is high enough. This shows that costly traits can be maintained in polymorphism even in absence of spatial structure or frequency-dependent selection.

Overview and concluding remarks

We have constructed a model for the dynamics of two interacting populations, each being characterized by a 'trait' which is inherited vertically (under the assumption of clonal reproduction) and can be exchanged horizontally upon contact between individuals. The 'traits' can describe genes, plasmids, endosymbionts, or cultural information; they may influence the birth and/or death rates of their bearers, as well as the intensity of ecological competition among them. We called A and a the two values or states of the traits. Starting from a 'microscopic' description of stochastic birth, death, and contact events at the level of individuals, we first derived a general model for the rate of contact (BDA), of which frequency-dependent (FD) and density-dependent (DD) rates are special cases (cf. Section 2). This extends previous studies and discussions of contact processes in epidemiology (see [START_REF] Begon | A clarification of transmission terms in hoist-microparasite models: numbers, densities and areas[END_REF][START_REF] Diekmann | Mathematical epidemiology of infectious diseases[END_REF][START_REF] Mccallum | How should pathogen transmission be modelled?[END_REF][START_REF] Turner | Modelling pathogen transmission: the interrelationship between local and global approaches[END_REF]) and provides a unifying mathematical validation for the notions of frequency-dependent versus density-dependent contact rates -both models can be recovered by taking different limits on the same underlying stochastic individual-level process. Whereas McCaig et al. [START_REF] Mccaig | A rigorous approach to investigating common assumptions about disease transmission[END_REF] took a cybernetic (algorithmic) approach to the same problem (i.e. scaling up from individual-level interactions to population-level transmission models), our approach provides an analytical treatment in which stochastic processes are modeled explicitely. The mathematical limits by which transfer rates are derived lead us to expect density-dependent HT rates when the population size is low, and frequency-dependent HT rates when the population is close to its carrying capacity. Although measuring the transfer rates of genes, plasmids or endosymbionts remains a major empirical challenge [START_REF] Philipsen | Modelling conjugation with stochastic differential equations[END_REF][START_REF] Sørensen | Studying plasmid horizontal transfer in situ: a critical review[END_REF][START_REF] Zhong | On the meaning and estimation of plasmid transfer rates for surface-associated and well-mixed bacterial populations[END_REF], there are some observations for plasmids that do suggest such a correlation between the form (density-versus frequency-dependent) of the transfer rate and the state of the population (low size versus close to carrying capacity) (Raul Fernandez-Lopez, pers. com.). Taking a large-population limit on the stochastic individual-level model, we obtained a deterministic model which takes the form of a Lotka-Volterra competition system with additional terms accounting for HT (Section 3, equations (3.1)). The stability analysis of this system revealed the possible patterns of invasion of one trait by the other, or coexistence of both traits. From this analysis, we calculated invasion fitness taking HT into account; three conclusions followed: (i) HT can revert the direction of selection, i.e. invasion fitness (S) and selective value (f ) can have opposite signs. A necessary condition is that the transfer flux (negative or positive) more than compensate for the selective value (advantage or disadvantage) of the rare trait, and a smaller resident population makes the condition more likely to be sufficient. Thus, HT can drive invasion of a deleterious trait, or prevent invasion of an advantageous trait.

(ii) Invasion does not necessarily imply fixation, even if the traits' invasion fitnesses have opposite signs, and even if their phenotypic effects are small. Thus, HT causes violation of the otherwise general 'attractor inheritance' principle of Geritz et al. [START_REF] Geritz | Invasion dynamics and attractor inheritance[END_REF]. Due to HT, both traits may coexist in a stable polymorphism even if their invasion fitnesses are of opposite signs. (iii) Polymorphic coexistence may occur even when both invasion fitnesses are negative, i.e. neither trait is able to grow from rarity in a resident population of the other trait. This requires that the initial population contains both traits at sufficiently high frequencies.

In the case where the traits have no effect on the competition coefficients, the classical Lotka-Volterra model predicts exclusion of one type by the other, whereas with HT, systematic exclusion of one type by the other is the rule only in the special case of FD transfer rates. Our deterministic model may also be compared to epidemiological models of disease transmission in which two classes (susceptibles and infectives) are distinguished and host demographics account for resource competition (a seminal contribution in this vein was Gao and Hethcote [START_REF] Gao | Disease transmission models with density-dependent demographics[END_REF], see also Lili et al. [START_REF] Lili | The persistence of parasitic plasmids[END_REF] in the case of plasmid transmission). Epidemiological theory has highlighted the importance of the effect of host state (susceptible versus infected) on host intraspecific competition; "emergent carrying capacity" models thus recognize infection-modified host competitive abilities (see [START_REF] Sieber | Disease-induced modification of prey competition in eco-epidemiological models[END_REF]). Here the case of frequency-dependent transfer rates highlights that trait-dependent competitive abilities can lead to very different dynamical behaviors, including the possibility of polymorphism (i.e. stable coexistence of both traits) and even bistability between an exclusion equilibrium (only one type present at equilibrium) and a polymorphic equilibrium (see Fig. 3.1 (5)-( 6)). Bistability of polymorphic equilibria and tri-stability among both exclusion equilibria and one polymorphic equilibrium become possible under the more general form of transfer rates (BDA). The likelihood of these dynamical scenarios (Cases ( 5)- [START_REF] Getino | Synthetic fatty acids prevent plasmid-mediated horizontal gene transfer[END_REF] in Fig. 3.1) is very small when parameters are drawn at random; however, the fact that they are possible for traits with small effects on phenotypes (see Special case 2 in Section 3) calls for studying their attainability by adaptive evolution proceeding as a trait substitution sequence ( [START_REF] Metz | Adaptative dynamics, a geometrical study of the consequences of nearly faithful reproduction[END_REF] and [START_REF] Champagnat | Unifying evolutionary dynamics: from individual stochastic processes to macroscopic models via timescale separation[END_REF]). In other words, evaluating the biological significance of these dynamical scenarios requires that we determine their evolutionary attractivity and stability -an open question that we are currently investigating.

What is the effect of demographic stochasticity and stochasticity of transfer events on the population dynamics predicted by the deterministic model (Section 4)? We found that the effect of HT stochasticity on population fluctuations is not determined solely by the net transfer flux (α(A, a)), but is influenced by the sum of transfer rates in both directions (τ (A, a) and τ (a, A)); thus fast transfers that balance out (small α) may nonetheless cause large stochastic fluctuations in the size of both subpopulations. In the case of 'quasicritical' populations that have very small growth rate and transfer flux, we focused on the case of demographically neutral traits and found that the contact process had a key influence on the relative effect of HT on population variance. With FD transfer rates, the effect of birth-death stochasticity and transfer stochasticity are additive and contribute equally to population variance, in line with the results of Tazzyman and Bonhoeffer [START_REF] Tazzyman | Fixation probability of mobile elements such as plasmids[END_REF]. With DD transfer rates, the relative effect of transfer stochasticity can become very large or very small depending on the population size.

Assuming that one trait (e.g. A) is initially rare in a population of the other trait (a), we focused on the case of A potentially invading (i.e. S(A, a) > 0) and derived exact analytical expressions for the probability of invasion and time to fixation for each model of transfer rates (DD, FD, and the general case BDA) (Section 5). We derived the general condition for HT to increase the probability of invasion. In the case of symmetrical transfer, HT always increases the invasion probability of a deleterious trait and always decreases the invasion probability of a beneficial trait (due to the stochasticity of the transfer process). If A goes to fixation, a bias of transfer in favor of A will speed up fixation; under DD or BDA (not FD) transfer rates, the larger the resident population, the stronger this effect.

Finally we addressed the case of unilateral transfer, as for plasmids, assuming no effect of traits on competition coefficients (constant C). Unilateral HT does not alter the invasion potential of a beneficial trait; for deleterious traits, unilateral HT promotes invasion if the transfer rate is high enough, and invasion is facilitated in a larger resident population (provided that the transfer rate is DD or BDA, not FD). With FD transfer rates (and trait-independent competition), invasion implies fixation, and we found the probability of fixation to be not simply f (A, a) + τ (A, a) (as was found by [START_REF] Tazzyman | Fixation probability of mobile elements such as plasmids[END_REF]) but (f (A, a) + τ (A, a))/(b(A) + τ (A, a)). Thus, vertical transmission and horizontal transfer are not equivalent in determining fixation; the probability of fixation of a beneficial trait (f (A, a) > 0) becomes more sensitive to the transfer rate τ (A, a) than to the selective value f (A, a) in organisms in which vertical transmission is slower (i.e. smaller birth rate). In the case of costly plasmids (i.e. trait A is deleterious), invasion is always possible provided that the transfer rate is large enough. Invasion implies fixation under FD, but under DD maintenance of the plasmid in a polymorphic population is possible, for intermediate values of the transfer rate.

In conclusion, HT interacts with ecology (competition) in non-trivial ways. Competition influences individual demographics, and this in turn affects population size (that we do not assume constant), which feeds back on the dynamics of transfer. This feedback loop has complex, previously unknown, effects on the dynamics of deleterious traits (including the case of costly plasmids), making their stable polymorphic maintenance possible, even in the absence of frequency-dependent selection, spatio-temporal heterogeneity, compensatory mutations [START_REF] Dionisio | The evolution of a conjugative plasmid and its ability to increase bacterial fitness[END_REF], mutation-selection balance [START_REF] Novozhilov | Mathematical modeling of evolution of horizontally transferred genes[END_REF], or imperfect horizontal transmission -selection balance [START_REF] Jaenike | Population genetics of beneficial heritable symbionts[END_REF] -all mechanisms which are classically invoked to explain stable polymorphisms [START_REF] Slater | Progress towards understanding the fate of plasmids in bacterial communities[END_REF]. The population-size mediated interaction between competition and transfer has other notable consequences, including (i) a strong contribution of transfer stochasticity (relative to demographic stochasticity) on population fluctuations when transfer rates are density-dependent or of the more general form BDA (ii) a greater acceleration of fixation by HT obtained by weakening competition in the resident population. Our modeling framework provides a basis to develop a general theory for the influence of HT on evolutionary adaptation, where trait variation may represent different types of transferrable elements (as in Mc Ginty et al. [START_REF] Ginty | The interplay between relatedness and horizontal gene transfer drives the evolution of plasmid-carried public goods[END_REF] who studied the evolution of plasmidcarried public goods, and Doebeli and Ispolatov [START_REF] Doebeli | A model for the evolutionary diversification of religions[END_REF] who modelled the adaptive evolution and diversification of cultural ideas), or host phenotypes differing in their control of or response to transfer (as in Gandon and Vale [START_REF] Gandon | The evolution of resistance against good and bad infections[END_REF] who studied the evolution of resistance

Figure 2 . 1 :

 21 Figure 2.1: Schematic representation of the stochastic model given by the generator (Eq. 2.1).

  a) y with y = r(a) C(a, a) = f (A, a) + α(A, a)r(a) βC(a, a) + µr(a) , (3.2) where f (A, a) = r(A) -C(A,a)r(a) C(a,a) is the invasion fitness of A in a resident population a in the absence of HT. Equation (3.2) thus shows that HT can revert the direction of selection (i.e. S(A, a) and f (A, a) have opposite signs) provided 1) invasion fitness f (A, a) and transfer flux rate α(A, a) have opposite signs, and 2) |f (A, a)| < r(a) βC(a,a)+µr(a) |α(A, a)|. Condition 2 is facilitated if r(a)/(βC(a, a) + µr(a)) is larger, which happens if the resident a equilibrium population density y = r(a)/C(a, a) is large. The effect of horizontal transfer on deterministic equilibria Interestingly, not all phase diagrams of Figures 3.1 can be obtained for every form of transfer rates. The DD case reduces to a classical Lotka-Volterra model with the fitness function S and Figures 3.1

( 1 )

 1 -(4) are the only possibilities. In a classical Lotka-Volterra competition model without HT, both types A and a can coexist if and only if their invasion fitnesses are positive. As seen in (3.2), HT may revert the sense of selection. In the FD case, the two new phases of Figures 3.1

  (5)-(6) are possible. Figures 3.1

  (

Figure 3 . 1 :

 31 Figure 3.1: Deterministic dynamics of a two-trait population with HT. x and y denote the densities of each type. Circles and stars respectively indicate stable and saddle fixed points. See text for more details.

( 1 )

 1 -(

. 4 )

 4 Thus, compared to a system without HT, horizontal transfer can revert the direction of selection (i.e. S(A, a) and f (A, a) have opposite signs) provided that |α(A, a)| > |f (A, a)| and Sgn(α(A, a)) = -Sgn(f (A, a)).

  If f (A, a) and α(A, a) are both positive, the above expression is negative and there is fixation of A. If f (A, a) and α(A, a) are both negative, p < 1 ⇐⇒ -f (A, a)βC < r(A)(µf (A, a) + α(A, a)) which never happens since the left hand side is positive and the right hand side is negative. So there is fixation of a in this case. When f (A, a) and α(A, a) have opposite signs, there may exist a non-trivial fixed point which is stable if µf (A, a) + α(A, a) > 0.(3.6)

) Ȳt =y 0 + t 0 ν

 0 (a) -ρ(a) -C(a, A) Xs -C(a, a) Ȳs Ȳsθ(A, a) -θ(a, A) β + µ( Xs + Ȳs ) β + µ( Xs + Ȳs ) dB h s .

Figure 5 . 1 :

 51 Figure 5.1: Invasion and fixation or polymorphic persistence of a deleterious mutation with density-dependent (left, (a) and (c), µ = 0, β = 1) or frequency-dependent (right, (b) and (d), µ = 1, β = 0,) unilateral HT rates. The deleterious nature of the mutation means that its invasion fitness without HT is negative. Other parameters: Top figures (a) and (b): constant competition coefficients C(A, a) = C(a, A) = C(a, a) = C(A, A) = 1, b(A) = 0.5, b(a) = 1, d(a) = d(A) = 0 K = 1000, α = 0.7; Bottom figures (c) and (d): C(A, a) = C(a, a) = 2, C(A, A) = 4, C(a, A) = 1, b(A) = 0.8, b(a) = 1, d(a) = d(A) = 0 K = 10000, α = 5 under density-dependent rate, α = 0.5 under frequency-dependent rate.

)

  FD : τ (A,a) x+y f (A, a) + α(A, a) f (A,a)+α(A,a) + b(A)+τ (A,a) BDA : τ (A,a) β+µ(x+y) f (A, a) + α(A,a)r(a) βC(a,a)+µr(a) f (A,a)+ α(A,a)r(a) βC(a,a)+µr(a) + b(A)+ τ (A,a)r(a) βC(a,a)+µr(a)

  a , x , y ) x

	Birth rate of an individual A	Birth rate of an individual a
	Horizontal transmission rate
	Individual A becomes a
	Horizontal transmission rate
	Individual a becomes A
	Death rate of an individual A (due to intrinsinc death and competition)	Death rate of an individual a (due to intrinsinc death and competition)

Acknowledgements S.B., S.M. and V.C.T. have been supported by the ANR MANEGE (ANR-09-BLAN-0215), the Chair "Modélisation Mathématique et Biodiversité" of Veolia Environnement-Ecole Polytechnique-Museum National d'Histoire Naturelle-Fondation X. V.C.T. also acknowledges support from Labex CEMPI (ANR-11-LABX-0007-01) and has been invited by the University of Arizona. R.F. acknowledges support from the Pépinière Interdisciplinaire CNRS-PSL "Eco-Evo-Devo" and the Partner University Fund.