The gut microbiota is very diverse [1 , 2 ] , and its diversity is shaped by evolutionary processes occurring within the gut [3 , 4 , 5 ] . Understanding these processes is of substantial public-health importance, as the gut can act as a reservoir for antibiotic-resistance genes in both humans and livestock [6 , 7 ] . The gut has a specific spatial structure, featuring hydrodynamic transport and nutrient and bacterial concentration gradients [8 , 9 , 10 , 11 ] . Effective one-dimensional models have been developed to describe the key ingredients of this spatial structure within the ascending colon [8 , 9 ] . As transport makes bacterial growth strongly heterogeneous across the gut, a key question is how this impacts the evolution of gut bacteria. In discrete models on graphs, spatial structure can strongly impact mutant fixation probability [12 , 13 , 14 , 15 , 16 ] , especially with asymmetric migration flows [17 , 18 , 19 ] . In continuous systems, fluid flow can strongly affect mutant fate [20 , 21 , 22 , 23 ] . In the gut, the fixation probability of neutral mutants was predicted to be increased [24 ] . An effective stochastic theory was then developed for beneficial mutants [25 ] . Here, we ask how the spatial structure of the gut impacts the fate of beneficial mutants relative to the well-mixed case, and how this depends on hydrodynamic flow.
Using a branching-process approach, we derive a reaction-diffusion equation for the fixation probability of beneficial mutants. We demonstrate that the fixation probability of a beneficial mutant appearing randomly upon division is suppressed compared to the well-mixed case, by a factor that reflects the heterogeneity of mutant fate in the gut. We show that mutant invasion is faster than in a matched well-mixed population. Both results hold for any positive relative mutant fitness advantage s s s . Finally, we find that higher advective flow in the gut leads to lower fixation probabilities but faster invasion of mutant lineages that survive initial stochastic extinction.
Effective one-dimensional model. We consider the minimal one-dimensional model of transport and bacterial growth in the ascending colon introduced in Refs. [8 , 9 ] . In a segment of length L L L , the linear concentrations of
bacteria B ( x , t ) B(x,t) B ( x , t ) and food F ( x , t ) F(x,t) F ( x , t ) are subject to effective diffusion with coefficient D D D , modeling mixing due to contractions of the gut, and to advection with velocity v v v . Food, but no bacteria (because bacterial concentrations in the small intestine are very low), enter the system at x = 0 x=0 x = 0 , and both food and bacteria exit to the rest of the colon at x = L x=L x = L . Bacteria consume food to divide, and division is limited by food availability. Specifically, wild-type bacteria divide at rate r w ρ ( x , t ) r_w\rho(x,t) r w ρ ( x , t ) with r w r_w r w their maximal growth rate and ρ ( x , t ) = F ( x , t ) / [ k + F ( x , t ) ] \rho(x,t)=F(x,t)/[k+F(x,t)] ρ ( x , t ) = F ( x , t ) / [ k + F ( x , t )] the division rate profile, where k k k is a Monod constant. This yields coupled reaction-diffusion partial differential equations on B ( x , t ) B(x,t) B ( x , t ) and F ( x , t ) F(x,t) F ( x , t ) (see SI Sec. 1A).
Our goal is to investigate the fate of a beneficial mutant in this system. We focus on mutants with a uniform relative fitness advantage s s s with respect to wild-types throughout the system. Their maximum division rate is r m = r w ( 1 + s ) r_m=r_w(1+s) r m = r w ( 1 + s ) , but they follow the same transport dynamics as wild-types. To investigate the early dynamics of the mutant population, after a single mutant has appeared in the system at steady state, we approximate the division rate profile ρ ( x , t ) \rho(x,t) ρ ( x , t ) with
ρ ( x ) = F ( x ) k + F ( x ) , (1) \rho(x)=\frac{F(x)}{k+F(x)}, \tag*{(1)} ρ ( x ) = k + F ( x ) F ( x ) , (1)
where F ( x ) F(x) F ( x ) denotes the steady-state food concentration in the absence of mutants. Hence, mutants divide at rate r m ρ ( x ) r_m\rho(x) r m ρ ( x ) , and are transported, see Figure 1 (a). They experience a steady-state environment illustrated in Figure 1 (b).
Figure 1. (a) Schematic of the one-dimensional model of the gut [8 , 9 , 24 , 25 ] : each mutant at position x ∈ [ 0 , L ] x \in[0,L] x ∈ [ 0 , L ] divides with rate r m ρ ( x ) r_{\mathrm{m}}\rho(x) r m ρ ( x ) , and is transported with an advective velocity v v v and an effective diffusion coefficient D D D . (b) Steady-state wild-type bacteria concentration B B B , food concentration F F F and division rate ρ \rho ρ along the gut. Numerical solutions of Eqs. (S1), (S2) are compared to analytical solutions assuming a step function ρ \rho ρ [25 ] , see SI Sec. II B. Parameter values: λ w = r w L 2 / D = 75.6 \lambda_{\mathrm{w}}=r_{\mathrm{w}}L^2/D=75.6 λ w = r w L 2 / D = 75.6 , k / F i n = 5 × 10 − 3 k/F_{\mathrm{in}}=5\times10^{-3} k / F in = 5 × 1 0 − 3 with F i n F_{\mathrm{in}} F in the incoming food concentration at x = 0 x=0 x = 0 , food-bacteria conversion factor α = 200 \alpha=200 α = 200 , and P e = v L / D = 15.3 = 0.92 P e max \mathrm{Pe}=vL/D=15.3=0.92\,\mathrm{Pe}_{\max} Pe = v L / D = 15.3 = 0.92 Pe m a x , with P e max = 16.6 \mathrm{Pe}_{\max}=16.6 Pe m a x = 16.6 corresponding to washout.
Fixation probability. Let ϕ ( x ) \phi(x) ϕ ( x ) be the mutant fixation probability, starting from a mutant at initial position x x x in the gut. Reasoning on what happens to the mutant just after it appears (transport and division events, see Figure 1 (a)) allows us to establish the differential equation satisfied by ϕ ( x ) \phi(x) ϕ ( x ) , see SI Sec. 1B:
D ϕ ′ ′ ( x ) + v ϕ ′ ( x ) + r m ρ ( x ) ϕ ( x ) [ 1 − ϕ ( x ) ] = 0. (2) D\phi''(x)+v\phi'(x)+r_m\rho(x)\phi(x)\left[1-\phi(x)\right]=0. \tag*{(2)} D ϕ ′′ ( x ) + v ϕ ′ ( x ) + r m ρ ( x ) ϕ ( x ) [ 1 − ϕ ( x ) ] = 0. (2)
The associated boundary conditions are
ϕ ′ ( 0 ) = 0 , D ϕ ′ ( L ) + v ϕ ( L ) = 0 , (3) \phi'(0)=0,\qquad D\phi'(L)+v\phi(L)=0, \tag*{(3)} ϕ ′ ( 0 ) = 0 , D ϕ ′ ( L ) + v ϕ ( L ) = 0 , (3)
see SI Sec. I C. To obtain Eqs. (2) and (3) , the mutant environment is assumed to be the steady-state wild-type one (Eq. (1) ), and different mutant lineages are assumed to behave independently (branching process approximation). These assumptions are appropriate if the fate of the mutant lineage is determined early, when the mutant population is still very small compared to the wild-type one, which is assumed to be large. We further assume that if the mutant population does not go extinct while it is rare, then it fixes, which holds for beneficial mutations [26 ] . Such branching-process descriptions are often used to describe the evolution of well-mixed populations [27 , 28 ] , and have been generalized to spatially structured ones on graphs [18 , 19 ] . Furthermore, continuous equations analogous to Eq. (2) describe the survival of branching Brownian motion [29 ] , and gene surfing in expanding populations [30 , 31 ] .
Fig. 2 shows that the fixation probability ϕ ( x ) \phi(x) ϕ ( x ) of a beneficial mutant is much larger if the mutant appears upstream (small x x x ) than downstream. We also observe that a mutant appearing close to x = 0 x=0 x = 0 has an enhanced fixation probability compared to the well-mixed case: for s = 0.1 s=0.1 s = 0.1 , we have ϕ ( 0 ) ≈ 0.25 \phi(0)\approx0.25 ϕ ( 0 ) ≈ 0.25 with the parameters considered, while the Moran process for large populations would give a fixation probability s / ( 1 + s ) ≈ 0.09 s/(1+s)\approx0.09 s / ( 1 + s ) ≈ 0.09 . Meanwhile, the fixation probability is strongly suppressed downstream.
Fig. 2 also shows that a numerical solution of Eqs. (2) and (3) is in good agreement with stochastic simulations of the model, and that Eq. (6) gives a good approximation for s ≪ 1 s\ll1 s ≪ 1 . Note that the small discrepancy between simulation and numerical solution can be attributed to fluctuations of the division rate profile ρ ( x ) \rho(x) ρ ( x ) in simulations due to finite-size effects, see SI Sec. I D 3. We also observe in Figure 2 that approximating ρ \rho ρ with a step function gives a good approximation with the parameters used (satisfying k ≪ F i n k\ll F_{\mathrm{in}} k ≪ F in ).
Figure 2. Mutant fixation probability ϕ ( X ) \phi(X) ϕ ( X ) versus normalized initial mutant position X = x / L X=x/L X = x / L along the gut, for different values of the mutant relative fitness advantage s s s . Stochastic simulations are described in SI Sec. IV A. Numerical solutions of the branching process Eq. (2) use either the steady-state mutant-free profile of the division rate ρ \rho ρ (“BP numerics”) or its step approximation (“BP step ρ \rho ρ ”). The first-order approximation Eq. (6) in the first case is shown for small s s s . The two profiles of ρ \rho ρ are shown for reference. Other parameter values: same as in Figure 1 .
To get analytical insight into ϕ ( x ) \phi(x) ϕ ( x ) , we introduce the linear differential operator A s \mathcal{A}_s A s such that
A s ϕ ( x ) = D ϕ ′ ′ ( x ) + v ϕ ′ ( x ) + ( 1 + s ) r w ρ ( x ) ϕ ( x ) , (4) \mathcal{A}_s\phi(x)=D\phi^{\prime\prime}(x)+v\phi^\prime(x)+(1+s)r_{\mathrm{w}}\rho(x)\phi(x), \tag*{(4)} A s ϕ ( x ) = D ϕ ′′ ( x ) + v ϕ ′ ( x ) + ( 1 + s ) r w ρ ( x ) ϕ ( x ) , (4)
with boundary conditions in Eq. (3) . Then, Eq. (2) can be written as
A s ϕ ( x ) = ( 1 + s ) r w ρ ( x ) ϕ 2 ( x ) . (5) \mathcal{A}_s\phi(x)=(1+s)r_{\mathrm{w}}\rho(x)\phi^2(x). \tag*{(5)} A s ϕ ( x ) = ( 1 + s ) r w ρ ( x ) ϕ 2 ( x ) . (5)
Linearizing this equation around ϕ = 0 \phi=0 ϕ = 0 gives A s ϕ ( x ) = 0 \mathcal{A}_s\phi(x)=0 A s ϕ ( x ) = 0 , which leads to the eigenvalue problem for A s \mathcal{A}_s A s . Transforming it into a self-adjoint Sturm–Liouville problem [32 ] allows us to show that the principal eigenvalue of A s \mathcal{A}_s A s is zero at s = 0 s=0 s = 0 and positive if and only if s > 0 s>0 s > 0 (see SI Sec. I D 1). This entails that Eq. (2) admits a non-zero solution if and only if s > 0 s>0 s > 0 [33 ] : the critical point is s = 0 s=0 s = 0 . This result is consistent with branching process results in well-mixed [27 ] and deme-structured [18 ] populations. Performing a perturbative expansion of ϕ \phi ϕ for s ≪ 1 s\ll1 s ≪ 1 yields
ϕ ( x ) = s ⟨ f ⟩ ⟨ f 2 ⟩ f ( x ) + O ( s 2 ) , (6) \phi(x)=s\frac{\langle f\rangle}{\langle f^2\rangle}f(x)+O(s^2), \tag*{(6)} ϕ ( x ) = s ⟨ f 2 ⟩ ⟨ f ⟩ f ( x ) + O ( s 2 ) , (6)
where we introduced
f ( x ) = B ( x ) e − v x / D , (7) f(x) = B(x)e^{-vx/D}, \tag*{(7)} f ( x ) = B ( x ) e − v x / D , (7)
with B ( x ) B(x) B ( x ) the steady-state wild-type concentration in the absence of mutants (see SI Sec. I D 2), and the division-event-weighted average [24 , 25 ] ,
⟨ f ⟩ = ∫ 0 L d x f ( x ) ρ ( x ) B ( x ) ∫ 0 L d x ρ ( x ) B ( x ) . (8) \langle f\rangle= \frac{\int_{0}^{L} \mathrm{d}x\, f(x)\rho(x)B(x)}{\int_{0}^{L} \mathrm{d}x\, \rho(x)B(x)}. \tag*{(8)} ⟨ f ⟩ = ∫ 0 L d x ρ ( x ) B ( x ) ∫ 0 L d x f ( x ) ρ ( x ) B ( x ) . (8)
Note that the first-order result in Eq. (6) is consistent with Ref. [25] in the limit L → ∞ L \to\infty L → ∞ , but that higher orders differ (see SI Sec. III).
Studying the mean number of n n n -th generation descendants of a neutral mutant appearing at x x x allows us to show that in the limit n → ∞ n \to\infty n → ∞ , its long-term contribution is proportional to f ( x ) f(x) f ( x ) , see SI Sec. I E. This long-term contribution to future generations can be interpreted as reproductive value [34 , 35 ] . Eq. (6) therefore shows that the fixation probability of a beneficial mutant appearing at x x x is proportional to reproductive value there, to first order in s s s . Close relationships between fixation probability and reproductive value exist in other contexts [36 ] .
Let us now average the fixation probability ϕ ( x ) \phi(x) ϕ ( x ) over the initial position x x x of the mutant. Assuming that mutants appear randomly upon cell division, which is realistic for mutations resulting from DNA replication errors, we focus on the division-event-weighted fixation probability ⟨ ϕ ⟩ \langle\phi\rangle ⟨ ϕ ⟩ (see Eq. (8) ). To first order in s s s , Eq. (6) gives
⟨ ϕ ⟩ = s ⟨ f ⟩ 2 ⟨ f 2 ⟩ + O ( s 2 ) = s 1 1 + c v 2 ( f ) + O ( s 2 ) ≤ s , (9) \langle\phi\rangle= s\frac{\langle f\rangle^2}{\langle f^2\rangle} + O(s^2) = s\frac{1}{1+c_v^2(f)} + O(s^2) \le s, \tag*{(9)} ⟨ ϕ ⟩ = s ⟨ f 2 ⟩ ⟨ f ⟩ 2 + O ( s 2 ) = s 1 + c v 2 ( f ) 1 + O ( s 2 ) ≤ s , (9)
where c v ( f ) = ( ⟨ f 2 ⟩ − ⟨ f ⟩ 2 ) 1 / 2 / ⟨ f ⟩ c_v(f) = \left(\langle f^2\rangle-\langle f\rangle^2\right)^{1/2}/\langle f\rangle c v ( f ) = ( ⟨ f 2 ⟩ − ⟨ f ⟩ 2 ) 1/2 / ⟨ f ⟩ is the coefficient of variation of reproductive value. While mutations are produced proportionally to ρ B \rho B ρB , their long-term contribution is controlled by f f f , showing that mutant production and fate are distinct in a spatial system with advection. In addition, for a step-function ρ \rho ρ and at first order in s s s , ⟨ ϕ ⟩ / s \langle\phi\rangle/s ⟨ ϕ ⟩ / s depends only on v / v F v/v_F v / v F , where v F = 2 r w D v_F = 2\sqrt{r_wD} v F = 2 r w D is the Fisher speed (see SI Sec. II D 1).
Beyond the perturbative regime, we obtain
⟨ ϕ ⟩ = s 1 + s 1 1 + c v 2 ( ϕ ) ≤ s 1 + s , ∀ s > 0 , (10) \langle\phi\rangle= \frac{s}{1+s}\frac{1}{1+c_v^2(\phi)} \le\frac{s}{1+s}, \qquad\forall s>0, \tag*{(10)} ⟨ ϕ ⟩ = 1 + s s 1 + c v 2 ( ϕ ) 1 ≤ 1 + s s , ∀ s > 0 , (10)
see SI Sec. I D 3. Therefore, ⟨ ϕ ⟩ \langle\phi\rangle ⟨ ϕ ⟩ cannot exceed the mutant fixation probability of the Moran model in the large-population limit, ϕ = s / ( 1 + s ) \phi=s/(1+s) ϕ = s / ( 1 + s ) [28 , 37 ] , which constitutes the well-mixed reference for our model where birth and death events happen at the individual level.
Figure 3 shows that the division-event-weighted fixation probability ⟨ ϕ ⟩ \langle\phi\rangle ⟨ ϕ ⟩ is strongly impacted by the Péclet number P e = v L / D \mathrm{Pe}=vL/D Pe = v L / D , which quantifies the intensity of advective flow versus diffusive flow. Larger Péclet numbers lead to stronger suppression of selection compared to the well-mixed Moran model reference.
Figure 3. Division-event-weighted mutant fixation probability ⟨ ϕ ⟩ \langle\phi\rangle ⟨ ϕ ⟩ versus mutant relative fitness advantage s s s , for different values of the Péclet number Pe. Panel (b) reports results for smaller s s s than (a), shown by a rectangle in (a). Stochastic simulations are described in SI Sec. IV A. Numerical solutions of the branching process Eq. (2) use either the steady-state mutant-free profile of the division rate ρ \rho ρ (“BP numerics”) or its step approximation (“BP step ρ \rho ρ ” in (a)). The first-order approximation Eq. (9) is shown in (b). The Moran model for large populations, ϕ = s / ( 1 + s ) \phi=s/(1+s) ϕ = s / ( 1 + s ) , gives the well-mixed reference. Inset in (a): profiles of ρ \rho ρ along the gut. Parameters: same λ w \lambda_w λ w (and P e max \mathrm{Pe}_{\max} Pe m a x ), κ / F i n \kappa/F_{\mathrm{in}} κ / F in and α \alpha α as in Figure 1 .
Importantly, Péclet numbers close to washout are biologically relevant, given the strong spatial gradients of food and bacterial concentration in the colon [8 , 9 , 25 ] (see SI Sec. V). Figure 3 (b) confirms that Eq. (9) gives a good approximation for s ≪ 1 s \ll1 s ≪ 1 . Analytical predictions slightly underestimate simulation results for s = 0 s=0 s = 0 and for the largest Péclet numbers shown, because finite population effects yield a nonzero fixation probability for neutral mutants (see SI Sec. I G) [24 , 25 ] .
Mutant invasion growth rate. Once the lineage arising from a single beneficial mutant with r m = ( 1 + s ) r w > r w r_m=(1+s)r_w>r_w r m = ( 1 + s ) r w > r w has passed the initial stochastic phase where it may go extinct (described by the branching process), the concentration of beneficial mutants grows deterministically [26 , 38 ] . Let us focus on the initial growth phase, assuming that the division rate profile remains unperturbed and given by Eq. (1) . Looking for a separable solution of the form M ( x , t ) = g ( x ) h ( t ) M(x,t)=g(x)h(t) M ( x , t ) = g ( x ) h ( t ) for the partial differential equation on mutant concentration M ( x , t ) M(x,t) M ( x , t ) , we find that mutant number exponentially grows with a rate given by the principal (largest) eigenvalue γ max \gamma_{\max} γ m a x of the operator A s † A_s^\dagger A s † , defined by
A s † g ( x ) = D g ′ ′ ( x ) − v g ′ ( x ) + ( 1 + s ) r w ρ ( x ) g ( x ) , (11) A_s^\dagger g(x) = Dg''(x) - vg'(x) + (1+s)r_w\rho(x)g(x), \tag*{(11)} A s † g ( x ) = D g ′′ ( x ) − v g ′ ( x ) + ( 1 + s ) r w ρ ( x ) g ( x ) , (11)
with boundary conditions
D g ′ ( 0 ) − v g ( 0 ) = 0 , D g ′ ( L ) = 0 , (12) Dg'(0)-vg(0)=0,\qquad Dg'(L)=0, \tag*{(12)} D g ′ ( 0 ) − v g ( 0 ) = 0 , D g ′ ( L ) = 0 , (12)
see SI Sec. I F. This operator is the adjoint of A s A_s A s in Eq. (4) . It comprises a forward transport operator, while A s A_s A s , which acts on the fixation probability, comprises a backward one. The eigenvalue problem of operator A s † A_s^\dagger A s † can be mapped onto the same Sturm-Liouville problem as that of A s A_s A s , yielding the principal eigenvalue
γ max = s r w ∫ 0 L ρ ( x ) f ( x ) B ( x ) d x ∫ 0 L f ( x ) B ( x ) d x + O ( s 2 ) . (13) \gamma_{\max}=sr_w\frac{\int_0^L \rho(x)f(x)B(x)\,\mathrm{d}x}{\int_0^L f(x)B(x)\,\mathrm{d}x}+O(s^2). \tag*{(13)} γ m a x = s r w ∫ 0 L f ( x ) B ( x ) d x ∫ 0 L ρ ( x ) f ( x ) B ( x ) d x + O ( s 2 ) . (13)
which gives the invasion growth rate of mutants. Note that the first-order term is consistent with Ref. [25 ] (see SI Sec. I F 2). Eq. (13) shows that, to first order in s s s , the invasion growth rate is obtained by spatially averaging the mutant division rate advantage s r w ρ ( x ) sr_w\rho(x) s r w ρ ( x ) , weighing each position x x x by f ( x ) B ( x ) f(x)B(x) f ( x ) B ( x ) , which is proportional to its long-term contribution to the future population. Beyond the perturbative regime, denoting by γ W M \gamma_{\mathrm{WM}} γ WM the mutant invasion rate in the reference well-mixed population with the same average per capita division rate, we obtain
γ max ≥ γ W M , ∀ s > 0 , (14) \gamma_{\max}\geq\gamma_{\mathrm{WM}},\qquad\forall s>0, \tag*{(14)} γ m a x ≥ γ WM , ∀ s > 0 , (14)
see SI Sec. I F 3. Hence, mutant invasion is accelerated in the gut compared to a matched well-mixed population. Figure 4 shows that, to first order in s s s , the division-event-weighted fixation probability ⟨ ϕ ⟩ \langle\phi\rangle ⟨ ϕ ⟩ decreases with the Péclet number, while the mutant invasion growth rate γ max \gamma_{\max} γ m a x grows with it. Increasing the importance of advection with respect to diffusion makes a mutant’s fate strongly depend on where it appears, thus decreasing ⟨ ϕ ⟩ \langle\phi\rangle ⟨ ϕ ⟩ . However, it also increases the importance of fast-dividing regions in terms of long-term contributions to the population, thus increasing γ max \gamma_{\max} γ m a x .
Figure 4. The rescaled first-order approximations of the division-event-weighted fixation probability ⟨ ϕ ⟩ \langle\phi\rangle ⟨ ϕ ⟩ and of the mutant invasion growth rate γ max \gamma_{\max} γ m a x are shown versus the normalized Péclet number Pe. Specifically, we plot ⟨ ϕ ( 1 ) ⟩ / s \langle\phi^{(1)}\rangle/s ⟨ ϕ ( 1 ) ⟩ / s where ⟨ ϕ ⟩ = ⟨ ϕ ( 1 ) ⟩ + O ( s 2 ) \langle\phi\rangle=\langle\phi^{(1)}\rangle+O(s^2) ⟨ ϕ ⟩ = ⟨ ϕ ( 1 ) ⟩ + O ( s 2 ) and γ ( 1 ) / ( s r w ) \gamma^{(1)}/(sr_w) γ ( 1 ) / ( s r w ) where γ max = γ ( 1 ) + O ( s 2 ) \gamma_{\max}=\gamma^{(1)}+O(s^2) γ m a x = γ ( 1 ) + O ( s 2 ) versus P e / P e max \mathrm{Pe}/\mathrm{Pe}_{\max} Pe / Pe m a x . For reference, we also show the rescaled mutant invasion growth rate γ W M / ( s r w ) \gamma_{\mathrm{WM}}/(sr_w) γ WM / ( s r w ) in a well-mixed population with the same mean per-capita division rate. Note that s r w sr_w s r w is the maximum possible invasion growth rate (see SI Sec. I F). Parameter values: same λ w \lambda_w λ w (and hence P e max \mathrm{Pe}_{\max} Pe m a x ), k / F i n k/F_{\mathrm{in}} k / F in and α \alpha α as in Fig. 1.
Discussion. Using a branching-process approach, we showed that spatial structure and transport in the gut reduce the fixation probability of beneficial mutants arising randomly upon division compared to the well-mixed case. The suppression factor is set by the spatial heterogeneity of mutant fate across the gut. We also showed that mutant invasion is faster in the gut than in a matched well-mixed population. These results hold for all positive relative mutant fitness advantages s s s , including large ones, which are relevant for adaptation to the gut [39 ] . Furthermore, increased hydrodynamic flow reduces fixation probability but accelerates invasion. This combination is reminiscent of models on graphs with directional migration flows, where mutants with uniform s s s feature suppression of natural selection and accelerated dynamics in the
branching process regime for frequent migrations [18 , 19 ] . It emphasizes that conditions yielding faster mutant invasion do not always reduce stochastic extinction [40 ] . While our fixation probability is consistent with Ref. [25 ] to leading order in s s s , it differs beyond that, and better agrees with simulation results (see SI Sec. III).
In the future, it will be interesting to investigate the fate of beneficial mutants in a more detailed gut model [11 ] than the one-dimensional one [8 , 9 ] used here for tractability. Incorporating clonal interference will be important as well [38 , 39 ] . Including ecological interactions between different bacterial strains would also be highly relevant, given the rich coupling between ecological and evolutionary dynamics [41 ] . More generally, the framework developed here can give insight in populations growing in systems with net flow, including microfluidic channels [42 ] , flow reactors [43 ] and streams [22 , 44 ] .
Acknowledgments. We thank Antoine Aragon for a preliminary exploration of this question by simulations. This research was partly funded by the Swiss National Science Foundation (SNSF, grant No. 315230 208196, to A.-F. B.) and by the Chan-Zuckerberg Initiative (CZI, to A.-F. B.). C. L. acknowledges funding by the Agence Nationale de la Recherche (grants ANR-20-CE30-0001, ANR-21-CE45-0015 and ANR-25-CE44-4822, to C. L.). AI tools (Claude Opus 5, 5.5, GPT 5.6 Sol, & Astra) were used for literature analysis, mathematical assistance on Sturm-Liouville problems, and proofreading. We checked all AI suggestions and take responsibility for the content.
Data availability. Our stochastic simulation code is freely available at https://github.com/Bitbol-Lab/Gut_evolutionary_dynamics.
General results for the one-dimensional gut model
Equations of the model
We start from a description of transport and division in the gut from Ref. [8 ] , which was extended in Ref. [24 ] to include neutral mutants, and in Ref. [25 ] to include beneficial mutants. We consider three fields: the food concentration F ( x , t ) F(x,t) F ( x , t ) , the wild type bacteria concentration B ( x , t ) B(x,t) B ( x , t ) , and the mutant concentration M ( x , t ) M(x,t) M ( x , t ) . They satisfy the following coupled partial differential equations:
∂ F ∂ t = D ∂ 2 F ∂ x 2 − v ∂ F ∂ x − 1 α ( r w B + r m M ) F k + F , ∂ B ∂ t = D ∂ 2 B ∂ x 2 − v ∂ B ∂ x + r w B F k + F , ∂ M ∂ t = D ∂ 2 M ∂ x 2 − v ∂ M ∂ x + r m M F k + F . \begin{aligned}
\frac{\partial F}{\partial t} &= D\frac{\partial^{2}F}{\partial x^{2}}-v\frac{\partial F}{\partial x}-\frac{1}{\alpha}\frac{(r_wB+r_mM)F}{k+F},\\
\frac{\partial B}{\partial t} &= D\frac{\partial^{2}B}{\partial x^{2}}-v\frac{\partial B}{\partial x}+r_w\frac{BF}{k+F},\\
\frac{\partial M}{\partial t} &= D\frac{\partial^{2}M}{\partial x^{2}}-v\frac{\partial M}{\partial x}+r_m\frac{MF}{k+F}.
\end{aligned} ∂ t ∂ F ∂ t ∂ B ∂ t ∂ M = D ∂ x 2 ∂ 2 F − v ∂ x ∂ F − α 1 k + F ( r w B + r m M ) F , = D ∂ x 2 ∂ 2 B − v ∂ x ∂ B + r w k + F B F , = D ∂ x 2 ∂ 2 M − v ∂ x ∂ M + r m k + F M F .
where D D D is the effective diffusion constant and v v v is the effective flow velocity. The wild-type and mutant maximal division rates are respectively r w r_w r w and r m = r w ( 1 + s ) r_m=r_w(1+s) r m = r w ( 1 + s ) , where we introduced the mutant relative fitness advantage s s s . Given the definition of s s s , we will always assume that s > − 1 s>-1 s > − 1 , and we will mainly focus on beneficial mutants with s > 0 s>0 s > 0 . Moreover, k k k is the Monod constant and α \alpha α is a conversion factor. For simplicity, we assume that F F F , B B B and M M M are linear concentrations, i.e. they are integrated over the gut cross section, and ∫ 0 L B ( x , t ) d x \int_0^L B(x,t)\,dx ∫ 0 L B ( x , t ) d x is the total number of wild-type bacteria in the system at time t t t .
The boundary conditions are
{ [ D ∂ ∂ x ( F ; B ; M ) − v ( F ; B ; M ) ] ( x = 0 ) = ( − v F i n ; 0 ; 0 ) , D ∂ ∂ x ( F ; B ; M ) ( x = L ) = ( 0 ; 0 ; 0 ) . \begin{cases}
\left[D\frac{\partial}{\partial x}(F;B;M)-v(F;B;M)\right](x=0)=(-vF_{\mathrm{in}};0;0),\\
D\frac{\partial}{\partial x}(F;B;M)(x=L)=(0;0;0).
\end{cases} { [ D ∂ x ∂ ( F ; B ; M ) − v ( F ; B ; M ) ] ( x = 0 ) = ( − v F in ; 0 ; 0 ) , D ∂ x ∂ ( F ; B ; M ) ( x = L ) = ( 0 ; 0 ; 0 ) .
where F i n F_{\mathrm{in}} F in is the incoming food concentration at the upstream boundary, corresponding to a food inflow v F i n vF_{\mathrm{in}} v F in .
Ordinary differential equation for the fixation probability of a beneficial mutant
Discrete derivation
To obtain an equation on the extinction probability u ( x ) u(x) u ( x ) , we reason on what happens to the mutant just after it appears. Here, we present an intuitive derivation in discrete space, where the x x x axis is divided into K + 1 K+1 K + 1 sites located at x i = i δ x x_i=i\delta x x i = i δ x with 0 ≤ i ≤ K 0\le i\le K 0 ≤ i ≤ K , with δ x = L / K \delta x=L/K δ x = L / K , see Figure S1 . Afterwards, we will present a more rigorous derivation based on a Langevin equation describing the stochastic motion of mutant bacteria.
Figure S1. Schematic of the discretized one-dimensional model of the gut. The segment [ 0 , L ] [0,L] [ 0 , L ] is discretized into K + 1 K+1 K + 1 sites located at x i = i δ x x_i=i\delta x x i = i δ x with 0 ≤ i ≤ K 0\le i\le K 0 ≤ i ≤ K , with δ x = L / K \delta x=L/K δ x = L / K (light blue). Each mutant (resp. wild-type) at site x i x_i x i divides with rate r m ρ ( x i ) r_m\rho(x_i) r m ρ ( x i ) (resp. r w ρ ( x i ) r_w\rho(x_i) r w ρ ( x i ) ) (shown in orange in the mutant case). Bacteria perform discrete jumps from their site of origin to its left (resp. right) neighbor with rate r − = D / ( δ x ) 2 r_-=D/(\delta x)^2 r − = D / ( δ x ) 2 (resp. r + = D / ( δ x ) 2 + v / δ x r_+=D/(\delta x)^2+v/\delta x r + = D / ( δ x ) 2 + v / δ x ). There is no upstream jump from x 0 x_0 x 0 , and there are only advective downstream jumps from x K x_K x K . Recall that in the continuous model [8 , 9 ] , bacteria are transported with an advective velocity v v v and an effective diffusion coefficient D D D (see main text Figure 1 (a)).
In the discrete framework, a given bacterium at x i x_i x i with 1 ≤ i ≤ K − 1 1\le i\le K-1 1 ≤ i ≤ K − 1 (i.e. at a non-boundary site) may move to the neighboring site on the right (resp. left) with a rate r + = D / ( δ x ) 2 + v / δ x r_+=D/(\delta x)^2+v/\delta x r + = D / ( δ x ) 2 + v / δ x (resp. r − = D / ( δ x ) 2 r_-=D/(\delta x)^2 r − = D / ( δ x ) 2 ), see Figure S1 . Boundary conditions will be addressed in Section I C 1. Let us consider a short time δ t \delta t δ t such that, to first order in δ t \delta t δ t , at most one event may happen. During this time, either:
the mutant moves right with probability r + δ t r_{+}\delta t r + δ t , and the extinction probability becomes u ( x + δ x ) u(x+\delta x) u ( x + δ x ) ;
the mutant moves left with probability r − δ t r_{-}\delta t r − δ t , and the extinction probability becomes u ( x − δ x ) u(x-\delta x) u ( x − δ x ) ;
the mutant divides, with probability r m ρ ( x ) δ t r_m\rho(x)\delta t r m ρ ( x ) δ t , and the extinction probability becomes u 2 ( x ) u^2(x) u 2 ( x ) under the branching process approximation, where different mutant lineages do not interact;
nothing happens, with probability 1 − [ r + + r − + r m ρ ( x ) ] δ t 1-[r_{+}+r_{-}+r_m\rho(x)]\delta t 1 − [ r + + r − + r m ρ ( x )] δ t , and the extinction probability remains u ( x ) u(x) u ( x ) .
This leads to
u ( x ) = r + δ t u ( x + δ x ) + r − δ t u ( x − δ x ) + r m ρ ( x ) δ t u 2 ( x ) + [ 1 − r − δ t − r + δ t − r m ρ ( x ) δ t ] u ( x ) + o ( δ t ) , (15) u(x)=r_{+}\delta t u(x+\delta x)+r_{-}\delta t u(x-\delta x)+r_m\rho(x)\delta t u^2(x)+[1-r_{-}\delta t-r_{+}\delta t-r_m\rho(x)\delta t]u(x)+o(\delta t), \tag*{(15)} u ( x ) = r + δ t u ( x + δ x ) + r − δ t u ( x − δ x ) + r m ρ ( x ) δ t u 2 ( x ) + [ 1 − r − δ t − r + δ t − r m ρ ( x ) δ t ] u ( x ) + o ( δ t ) , (15)
which gives
0 = D δ x 2 [ u ( x + δ x ) − 2 u ( x ) + u ( x − δ x ) ] + v δ x [ u ( x + δ x ) − u ( x ) ] − r m ρ ( x ) u ( x ) [ 1 − u ( x ) ] . (16) 0=\frac{D}{\delta x^2}[u(x+\delta x)-2u(x)+u(x-\delta x)]+\frac{v}{\delta x}[u(x+\delta x)-u(x)]-r_m\rho(x)u(x)[1-u(x)]. \tag*{(16)} 0 = δ x 2 D [ u ( x + δ x ) − 2 u ( x ) + u ( x − δ x )] + δ x v [ u ( x + δ x ) − u ( x )] − r m ρ ( x ) u ( x ) [ 1 − u ( x )] . (16)
In the continuous limit δ x → 0 \delta x\to0 δ x → 0 , we obtain the differential equation satisfied by the extinction probability,
D u ′ ′ ( x ) + v u ′ ( x ) − r m ρ ( x ) u ( x ) [ 1 − u ( x ) ] = 0. (17) Du''(x)+vu'(x)-r_m\rho(x)u(x)[1-u(x)]=0. \tag*{(17)} D u ′′ ( x ) + v u ′ ( x ) − r m ρ ( x ) u ( x ) [ 1 − u ( x )] = 0. (17)
The fixation probability ϕ ( x ) = 1 − u ( x ) \phi(x)=1-u(x) ϕ ( x ) = 1 − u ( x ) thus satisfies
D ϕ ′ ′ ( x ) + v ϕ ′ ( x ) + r m ρ ( x ) ϕ ( x ) [ 1 − ϕ ( x ) ] = 0. (18) D\phi''(x)+v\phi'(x)+r_m\rho(x)\phi(x)[1-\phi(x)]=0. \tag*{(18)} D ϕ ′′ ( x ) + v ϕ ′ ( x ) + r m ρ ( x ) ϕ ( x ) [ 1 − ϕ ( x )] = 0. (18)
Continuous derivation
In our effective model of transport in the gut, with advection and effective diffusion, the Langevin equation for bacterial motion is
d X t = v d t + 2 D d W t , (19) \mathrm{d}X_t=v\mathrm{d}t+\sqrt{2D}\,\mathrm{d}W_t, \tag*{(19)} d X t = v d t + 2 D d W t , (19)
with d t \mathrm{d}t d t the infinitesimal time step, and d W t \mathrm{d}W_t d W t the Wiener increment such that d W t ‾ = 0 \overline{\mathrm{d}W_t}=0 d W t = 0 and d W t 2 ‾ = d t \overline{\mathrm{d}W_t^2}=\mathrm{d}t d W t 2 = d t . This is the Langevin equation associated to the transport part of the Fokker-Planck equation for the probability density of bacteria, or equivalently, for their concentration B ( x , t ) B(x,t) B ( x , t ) , i.e. to the transport part of Eq. (S2).
We assume that a beneficial mutant arises in the bacterial population upon division at a position x x x along the gut. We are interested in the early dynamics of the new mutant population, where its lineage is still rare. Thus, we make the approximation that the division rate profile
ρ ( x , t ) = F ( x , t ) k + F ( x , t ) (20) \rho(x,t)=\frac{F(x,t)}{k+F(x,t)} \tag*{(20)} ρ ( x , t ) = k + F ( x , t ) F ( x , t ) (20)
is time-independent and matches the mutant-free stationary profile ρ ( x ) \rho(x) ρ ( x ) . This assumes that the mutant is rare enough not to perturb F F F and B B B , and that the food and wild-type bacteria profiles are initially at steady state.
Let u ( x ) u(x) u ( x ) be the extinction probability of the mutant lineage for one mutant starting from x x x . Let us focus on the infinitesimal time interval d t \mathrm{d}t d t just after the mutant has appeared. This time interval is so short that at most one division event happens during it. During d t \mathrm{d}t d t , either the mutant does not replicate, in which case it may be transported by advection or diffusion, or the mutant replicates. In the latter case, the two offspring mutant lineages are assumed to be independent within the branching process approximation, so that the mutant extinction probability becomes u 2 ( x ) u^2(x) u 2 ( x ) , and the spatial displacement only contributes at higher order. Summing over these two possibilities yields
u ( x ) = [ 1 − r m ρ ( x ) d t ] u ( x + d X t ) ‾ + r m ρ ( x ) d t u 2 ( x ) + o ( d t ) , (21) u(x)=[1-r_m\rho(x)\mathrm{d}t]\,\overline{u(x+\mathrm{d}X_t)}+r_m\rho(x)\mathrm{d}t\,u^2(x)+o(\mathrm{d}t), \tag*{(21)} u ( x ) = [ 1 − r m ρ ( x ) d t ] u ( x + d X t ) + r m ρ ( x ) d t u 2 ( x ) + o ( d t ) , (21)
where the bar denotes the average over the stochastic increment d X t \mathrm{d}X_t d X t introduced in Eq. (S10). Expanding to second order in the stochastic increment and using d X t ‾ = v d t \overline{\mathrm{d}X_t}=v\mathrm{d}t d X t = v d t and ( d X t ) 2 ‾ = 2 D d t + o ( d t ) \overline{(\mathrm{d}X_t)^2}=2D\mathrm{d}t+o(\mathrm{d}t) ( d X t ) 2 = 2 D d t + o ( d t ) , we obtain
u ( x + d X t ) ‾ = u ( x ) + [ D u ′ ′ ( x ) + v u ′ ( x ) ] d t + o ( d t ) . (22) \overline{u(x+\mathrm{d}X_t)}=u(x)+[Du''(x)+vu'(x)]\mathrm{d}t+o(\mathrm{d}t). \tag*{(22)} u ( x + d X t ) = u ( x ) + [ D u ′′ ( x ) + v u ′ ( x )] d t + o ( d t ) . (22)
Let us introduce the differential operator L x \mathcal{L}_x L x such that
L x u ( x ) = D u ′ ′ ( x ) + v u ′ ( x ) . (23) \mathcal{L}_x u(x)=Du''(x)+vu'(x). \tag*{(23)} L x u ( x ) = D u ′′ ( x ) + v u ′ ( x ) . (23)
We observe that it is the backward operator adjoint to the forward transport operator L x † \mathcal{L}_{x}^{\dagger} L x † that enters Eq. (S2),
L x † B ( x ) = D B ′ ′ ( x ) − v B ′ ( x ) . (24) \mathcal{L}_{x}^{\dagger}B(x)=DB''(x)-vB'(x). \tag*{(24)} L x † B ( x ) = D B ′′ ( x ) − v B ′ ( x ) . (24)
Hence, L x † \mathcal{L}_{x}^{\dagger} L x † acts on bacteria concentration B B B , while L x \mathcal{L}_{x} L x acts on extinction probability u u u , which is a function of the initial mutant position. Combining Eq. (21) with Eq. (22) yields
L x u ( x ) − r m ρ ( x ) u ( x ) [ 1 − u ( x ) ] = 0. (25) \mathcal{L}_{x}u(x)-r_{m}\rho(x)u(x)[1-u(x)]=0. \tag*{(25)} L x u ( x ) − r m ρ ( x ) u ( x ) [ 1 − u ( x )] = 0. (25)
Assuming that once a mutant lineage has escaped early extinctions described within the branching process regime, it fixes in the whole population [26 ] , the fixation probability ϕ ( x ) \phi(x) ϕ ( x ) can be expressed as ϕ ( x ) = 1 − u ( x ) \phi(x)=1-u(x) ϕ ( x ) = 1 − u ( x ) . Hence, it satisfies the differential equation
L x ϕ ( x ) + r m ρ ( x ) ϕ ( x ) [ 1 − ϕ ( x ) ] = 0. (26) \mathcal{L}_{x}\phi(x)+r_{m}\rho(x)\phi(x)[1-\phi(x)]=0. \tag*{(26)} L x ϕ ( x ) + r m ρ ( x ) ϕ ( x ) [ 1 − ϕ ( x )] = 0. (26)
Boundary conditions for the fixation probability profile of a beneficial mutant
In this section, we derive the boundary conditions for ϕ \phi ϕ . As for the bulk differential equation, it is possible to derive them using two methods, either reasoning on discrete jumps or directly in the continuous limit. Here, we present both, which allows us to check consistency.
Discrete derivation
For this derivation, we will use the discretization of the system introduced in Section IB1, with K + 1 K+1 K + 1 sites x i = i δ x x_i=i\delta x x i = i δ x for 0 ≤ i ≤ K 0\leq i\leq K 0 ≤ i ≤ K .
Boundary condition at x = 0 x=0 x = 0 . Let us assume that a mutant appears in the upstream boundary site x 0 = 0 x_0=0 x 0 = 0 . Recall that the total transport flux vanishes at x = 0 x=0 x = 0 , both for wild-types and for mutants: D B ′ ( 0 ) − v B ( 0 ) = 0 DB'(0)-vB(0)=0 D B ′ ( 0 ) − v B ( 0 ) = 0 and D M ′ ( 0 ) − v M ( 0 ) = 0 DM'(0)-vM(0)=0 D M ′ ( 0 ) − v M ( 0 ) = 0 . We implement this zero-flux condition by allowing no upstream jumps from site x 0 x_0 x 0 . Let us consider a short time δ t \delta t δ t such that, to first order in δ t \delta t δ t , at most one event may happen. During this time, either:
the mutant moves right with probability r + δ t r_{+}\delta t r + δ t , where r + = D / ( δ x ) 2 + v / δ x r_{+}=D/(\delta x)^2+v/\delta x r + = D / ( δ x ) 2 + v / δ x , and the extinction probability becomes u ( x 1 ) u(x_1) u ( x 1 ) ;
the mutant divides, with probability r m ρ ( x 0 ) δ t r_m\rho(x_0)\delta t r m ρ ( x 0 ) δ t , and the extinction probability becomes u 2 ( x 0 ) u^2(x_0) u 2 ( x 0 ) under the branching process approximation;
nothing happens, with probability 1 − [ r + + r m ρ ( x 0 ) ] δ t 1-[r_{+}+r_m\rho(x_0)]\delta t 1 − [ r + + r m ρ ( x 0 )] δ t , and the extinction probability remains u ( x 0 ) u(x_0) u ( x 0 ) .
This leads to
u ( x 0 ) = [ v δ t δ x + D δ t δ x 2 ] u ( x 1 ) + r m ρ ( x 0 ) δ t u 2 ( x 0 ) + [ 1 − v δ t δ x − D δ t δ x 2 − r m ρ ( x 0 ) δ t ] u ( x 0 ) + o ( δ t ) . (27) u(x_0)=\left[\frac{v\delta t}{\delta x}+\frac{D\delta t}{\delta x^2}\right]u(x_1)+r_m\rho(x_0)\delta t\,u^2(x_0)+\left[1-\frac{v\delta t}{\delta x}-\frac{D\delta t}{\delta x^2}-r_m\rho(x_0)\delta t\right]u(x_0)+o(\delta t). \tag*{(27)} u ( x 0 ) = [ δ x v δ t + δ x 2 D δ t ] u ( x 1 ) + r m ρ ( x 0 ) δ t u 2 ( x 0 ) + [ 1 − δ x v δ t − δ x 2 D δ t − r m ρ ( x 0 ) δ t ] u ( x 0 ) + o ( δ t ) . (27)
Identifying the first-order terms in δ t \delta t δ t yields
0 = D ( δ x ) 2 [ u ( x 1 ) − u ( x 0 ) ] + v δ x [ u ( x 1 ) − u ( x 0 ) ] − r m ρ ( x 0 ) u ( x 0 ) [ 1 − u ( x 0 ) ] = D δ x [ u ′ ( x 0 ) + O ( δ x ) ] + v δ x [ u ′ ( x 0 ) δ x + O ( ( δ x ) 2 ) ] − r m ρ ( x 0 ) u ( x 0 ) [ 1 − u ( x 0 ) ] . (28) \begin{aligned}
0={}&\frac{D}{(\delta x)^2}[u(x_1)-u(x_0)]+\frac{v}{\delta x}[u(x_1)-u(x_0)]-r_m\rho(x_0)u(x_0)[1-u(x_0)]\\
={}&\frac{D}{\delta x}[u'(x_0)+O(\delta x)]+\frac{v}{\delta x}[u'(x_0)\delta x+O((\delta x)^2)]-r_m\rho(x_0)u(x_0)[1-u(x_0)]. \tag*{(28)}
\end{aligned} 0 = = ( δ x ) 2 D [ u ( x 1 ) − u ( x 0 )] + δ x v [ u ( x 1 ) − u ( x 0 )] − r m ρ ( x 0 ) u ( x 0 ) [ 1 − u ( x 0 )] δ x D [ u ′ ( x 0 ) + O ( δ x )] + δ x v [ u ′ ( x 0 ) δ x + O (( δ x ) 2 )] − r m ρ ( x 0 ) u ( x 0 ) [ 1 − u ( x 0 )] . (28)
This yields D u ′ ( x 0 ) + O ( δ x ) = 0 Du'(x_0)+O(\delta x)=0 D u ′ ( x 0 ) + O ( δ x ) = 0 . Since x 0 = 0 x_0=0 x 0 = 0 , we obtain
u ′ ( 0 ) = 0. (29) u'(0)=0. \tag*{(29)} u ′ ( 0 ) = 0. (29)
Finally, using ϕ ( x ) = 1 − u ( x ) \phi(x)=1-u(x) ϕ ( x ) = 1 − u ( x ) yields the boundary condition on ϕ \phi ϕ at x = 0 x=0 x = 0 :
ϕ ′ ( 0 ) = 0. (30) \phi'(0)=0. \tag*{(30)} ϕ ′ ( 0 ) = 0. (30)
Boundary condition at x = L x=L x = L . Let us assume that a mutant appears in the downstream boundary site x K = L x_K=L x K = L . Recall that we assume that diffusive flux is zero at x = L x=L x = L , both for wild-type and for mutant bacteria: M ′ ( L ) = B ′ ( L ) = 0 M'(L)=B'(L)=0 M ′ ( L ) = B ′ ( L ) = 0 . We implement this condition by suppressing downstream diffusive jumps from site x K x_K x K . Let us consider a short time δ t \delta t δ t such that, to first order in δ t \delta t δ t , at most one event may happen. During this time, either:
the mutant moves right due to advection with probability v δ t / δ x v\delta t/\delta x v δ t / δ x , and exits the system: the extinction probability becomes 1;
the mutant moves left due to diffusion with probability D δ t / ( δ x ) 2 D\delta t/(\delta x)^2 D δ t / ( δ x ) 2 , and the extinction probability becomes u ( x K − 1 ) u(x_K-1) u ( x K − 1 ) ;
the mutant divides, with probability r m ρ ( x K ) δ t r_m\rho(x_K)\delta t r m ρ ( x K ) δ t , and the extinction probability becomes u 2 ( x K ) u^2(x_K) u 2 ( x K ) under the branching process approximation;
nothing happens, with probability 1 − [ v / δ x + D / ( δ x ) 2 + r m ρ ( x K ) ] δ t 1-[v/\delta x+D/(\delta x)^2+r_m\rho(x_K)]\delta t 1 − [ v / δ x + D / ( δ x ) 2 + r m ρ ( x K )] δ t , and the extinction probability remains u ( x K ) u(x_K) u ( x K ) .
This leads to
u ( x K ) = v δ t δ x + D δ t δ x 2 u ( x K − 1 ) + r m ρ ( x K ) δ t u 2 ( x K ) + [ 1 − v δ t δ x − D δ t δ x 2 − r m ρ ( x K ) δ t ] u ( x K ) + o ( δ t ) . (31) u(x_K)=\frac{v\delta t}{\delta x}+\frac{D\delta t}{\delta x^2}u(x_K-1)+r_m\rho(x_K)\delta t\,u^2(x_K)+\left[1-\frac{v\delta t}{\delta x}-\frac{D\delta t}{\delta x^2}-r_m\rho(x_K)\delta t\right]u(x_K)+o(\delta t). \tag*{(31)} u ( x K ) = δ x v δ t + δ x 2 D δ t u ( x K − 1 ) + r m ρ ( x K ) δ t u 2 ( x K ) + [ 1 − δ x v δ t − δ x 2 D δ t − r m ρ ( x K ) δ t ] u ( x K ) + o ( δ t ) . (31)
Identifying the first-order terms in δ t \delta t δ t yields
0 = − D δ x 2 [ u ( x K ) − u ( x K − 1 ) ] + v δ x [ 1 − u ( x K ) ] − r m ρ ( x K ) u ( x K ) [ 1 − u ( x K ) ] = − D δ x [ u ′ ( x K ) + O ( δ x ) ] + v δ x [ 1 − u ( x K ) ] − r m ρ ( x K ) u ( x K ) [ 1 − u ( x K ) ] . (32) \begin{aligned}
0&=-\frac{D}{\delta x^2}[u(x_K)-u(x_K-1)]+\frac{v}{\delta x}[1-u(x_K)]-r_m\rho(x_K)u(x_K)[1-u(x_K)]\\
&=-\frac{D}{\delta x}[u'(x_K)+O(\delta x)]+\frac{v}{\delta x}[1-u(x_K)]-r_m\rho(x_K)u(x_K)[1-u(x_K)]. \tag*{(32)}
\end{aligned} 0 = − δ x 2 D [ u ( x K ) − u ( x K − 1 )] + δ x v [ 1 − u ( x K )] − r m ρ ( x K ) u ( x K ) [ 1 − u ( x K )] = − δ x D [ u ′ ( x K ) + O ( δ x )] + δ x v [ 1 − u ( x K )] − r m ρ ( x K ) u ( x K ) [ 1 − u ( x K )] . (32)
This yields − D u ′ ( x K ) + v [ 1 − u ( x K ) ] + O ( δ x ) = 0 -Du'(x_K)+v[1-u(x_K)]+O(\delta x)=0 − D u ′ ( x K ) + v [ 1 − u ( x K )] + O ( δ x ) = 0 . Since x K = L x_K=L x K = L , we obtain
− D u ′ ( L ) + v [ 1 − u ( L ) ] = 0. (33) -Du'(L)+v[1-u(L)]=0. \tag*{(33)} − D u ′ ( L ) + v [ 1 − u ( L )] = 0. (33)
Finally, using ϕ ( x ) = 1 − u ( x ) \phi(x)=1-u(x) ϕ ( x ) = 1 − u ( x ) yields the boundary condition on ϕ \phi ϕ at x = L x=L x = L :
D ϕ ′ ( L ) + v ϕ ( L ) = 0. (34) D\phi'(L)+v\phi(L)=0. \tag*{(34)} D ϕ ′ ( L ) + v ϕ ( L ) = 0. (34)
Continuous derivation
Let us consider the two transport operators L x \mathcal{L}_x L x and L x † \mathcal{L}_x^\dagger L x † . In the bulk, they are defined respectively by Eqs. Eqs. (23) and (S15). The forward operator L x † \mathcal{L}_x^\dagger L x † describes the evolution of probability densities associated with the stochastic transport process considered, while the backward one L x \mathcal{L}_x L x acts on quantities that depend on the initial position of the stochastic process. Since both operators describe the same stochastic process, the boundary conditions on ϕ \phi ϕ should be chosen so that they are adjoint on the whole interval [ 0 , L ] [0,L] [ 0 , L ] . Hence, we impose the condition
∫ 0 L ψ L x ϕ d x = ∫ 0 L ϕ L x † ψ d x , (35) \int_0^L\psi\mathcal{L}_x\phi\,\mathrm{d}x=\int_0^L\phi\mathcal{L}_x^\dagger\psi\,\mathrm{d}x, \tag*{(35)} ∫ 0 L ψ L x ϕ d x = ∫ 0 L ϕ L x † ψ d x , (35)
where ψ \psi ψ is any function on which the operator L x † \mathcal{L}_x^\dagger L x † is allowed to act. Thus, ψ \psi ψ should be sufficiently smooth and satisfy the same boundary conditions as B B B in Eqs. Eqs. (S4) and (S5), namely
D ψ ′ ( 0 ) − v ψ ( 0 ) = 0 , (36) D\psi'(0)-v\psi(0)=0, \tag*{(36)} D ψ ′ ( 0 ) − v ψ ( 0 ) = 0 , (36)
ψ ′ ( L ) = 0. (37) \psi'(L)=0. \tag*{(37)} ψ ′ ( L ) = 0. (37)
Let us consider
∫ 0 L ϕ L x † ψ d x = ∫ 0 L ϕ ( x ) [ D ψ ′ ′ ( x ) − v ψ ′ ( x ) ] d x . (38) \int_0^L\phi\mathcal{L}_x^\dagger\psi\,\mathrm{d}x=\int_0^L\phi(x)[D\psi''(x)-v\psi'(x)]\,\mathrm{d}x. \tag*{(38)} ∫ 0 L ϕ L x † ψ d x = ∫ 0 L ϕ ( x ) [ D ψ ′′ ( x ) − v ψ ′ ( x )] d x . (38)
After integration by parts (IBP), it yields
∫ 0 L ϕ L x † ψ d x = − ∫ 0 L ϕ ′ ( x ) [ D ψ ′ ( x ) − v ψ ( x ) ] d x + [ ϕ ( x ) ( D ψ ′ ( x ) − v ψ ( x ) ) ] 0 L . (39) \int_0^L\phi\mathcal{L}_x^\dagger\psi\,\mathrm{d}x=-\int_0^L\phi'(x)[D\psi'(x)-v\psi(x)]\,\mathrm{d}x+[\phi(x)(D\psi'(x)-v\psi(x))]_0^L. \tag*{(39)} ∫ 0 L ϕ L x † ψ d x = − ∫ 0 L ϕ ′ ( x ) [ D ψ ′ ( x ) − v ψ ( x )] d x + [ ϕ ( x ) ( D ψ ′ ( x ) − v ψ ( x )) ] 0 L . (39)
Using Eqs. (S27) and (S28), the expression simplifies and a second IBP gives
∫ 0 L ϕ L x † ψ d x = ∫ 0 L ψ ( x ) [ D ϕ ′ ′ ( x ) + v ϕ ′ ( x ) ] d x − [ ϕ ′ ( x ) D ψ ( x ) ] 0 L − v ψ ( L ) ϕ ( L ) . (40) \int_0^L\phi\mathcal{L}_x^\dagger\psi\,\mathrm{d}x=\int_0^L\psi(x)[D\phi''(x)+v\phi'(x)]\,\mathrm{d}x-[\phi'(x)D\psi(x)]_0^L-v\psi(L)\phi(L). \tag*{(40)} ∫ 0 L ϕ L x † ψ d x = ∫ 0 L ψ ( x ) [ D ϕ ′′ ( x ) + v ϕ ′ ( x )] d x − [ ϕ ′ ( x ) D ψ ( x ) ] 0 L − v ψ ( L ) ϕ ( L ) . (40)
Imposing Eq. (35) then yields
− ψ ( L ) [ D ϕ ′ ( L ) + v ϕ ( L ) ] + ψ ( 0 ) D ϕ ′ ( 0 ) = 0. (41) -\psi(L)\left[D\phi'(L)+v\phi(L)\right]+\psi(0)D\phi'(0)=0. \tag*{(41)} − ψ ( L ) [ D ϕ ′ ( L ) + v ϕ ( L ) ] + ψ ( 0 ) D ϕ ′ ( 0 ) = 0. (41)
As this identity must be satisfied for all admissible forward functions ψ \psi ψ , whose values at x = 0 x=0 x = 0 and x = L x=L x = L can be varied independently, we obtain
ϕ ′ ( 0 ) = 0 , (42) \phi'(0)=0, \tag*{(42)} ϕ ′ ( 0 ) = 0 , (42)
D ϕ ′ ( L ) + v ϕ ( L ) = 0 , (43) D\phi'(L)+v\phi(L)=0, \tag*{(43)} D ϕ ′ ( L ) + v ϕ ( L ) = 0 , (43)
which yields the boundary conditions associated to the fixation probability ϕ \phi ϕ . Note that the adjointness condition on the transport operator fixes the boundary conditions of the full equation for ϕ \phi ϕ , because the reaction term involves no derivatives (and thus, it produces no boundary terms).
Fixation probability in the branching process approximation
Critical point
Let us first identify the critical point where a nonzero fixation probability appears. The differential equation for the fixation probability, Eq. (26) , can be written as
A s ϕ ( x ) − ( 1 + s ) r w ρ ( x ) ϕ 2 ( x ) = 0 , (44) \mathcal{A}_s\phi(x)-(1+s)r_w\rho(x)\phi^2(x)=0, \tag*{(44)} A s ϕ ( x ) − ( 1 + s ) r w ρ ( x ) ϕ 2 ( x ) = 0 , (44)
where we introduced the backward operator
A s = L x + ( 1 + s ) r w ρ ( x ) , (45) \mathcal{A}_s=\mathcal{L}_x+(1+s)r_w\rho(x), \tag*{(45)} A s = L x + ( 1 + s ) r w ρ ( x ) , (45)
with L x \mathcal{L}_x L x denoting the backward transport operator defined in Eq. (23) . We observe that ϕ = 0 \phi=0 ϕ = 0 is always a solution of Eq. (44) . We are interested in the onset of a positive solution of Eq. (44) . To determine it, we linearize Eq. (44) around ϕ = 0 \phi=0 ϕ = 0 , yielding A s ϕ ( x ) = 0 \mathcal{A}_s\phi(x)=0 A s ϕ ( x ) = 0 , and we search for the point where the largest eigenvalue of the linearized operator A s \mathcal{A}_s A s crosses zero [33 ] .
Although A s \mathcal{A}_s A s is not self-adjoint because of the advective term, its eigenvalue problem
A s q ( x ) = γ q ( x ) , (46) \mathcal{A}_s q(x)=\gamma q(x), \tag*{(46)} A s q ( x ) = γ q ( x ) , (46)
with the backward boundary conditions Eqs. (42) and (S34), can be transformed into a self-adjoint Sturm-Liouville problem [32 ] by introducing y ( x ) = e v x / ( 2 D ) q ( x ) y(x)=e^{vx/(2D)}q(x) y ( x ) = e v x / ( 2 D ) q ( x ) . Indeed, Eq. (46) then becomes
− D y ′ ′ ( x ) + [ v 2 4 D − ( 1 + s ) r w ρ ( x ) ] y ( x ) = − γ y ( x ) , (47) -Dy''(x)+\left[\frac{v^2}{4D}-(1+s)r_w\rho(x)\right]y(x)=-\gamma y(x), \tag*{(47)} − D y ′′ ( x ) + [ 4 D v 2 − ( 1 + s ) r w ρ ( x ) ] y ( x ) = − γ y ( x ) , (47)
with boundary conditions
y ′ ( 0 ) = v 2 D y ( 0 ) , y ′ ( L ) = − v 2 D y ( L ) . (48) y'(0)=\frac{v}{2D}y(0),\qquad y'(L)=-\frac{v}{2D}y(L). \tag*{(48)} y ′ ( 0 ) = 2 D v y ( 0 ) , y ′ ( L ) = − 2 D v y ( L ) . (48)
In such a regular Sturm-Liouville problem with separated boundary conditions, all eigenvalues are real and simple. Furthermore, the smallest eigenvalue − γ max -\gamma_{\max} − γ m a x is associated with an eigenfunction that can be chosen positive, while all other eigenfunctions change sign [32 ] . This entails that the largest (or principal) eigenvalue γ max \gamma_{\max} γ m a x of A s \mathcal{A}_s A s is simple, and is associated with an eigenfunction q ( x ) = e − v x / ( 2 D ) y ( x ) q(x)=e^{-vx/(2D)}y(x) q ( x ) = e − v x / ( 2 D ) y ( x ) that can be chosen positive (i.e. q ( x ) > 0 q(x)>0 q ( x ) > 0 for x ∈ ( 0 , L ) x\in(0,L) x ∈ ( 0 , L ) ), while all other eigenfunctions of A s \mathcal{A}_s A s change sign.
Let us consider
f ( x ) = B ( x ) e − v x / D , (49) f(x)=B(x)e^{-vx/D}, \tag*{(49)} f ( x ) = B ( x ) e − v x / D , (49)
where B ( x ) B(x) B ( x ) is the steady-state wild-type bacteria concentration profile in the absence of mutants, i.e. the solution to Eqs. (S2), (S4) and (S5) for M = 0 M=0 M = 0 . In the case of a neutral mutant, s = 0 s=0 s = 0 , it satisfies
A 0 f ( x ) = L x f ( x ) + r w ρ ( x ) f ( x ) = D f ′ ′ ( x ) + v f ′ ( x ) + r w ρ ( x ) f ( x ) = 0 , (50) \mathcal{A}_0f(x)=\mathcal{L}_xf(x)+r_w\rho(x)f(x)=Df''(x)+vf'(x)+r_w\rho(x)f(x)=0, \tag*{(50)} A 0 f ( x ) = L x f ( x ) + r w ρ ( x ) f ( x ) = D f ′′ ( x ) + v f ′ ( x ) + r w ρ ( x ) f ( x ) = 0 , (50)
as well as the backward boundary conditions Eqs. (42) and (43) . Since B ( x ) > 0 B(x)>0 B ( x ) > 0 for x ∈ [ 0 , L ] x\in[0,L] x ∈ [ 0 , L ] , we have f ( x ) > 0 f(x)>0 f ( x ) > 0 for x ∈ [ 0 , L ] x\in[0,L] x ∈ [ 0 , L ] . The corresponding eigenvalue, 0 0 0 , is therefore the principal eigenvalue of A 0 A_0 A 0 . Moreover, since A s = A 0 + s r w ρ ( x ) A_s=A_0+sr_w\rho(x) A s = A 0 + s r w ρ ( x ) (see Eq. (45) ), A s A_s A s differs from A 0 A_0 A 0 by a growth term whose sign is that of s s s . Hence, the principal eigenvalue of A s A_s A s is larger than that of A 0 A_0 A 0 for s > 0 s>0 s > 0 and smaller for s < 0 s<0 s < 0 : it crosses zero at s = 0 s=0 s = 0 . This entails that the critical point where a nonzero fixation probability appears is s = 0 s=0 s = 0 . Note that this result is consistent with the fixation probability expressions within the branching process approximation in well-mixed populations [27 ] and in deme-structured populations [18 ] . Note also that the function introduced in Eq. (49) coincides with the one in Eq. 6 of Ref. [25 ] up to normalization when D D D and v v v are constant.
Moderate selection regime
Let us perform a perturbative calculation of the fixation probability in the regime where the relative selective advantage s s s of the mutant, defined via r m = ( 1 + s ) r w r_m=(1+s)r_w r m = ( 1 + s ) r w , is small: s ≪ 1 s\ll1 s ≪ 1 . Within the branching-process approximation, the fixation probability vanishes at the critical point s = 0 s=0 s = 0 . Thus, we write
ϕ ( x ) = s ϕ 1 ( x ) + s 2 ϕ 2 ( x ) + O ( s 3 ) . (51) \phi(x)=s\phi_1(x)+s^2\phi_2(x)+O(s^3). \tag*{(51)} ϕ ( x ) = s ϕ 1 ( x ) + s 2 ϕ 2 ( x ) + O ( s 3 ) . (51)
Note that both the present expansion and the branching process approximation neglect the fact that neutral mutants have a nonzero fixation probability in finite populations. In particular, this expansion requires 1 / N a c t i v e ≪ s ≪ 1 1/N_{\mathrm{active}}\ll s\ll1 1/ N active ≪ s ≪ 1 , where N a c t i v e N_{\mathrm{active}} N active is the active population size which controls the fixation of a neutral mutant appearing randomly upon division in the system [24 ] . Let us call this regime the moderate selection regime. We will give a more precise definition of the moderate selection regime in § 0.1 G.
Substituting Eq. (51) into the differential equation for ϕ \phi ϕ Eq. (26) and identifying terms of first and second order in s s s yields:
A 0 ϕ 1 ( x ) = D ϕ 1 ′ ′ ( x ) + v ϕ 1 ′ ( x ) + r w ρ ( x ) ϕ 1 ( x ) = 0 , (52) A_0\phi_1(x)=D\phi_1''(x)+v\phi_1'(x)+r_w\rho(x)\phi_1(x)=0, \tag*{(52)} A 0 ϕ 1 ( x ) = D ϕ 1 ′′ ( x ) + v ϕ 1 ′ ( x ) + r w ρ ( x ) ϕ 1 ( x ) = 0 , (52)
A 0 ϕ 2 ( x ) = D ϕ 2 ′ ′ ( x ) + v ϕ 2 ′ ( x ) + r w ρ ( x ) ϕ 2 ( x ) = r w ρ ( x ) ϕ 1 ( x ) [ ϕ 1 ( x ) − 1 ] . (53) A_0\phi_2(x)=D\phi_2''(x)+v\phi_2'(x)+r_w\rho(x)\phi_2(x)=r_w\rho(x)\phi_1(x)[\phi_1(x)-1]. \tag*{(53)} A 0 ϕ 2 ( x ) = D ϕ 2 ′′ ( x ) + v ϕ 2 ′ ( x ) + r w ρ ( x ) ϕ 2 ( x ) = r w ρ ( x ) ϕ 1 ( x ) [ ϕ 1 ( x ) − 1 ] . (53)
In addition, the boundary conditions on ϕ \phi ϕ , namely Eqs. (42) and (43) , also apply to ϕ 1 \phi_1 ϕ 1 and ϕ 2 \phi_2 ϕ 2 .
We notice that any multiple of f f f defined in Eq. (49) satisfies Eqs. (52) , (42) and (43) . As shown above, zero is the principal eigenvalue of A 0 A_0 A 0 . Since this eigenvalue is simple [32 ] , we have
ϕ 1 ( x ) = A f ( x ) = A B ( x ) e − v x / D , (54) \phi_1(x)=Af(x)=AB(x)e^{-vx/D}, \tag*{(54)} ϕ 1 ( x ) = A f ( x ) = A B ( x ) e − v x / D , (54)
where A A A is a constant.
Next, let us consider Eq. (53) : A 0 ϕ 2 ( x ) = r w ρ ( x ) ϕ 1 ( x ) [ ϕ 1 ( x ) − 1 ] A_0\phi_2(x)=r_w\rho(x)\phi_1(x)[\phi_1(x)-1] A 0 ϕ 2 ( x ) = r w ρ ( x ) ϕ 1 ( x ) [ ϕ 1 ( x ) − 1 ] . Multiplying both sides by B ( x ) B(x) B ( x ) and integrating between 0 0 0 and L L L gives:
∫ 0 L B ( x ) A 0 ϕ 2 ( x ) d x = r w ∫ 0 L ρ ( x ) B ( x ) ϕ 1 ( x ) [ ϕ 1 ( x ) − 1 ] d x . (55) \int_0^L B(x)A_0\phi_2(x)\,\mathrm{d}x=r_w\int_0^L\rho(x)B(x)\phi_1(x)[\phi_1(x)-1]\,\mathrm{d}x. \tag*{(55)} ∫ 0 L B ( x ) A 0 ϕ 2 ( x ) d x = r w ∫ 0 L ρ ( x ) B ( x ) ϕ 1 ( x ) [ ϕ 1 ( x ) − 1 ] d x . (55)
Let us introduce the adjoint A 0 † A_0^\dagger A 0 † of A 0 A_0 A 0 as
A 0 † = L x † + r w ρ ( x ) , (56) A_0^\dagger=\mathcal{L}_x^\dagger+r_w\rho(x), \tag*{(56)} A 0 † = L x † + r w ρ ( x ) , (56)
where L x † \mathcal{L}_x^\dagger L x † denotes the forward transport operator defined in Eq. (24) . Performing integrations by parts, and using the adjointness of A 0 A_0 A 0 and A 0 † A_0^\dagger A 0 † together with the backward and forward boundary conditions, we obtain
∫ 0 L ϕ 2 ( x ) A 0 † B ( x ) d x = r w ∫ 0 L ρ ( x ) B ( x ) ϕ 1 ( x ) [ ϕ 1 ( x ) − 1 ] d x . (57) \int_0^L\phi_2(x)A_0^\dagger B(x)\,\mathrm{d}x=r_w\int_0^L\rho(x)B(x)\phi_1(x)[\phi_1(x)-1]\,\mathrm{d}x. \tag*{(57)} ∫ 0 L ϕ 2 ( x ) A 0 † B ( x ) d x = r w ∫ 0 L ρ ( x ) B ( x ) ϕ 1 ( x ) [ ϕ 1 ( x ) − 1 ] d x . (57)
As B B B satisfies the stationary Eq. (S2), i.e. A 0 † B ( x ) = 0 A_0^\dagger B(x)=0 A 0 † B ( x ) = 0 , the left-hand side of this equation vanishes, leading to
∫ 0 L ρ ( x ) B ( x ) ϕ 1 ( x ) [ ϕ 1 ( x ) − 1 ] d x = 0. (58) \int_0^L\rho(x)B(x)\phi_1(x)[\phi_1(x)-1]\,\mathrm{d}x=0. \tag*{(58)} ∫ 0 L ρ ( x ) B ( x ) ϕ 1 ( x ) [ ϕ 1 ( x ) − 1 ] d x = 0. (58)
Combining Eq. (54) with Eq. (58) and assuming A ≠ 0 A \ne0 A = 0 gives
A = ∫ 0 L ρ ( x ) B ( x ) f ( x ) d x ∫ 0 L ρ ( x ) B ( x ) f 2 ( x ) d x . (59) A = \frac{\int_{0}^{L} \rho(x)B(x)f(x)\,\mathrm{d}x}{\int_{0}^{L} \rho(x)B(x)f^{2}(x)\,\mathrm{d}x}. \tag*{(59)} A = ∫ 0 L ρ ( x ) B ( x ) f 2 ( x ) d x ∫ 0 L ρ ( x ) B ( x ) f ( x ) d x . (59)
Let us define the division-event-weighted average ⟨ q ⟩ \langle q\rangle ⟨ q ⟩ of a quantity q ( x ) q(x) q ( x ) [24 , 25 ] as:
⟨ q ⟩ = ∫ 0 L d x ρ ( x ) B ( x ) q ( x ) ∫ 0 L d x ρ ( x ) B ( x ) . (60) \langle q\rangle= \frac{\int_{0}^{L} \mathrm{d}x\,\rho(x)B(x)q(x)}{\int_{0}^{L} \mathrm{d}x\,\rho(x)B(x)}. \tag*{(60)} ⟨ q ⟩ = ∫ 0 L d x ρ ( x ) B ( x ) ∫ 0 L d x ρ ( x ) B ( x ) q ( x ) . (60)
We can then write A = ⟨ f ⟩ / ⟨ f 2 ⟩ A = \langle f\rangle/ \langle f^{2}\rangle A = ⟨ f ⟩ / ⟨ f 2 ⟩ .
Assembling our results gives the mutant fixation probability ϕ \phi ϕ in the moderate selection regime:
ϕ ( x ) = s ⟨ f ⟩ ⟨ f 2 ⟩ f ( x ) + O ( s 2 ) = s ⟨ f ⟩ ⟨ f 2 ⟩ B ( x ) e − v x / D + O ( s 2 ) , (61) \phi(x) = s\frac{\langle f\rangle}{\langle f^{2}\rangle}f(x) + O(s^{2}) = s\frac{\langle f\rangle}{\langle f^{2}\rangle}B(x)e^{-vx/D} + O(s^{2}), \tag*{(61)} ϕ ( x ) = s ⟨ f 2 ⟩ ⟨ f ⟩ f ( x ) + O ( s 2 ) = s ⟨ f 2 ⟩ ⟨ f ⟩ B ( x ) e − v x / D + O ( s 2 ) , (61)
where B ( x ) B(x) B ( x ) is the steady-state wild-type bacteria concentration profile in the absence of mutants, i.e. the solution to Eqs. (S2), (S4) and (S5) for M = 0 M = 0 M = 0 . Note that, although it was obtained using a different approach (see Section III) and formulated differently, the first-order result in Eq. (61) is consistent with Ref. [25 ] in the limit L → ∞ L \to\infty L → ∞ (see their Eq. S112, with s e = s s_e = s s e = s from Eq. S100 without cell death, N e N_e N e from Eq. 10 and u ( x ) u(x) u ( x ) from Eq. 6 when D D D and v v v are constant).
The division-event-weighted average of ϕ \phi ϕ reads
⟨ ϕ ⟩ = s ⟨ f ⟩ 2 ⟨ f 2 ⟩ + O ( s 2 ) = s 1 1 + c v 2 ( f ) + O ( s 2 ) , (62) \langle\phi\rangle= s\frac{\langle f\rangle^{2}}{\langle f^{2}\rangle} + O(s^{2}) = s\frac{1}{1+c_v^{2}(f)} + O(s^{2}), \tag*{(62)} ⟨ ϕ ⟩ = s ⟨ f 2 ⟩ ⟨ f ⟩ 2 + O ( s 2 ) = s 1 + c v 2 ( f ) 1 + O ( s 2 ) , (62)
where we introduced the coefficient of variation c v ( f ) = std ( f ) / ⟨ f ⟩ c_v(f) = \operatorname{std}(f)/\langle f\rangle c v ( f ) = std ( f ) / ⟨ f ⟩ , with std \operatorname{std} std denoting the standard deviation using the division-event-weighted average: std 2 ( f ) = ⟨ f 2 ⟩ − ⟨ f ⟩ 2 \operatorname{std}^{2}(f) = \langle f^{2}\rangle- \langle f\rangle^{2} std 2 ( f ) = ⟨ f 2 ⟩ − ⟨ f ⟩ 2 . Eq. (62) demonstrates that, to leading order in s s s , we have ⟨ ϕ ⟩ ≤ s \langle\phi\rangle\le s ⟨ ϕ ⟩ ≤ s in the gut. In addition, the inequality is strict whenever f ( x ) f(x) f ( x ) varies spatially over the region where bacteria reproduce. Hence, to leading order in the moderate selection regime for beneficial mutants, the specific spatial structure and environmental gradients in the gut suppress natural selection compared to a well-mixed Moran process [28 , 37 ] , which gives ϕ = s + O ( s 2 ) \phi= s + O(s^{2}) ϕ = s + O ( s 2 ) in the limit of large population sizes.
From a formal point of view, we note that the derivation of the first-order approximation of the fixation probability in the moderate selection regime is similar to that presented in Ref. [18 ] in the case of populations on graphs. In particular, the second-order equation allows us to determine the amplitude of the first-order term. Both calculations are branching process calculations, but the present one involves dependencies on a continuous variable x x x , while the one in Ref. [18 ] involves dependencies on a discrete variable i i i that labels graph nodes.
Beyond moderate selection
The ordinary differential equation on ϕ \phi ϕ , Eq. (18) , can be written as
A 0 ϕ ( x ) = ( 1 + s ) r w ρ ( x ) ϕ 2 ( x ) − s r w ρ ( x ) ϕ ( x ) . (63) \mathcal{A}_{0}\phi(x) = (1+s)r_w\rho(x)\phi^{2}(x) - sr_w\rho(x)\phi(x). \tag*{(63)} A 0 ϕ ( x ) = ( 1 + s ) r w ρ ( x ) ϕ 2 ( x ) − s r w ρ ( x ) ϕ ( x ) . (63)
Inspired by the above reasoning on ϕ 2 \phi_{2} ϕ 2 , let us multiply both sides by B ( x ) B(x) B ( x ) and integrate between 0 0 0 and L L L . It gives:
∫ 0 L B ( x ) A 0 ϕ ( x ) d x = ( 1 + s ) r w ∫ 0 L ρ ( x ) B ( x ) ϕ 2 ( x ) d x − s r w ∫ 0 L ρ ( x ) B ( x ) ϕ ( x ) d x . (64) \int_{0}^{L} B(x)\mathcal{A}_{0}\phi(x)\,\mathrm{d}x = (1+s)r_w\int_{0}^{L}\rho(x)B(x)\phi^{2}(x)\,\mathrm{d}x - sr_w\int_{0}^{L}\rho(x)B(x)\phi(x)\,\mathrm{d}x. \tag*{(64)} ∫ 0 L B ( x ) A 0 ϕ ( x ) d x = ( 1 + s ) r w ∫ 0 L ρ ( x ) B ( x ) ϕ 2 ( x ) d x − s r w ∫ 0 L ρ ( x ) B ( x ) ϕ ( x ) d x . (64)
Performing integrations by parts, and using the adjointness of A 0 \mathcal{A}_{0} A 0 and A 0 † \mathcal{A}_{0}^{\dagger} A 0 † together with the backward and forward boundary conditions, we obtain
∫ 0 L ϕ ( x ) A 0 † B ( x ) d x = ( 1 + s ) r w ∫ 0 L ρ ( x ) B ( x ) ϕ 2 ( x ) d x − s r w ∫ 0 L ρ ( x ) B ( x ) ϕ ( x ) d x . (65) \int_{0}^{L}\phi(x)\mathcal{A}_{0}^{\dagger}B(x)\,\mathrm{d}x = (1+s)r_w\int_{0}^{L}\rho(x)B(x)\phi^{2}(x)\,\mathrm{d}x - sr_w\int_{0}^{L}\rho(x)B(x)\phi(x)\,\mathrm{d}x. \tag*{(65)} ∫ 0 L ϕ ( x ) A 0 † B ( x ) d x = ( 1 + s ) r w ∫ 0 L ρ ( x ) B ( x ) ϕ 2 ( x ) d x − s r w ∫ 0 L ρ ( x ) B ( x ) ϕ ( x ) d x . (65)
As B B B satisfies A 0 † B ( x ) = 0 \mathcal{A}_{0}^{\dagger}B(x) = 0 A 0 † B ( x ) = 0 , the left-hand side of this equation vanishes, leading to
( 1 + s ) ∫ 0 L ρ ( x ) B ( x ) ϕ 2 ( x ) d x = s ∫ 0 L ρ ( x ) B ( x ) ϕ ( x ) d x (66) (1+s)\int_{0}^{L}\rho(x)B(x)\phi^{2}(x)\,\mathrm{d}x = s\int_{0}^{L}\rho(x)B(x)\phi(x)\,\mathrm{d}x \tag*{(66)} ( 1 + s ) ∫ 0 L ρ ( x ) B ( x ) ϕ 2 ( x ) d x = s ∫ 0 L ρ ( x ) B ( x ) ϕ ( x ) d x (66)
Dividing both sides by ∫ 0 L ρ ( x ) B ( x ) d x \int_{0}^{L} \rho(x)B(x)\,\mathrm{d}x ∫ 0 L ρ ( x ) B ( x ) d x , and recognizing division-event-weighted averages, we obtain:
( 1 + s ) ⟨ ϕ 2 ⟩ = s ⟨ ϕ ⟩ , (67) (1+s)\langle\phi^{2}\rangle=s\langle\phi\rangle, \tag*{(67)} ( 1 + s ) ⟨ ϕ 2 ⟩ = s ⟨ ϕ ⟩ , (67)
which gives
⟨ ϕ 2 ⟩ = s 1 + s ⟨ ϕ ⟩ . (68) \langle\phi^{2}\rangle=\frac{s}{1+s}\langle\phi\rangle. \tag*{(68)} ⟨ ϕ 2 ⟩ = 1 + s s ⟨ ϕ ⟩ . (68)
Let us consider the coefficient of variation of the fixation probability c v ( ϕ ) = ( ⟨ ϕ 2 ⟩ − ⟨ ϕ ⟩ 2 ) 1 / 2 / ⟨ ϕ ⟩ c_{\mathrm{v}}(\phi)=(\langle\phi^{2}\rangle-\langle\phi\rangle^{2})^{1/2}/\langle\phi\rangle c v ( ϕ ) = (⟨ ϕ 2 ⟩ − ⟨ ϕ ⟩ 2 ) 1/2 / ⟨ ϕ ⟩ . We have
⟨ ϕ 2 ⟩ = [ c v 2 ( ϕ ) + 1 ] ⟨ ϕ ⟩ 2 . (69) \langle\phi^{2}\rangle=[c_{\mathrm{v}}^{2}(\phi)+1]\langle\phi\rangle^{2}. \tag*{(69)} ⟨ ϕ 2 ⟩ = [ c v 2 ( ϕ ) + 1 ] ⟨ ϕ ⟩ 2 . (69)
Combining Eqs. (68) and (69) and using ⟨ ϕ ⟩ > 0 \langle\phi\rangle>0 ⟨ ϕ ⟩ > 0 (which holds for s > 0 s>0 s > 0 ) yields
⟨ ϕ ⟩ = s 1 + s 1 1 + c v 2 ( ϕ ) ≤ s 1 + s . (70) \langle\phi\rangle=\frac{s}{1+s}\frac{1}{1+c_{\mathrm{v}}^{2}(\phi)}\leq\frac{s}{1+s}. \tag*{(70)} ⟨ ϕ ⟩ = 1 + s s 1 + c v 2 ( ϕ ) 1 ≤ 1 + s s . (70)
Hence, the division-event-weighted average ⟨ ϕ ⟩ \langle\phi\rangle ⟨ ϕ ⟩ of the fixation probability cannot exceed the large-population limit of the Moran process, which constitutes the well-mixed reference. This generalizes our first-order result above, and shows that the spatial structure of the gut can only decrease the division-event-weighted average of the fixation probability of beneficial mutants. Note that Eq. (70) reduces to Eq. (62) to first order in s s s (as it should), as we then have ϕ ( x ) = s A f ( x ) + O ( s 2 ) \phi(x)=sAf(x)+O(s^{2}) ϕ ( x ) = s A f ( x ) + O ( s 2 ) (see Eq. (54) ), which yields c v 2 ( ϕ ) = c v 2 ( f ) + O ( s ) c_{\mathrm{v}}^{2}(\phi)=c_{\mathrm{v}}^{2}(f)+O(s) c v 2 ( ϕ ) = c v 2 ( f ) + O ( s ) .
Figure S2 shows that the division-event-weighted mutant fixation probability ⟨ ϕ ⟩ \langle\phi\rangle ⟨ ϕ ⟩ decreases as the Péclet number increases, and that this decrease is more pronounced for larger values of λ w = r w L 2 / D \lambda_{w}=r_{w}L^{2}/D λ w = r w L 2 / D . Indeed, spatial heterogeneities in the system, and in particular in mutant fate, increase as advection becomes dominant over diffusion (larger Pe) and as bacteria divide faster (larger λ w \lambda_{w} λ w ).
Figure S2. Division-event-weighted mutant fixation probability ⟨ ϕ ⟩ \langle\phi\rangle ⟨ ϕ ⟩ versus normalized Péclet number P e / P e max \mathrm{Pe}/\mathrm{Pe}_{\max} Pe / Pe m a x , for a mutant relative fitness advantage s = 0.1 s=0.1 s = 0.1 . Numerical solutions of the branching process Eq. (18) use either the steady-state mutant-free profile of the division rate ρ \rho ρ (“BP numerics”) or its step approximation (“BP step ρ \rho ρ ”). Note that the Moran model for large populations, which is the well-mixed reference, gives ⟨ ϕ ⟩ = s / ( 1 + s ) = 0.09 \langle\phi\rangle=s/(1+s)=0.09 ⟨ ϕ ⟩ = s / ( 1 + s ) = 0.09 for s = 0.1 s=0.1 s = 0.1 , which matches with the result obtained for small Pe here. Parameters: same k / F i n k/F_{\mathrm{in}} k / F in and α \alpha α as in main text Figure 1 , Figure 2 and Figure 3 .
Figure S3 shows a comparison between our predictions and the results of stochastic simulations for the mutant fixation probability ϕ ( x ) \phi(x) ϕ ( x ) of a mutant appearing at position x x x along the gut, as in main text Figure 2 , but including an additional variant for the calculation of the predictions. Specifically, our predictions are plotted using a numerical solution of Eq. (18) . This requires first computing the steady-state division rate profile ρ ( x ) = F ( x ) / [ k + F ( x ) ] \rho(x)=F(x)/[k+F(x)] ρ ( x ) = F ( x ) / [ k + F ( x )] in the absence of mutants. Here, we compute it two ways. The first one uses the food concentration profile F ( x ) F(x) F ( x ) determined by numerical integration of Eqs. (S1) and (S2) at steady state (see Section IV B for details), and is the same as in Figure 2 of the main text. The second one uses the expectation value E [ ρ ( x ) ] = E [ F ( x ) / ( k + F ( x ) ) ] \mathbb{E}[\rho(x)]=\mathbb{E}[F(x)/(k+F(x))] E [ ρ ( x )] = E [ F ( x ) / ( k + F ( x ))] of ρ ( x ) \rho(x) ρ ( x ) directly obtained from stochastic simulations. We observe in Figure S3 that these two estimates of the division rate profiles differ. This is due to the fluctuations from finite-size effects which exist in stochastic simulations but are not taken into account in the deterministic partial differential equation description. Note that in our stochastic simulations, the total number of bacteria is in the 1200–2400 range, see Section IV A. The discretization employed in stochastic simulations could also play a role in the observed discrepancy, but in practice, decreasing spatial and temporal discretization steps resulted in negligible changes here. We observe in Figure S3 that the predictions of fixation probability ϕ ( x ) \phi(x) ϕ ( x ) from Eq. (18) differ as a result of these differences in ρ ( x ) \rho(x) ρ ( x ) . Stochastic simulation results lie between these two cases. This suggests that the small but systematic discrepancies observed in main text Figure 2 between our predictions and the results of stochastic simulations can be attributed to finite-size effect fluctuations.
Figure S3. Mutant fixation probability ϕ ( X ) \phi(X) ϕ ( X ) versus normalized initial mutant position X = x / L X = x/L X = x / L along the gut, for different values of the mutant relative fitness advantage s s s . Stochastic simulations are described in Section IV A. Numerical solutions of the branching process Eq. (18) use either the steady-state mutant-free profile of the division rate ρ ( x ) \rho(x) ρ ( x ) from numerical integrations (“BP num. ρ \rho ρ ”) or the expectation value E [ ρ ( x ) ] = E [ F ( x ) / ( k + F ( x ) ) ] \mathbb{E}[\rho(x)] = \mathbb{E}[F(x)/(k + F(x))] E [ ρ ( x )] = E [ F ( x ) / ( k + F ( x ))] of ρ ( x ) \rho(x) ρ ( x ) from stochastic simulations (“BP num. E [ ρ ] \mathbb{E}[\rho] E [ ρ ] ”). The profiles of ρ \rho ρ and of E [ ρ ] \mathbb{E}[\rho] E [ ρ ] are shown as well. Parameter values: same as in main text Figure 1 and Figure 2 . Simulation results and pure numerical solutions (“BP num. ρ \rho ρ ”) are the same as in main text Figure 2 .
Mean number of descendant branches across successive generations
Mean number of first-generation offspring branches
Definition. Let us consider a single mutant bacterium starting at x x x , and track its divisions [45 ] . At each division, one daughter bacterium is considered as continuing the parental branch, while the other is considered as a new offspring branch. In this convention (reminiscent of a “spine decomposition” viewpoint in branching process theory [33 ] ), the number of division events along the parental branch is equal to the number of first-generation offspring branches it produces. Let us define the mean number R 1 ( x ) R_1(x) R 1 ( x ) of division events along the parental branch, before the tracked parental branch exits the system, as:
R 1 ( x ) = r m ∫ 0 + ∞ d t ∫ 0 L d y ρ ( y ) p ( y , t ∣ x ) , (71) R_1(x) = r_m \int_{0}^{+\infty} \mathrm{d}t \int_{0}^{L} \mathrm{d}y\, \rho(y)p(y,t|x), \tag*{(71)} R 1 ( x ) = r m ∫ 0 + ∞ d t ∫ 0 L d y ρ ( y ) p ( y , t ∣ x ) , (71)
where p ( y , t ∣ x ) p(y,t|x) p ( y , t ∣ x ) is the probability density for the tracked parental branch, initially located at x x x at time t = 0 t = 0 t = 0 , to be at position y y y at time t t t . In other words, the number R 1 ( x ) R_1(x) R 1 ( x ) is the expected integrated division rate along the tracked parental branch trajectory before it exits the system. As division does not change the position or transport dynamics of the bacterium continuing the parental branch, its position changes by transport alone. Hence, the probability density p ( y , t ∣ x ) p(y,t|x) p ( y , t ∣ x ) satisfies both the backward and forward Kolmogorov equations
∂ p ∂ t ( y , t ∣ x ) = L x p ( y , t ∣ x ) , ∂ p ∂ t ( y , t ∣ x ) = L y † p ( y , t ∣ x ) , (72) \frac{\partial p}{\partial t}(y,t|x) = \mathcal{L}_x p(y,t|x), \qquad\frac{\partial p}{\partial t}(y,t|x) = \mathcal{L}_y^\dagger p(y,t|x), \tag*{(72)} ∂ t ∂ p ( y , t ∣ x ) = L x p ( y , t ∣ x ) , ∂ t ∂ p ( y , t ∣ x ) = L y † p ( y , t ∣ x ) , (72)
with the associated backward and forward boundary conditions and the initial condition
p ( y , 0 ∣ x ) = δ ( y − x ) . (73) p(y,0|x) = \delta(y-x). \tag*{(73)} p ( y , 0∣ x ) = δ ( y − x ) . (73)
Note that trajectories that have already exited the system no longer contribute to p p p . Assuming that the parental branch eventually exits the system, we have p ( y , t ∣ x ) → 0 p(y,t|x) \to0 p ( y , t ∣ x ) → 0 for t → ∞ t \to\infty t → ∞ . Let us introduce the Green function G G G of the backward transport operator L x \mathcal{L}_x L x defined in Eq. (23) and acting on x x x . It satisfies
L x G ( y ∣ x ) = − δ ( x − y ) . (74) \mathcal{L}_x G(y|x) = -\delta(x-y). \tag*{(74)} L x G ( y ∣ x ) = − δ ( x − y ) . (74)
Since G ( y ∣ x ) G(y|x) G ( y ∣ x ) , seen as a function of x x x , is a backward observable of the same stochastic transport process as φ \varphi φ , it satisfies the same boundary conditions, namely
∂ x G ( y ∣ 0 ) = 0 , (75) \partial_x G(y|0) = 0, \tag*{(75)} ∂ x G ( y ∣0 ) = 0 , (75)
D ∂ x G ( y ∣ L ) + v G ( y ∣ L ) = 0. (76) D\partial_xG(y|L) + vG(y|L) = 0. \tag*{(76)} D ∂ x G ( y ∣ L ) + v G ( y ∣ L ) = 0. (76)
It can be expressed as
G ( y ∣ x ) = ∫ 0 + ∞ d t p ( y , t ∣ x ) . (77) G(y|x) = \int_0^{+\infty} \mathrm{d}t\,p(y,t|x). \tag*{(77)} G ( y ∣ x ) = ∫ 0 + ∞ d t p ( y , t ∣ x ) . (77)
Indeed, we have
L x ∫ 0 + ∞ d t p ( y , t ∣ x ) = ∫ 0 + ∞ d t L x p ( y , t ∣ x ) = ∫ 0 + ∞ d t ∂ p ∂ t ( y , t ∣ x ) = [ p ( y , t ∣ x ) ] 0 + ∞ = − δ ( x − y ) . (78) \mathcal{L}_x \int_0^{+\infty} \mathrm{d}t\,p(y,t|x) = \int_0^{+\infty} \mathrm{d}t\,\mathcal{L}_x p(y,t|x) = \int_0^{+\infty} \mathrm{d}t\,\frac{\partial p}{\partial t}(y,t|x) = [p(y,t|x)]_0^{+\infty} = -\delta(x-y). \tag*{(78)} L x ∫ 0 + ∞ d t p ( y , t ∣ x ) = ∫ 0 + ∞ d t L x p ( y , t ∣ x ) = ∫ 0 + ∞ d t ∂ t ∂ p ( y , t ∣ x ) = [ p ( y , t ∣ x ) ] 0 + ∞ = − δ ( x − y ) . (78)
Hence, Eq. (71) can be expressed as
R 1 ( x ) = r m ∫ 0 L d y ρ ( y ) G ( y ∣ x ) . (79) R_1(x) = r_m \int_0^L \mathrm{d}y\,\rho(y)G(y|x). \tag*{(79)} R 1 ( x ) = r m ∫ 0 L d y ρ ( y ) G ( y ∣ x ) . (79)
Furthermore, the Green function can be expressed explicitly as
G ( y ∣ x ) = { 1 v exp [ − v D ( x − y ) ] , x > y , 1 v , x < y . (80) G(y|x) =
\begin{cases}
\frac{1}{v}\exp\left[-\frac{v}{D}(x-y)\right], & x>y,\\
\frac{1}{v}, & x<y.
\end{cases} \tag*{(80)} G ( y ∣ x ) = { v 1 exp [ − D v ( x − y ) ] , v 1 , x > y , x < y . (80)
This yields
R 1 ( x ) = r m v [ ∫ 0 x d y ρ ( y ) e − v ( x − y ) / D + ∫ x L d y ρ ( y ) ] . (81) R_1(x) = \frac{r_m}{v}\left[\int_0^x \mathrm{d}y\,\rho(y)e^{-v(x-y)/D}+\int_x^L \mathrm{d}y\,\rho(y)\right]. \tag*{(81)} R 1 ( x ) = v r m [ ∫ 0 x d y ρ ( y ) e − v ( x − y ) / D + ∫ x L d y ρ ( y ) ] . (81)
Differential equation for R 1 R_1 R 1 . We observe that
L x R 1 ( x ) = r m ∫ 0 L d y ρ ( y ) L x G ( y ∣ x ) = − r m ∫ 0 L d y ρ ( y ) δ ( x − y ) = − r m ρ ( x ) . (82) \mathcal{L}_xR_1(x) = r_m\int_0^L \mathrm{d}y\,\rho(y)\mathcal{L}_xG(y|x) = -r_m\int_0^L \mathrm{d}y\,\rho(y)\delta(x-y) = -r_m\rho(x). \tag*{(82)} L x R 1 ( x ) = r m ∫ 0 L d y ρ ( y ) L x G ( y ∣ x ) = − r m ∫ 0 L d y ρ ( y ) δ ( x − y ) = − r m ρ ( x ) . (82)
Hence, R 1 R_1 R 1 satisfies the ordinary differential equation
L x R 1 ( x ) = D R 1 ′ ′ ( x ) + v R 1 ′ ( x ) = − r m ρ ( x ) . (83) \mathcal{L}_xR_1(x) = DR_1^{\prime\prime}(x) + vR_1^\prime(x) = -r_m\rho(x). \tag*{(83)} L x R 1 ( x ) = D R 1 ′′ ( x ) + v R 1 ′ ( x ) = − r m ρ ( x ) . (83)
In addition, the boundary conditions on G G G lead to
R 1 ′ ( 0 ) = 0 , (84) R_1^\prime(0) = 0, \tag*{(84)} R 1 ′ ( 0 ) = 0 , (84)
D R 1 ′ ( L ) + v R 1 ( L ) = 0. (85) DR_1^\prime(L) + vR_1(L) = 0. \tag*{(85)} D R 1 ′ ( L ) + v R 1 ( L ) = 0. (85)
Note that the solution can be expressed as
R 1 ( x ) = r m D ∫ x L d x ′ e − v x ′ / D ∫ 0 x ′ d y e v y / D ρ ( y ) + r m e − v L / D v ∫ 0 L d x ′ e v x ′ / D ρ ( x ′ ) , (86) R_1(x) = \frac{r_m}{D}\int_x^L \mathrm{d}x'\,e^{-vx'/D}\int_0^{x'}\mathrm{d}y\,e^{vy/D}\rho(y) + \frac{r_m e^{-vL/D}}{v}\int_0^L \mathrm{d}x'\,e^{vx'/D}\rho(x'), \tag*{(86)} R 1 ( x ) = D r m ∫ x L d x ′ e − v x ′ / D ∫ 0 x ′ d y e v y / D ρ ( y ) + v r m e − v L / D ∫ 0 L d x ′ e v x ′ / D ρ ( x ′ ) , (86)
which gives back Eq. (81) after integration by parts.
Alternative derivation of the differential equation for R 1 R_1 R 1 . One can also derive the bulk differential equation for R 1 ( x ) R_1(x) R 1 ( x ) using a similar first-step decomposition as for the differential equation for the fixation probability, see § 0.1 B. We focus on the infinitesimal time interval d t dt d t just after the tracked parental branch starts at position x x x , with 0 < x < L 0 < x < L 0 < x < L . During d t dt d t , either no division occurs, in which case its position changes according to the advective and diffusive transport in the gut, or a division event occurs. In the latter case, one daughter bacterium continues the parental branch, which still has an expected R 1 ( x ) R_1(x) R 1 ( x ) further division events after the one that just occurred, giving a contribution R 1 ( x ) + 1 R_1(x) + 1 R 1 ( x ) + 1 , and the spatial displacement only contributes at higher order. Note that subsequent divisions along the offspring branch and its descendants do not contribute to R 1 R_1 R 1 , since we specifically track the parental branch. Summing over these two possibilities yields
R 1 ( x ) = [ 1 − r m ρ ( x ) d t ] R 1 ( x + d X t ) ‾ + r m ρ ( x ) d t [ R 1 ( x ) + 1 ] + o ( d t ) , (87) R_1(x) = [1-r_m\rho(x)dt]\,\overline{R_1(x+dX_t)} + r_m\rho(x)dt[R_1(x)+1] + o(dt), \tag*{(87)} R 1 ( x ) = [ 1 − r m ρ ( x ) d t ] R 1 ( x + d X t ) + r m ρ ( x ) d t [ R 1 ( x ) + 1 ] + o ( d t ) , (87)
where the bar denotes the average over the stochastic increment d X t dX_t d X t introduced in Eq. (19) . Expanding to second order in d X t dX_t d X t and using d X t ‾ = v d t \overline{dX_t}=vdt d X t = v d t and ( d X t ) 2 ‾ = 2 D d t + o ( d t ) \overline{(dX_t)^2}=2Ddt+o(dt) ( d X t ) 2 = 2 D d t + o ( d t ) , we obtain
R 1 ( x + d X t ) ‾ = R 1 ( x ) + L x R 1 ( x ) d t + o ( d t ) , (88) \overline{R_1(x+dX_t)}=R_1(x)+\mathcal{L}_xR_1(x)dt+o(dt), \tag*{(88)} R 1 ( x + d X t ) = R 1 ( x ) + L x R 1 ( x ) d t + o ( d t ) , (88)
and we recover Eq. (83) :
L x R 1 ( x ) = − r m ρ ( x ) . (89) \mathcal{L}_xR_1(x)=-r_m\rho(x). \tag*{(89)} L x R 1 ( x ) = − r m ρ ( x ) . (89)
Comparison with the wild-type case. The mean number R 1 0 R_1^0 R 1 0 of division events along the tracked parental branch of a wild-type bacterium starting at x x x is given by Eq. (79) where r m r_m r m is replaced with r w r_w r w . Recall that r m = ( 1 + s ) r w r_m=(1+s)r_w r m = ( 1 + s ) r w where s s s is the relative mutant fitness advantage. Hence, we have
R 1 ( x ) = r m r w R 1 0 ( x ) = ( 1 + s ) R 1 0 ( x ) . (90) R_1(x)=\frac{r_m}{r_w}R_1^0(x)=(1+s)R_1^0(x). \tag*{(90)} R 1 ( x ) = r w r m R 1 0 ( x ) = ( 1 + s ) R 1 0 ( x ) . (90)
This relation between R 1 0 R_1^0 R 1 0 and R 1 R_1 R 1 shows that the parental branch of a mutant with relative fitness advantage s s s undergoes, on average, 1 + s 1+s 1 + s times as many division events as that of a wild-type starting from the same initial position x x x . This result is in good agreement with intuition, as the mutant and wild type experience the same transport process, but the mutant division rate is 1 + s 1+s 1 + s times larger than that of the wild-type everywhere.
Mean number of descendant branches across successive generations and reproductive value
Second generation. So far, we determined the mean number of first-generation offspring branches a tracked parental branch produces before it exits the system. Similarly, the mean number of second-generation descendant branches it produces can be expressed as
R 2 ( x ) = r m 2 ∫ 0 L d y 1 ∫ 0 L d y 2 ρ ( y 1 ) ρ ( y 2 ) G ( y 2 ∣ y 1 ) G ( y 1 ∣ x ) , (91) R_2(x)=r_m^2\int_0^L dy_1\int_0^L dy_2\rho(y_1)\rho(y_2)G(y_2\mid y_1)G(y_1\mid x), \tag*{(91)} R 2 ( x ) = r m 2 ∫ 0 L d y 1 ∫ 0 L d y 2 ρ ( y 1 ) ρ ( y 2 ) G ( y 2 ∣ y 1 ) G ( y 1 ∣ x ) , (91)
where we integrate over the position y 1 y_1 y 1 where a first-generation offspring branch is produced and over the subsequent trajectory of this branch and the positions y 2 y_2 y 2 of its division events, each of which produces a second-generation offspring branch. Here, each first-generation offspring branch is treated according to the parental-branch convention used for the calculation of R 1 R_1 R 1 . We have
L x R 2 ( x ) = r m 2 ∫ 0 L d y 1 ∫ 0 L d y 2 ρ ( y 1 ) ρ ( y 2 ) G ( y 2 ∣ y 1 ) L x G ( y 1 ∣ x ) = − r m 2 ∫ 0 L d y 1 ∫ 0 L d y 2 ρ ( y 1 ) ρ ( y 2 ) G ( y 2 ∣ y 1 ) δ ( y 1 − x ) = − r m 2 ρ ( x ) ∫ 0 L d y 2 ρ ( y 2 ) G ( y 2 ∣ x ) = − r m ρ ( x ) R 1 ( x ) . (92) \begin{aligned}
\mathcal{L}_xR_2(x)&=r_m^2\int_0^Ldy_1\int_0^Ldy_2\rho(y_1)\rho(y_2)G(y_2\mid y_1)\mathcal{L}_xG(y_1\mid x)\\
&=-r_m^2\int_0^Ldy_1\int_0^Ldy_2\rho(y_1)\rho(y_2)G(y_2\mid y_1)\delta(y_1-x)\\
&=-r_m^2\rho(x)\int_0^Ldy_2\rho(y_2)G(y_2\mid x)\\
&=-r_m\rho(x)R_1(x). \tag*{(92)}
\end{aligned} L x R 2 ( x ) = r m 2 ∫ 0 L d y 1 ∫ 0 L d y 2 ρ ( y 1 ) ρ ( y 2 ) G ( y 2 ∣ y 1 ) L x G ( y 1 ∣ x ) = − r m 2 ∫ 0 L d y 1 ∫ 0 L d y 2 ρ ( y 1 ) ρ ( y 2 ) G ( y 2 ∣ y 1 ) δ ( y 1 − x ) = − r m 2 ρ ( x ) ∫ 0 L d y 2 ρ ( y 2 ) G ( y 2 ∣ x ) = − r m ρ ( x ) R 1 ( x ) . (92)
Hence, R 2 R_2 R 2 satisfies
L x R 2 ( x ) = D R 2 ′ ′ ( x ) + v R 2 ′ ( x ) = − r m ρ ( x ) R 1 ( x ) , (93) \mathcal{L}_xR_2(x)=DR_2''(x)+vR_2'(x)=-r_m\rho(x)R_1(x), \tag*{(93)} L x R 2 ( x ) = D R 2 ′′ ( x ) + v R 2 ′ ( x ) = − r m ρ ( x ) R 1 ( x ) , (93)
and the boundary conditions in Eqs. (84) and (85) . In addition, we have
R 2 ( x ) = ( 1 + s ) 2 R 2 0 ( x ) , (94) R_2(x) = (1+s)^2 R^0_2(x), \tag*{(94)} R 2 ( x ) = ( 1 + s ) 2 R 2 0 ( x ) , (94)
where R 2 0 R^0_2 R 2 0 denotes the mean number of second-generation descendant branches of a wild-type.
Subsequent generations. The same calculation can be generalized to n ≥ 2 n \ge2 n ≥ 2 , yielding
L x R n ( x ) = D R n ′ ′ ( x ) + v R n ′ ( x ) = − r m ρ ( x ) R n − 1 ( x ) . (95) \mathcal{L}_x R_n(x) = D R_n^{\prime\prime}(x) + v R_n^{\prime}(x) = -r_m \rho(x) R_{n-1}(x). \tag*{(95)} L x R n ( x ) = D R n ′′ ( x ) + v R n ′ ( x ) = − r m ρ ( x ) R n − 1 ( x ) . (95)
Each R n R_n R n , being a backward observable of the same transport process, satisfies the same boundary conditions as R 1 R_1 R 1 , given in Eqs. (84) and (85) . In addition, we have
R n ( x ) = ( 1 + s ) n R n 0 ( x ) , (96) R_n(x) = (1+s)^n R^0_n(x), \tag*{(96)} R n ( x ) = ( 1 + s ) n R n 0 ( x ) , (96)
where R n 0 R^0_n R n 0 denotes the mean number of n n n -th-generation descendant branches of a wild-type. Indeed, each of the n n n successive generations of offspring branches contributes one factor r m / r w = 1 + s r_m/r_w = 1+s r m / r w = 1 + s , while mutant and wild type follow the same stochastic transport process.
Long-term limit. Let us first focus on the wild-type. Assuming convergence of R n 0 R^0_n R n 0 to a finite nonzero limit R ∞ 0 R^0_\infty R ∞ 0 , we obtain in the limit n → ∞ n \to\infty n → ∞
L x R ∞ 0 ( x ) = D [ R ∞ 0 ] ′ ′ ( x ) + v [ R ∞ 0 ] ′ ( x ) = − r w ρ ( x ) R ∞ 0 ( x ) , (97) \mathcal{L}_x R^0_\infty(x) = D[R^0_\infty]^{\prime\prime}(x) + v[R^0_\infty]^{\prime}(x) = -r_w \rho(x) R^0_\infty(x), \tag*{(97)} L x R ∞ 0 ( x ) = D [ R ∞ 0 ] ′′ ( x ) + v [ R ∞ 0 ] ′ ( x ) = − r w ρ ( x ) R ∞ 0 ( x ) , (97)
and R ∞ 0 R^0_\infty R ∞ 0 satisfies the same boundary conditions as R 1 0 R^0_1 R 1 0 and R 1 R_1 R 1 . We recognize Eqs. (52) , the differential equation for the first-order term ϕ 1 \phi_1 ϕ 1 of the fixation probability, as well as the associated boundary conditions. Hence, we have
R ∞ 0 ( x ) = A ∞ f ( x ) = A ∞ B ( x ) e − v x / D , (98) R^0_\infty(x) = A_\infty f(x) = A_\infty B(x)e^{-vx/D}, \tag*{(98)} R ∞ 0 ( x ) = A ∞ f ( x ) = A ∞ B ( x ) e − v x / D , (98)
where A ∞ A_\infty A ∞ is a constant. Combining Eqs. (96) and (98) , we obtain for n → ∞ n \to\infty n → ∞
R n ( x ) ∼ ( 1 + s ) n A ∞ B ( x ) e − v x / D . (99) R_n(x) \sim(1+s)^n A_\infty B(x)e^{-vx/D}. \tag*{(99)} R n ( x ) ∼ ( 1 + s ) n A ∞ B ( x ) e − v x / D . (99)
Hence, for n → ∞ n \to\infty n → ∞ :
If s < 0 s < 0 s < 0 , R n ( x ) → 0 R_n(x) \to0 R n ( x ) → 0 ;
If s = 0 s = 0 s = 0 , R n ( x ) → A ∞ B ( x ) e − v x / D R_n(x) \to A_\infty B(x)e^{-vx/D} R n ( x ) → A ∞ B ( x ) e − v x / D ;
If s > 0 s > 0 s > 0 , R n ( x ) → ∞ R_n(x) \to\infty R n ( x ) → ∞ ;
Note that we determine the value of the constant A ∞ A_\infty A ∞ in the next section, see Eq. (107) .
These results are consistent with our conclusion from § 0.1 D 1: the critical point is at s = 0 s = 0 s = 0 . Furthermore, the asymptotic long-term contribution R ∞ 0 ( x ) R^0_\infty(x) R ∞ 0 ( x ) of a neutral individual starting at position x x x to future generations can be interpreted as its reproductive value, and can be viewed as a continuous-space analog of the discrete-class reproductive value [34 ] . Note that the reproductive value notion is also used in evolutionary graph theory [35 ] . We showed that R ∞ 0 ( x ) ∝ f ( x ) R^0_\infty(x) \propto f(x) R ∞ 0 ( x ) ∝ f ( x ) , but also that, to first order in relative mutant selective advantage s s s , the fixation probability satisfies ϕ ( x ) ∝ f ( x ) \phi(x) \propto f(x) ϕ ( x ) ∝ f ( x ) , see Eq. (61) . Hence, the fixation probability of a mutant appearing at a given position along the gut is proportional to reproductive value. Such close relationships between fixation probability and reproductive value were evidenced in other contexts [36 ] .
The spatial profiles of R n 0 R^0_n R n 0 for n = 1 , 2 , 3 , 4 n = 1, 2, 3, 4 n = 1 , 2 , 3 , 4 and of R ∞ 0 R^0_\infty R ∞ 0 are shown in Figure S4 using the same parameter values as in the main text. We observe that R n 0 R^0_n R n 0 is strongly space-dependent, with large values upstream and very small ones downstream, illustrating the strong impact of initial position on the fate of a bacterium in the gut.
Figure S4. Mean number R n 0 R_n^0 R n 0 of descendant branches of a tracked wild-type (or neutral mutant) parental branch at the n n n -th generation versus normalized initial mutant position X = x / L X=x/L X = x / L along the gut, for different values of n n n . For finite n n n , we plot numerical solutions of Eq. (95) using either the steady-state mutant-free profile of the division rate ρ \rho ρ (“Numerical solution”) or its step approximation (“Analytical, step ρ \rho ρ ”). For n → + ∞ n\to+\infty n → + ∞ , we plot Eq. (98) using the steady-state wild-type profile B B B either from numerical integrations (“Numerical solution”) or from the analytical formula in Section II B in the step division rate case (“Analytical, step ρ \rho ρ ”). Parameter values: same as in main text Figs. 1 and 2.
Division-event-weighted average
Wild-type case. Let us consider the division-event-weighted average of the number R n 0 R_n^0 R n 0 of n n n -th-generation descendant branches of a wild-type parental branch (see Eq. (60) ):
⟨ R n 0 ⟩ = ∫ 0 L d x ρ ( x ) B ( x ) R n 0 ( x ) ∫ 0 L d x ρ ( x ) B ( x ) . (100) \langle R_n^0\rangle= \frac{\int_0^L \mathrm{d}x\,\rho(x)B(x)R_n^0(x)}{\int_0^L \mathrm{d}x\,\rho(x)B(x)}. \tag*{(100)} ⟨ R n 0 ⟩ = ∫ 0 L d x ρ ( x ) B ( x ) ∫ 0 L d x ρ ( x ) B ( x ) R n 0 ( x ) . (100)
This quantity is the mean number of n n n -th-generation descendant branches of a wild-type parental branch that appeared upon a random division event occurring in the stationary wild-type population. The starting position x x x which we integrate over is the position where the tracked wild-type branch was produced by a division event. We have L x R n 0 ( x ) = − r w ρ ( x ) R n − 1 0 ( x ) \mathcal{L}_xR_n^0(x)=-r_w\rho(x)R_{n-1}^0(x) L x R n 0 ( x ) = − r w ρ ( x ) R n − 1 0 ( x ) (see Eq. (95) in the wild-type case), while the stationary wild-type concentration B B B satisfies L x † B ( x ) = − r w ρ ( x ) B ( x ) \mathcal{L}_x^\dagger B(x)=-r_w\rho(x)B(x) L x † B ( x ) = − r w ρ ( x ) B ( x ) (see Eq. (S2)). Since L x \mathcal{L}_x L x and L x † \mathcal{L}_x^\dagger L x † are adjoint (including the corresponding boundary conditions), we have
∫ 0 L d x B ( x ) L x R n 0 ( x ) = ∫ 0 L d x R n 0 ( x ) L x † B ( x ) . (101) \int_0^L \mathrm{d}x\,B(x)\mathcal{L}_xR_n^0(x)=\int_0^L \mathrm{d}x\,R_n^0(x)\mathcal{L}_x^\dagger B(x). \tag*{(101)} ∫ 0 L d x B ( x ) L x R n 0 ( x ) = ∫ 0 L d x R n 0 ( x ) L x † B ( x ) . (101)
Using the two differential equations mentioned above yields
∫ 0 L d x ρ ( x ) B ( x ) R n − 1 0 ( x ) = ∫ 0 L d x ρ ( x ) B ( x ) R n 0 ( x ) . (102) \int_0^L \mathrm{d}x\,\rho(x)B(x)R_{n-1}^0(x)=\int_0^L \mathrm{d}x\,\rho(x)B(x)R_n^0(x). \tag*{(102)} ∫ 0 L d x ρ ( x ) B ( x ) R n − 1 0 ( x ) = ∫ 0 L d x ρ ( x ) B ( x ) R n 0 ( x ) . (102)
Iterating this identity gives
∫ 0 L d x ρ ( x ) B ( x ) R n 0 ( x ) = ∫ 0 L d x ρ ( x ) B ( x ) R 1 0 ( x ) . (103) \int_0^L \mathrm{d}x\,\rho(x)B(x)R_n^0(x)=\int_0^L \mathrm{d}x\,\rho(x)B(x)R_1^0(x). \tag*{(103)} ∫ 0 L d x ρ ( x ) B ( x ) R n 0 ( x ) = ∫ 0 L d x ρ ( x ) B ( x ) R 1 0 ( x ) . (103)
Furthermore, since L x R 1 0 ( x ) = − r w ρ ( x ) \mathcal{L}_xR_1^0(x)=-r_w\rho(x) L x R 1 0 ( x ) = − r w ρ ( x ) (see Eq. (83) in the wild-type case), and since ∫ 0 L d x B ( x ) L x R 1 0 ( x ) = ∫ 0 L d x R 1 0 ( x ) L x † B ( x ) \int_0^L\mathrm{d}x\,B(x)\mathcal{L}_xR_1^0(x)=\int_0^L\mathrm{d}x\,R_1^0(x)\mathcal{L}_x^\dagger B(x) ∫ 0 L d x B ( x ) L x R 1 0 ( x ) = ∫ 0 L d x R 1 0 ( x ) L x † B ( x ) , we have
∫ 0 L d x ρ ( x ) B ( x ) = ∫ 0 L d x ρ ( x ) B ( x ) R 1 0 ( x ) . (104) \int_0^L \mathrm{d}x\,\rho(x)B(x)=\int_0^L \mathrm{d}x\,\rho(x)B(x)R_1^0(x). \tag*{(104)} ∫ 0 L d x ρ ( x ) B ( x ) = ∫ 0 L d x ρ ( x ) B ( x ) R 1 0 ( x ) . (104)
Combining Eq. (103) and Eq. (104) yields
∫ 0 L d x ρ ( x ) B ( x ) R n 0 ( x ) = ∫ 0 L d x ρ ( x ) B ( x ) , (105) \int_0^L \mathrm{d}x\,\rho(x)B(x)R_n^0(x)=\int_0^L \mathrm{d}x\,\rho(x)B(x), \tag*{(105)} ∫ 0 L d x ρ ( x ) B ( x ) R n 0 ( x ) = ∫ 0 L d x ρ ( x ) B ( x ) , (105)
and hence
⟨ R n 0 ⟩ = ∫ 0 L d x ρ ( x ) B ( x ) R n 0 ( x ) ∫ 0 L d x ρ ( x ) B ( x ) = 1 , (106) \langle R_n^0\rangle= \frac{\int_0^L dx\,\rho(x)B(x)R_n^0(x)}{\int_0^L dx\,\rho(x)B(x)} = 1, \tag*{(106)} ⟨ R n 0 ⟩ = ∫ 0 L d x ρ ( x ) B ( x ) ∫ 0 L d x ρ ( x ) B ( x ) R n 0 ( x ) = 1 , (106)
for all n ≥ 1 n \ge1 n ≥ 1 . This result is consistent with intuition: at steady-state, a wild-type branch sampled at a random division event has, on average, one descendant branch at each subsequent generation, as the population does not grow or shrink.
Note that Eq. (106) allows us to determine the value of the constant A ∞ A_\infty A ∞ involved in Eqs. (S89) and (S90). Indeed, taking the limit of Eq. (106) when n → ∞ n \to\infty n → ∞ gives ⟨ R ∞ 0 ⟩ = 1 \langle R_\infty^0\rangle= 1 ⟨ R ∞ 0 ⟩ = 1 . Hence, A ∞ ⟨ f ⟩ = 1 A_\infty\langle f\rangle= 1 A ∞ ⟨ f ⟩ = 1 , and
A ∞ = 1 ⟨ f ⟩ , (107) A_\infty= \frac{1}{\langle f\rangle}, \tag*{(107)} A ∞ = ⟨ f ⟩ 1 , (107)
where f f f is defined in Eq. (49) as f ( x ) = B ( x ) e − v x / D f(x)=B(x)e^{-vx/D} f ( x ) = B ( x ) e − v x / D .
Mutant case. In the case of a mutant parental branch, since R n ( x ) = ( 1 + s ) n R n 0 ( x ) R_n(x)=(1+s)^nR_n^0(x) R n ( x ) = ( 1 + s ) n R n 0 ( x ) (see Eq. (96) ), we obtain
⟨ R n ⟩ = ( 1 + s ) n (108) \langle R_n\rangle= (1+s)^n \tag*{(108)} ⟨ R n ⟩ = ( 1 + s ) n (108)
for all n ≥ 1 n \ge1 n ≥ 1 .
Deterministic growth of the mutant concentration
Eigenvalue problem
Let us focus on the deterministic growth of the concentration of beneficial mutants with r m > r w r_m>r_w r m > r w in the system. We start from the bulk partial differential equation which describes the time evolution of the mutant concentration M ( x , t ) M(x,t) M ( x , t ) , namely Eq. (S3). We assume that mutants are sufficiently rare not to perturb the wild-type and food concentration profiles. Consequently, F ( x , t ) F(x,t) F ( x , t ) , and thus ρ ( x , t ) \rho(x,t) ρ ( x , t ) , are assumed to be time-independent and equal to their mutant-free stationary profiles, ρ ( x , t ) = ρ ( x ) \rho(x,t)=\rho(x) ρ ( x , t ) = ρ ( x ) , as in Sections I B, I D and I E. Looking for a separable solution of the form M ( x , t ) = g ( x ) h ( t ) M(x,t)=g(x)h(t) M ( x , t ) = g ( x ) h ( t ) for this equation gives
1 h ( t ) d h d t ( t ) = D g ′ ′ ( x ) g ( x ) − v g ′ ( x ) g ( x ) + r m ρ ( x ) = γ , (109) \frac{1}{h(t)}\frac{dh}{dt}(t)=D\frac{g''(x)}{g(x)}-v\frac{g'(x)}{g(x)}+r_m\rho(x)=\gamma, \tag*{(109)} h ( t ) 1 d t d h ( t ) = D g ( x ) g ′′ ( x ) − v g ( x ) g ′ ( x ) + r m ρ ( x ) = γ , (109)
where γ \gamma γ is a constant. Solving the differential equation for h h h yields
h ( t ) = h 0 e γ t , (110) h(t)=h_0e^{\gamma t}, \tag*{(110)} h ( t ) = h 0 e γ t , (110)
where h 0 h_0 h 0 is a constant.
Let us now consider the corresponding spatial differential equation, describing g g g :
D g ′ ′ ( x ) − v g ′ ( x ) + [ r m ρ ( x ) − γ ] g ( x ) = 0 , (111) Dg''(x)-vg'(x)+[r_m\rho(x)-\gamma]g(x)=0, \tag*{(111)} D g ′′ ( x ) − v g ′ ( x ) + [ r m ρ ( x ) − γ ] g ( x ) = 0 , (111)
with the forward boundary conditions given by Eqs. (S4) and (S5). Note that this is similar to Eqs. S122-S123 in Ref. [25 ] for constant D D D and v v v and zero death rate. Introducing the adjoint operator A s † A_s^\dagger A s † of A s A_s A s from Eq. (45) , namely
A s † = L x † + ( 1 + s ) r w ρ ( x ) , (112) A_s^\dagger=\mathcal{L}_x^\dagger+(1+s)r_w\rho(x), \tag*{(112)} A s † = L x † + ( 1 + s ) r w ρ ( x ) , (112)
where we wrote r m = ( 1 + s ) r w r_m=(1+s)r_w r m = ( 1 + s ) r w , and where L x † \mathcal{L}_x^\dagger L x † is the forward transport operator defined in Eq. (24) , Eq. (111) can be written as
A s † g = γ g . (113) A_s^\dagger g=\gamma g. \tag*{(113)} A s † g = γ g . (113)
Our goal is to solve this eigenvalue problem, i.e. to determine the eigenvalues γ \gamma γ of the operator A s † A_s^\dagger A s † . Indeed, each eigenvalue corresponds to a spatial mode whose amplitude evolves as e γ t e^{\gamma t} e γ t (see Eq. (110) ). In particular, the long-time deterministic behavior of the mutant concentration is controlled by the largest eigenvalue γ max \gamma_{\max} γ m a x .
Introducing y ( x ) = e − v x / ( 2 D ) g ( x ) y(x)=e^{-vx/(2D)}g(x) y ( x ) = e − v x / ( 2 D ) g ( x ) maps the eigenvalue problem in Eq. (113) with the forward boundary conditions in Eqs. (S4) and (S5) to the self-adjoint Sturm-Liouville problem introduced in Section I D 1, namely Eqs. (47) and (S39). Therefore, A s A_s A s and A s † A_s^\dagger A s † have the same spectrum, and in particular the same principal (largest) eigenvalue γ max \gamma_{\max} γ m a x . In addition, the principal eigenfunction of A s † A_s^\dagger A s † can be chosen positive, while every higher eigenfunction changes sign [32 ] . The transformation introduced here further shows that their eigenfunctions are related by q ( x ) ∝ g ( x ) e − v x / D q(x) \propto g(x)e^{-vx/D} q ( x ) ∝ g ( x ) e − v x / D , where q q q and g g g are the respective eigenfunctions of A s A_s A s and A s † A_s^\dagger A s † associated with the same eigenvalue.
Note that this is consistent with our earlier observation that A 0 f ( x ) = 0 A_0f(x)=0 A 0 f ( x ) = 0 while A 0 † B ( x ) = 0 A_0^\dagger B(x)=0 A 0 † B ( x ) = 0 with f ( x ) = B ( x ) e − v x / D f(x)=B(x)e^{-vx/D} f ( x ) = B ( x ) e − v x / D , see Eq. (49) .
Here, the largest admissible eigenvalue γ max \gamma_{\max} γ m a x will determine the mutant invasion growth rate (see Eq. (110) ). The value of γ max \gamma_{\max} γ m a x can be determined numerically, e.g. by discretizing the associated self-adjoint Sturm-Liouville operator and computing its lowest eigenvalue. Below, we further perform a perturbative expansion in the weak selection regime s ≪ 1 s \ll1 s ≪ 1 .
Weak selection regime
Neutral mutant case. For s = 0 s=0 s = 0 , the relevant forward operator is A 0 † = L x † + r w ρ ( x ) A_0^\dagger=\mathcal{L}_x^\dagger+r_w\rho(x) A 0 † = L x † + r w ρ ( x ) . Since the stationary wild-type concentration profile B ( x ) B(x) B ( x ) satisfies A 0 † B = 0 A_0^\dagger B=0 A 0 † B = 0 and the boundary conditions in Eqs. (S4) and (S5), it is an eigenfunction of the system in the neutral mutant case. Furthermore, since B ( x ) > 0 B(x)>0 B ( x ) > 0 for all x ∈ [ 0 , L ] x\in[0,L] x ∈ [ 0 , L ] , the corresponding transformed eigenfunction B ( x ) e − v x / ( 2 D ) B(x)e^{-vx/(2D)} B ( x ) e − v x / ( 2 D ) is positive as well. Thus, it is the principal Sturm-Liouville eigenfunction [32 ] . Hence, the principal eigenvalue is γ max = 0 \gamma_{\max}=0 γ m a x = 0 , with right eigenfunction B ( x ) B(x) B ( x ) . In the neutral case, the mutant concentration has zero invasion exponential growth rate, consistent with the result γ max = 0 \gamma_{\max}=0 γ m a x = 0 .
The adjoint operator is A 0 = L x + r w ρ ( x ) A_0=\mathcal{L}_x+r_w\rho(x) A 0 = L x + r w ρ ( x ) , where L x \mathcal{L}_x L x is the backward transport operator defined in Eq. (23) . The associated boundary conditions are given by Eqs. (42) and (S34). The corresponding left eigenfunction is f ( x ) = B ( x ) e − v x / D f(x)=B(x)e^{-vx/D} f ( x ) = B ( x ) e − v x / D , see Eq. (49) , as it satisfies A 0 f = 0 A_0f=0 A 0 f = 0 and the boundary conditions.
Perturbative expansion. Let us now determine γ max \gamma_{\max} γ m a x perturbatively for s ≪ 1 s\ll1 s ≪ 1 . Since
A s † = A 0 † + s r w ρ ( x ) , (114) A_s^\dagger=A_0^\dagger+s\,r_w\rho(x), \tag*{(114)} A s † = A 0 † + s r w ρ ( x ) , (114)
we expand the principal eigenfunction as
g ( x ) = B ( x ) + s g 1 ( x ) + O ( s 2 ) , (115) g(x)=B(x)+s g_1(x)+O(s^2), \tag*{(115)} g ( x ) = B ( x ) + s g 1 ( x ) + O ( s 2 ) , (115)
and the associated principal eigenvalue as
γ max = s γ 1 + O ( s 2 ) . (116) \gamma_{\max}=s\gamma_1+O(s^2). \tag*{(116)} γ m a x = s γ 1 + O ( s 2 ) . (116)
Substituting these expansions into Eq. (113) and identifying first-order terms in s s s gives
A 0 † g 1 ( x ) + r w ρ ( x ) B ( x ) = γ 1 B ( x ) . (117) A_0^\dagger g_1(x)+r_w\rho(x)B(x)=\gamma_1 B(x). \tag*{(117)} A 0 † g 1 ( x ) + r w ρ ( x ) B ( x ) = γ 1 B ( x ) . (117)
Multiplying both sides by f ( x ) f(x) f ( x ) and integrating between 0 0 0 and L L L gives
∫ 0 L f ( x ) A 0 † g 1 ( x ) d x + r w ∫ 0 L ρ ( x ) f ( x ) B ( x ) d x = γ 1 ∫ 0 L f ( x ) B ( x ) d x . (118) \int_0^L f(x)A_0^\dagger g_1(x)\,\mathrm{d}x+r_w\int_0^L \rho(x)f(x)B(x)\,\mathrm{d}x=\gamma_1\int_0^L f(x)B(x)\,\mathrm{d}x. \tag*{(118)} ∫ 0 L f ( x ) A 0 † g 1 ( x ) d x + r w ∫ 0 L ρ ( x ) f ( x ) B ( x ) d x = γ 1 ∫ 0 L f ( x ) B ( x ) d x . (118)
Since A 0 A_0 A 0 and A 0 † A_0^\dagger A 0 † are adjoint, this can be rewritten as
∫ 0 L g 1 ( x ) A 0 f ( x ) d x + r w ∫ 0 L ρ ( x ) f ( x ) B ( x ) d x = γ 1 ∫ 0 L f ( x ) B ( x ) d x . (119) \int_0^L g_1(x)A_0f(x)\,\mathrm{d}x+r_w\int_0^L \rho(x)f(x)B(x)\,\mathrm{d}x=\gamma_1\int_0^L f(x)B(x)\,\mathrm{d}x. \tag*{(119)} ∫ 0 L g 1 ( x ) A 0 f ( x ) d x + r w ∫ 0 L ρ ( x ) f ( x ) B ( x ) d x = γ 1 ∫ 0 L f ( x ) B ( x ) d x . (119)
Using A 0 f = 0 A_0f=0 A 0 f = 0 (as shown in the neutral case above), we obtain
γ 1 = r w ∫ 0 L ρ ( x ) f ( x ) B ( x ) d x ∫ 0 L f ( x ) B ( x ) d x . (120) \gamma_1=r_w\frac{\int_0^L \rho(x)f(x)B(x)\,\mathrm{d}x}{\int_0^L f(x)B(x)\,\mathrm{d}x}. \tag*{(120)} γ 1 = r w ∫ 0 L f ( x ) B ( x ) d x ∫ 0 L ρ ( x ) f ( x ) B ( x ) d x . (120)
This provides the first-order expansion of the principal eigenvalue γ max \gamma_{\max} γ m a x for s ≪ 1 s \ll1 s ≪ 1 (including the moderate-selection regime discussed above):
γ max = s r w ∫ 0 L ρ ( x ) f ( x ) B ( x ) d x ∫ 0 L f ( x ) B ( x ) d x + O ( s 2 ) . (121) \gamma_{\max}=s r_w\frac{\int_0^L \rho(x)f(x)B(x)\,\mathrm{d}x}{\int_0^L f(x)B(x)\,\mathrm{d}x}+O(s^2). \tag*{(121)} γ m a x = s r w ∫ 0 L f ( x ) B ( x ) d x ∫ 0 L ρ ( x ) f ( x ) B ( x ) d x + O ( s 2 ) . (121)
We observe that γ max > 0 \gamma_{\max}>0 γ m a x > 0 to leading order in the present case of a beneficial mutant (s > 0 s>0 s > 0 ). This principal eigenvalue γ max \gamma_{\max} γ m a x gives the deterministic invasion growth rate of the mutant concentration in the system. Note that an equivalent expression was obtained for the mutant invasion growth rate in Ref. [25 ] to first order in s s s , see their Eq. S126 (see Section III for a comparison between our study and Ref. [25 ] ).
Eq. (121) can be interpreted as follows: The absolute mutant division-rate advantage over wild-types is s r w ρ ( x ) s r_w\rho(x) s r w ρ ( x ) at position x x x . To first order in s s s , the exponential growth rate of the overall mutant population is obtained by averaging this quantity spatially, weighting each position x x x by its long-term contribution to the future population, which is proportional to f ( x ) B ( x ) f(x)B(x) f ( x ) B ( x ) , i.e. to the reproductive value at x x x times the bacterial concentration at x x x . Qualitatively, although bacteria located downstream are numerous, they have a larger probability of exiting the system before contributing to the future population, hence the need to weight with reproductive value and not only with bacterial concentration.
Comparison with the well-mixed case. In the case of a well-mixed population where wild-types divide at rate r w r_w r w and mutants at rate r m = ( 1 + s ) r w r_m=(1+s)r_w r m = ( 1 + s ) r w , corresponding to the maximal division rates in the gut, the mutant to wild type ratio grows at rate r m − r w = s r w r_m-r_w=s r_w r m − r w = s r w (whether the well-mixed population exponentially grows or undergoes dilutions maintaining it at a steady state size). In other words, the invasion growth rate is s r w s r_w s r w . Since ρ ( x ) ≤ 1 \rho(x)\leq1 ρ ( x ) ≤ 1 for all x ∈ [ 0 , L ] x\in[0,L] x ∈ [ 0 , L ] , we have ∫ 0 L ρ ( x ) f ( x ) B ( x ) d x ≤ ∫ 0 L f ( x ) B ( x ) d x \int_0^L\rho(x)f(x)B(x)\,\mathrm{d}x\leq\int_0^L f(x)B(x)\,\mathrm{d}x ∫ 0 L ρ ( x ) f ( x ) B ( x ) d x ≤ ∫ 0 L f ( x ) B ( x ) d x . Hence, Eq. (121) shows that, to first order in s s s , γ max ≤ s r w \gamma_{\max}\leq s r_w γ m a x ≤ s r w : invasion is slower in the gut than in this maximally dividing well-mixed population. Note that the limit γ max → s r w \gamma_{\max}\to s r_w γ m a x → s r w is approached as P e → P e max \mathrm{Pe}\to\mathrm{Pe}_{\max} Pe → Pe m a x for k ≪ F i n k\ll F_{\mathrm{in}} k ≪ F in , since all bacteria divide at a rate close to the maximal one at washout.
However, this comparison is not the most relevant one, since it compares the population in the gut to a well-mixed population where all bacteria divide at the maximal rate. Let us consider a well-mixed population with the same mean per-capita division rate as in the gut. In this reference well-mixed population, the wild-type division rate is
r ~ w = r w ∫ 0 L ρ ( x ) B ( x ) d x ∫ 0 L B ( x ) d x , (122) \widetilde{r}_w=r_w\frac{\int_0^L\rho(x)B(x)\,\mathrm{d}x}{\int_0^L B(x)\,\mathrm{d}x}, \tag*{(122)} r w = r w ∫ 0 L B ( x ) d x ∫ 0 L ρ ( x ) B ( x ) d x , (122)
and the mutant division rate is r ~ m = ( 1 + s ) r ~ w \widetilde{r}_m=(1+s)\widetilde{r}_w r m = ( 1 + s ) r w . Hence, the mutant invasion growth rate is
γ W M = s r ~ w = s r w ∫ 0 L ρ ( x ) B ( x ) d x ∫ 0 L B ( x ) d x . (123) \gamma_{\mathrm{WM}}=s\widetilde{r}_w=s r_w\frac{\int_0^L\rho(x)B(x)\,\mathrm{d}x}{\int_0^L B(x)\,\mathrm{d}x}. \tag*{(123)} γ WM = s r w = s r w ∫ 0 L B ( x ) d x ∫ 0 L ρ ( x ) B ( x ) d x . (123)
Let us now compare γ max \gamma_{\max} γ m a x in Eq. (121) with γ W M \gamma_{\mathrm{WM}} γ WM in Eq. (123) . We remark that in our system, food concentration decreases along the gut, leading to a decreasing division rate profile ρ \rho ρ with x x x . Furthermore, f f f also decreases with x x x . Indeed, recalling that f ( x ) = B ( x ) e − v x / D f(x)=B(x)e^{-vx/D} f ( x ) = B ( x ) e − v x / D , we have
f ′ ( x ) = − 1 D [ v B ( x ) − D B ′ ( x ) ] e − v x / D . (124) f'(x)=-\frac{1}{D}\left[vB(x)-DB'(x)\right]e^{-vx/D}. \tag*{(124)} f ′ ( x ) = − D 1 [ v B ( x ) − D B ′ ( x ) ] e − v x / D . (124)
In this expression, we recognize the net downstream flux of wild-type bacteria between the square brackets. This quantity is nonnegative, thus showing that f ′ ( x ) ≤ 0 f'(x)\leq0 f ′ ( x ) ≤ 0 for x ∈ [ 0 , L ] x\in[0,L] x ∈ [ 0 , L ] . Since both ρ \rho ρ and f f f decrease with x x x , their covariance is nonnegative. Defining the average over wild-type bacteria of a function g g g as
⟨ g ⟩ B = ∫ 0 L g ( x ) B ( x ) d x ∫ 0 L B ( x ) d x , (125) \langle g\rangle_B=\frac{\int_0^L g(x)B(x)\,\mathrm{d}x}{\int_0^L B(x)\,\mathrm{d}x}, \tag*{(125)} ⟨ g ⟩ B = ∫ 0 L B ( x ) d x ∫ 0 L g ( x ) B ( x ) d x , (125)
this leads to
⟨ ρ f ⟩ B ≥ ⟨ ρ ⟩ B ⟨ f ⟩ B i.e. ∫ 0 L ρ ( x ) f ( x ) B ( x ) d x ∫ 0 L f ( x ) B ( x ) d x ≥ ∫ 0 L ρ ( x ) B ( x ) d x ∫ 0 L B ( x ) d x , (126) \langle\rho f\rangle_B\geq\langle\rho\rangle_B\langle f\rangle_B
\quad\text{i.e.}\quad
\frac{\int_0^L\rho(x)f(x)B(x)\,\mathrm{d}x}{\int_0^L f(x)B(x)\,\mathrm{d}x}
\geq
\frac{\int_0^L\rho(x)B(x)\,\mathrm{d}x}{\int_0^L B(x)\,\mathrm{d}x}, \tag*{(126)} ⟨ ρ f ⟩ B ≥ ⟨ ρ ⟩ B ⟨ f ⟩ B i.e. ∫ 0 L f ( x ) B ( x ) d x ∫ 0 L ρ ( x ) f ( x ) B ( x ) d x ≥ ∫ 0 L B ( x ) d x ∫ 0 L ρ ( x ) B ( x ) d x , (126)
which shows that γ max ≥ γ W M \gamma_{\max}\geq\gamma_{\mathrm{WM}} γ m a x ≥ γ WM to first order in s s s . Hence, to first order in s s s , mutant invasion is accelerated in the gut compared to the reference well-mixed population with the same average division rate.
Beyond weak selection
Let us now compare the mutant invasion growth rate in the gut and in the well-mixed population with same mean per-capita division rate, beyond weak selection. Recall that the eigenvalue problem A s † g = γ g A_s^\dagger g = \gamma g A s † g = γ g (i.e., Eq. (113) ) can be mapped, by introducing y ( x ) = e − v x / ( 2 D ) g ( x ) y(x) = e^{-vx/(2D)}g(x) y ( x ) = e − v x / ( 2 D ) g ( x ) , onto the self-adjoint Sturm-Liouville problem
H s y ( x ) = − γ y ( x ) , with H s y ( x ) = − D y ′ ′ ( x ) + [ v 2 4 D − ( 1 + s ) r w ρ ( x ) ] y ( x ) , (127) H_s y(x) = -\gamma y(x), \qquad\text{with} \qquad H_s y(x) = -D y''(x) + \left[\frac{v^2}{4D} - (1+s)r_w\rho(x)\right]y(x), \tag*{(127)} H s y ( x ) = − γ y ( x ) , with H s y ( x ) = − D y ′′ ( x ) + [ 4 D v 2 − ( 1 + s ) r w ρ ( x ) ] y ( x ) , (127)
and with boundary conditions
y ′ ( 0 ) = v 2 D y ( 0 ) , y ′ ( L ) = − v 2 D y ( L ) , (128) y'(0) = \frac{v}{2D}y(0), \qquad y'(L) = -\frac{v}{2D}y(L), \tag*{(128)} y ′ ( 0 ) = 2 D v y ( 0 ) , y ′ ( L ) = − 2 D v y ( L ) , (128)
see § 0.1 F 1. For any nonzero sufficiently regular function y y y on [ 0 , L ] [0,L] [ 0 , L ] satisfying Eq. (128) , let us consider the Rayleigh quotient
R s [ y ] = ∫ 0 L y ( x ) H s y ( x ) d x ∫ 0 L y 2 ( x ) d x . (129) \mathcal{R}_s[y] = \frac{\int_0^L y(x)H_s y(x)\,\mathrm{d}x}{\int_0^L y^2(x)\,\mathrm{d}x}. \tag*{(129)} R s [ y ] = ∫ 0 L y 2 ( x ) d x ∫ 0 L y ( x ) H s y ( x ) d x . (129)
The smallest eigenvalue of this Sturm-Liouville problem, namely − γ max -\gamma_{\max} − γ m a x , satisfies [32 ]
− γ max = min y ≠ 0 R s [ y ] . (130) -\gamma_{\max} = \min_{y\ne0}\mathcal{R}_s[y]. \tag*{(130)} − γ m a x = y = 0 min R s [ y ] . (130)
We have
∫ 0 L y ( x ) H s y ( x ) d x = D ∫ 0 L [ y ′ ( x ) ] 2 d x + ∫ 0 L [ v 2 4 D − r w ρ ( x ) ] y 2 ( x ) d x + v 2 [ y 2 ( 0 ) + y 2 ( L ) ] − s r w ∫ 0 L ρ ( x ) y 2 ( x ) d x , (131) \int_0^L y(x)H_s y(x)\,\mathrm{d}x = D\int_0^L [y'(x)]^2\,\mathrm{d}x + \int_0^L\left[\frac{v^2}{4D}-r_w\rho(x)\right]y^2(x)\,\mathrm{d}x + \frac{v}{2}[y^2(0)+y^2(L)] - sr_w\int_0^L \rho(x)y^2(x)\,\mathrm{d}x, \tag*{(131)} ∫ 0 L y ( x ) H s y ( x ) d x = D ∫ 0 L [ y ′ ( x ) ] 2 d x + ∫ 0 L [ 4 D v 2 − r w ρ ( x ) ] y 2 ( x ) d x + 2 v [ y 2 ( 0 ) + y 2 ( L )] − s r w ∫ 0 L ρ ( x ) y 2 ( x ) d x , (131)
which allows us to write
R s [ y ] = b [ y ] + s a [ y ] , (132) \mathcal{R}_s[y] = b[y] + s\,a[y], \tag*{(132)} R s [ y ] = b [ y ] + s a [ y ] , (132)
where a a a and b b b are independent of s s s . Hence,
γ max = − min y ≠ 0 { b [ y ] + s a [ y ] } . (133) \gamma_{\max} = -\min_{y\ne0}\{b[y] + s\,a[y]\}. \tag*{(133)} γ m a x = − y = 0 min { b [ y ] + s a [ y ]} . (133)
Since the pointwise minimum of affine functions is concave, γ max \gamma_{\max} γ m a x is a convex function of s s s . For s = 0 s=0 s = 0 , we have γ max = 0 \gamma_{\max}=0 γ m a x = 0 (see § 0.1 D 1). Convexity thus implies, for s > 0 s>0 s > 0 ,
γ max ( s ) ≥ γ max ( 0 ) + s γ max ′ ( 0 ) = s γ max ′ ( 0 ) . (134) \gamma_{\max}(s) \ge\gamma_{\max}(0) + s\gamma'_{\max}(0) = s\gamma'_{\max}(0). \tag*{(134)} γ m a x ( s ) ≥ γ m a x ( 0 ) + s γ m a x ′ ( 0 ) = s γ m a x ′ ( 0 ) . (134)
Besides, Eq. (121) yields
γ max ′ ( 0 ) = r w ∫ 0 L ρ ( x ) f ( x ) B ( x ) d x ∫ 0 L f ( x ) B ( x ) d x . (135) \gamma'_{\max}(0) = r_w\frac{\int_0^L \rho(x)f(x)B(x)\,\mathrm{d}x}{\int_0^L f(x)B(x)\,\mathrm{d}x}. \tag*{(135)} γ m a x ′ ( 0 ) = r w ∫ 0 L f ( x ) B ( x ) d x ∫ 0 L ρ ( x ) f ( x ) B ( x ) d x . (135)
Eq. (126) can thus be rewritten as
γ max ′ ( 0 ) ≥ γ W M ( s ) s , (136) \gamma'_{\max}(0) \ge\frac{\gamma_{\mathrm{WM}}(s)}{s}, \tag*{(136)} γ m a x ′ ( 0 ) ≥ s γ WM ( s ) , (136)
where the well-mixed mutant invasion growth rate is given by Eq. (123) . Combining Eqs. (134) and (136) yields
γ max ( s ) ≥ γ W M ( s ) , (137) \gamma_{\max}(s) \ge\gamma_{\mathrm{WM}}(s), \tag*{(137)} γ m a x ( s ) ≥ γ WM ( s ) , (137)
for all s > 0 s>0 s > 0 . Hence, for all s > 0 s>0 s > 0 , mutant invasion is accelerated in the gut compared to the reference well-mixed population with the same average division rate.
Figure S5 shows the division-event-weighted mutant fixation probability ⟨ ϕ ⟩ \langle\phi\rangle ⟨ ϕ ⟩ versus the rescaled mutant invasion growth rate γ max / r w \gamma_{\max}/r_w γ m a x / r w . We observe in Figure S5 that when varying the Péclet number P e \mathrm{Pe} Pe at fixed mutant relative fitness advantage s s s , ⟨ ϕ ⟩ \langle\phi\rangle ⟨ ϕ ⟩ decreases as γ max / r w \gamma_{\max}/r_w γ m a x / r w increases. This is due to the fact that ⟨ ϕ ⟩ \langle\phi\rangle ⟨ ϕ ⟩ decreases as P e \mathrm{Pe} Pe increases, while γ max / r w \gamma_{\max}/r_w γ m a x / r w increases as P e \mathrm{Pe} Pe increases, see main text, in particular Figure 4 there.
Figure S5. Division-event-weighted mutant fixation probability ⟨ ϕ ⟩ \langle\phi\rangle ⟨ ϕ ⟩ versus rescaled mutant invasion growth rate γ max / r w \gamma_{\max}/r_w γ m a x / r w . In panel (a), the normalized Péclet number P e / P e max \mathrm{Pe}/\mathrm{Pe}_{\max} Pe / Pe m a x is varied between 0.5 and 0.97 while holding fixed the mutant relative fitness advantages s s s . In panel (b), s s s is varied between 0 and 1 while holding fixed P e / P e max \mathrm{Pe}/\mathrm{Pe}_{\max} Pe / Pe m a x . Numerical solutions of the branching process Eq. (18) using the steady-state mutant-free profile of the division rate ρ \rho ρ (“ρ = F / [ k + F ] \rho= F/[k+F] ρ = F / [ k + F ] ” or its step approximation (“Step ρ \rho ρ ”) are used to obtain ⟨ ϕ ⟩ \langle\phi\rangle ⟨ ϕ ⟩ . The principal eigenvalue γ max \gamma_{\max} γ m a x of the operator A s † A_s^{\dagger} A s † is determined numerically in both cases. Parameters: same λ w \lambda_w λ w (and P e max \mathrm{Pe}_{\max} Pe m a x ), k / F i n k/F_{\mathrm{in}} k / F in and α \alpha α as in main text Figure 1 , Figure 2 and Figure 3 .
Fixation probability of a neutral mutant and active population size
Within the branching process approximation, the fixation probability of a neutral mutant vanishes (see § 0.1 D 1). Let us now focus specifically on this fixation probability, which is nonzero in finite populations, and express it in the gut model considered here. Ref. [24 ] showed that it is well-approximated by 1 / N a c t i v e 1/N_{\mathrm{active}} 1/ N active , where N a c t i v e N_{\mathrm{active}} N active is the number of actively dividing bacteria. In practice, in cases where the profiles of food and bacteria feature strong heterogeneity, with [ F ( 0 ) − F ( L ) ] / F i n ≳ 0.9 [F(0)-F(L)]/F_{\mathrm{in}} \gtrsim0.9 [ F ( 0 ) − F ( L )] / F in ≳ 0.9 , and where the division rate profile is close to a step, with k ≪ F i n k \ll F_{\mathrm{in}} k ≪ F in , N a c t i v e N_{\mathrm{active}} N active can be estimated by counting the bacteria whose division rate is larger than half its maximum value in the system. Then, Ref. [25 ] proposed a more detailed calculation of the fixation probability of a neutral mutant. Here, our focus is on beneficial mutants, but we nevertheless revisit the case of neutral mutants for completeness.
Let us consider a single neutral mutant (with s = 0 s=0 s = 0 ) appearing at x 0 x_0 x 0 in the stationary wild-type population. For simplicity, let us assume that a neutral mutant replaces an existing wild-type bacterium, thus not affecting the population state. In the neutral mutant case, the division rate profile remains equal to its stationary value ρ ( x ) \rho(x) ρ ( x ) , apart from fluctuations, even when the mutant lineage is no longer rare. Let m ( x , t ) m(x,t) m ( x , t ) denote the concentration of descendants of the initial mutant located at x 0 x_0 x 0 . Note that it is a linear concentration, like B ( x , t ) B(x,t) B ( x , t ) , M ( x , t ) M(x,t) M ( x , t ) and F ( x , t ) F(x,t) F ( x , t ) (see § 0.1 A). In the deterministic limit, m ( x , t ) m(x,t) m ( x , t ) satisfies (see Eq. (S3))
∂ m ∂ t ( x , t ) = A 0 † m ( x , t ) , m ( x , 0 ) = δ ( x − x 0 ) , (138) \frac{\partial m}{\partial t}(x,t)=A_0^{\dagger}m(x,t), \qquad m(x,0)=\delta(x-x_0), \tag*{(138)} ∂ t ∂ m ( x , t ) = A 0 † m ( x , t ) , m ( x , 0 ) = δ ( x − x 0 ) , (138)
with the forward boundary conditions in Eqs. (S4) and (S5), where A 0 † A_0^\dagger A 0 † is defined in Eq. (56) . Since A 0 A_0 A 0 and A 0 † A_0^\dagger A 0 † are adjoint, and since A 0 f = 0 A_0f=0 A 0 f = 0 (see Eq. (50) ), we have
d d t ∫ 0 L d x f ( x ) m ( x , t ) = ∫ 0 L d x f ( x ) ∂ m ∂ t ( x , t ) = ∫ 0 L d x f ( x ) A 0 † m ( x , t ) = ∫ 0 L d x m ( x , t ) A 0 f ( x ) = 0. (139) \frac{\mathrm{d}}{\mathrm{d}t}\int_0^L \mathrm{d}x\,f(x)m(x,t)=\int_0^L \mathrm{d}x\,f(x)\frac{\partial m}{\partial t}(x,t)=\int_0^L \mathrm{d}x\,f(x)A_0^\dagger m(x,t)=\int_0^L \mathrm{d}x\,m(x,t)A_0f(x)=0. \tag*{(139)} d t d ∫ 0 L d x f ( x ) m ( x , t ) = ∫ 0 L d x f ( x ) ∂ t ∂ m ( x , t ) = ∫ 0 L d x f ( x ) A 0 † m ( x , t ) = ∫ 0 L d x m ( x , t ) A 0 f ( x ) = 0. (139)
This entails that
∫ 0 L f ( x ) m ( x , t ) d x = ∫ 0 L f ( x ) m ( x , 0 ) d x = f ( x 0 ) , (140) \int_0^L f(x)m(x,t)\,\mathrm{d}x=\int_0^L f(x)m(x,0)\,\mathrm{d}x=f(x_0), \tag*{(140)} ∫ 0 L f ( x ) m ( x , t ) d x = ∫ 0 L f ( x ) m ( x , 0 ) d x = f ( x 0 ) , (140)
at all times t ≥ 0 t\ge0 t ≥ 0 . In addition, we saw in § 0.1 F 1 that the principal (largest) eigenvalue of A 0 † A_0^\dagger A 0 † is 0, and that it is simple and associated with the eigenfunction B B B . Thus, at long times, the profile of m m m tends towards that of B B B : there exists a constant C C C such that m ( x , t → ∞ ) ∼ C B ( x ) m(x,t\to\infty)\sim C B(x) m ( x , t → ∞ ) ∼ C B ( x ) . The long-time limit of the conservation law in Eq. (140) yields
m ( x , t → ∞ ) ∼ C B ( x ) with C = f ( x 0 ) ∫ 0 L f ( x ) B ( x ) d x . (141) m(x,t\to\infty)\sim C B(x)\quad\text{with}\quad C=\frac{f(x_0)}{\int_0^L f(x)B(x)\,\mathrm{d}x}. \tag*{(141)} m ( x , t → ∞ ) ∼ C B ( x ) with C = ∫ 0 L f ( x ) B ( x ) d x f ( x 0 ) . (141)
This shows that in the long term, the descendants of the initial mutant constitute a fraction C C C of the population, distributed along the gut as the wild type, and that this fraction is proportional to the reproductive value f ( x 0 ) f(x_0) f ( x 0 ) associated with the mutant initial position x 0 x_0 x 0 (see § 0.1 E 2).
In the neutral case, mutants behave exactly like wild-types and do not modify the steady-state of the system (neglecting fluctuations). Thus, the expectation of mutant concentration over stochastic realizations obeys the same linear equation as the deterministic large-size limit m ( x , t ) m(x,t) m ( x , t ) , namely Eq. (138) , with the same initial and boundary conditions. Hence, they coincide. In addition, in a stochastic description, each realization eventually ends with a mutant frequency of either 0 (extinction) or 1 (fixation). Therefore, we can interpret the expected final mutant frequency C C C as the fixation probability ϕ 0 ( x 0 ) \phi_0(x_0) ϕ 0 ( x 0 ) of a neutral mutant starting at position x 0 x_0 x 0 :
ϕ 0 ( x 0 ) = f ( x 0 ) ∫ 0 L f ( x ) B ( x ) d x . (142) \phi_0(x_0)=\frac{f(x_0)}{\int_0^L f(x)B(x)\,\mathrm{d}x}. \tag*{(142)} ϕ 0 ( x 0 ) = ∫ 0 L f ( x ) B ( x ) d x f ( x 0 ) . (142)
Hence, the fixation probability of a neutral mutant is proportional to reproductive value, see also Ref. [25 ] . Averaging over the positions of division events, where mutants appear, i.e. calculating the division-event-weighted average, gives
⟨ ϕ 0 ⟩ = ⟨ f ⟩ ∫ 0 L f ( x ) B ( x ) d x = 1 N a c t i v e , with N a c t i v e = ∫ 0 L f ( x ) B ( x ) d x ⟨ f ⟩ . (143) \langle\phi_0\rangle=\frac{\langle f\rangle}{\int_0^L f(x)B(x)\,\mathrm{d}x}=\frac{1}{N_{\mathrm{active}}},\quad\text{with}\quad N_{\mathrm{active}}=\frac{\int_0^L f(x)B(x)\,\mathrm{d}x}{\langle f\rangle}. \tag*{(143)} ⟨ ϕ 0 ⟩ = ∫ 0 L f ( x ) B ( x ) d x ⟨ f ⟩ = N active 1 , with N active = ⟨ f ⟩ ∫ 0 L f ( x ) B ( x ) d x . (143)
Note that this result is valid to leading order in 1 / N a c t i v e 1/N_{\mathrm{active}} 1/ N active , since fluctuations of the population and food profiles are neglected.
If f f f is uniform, the active population size N a c t i v e N_{\mathrm{active}} N active reduces to the total population size N = ∫ 0 L B ( x ) d x N=\int_0^L B(x)\,\mathrm{d}x N = ∫ 0 L B ( x ) d x . If f f f is uniform over the region where bacteria divide and negligible elsewhere, N a c t i v e N_{\mathrm{active}} N active is the number of bacteria in that region, thus matching the active population introduced heuristically in Ref. [24 ] . Furthermore, Eq. (142) coincides with the neutral fixation probability derived in Ref. [25 ] (see their Eqs. 6 and 8, for constant D D D and v v v ). Note that in Ref. [25 ] , f B fB f B is interpreted as the distribution of future common ancestors, following Ref. [30 ] . Indeed, in the neutral case, the probability density that a randomly chosen bacterium in the distant future descends from one that is now at x 0 x_0 x 0 is given by B ( x 0 ) ϕ 0 ( x 0 ) = B ( x 0 ) f ( x 0 ) / ∫ 0 L B ( x ) f ( x ) d x B(x_0)\phi_0(x_0)=B(x_0)f(x_0)/\int_0^L B(x)f(x)\,\mathrm{d}x B ( x 0 ) ϕ 0 ( x 0 ) = B ( x 0 ) f ( x 0 ) / ∫ 0 L B ( x ) f ( x ) d x .
The active population size can be connected to the mutant invasion growth rate:
N a c t i v e N = ∫ 0 L f ( x ) B ( x ) d x ⟨ f ⟩ 1 ∫ 0 L B ( x ) d x = ∫ 0 L f ( x ) B ( x ) d x ∫ 0 L f ( x ) ρ ( x ) B ( x ) d x ∫ 0 L ρ ( x ) B ( x ) d x ∫ 0 L B ( x ) d x = γ W M γ ( 1 ) . (144) \frac{N_{\mathrm{active}}}{N}=\frac{\int_0^L f(x)B(x)\,\mathrm{d}x}{\langle f\rangle}\frac{1}{\int_0^L B(x)\,\mathrm{d}x}=\frac{\int_0^L f(x)B(x)\,\mathrm{d}x}{\int_0^L f(x)\rho(x)B(x)\,\mathrm{d}x}\frac{\int_0^L \rho(x)B(x)\,\mathrm{d}x}{\int_0^L B(x)\,\mathrm{d}x}=\frac{\gamma_{\mathrm{WM}}}{\gamma^{(1)}}. \tag*{(144)} N N active = ⟨ f ⟩ ∫ 0 L f ( x ) B ( x ) d x ∫ 0 L B ( x ) d x 1 = ∫ 0 L f ( x ) ρ ( x ) B ( x ) d x ∫ 0 L f ( x ) B ( x ) d x ∫ 0 L B ( x ) d x ∫ 0 L ρ ( x ) B ( x ) d x = γ ( 1 ) γ WM . (144)
where we recognized the mutant invasion growth rate in the well-mixed reference case (Eq. (123) ) and the first-order approximation of the mutant invasion growth rate in the gut (Eq. (121) ), γ max = γ ( 1 ) + O ( s 2 ) \gamma_{\max}=\gamma^{(1)}+O(s^2) γ m a x = γ ( 1 ) + O ( s 2 ) . Since we showed above that γ ( 1 ) ≥ γ W M \gamma^{(1)}\ge\gamma_{\mathrm{WM}} γ ( 1 ) ≥ γ WM , we have N a c t i v e ≤ N N_{\mathrm{active}}\le N N active ≤ N . Furthermore, compared to a well-mixed population, the reduction of the active population size and the acceleration of mutant invasion in the gut both stem from the positive covariance between ρ \rho ρ and f f f .
In Figure S6 , we observe that N a c t i v e N_{\mathrm{active}} N active is close to N N N in the two cases with nearly uniform division rate where P e \mathrm{Pe} Pe is close to zero or close to P e max \mathrm{Pe}_{\max} Pe m a x but that N a c t i v e N_{\mathrm{active}} N active can become significantly smaller than N N N for intermediate P e \mathrm{Pe} Pe values. This decrease is more pronounced if λ w \lambda_{\mathrm{w}} λ w is larger, as faster-growing bacteria deplete food earlier, resulting in a growth region that occupies a smaller fraction of the system.
Figure S6. Rescaled active population N a c t i v e / N N_{\mathrm{active}}/N N active / N as a function of the normalized Péclet number P e / P e max \mathrm{Pe}/\mathrm{Pe}_{\max} Pe / Pe m a x (where N = ∫ 0 L d x B ( x ) N = \int_0^L \mathrm{d}x\,B(x) N = ∫ 0 L d x B ( x ) corresponds to the total population size). Solid lines: numerical integration of Eq. (144) using the numerically-obtained steady-state mutant-free wild-type bacteria concentration profile B ( x ) B(x) B ( x ) . Dashed lines: analytical result in Eq. (214) obtained using the step profile of ρ \rho ρ . Parameters: same k / F i n k/F_{\mathrm{in}} k / F in and α \alpha α as in main text Figure 1 , Figure 2 and Figure 3 .
In Figure S7 , we observe that the division-event-weighted mutant fixation probability ⟨ ϕ ⟩ \langle\phi\rangle ⟨ ϕ ⟩ is well-approximated by 1 / N a c t i v e 1/N_{\mathrm{active}} 1/ N active in the neutral limit s → 0 s \to0 s → 0 . In Figure S7 and in main text Figure 3 (b), we note that the branching process results underestimate the fixation probability for small values of s s s and for the largest Péclet numbers shown. This is due to the fact that the branching process calculation neglects neutral fixation. Comparing Eq. (143) with Eq. (62) , the branching-process result dominates over the neutral contribution when s ⟨ f ⟩ 2 / ⟨ f 2 ⟩ ≫ 1 / N a c t i v e s\langle f\rangle^2/\langle f^2\rangle\gg1/N_{\mathrm{active}} s ⟨ f ⟩ 2 / ⟨ f 2 ⟩ ≫ 1/ N active , i.e. when s ≫ [ 1 + c v 2 ( f ) ] / N a c t i v e s \gg[1+c_{\mathrm{v}}^2(f)]/N_{\mathrm{active}} s ≫ [ 1 + c v 2 ( f )] / N active . This allows us to make more precise the lower bound of the moderate selection regime of § 0.1 D 2. In our stochastic simulations, N a c t i v e N_{\mathrm{active}} N active is on the order of 500 bacteria (see Section IV A), so the moderate selection regime requires s ≫ 0.01 s \gg0.01 s ≫ 0.01 for P e = 0.97 P e max \mathrm{Pe}=0.97\mathrm{Pe}_{\max} Pe = 0.97 Pe m a x , while it only requires s ≫ 0.002 s \gg0.002 s ≫ 0.002 for P e = 0.5 P e max \mathrm{Pe}=0.5\mathrm{Pe}_{\max} Pe = 0.5 Pe m a x . This explains the slight underestimate of the fixation probability for the largest Péclet numbers shown in main text Figure 3 (b).
Figure S7. Division-event-weighted mutant fixation probability ⟨ ϕ ⟩ \langle\phi\rangle ⟨ ϕ ⟩ versus mutant relative fitness advantage s s s , for different values of the Péclet number P e \mathrm{Pe} Pe , for smaller s s s values than in main text Figure 3 . Stochastic simulations are described in Section IV A. Numerical solutions of the branching process Eq. (18) use the steady-state mutant-free profile of the division rate ρ \rho ρ and give our prediction in the large-population limit (“BP numerics”). The prediction for neutral mutants, 1 / N a c t i v e 1/N_{\mathrm{active}} 1/ N active , is obtained by numerical integration of Eq. (144) using the numerically-obtained steady-state mutant-free wild-type bacteria concentration profile B ( x ) B(x) B ( x ) . The Moran model for large populations, ⟨ ϕ ⟩ = s / ( 1 + s ) \langle\phi\rangle=s/(1+s) ⟨ ϕ ⟩ = s / ( 1 + s ) , gives the well-mixed reference in the large-population regime. Parameters: same λ w \lambda_{\mathrm{w}} λ w (and P e max \mathrm{Pe}_{\max} Pe m a x ), k / F i n k/F_{\mathrm{in}} k / F in and α \alpha α as in main text Figure 1 , Figure 2 and Figure 3 .
Additional analytical insight with a step-function division rate profile
In this Section, we will make the simplification that the stationary division rate profile in the absence of mutants is a step function:
ρ ( x ) = F ( x ) k + F ( x ) ≈ Θ ( x 0 − x ) , (145) \rho(x) = \frac{F(x)}{k + F(x)} \approx\Theta(x_0 - x), \tag*{(145)} ρ ( x ) = k + F ( x ) F ( x ) ≈ Θ ( x 0 − x ) , (145)
where x 0 x_0 x 0 denotes the position of the step [25 ] . This means that we make the approximation k ≪ F i n k \ll F_{\mathrm{in}} k ≪ F in . Furthermore, we assume that the stationary food concentration satisfies F ( x ) ≫ k F(x) \gg k F ( x ) ≫ k in the upstream food-rich region, while F ( x ) = 0 F(x) = 0 F ( x ) = 0 in the downstream food-poor region, with a sharp transition. The position x 0 x_0 x 0 of the step is determined self-consistently, ensuring that the coupling between food and bacterial concentration, which is crucial in our system, is preserved [25 ] . This approximation facilitates calculations and allows us to obtain some explicit analytical results.
Dimensionless variables
To streamline our analytical calculations, we will employ dimensionless variables throughout this section. These variables are listed below:
Table S137.
Note that P e \mathrm{Pe} Pe denotes the Péclet number. This dimensionless number is used in fluid mechanics to compare advective transport to diffusive transport.
Stationary wild-type concentration profile in the absence of mutants
Let us first focus on the stationary wild-type concentration profile B ( x ) B(x) B ( x ) in the absence of mutants, which provides the background when the mutant is introduced in our system. Our goal is to express it analytically in the case where the division rate profile is a step function.
At steady state in the absence of mutants, and using dimensionless variables, Eqs. (S2) and (S1) become
0 = B ′ ′ ( X ) − P e B ′ ( X ) + λ w Θ ( X 0 − X ) B ( X ) , (146) 0 = B^{\prime\prime}(X) - \mathrm{Pe} B^{\prime}(X) + \lambda_w \Theta(X_0-X)B(X), \tag*{(146)} 0 = B ′′ ( X ) − Pe B ′ ( X ) + λ w Θ ( X 0 − X ) B ( X ) , (146)
0 = F ′ ′ ( X ) − P e F ′ ( X ) − λ w α Θ ( X 0 − X ) B ( X ) . (147) 0 = F^{\prime\prime}(X) - \mathrm{Pe} F^{\prime}(X) - \frac{\lambda_w}{\alpha}\Theta(X_0-X)B(X). \tag*{(147)} 0 = F ′′ ( X ) − Pe F ′ ( X ) − α λ w Θ ( X 0 − X ) B ( X ) . (147)
with boundary conditions
B ′ ( 0 ) − P e B ( 0 ) = 0 , F ′ ( 0 ) − P e F ( 0 ) = − P e F i n , B^{\prime}(0) - \mathrm{Pe}\,B(0) = 0,\qquad F^{\prime}(0) - \mathrm{Pe}\,F(0) = -\mathrm{Pe}\,F_{\mathrm{in}}, B ′ ( 0 ) − Pe B ( 0 ) = 0 , F ′ ( 0 ) − Pe F ( 0 ) = − Pe F in ,
B ′ ( 1 ) = 0 , F ′ ( 1 ) = 0. (148) B^{\prime}(1) = 0,\qquad F^{\prime}(1) = 0. \tag*{(148)} B ′ ( 1 ) = 0 , F ′ ( 1 ) = 0. (148)
B ′ ( 1 ) = 0 , F ′ ( 1 ) = 0. (149) B^{\prime}(1) = 0,\qquad F^{\prime}(1) = 0. \tag*{(149)} B ′ ( 1 ) = 0 , F ′ ( 1 ) = 0. (149)
Following Ref. [24 ] , we notice that
0 = ( B + α F ) ′ ′ ( X ) − P e ( B + α F ) ′ ( X ) . (150) 0 = (B+\alpha F)^{\prime\prime}(X) - \mathrm{Pe}\,(B+\alpha F)^{\prime}(X). \tag*{(150)} 0 = ( B + α F ) ′′ ( X ) − Pe ( B + α F ) ′ ( X ) . (150)
Solving this differential equation and using the boundary conditions yields
B ( X ) + α F ( X ) = α F i n . (151) B(X) + \alpha F(X) = \alpha F_{\mathrm{in}}. \tag*{(151)} B ( X ) + α F ( X ) = α F in . (151)
This conserved quantity arises from the fact that bacteria need to eat food to divide, which dictates the structure of the reaction term of the model.
Upstream food-rich region. In the upstream part of the gut X < X 0 X < X_0 X < X 0 , where ρ ( X ) = 1 \rho(X) = 1 ρ ( X ) = 1 , we have
B u ′ ′ ( X ) − P e B u ′ ( X ) + λ w B u ( X ) = 0. (152) B_u''(X) - \mathrm{Pe}B_u'(X) + \lambda_w B_u(X) = 0. \tag*{(152)} B u ′′ ( X ) − Pe B u ′ ( X ) + λ w B u ( X ) = 0. (152)
Solving this equation and using the boundary conditions yields
B u ( X ) = B u 0 e P e X / 2 [ 2 K w P e cos ( K w X ) + sin ( K w X ) ] , (153) B_u(X) = B_u^0 e^{\mathrm{Pe}X/2}\left[\frac{2K_w}{\mathrm{Pe}}\cos(K_wX) + \sin(K_wX)\right], \tag*{(153)} B u ( X ) = B u 0 e Pe X /2 [ Pe 2 K w cos ( K w X ) + sin ( K w X ) ] , (153)
where we assumed P e < 2 λ w = P e 0 \mathrm{Pe} < 2\sqrt{\lambda_w} = \mathrm{Pe}_0 Pe < 2 λ w = Pe 0 and we introduced
K w = 4 λ w − P e 2 2 . (154) K_w = \frac{\sqrt{4\lambda_w-\mathrm{Pe}^2}}{2}. \tag*{(154)} K w = 2 4 λ w − Pe 2 . (154)
Downstream food-poor region. In the downstream part of the gut X > X 0 X > X_0 X > X 0 , where ρ ( X ) = 0 \rho(X) = 0 ρ ( X ) = 0 , we further assume that F ( X ) = 0 F(X) = 0 F ( X ) = 0 . Furthermore, the bacteria concentration (denoted by B d B_d B d ) satisfies
B d ′ ′ ( X ) − P e B d ′ ( X ) = 0. (155) B_d''(X) - \mathrm{Pe}B_d'(X) = 0. \tag*{(155)} B d ′′ ( X ) − Pe B d ′ ( X ) = 0. (155)
Using the boundary condition at X = 1 X = 1 X = 1 , it yields
B d ( X ) = B d 0 . (156) B_d(X) = B_d^0. \tag*{(156)} B d ( X ) = B d 0 . (156)
Then, using Eq. (151) gives
B d 0 = α F i n . (157) B_d^0 = \alpha F_{\mathrm{in}}. \tag*{(157)} B d 0 = α F in . (157)
Matching of the upstream and the downstream solutions. We now match the upstream and downstream solutions at X = X 0 X = X_0 X = X 0 in order to determine the two unknowns B u 0 B_u^0 B u 0 and X 0 X_0 X 0 :
B u ( X 0 ) = B d ( X 0 ) = α F i n , (158) B_u(X_0) = B_d(X_0) = \alpha F_{\mathrm{in}}, \tag*{(158)} B u ( X 0 ) = B d ( X 0 ) = α F in , (158)
B u ′ ( X 0 ) = B d ′ ( X 0 ) = 0. (159) B_u'(X_0) = B_d'(X_0) = 0. \tag*{(159)} B u ′ ( X 0 ) = B d ′ ( X 0 ) = 0. (159)
Eq. (158) yields
B u 0 = α F i n e − P e X 0 / 2 2 K w P e cos ( K w X 0 ) + sin ( K w X 0 ) , (160) B_u^0 = \frac{\alpha F_{\mathrm{in}}e^{-\mathrm{Pe}X_0/2}}{\frac{2K_w}{\mathrm{Pe}}\cos(K_wX_0) + \sin(K_wX_0)}, \tag*{(160)} B u 0 = Pe 2 K w cos ( K w X 0 ) + sin ( K w X 0 ) α F in e − Pe X 0 /2 , (160)
and Eq. (159) yields
tan ( K w X 0 ) = K w P e K w 2 − P e 2 / 4 , (161) \tan(K_wX_0) = \frac{K_w\mathrm{Pe}}{K_w^2-\mathrm{Pe}^2/4}, \tag*{(161)} tan ( K w X 0 ) = K w 2 − Pe 2 /4 K w Pe , (161)
which provides the location X 0 X_0 X 0 of the step in the division rate:
X 0 = 1 K w [ arctan ( K w P e K w 2 − P e 2 / 4 ) + ℓ π ] , (162) X_0 = \frac{1}{K_w}\left[\arctan\left(\frac{K_w\mathrm{Pe}}{K_w^2-\mathrm{Pe}^2/4}\right) + \ell\pi\right], \tag*{(162)} X 0 = K w 1 [ arctan ( K w 2 − Pe 2 /4 K w Pe ) + ℓ π ] , (162)
where ℓ \ell ℓ is an integer number. At P e = 2 λ w \mathrm{Pe} = \sqrt{2\lambda_w} Pe = 2 λ w , the argument of the arctangent in Eq. (162) tends to + ∞ +\infty + ∞ from below and to − ∞ -\infty − ∞ from above. Hence, using the principal branch (between − π / 2 -\pi/2 − π /2 and π / 2 \pi/2 π /2 ), the arctangent jumps from π / 2 \pi/2 π /2 to − π / 2 -\pi/2 − π /2 at that point. One must thus choose the integer ℓ \ell ℓ on each side of P e = 2 λ w \mathrm{Pe} = \sqrt{2\lambda_w} Pe = 2 λ w to ensure that X 0 X_0 X 0 remains continuous. In the limit P e → 0 \mathrm{Pe} \to0 Pe → 0 , X 0 → 0 X_0 \to0 X 0 → 0 , which entails ℓ = 0 \ell= 0 ℓ = 0 for P e < 2 λ w \mathrm{Pe} < \sqrt{2\lambda_w} Pe < 2 λ w . The continuity of X 0 X_0 X 0 at P e = 2 λ w \mathrm{Pe} = \sqrt{2\lambda_w} Pe = 2 λ w then imposes that
X 0 ( P e → 2 λ w − ) = X 0 ( P e → 2 λ w + ) , (163) X_0\left(\mathrm{Pe} \to\sqrt{2\lambda_w}^{-}\right)=X_0\left(\mathrm{Pe} \to\sqrt{2\lambda_w}^{+}\right), \tag*{(163)} X 0 ( Pe → 2 λ w − ) = X 0 ( Pe → 2 λ w + ) , (163)
i.e.
1 K w π 2 = 1 K w ( − π 2 + ℓ π ) . (164) \frac{1}{K_w}\frac{\pi}{2}=\frac{1}{K_w}\left(-\frac{\pi}{2}+\ell\pi\right). \tag*{(164)} K w 1 2 π = K w 1 ( − 2 π + ℓ π ) . (164)
Therefore ℓ = 1 \ell= 1 ℓ = 1 for P e > 2 λ w \mathrm{Pe} > \sqrt{2\lambda_w} Pe > 2 λ w . Finally, the solution for B B B is
B ( X ) = α F i n e P e ( X − X 0 ) / 2 2 K w cos ( K w X ) + P e sin ( K w X ) 2 K w cos ( K w X 0 ) + P e sin ( K w X 0 ) , for X < X 0 , (165) B(X)=\alpha F_{\mathrm{in}}e^{\mathrm{Pe}(X-X_0)/2}\frac{2K_w\cos(K_wX)+\mathrm{Pe}\sin(K_wX)}{2K_w\cos(K_wX_0)+\mathrm{Pe}\sin(K_wX_0)}, \qquad\text{for } X<X_0, \tag*{(165)} B ( X ) = α F in e Pe ( X − X 0 ) /2 2 K w cos ( K w X 0 ) + Pe sin ( K w X 0 ) 2 K w cos ( K w X ) + Pe sin ( K w X ) , for X < X 0 , (165)
B ( X ) = α F i n , for X > X 0 , (166) B(X)=\alpha F_{\mathrm{in}}, \qquad\text{for } X>X_0, \tag*{(166)} B ( X ) = α F in , for X > X 0 , (166)
with
X 0 = { 1 K w arctan ( K w P e K w 2 − P e 2 / 4 ) , if P e < 2 λ w , 1 K w [ arctan ( K w P e K w 2 − P e 2 / 4 ) + π ] , if 2 λ w < P e < P e max . (167) X_0=
\begin{cases}
\frac{1}{K_w}\arctan\left(\frac{K_w\mathrm{Pe}}{K_w^2-\mathrm{Pe}^2/4}\right), & \text{if } \mathrm{Pe}<\sqrt{2\lambda_w},\\
\frac{1}{K_w}\left[\arctan\left(\frac{K_w\mathrm{Pe}}{K_w^2-\mathrm{Pe}^2/4}\right)+\pi\right], & \text{if } \sqrt{2\lambda_w}<\mathrm{Pe}<\mathrm{Pe}_{\max}.
\end{cases} \tag*{(167)} X 0 = ⎩ ⎨ ⎧ K w 1 arctan ( K w 2 − Pe 2 /4 K w Pe ) , K w 1 [ arctan ( K w 2 − Pe 2 /4 K w Pe ) + π ] , if Pe < 2 λ w , if 2 λ w < Pe < Pe m a x . (167)
The position X 0 X_0 X 0 of the step is thus determined self-consistently, from the coupled system. Note that, while Eq. (167) is written for all P e < P e 0 \mathrm{Pe}<\mathrm{Pe}_0 Pe < Pe 0 , the step-profile requires X 0 ≤ 1 X_0\leq1 X 0 ≤ 1 , which in fact corresponds to the more restrictive condition P e < P e max \mathrm{Pe}<\mathrm{Pe}_{\max} Pe < Pe m a x , see Section II C below.
Our explicit solution for the profile of B ( X ) B(X) B ( X ) in the case of a step-function division rate profile coincides with that of Ref. [25 ] (Eqs. S140–S145) in the limit L → ∞ L\to\infty L → ∞ . However, here, we fully address the case of a finite L L L , and we fix the amplitude of the profile using food conservation.
Fig. S8 shows how the self-consistently determined step position X 0 X_0 X 0 from Eq. (167) increases with the Péclet number for various values of λ w = r w L 2 / D \lambda_w=r_wL^2/D λ w = r w L 2 / D . We observe that this increase arises for larger P e \mathrm{Pe} Pe values when λ w \lambda_w λ w is larger. This is because quickly-dividing bacteria deplete food faster, resulting in a smaller region where division is non-negligible.
Figure S8. Relative location X 0 = x 0 / L X_0=x_0/L X 0 = x 0 / L within the gut of the step of the division rate (when ρ \rho ρ is approximated by a step function) versus the normalized Péclet number P e / P e max \mathrm{Pe}/\mathrm{Pe}_{\max} Pe / Pe m a x for different values of λ w = r w L 2 / D \lambda_w=r_wL^2/D λ w = r w L 2 / D (recall that our usual value is λ w = 75.6 \lambda_w=75.6 λ w = 75.6 ). The position X 0 X_0 X 0 is plotted using Eq. (167) .
Fig. S9 further shows examples of profiles of wild-type bacterial concentration B B B , food concentration F F F and division rate ρ \rho ρ for different values of P e \mathrm{Pe} Pe , and compares the exact profiles obtained numerically to the analytical approximations using a step-function division rate profile. We observe that the step function approximation is quite good for this value of k / F i n k/F_{\mathrm{in}} k / F in , which is small, (k / F i n = 5 × 10 − 3 k/F_{\mathrm{in}}=5\times10^{-3} k / F in = 5 × 1 0 − 3 ). Note that this value is realistic, see § 0.5 .
Figure S9. Comparison of the exact system at steady state with its step-function approximation. Steady-state profiles of wild-type bacterial concentration B B B (a), food concentration F F F (b), and division rate ρ \rho ρ (c) are obtained from numerical solutions of Eqs. (S1), (S2) at steady state. They are compared to those obtained with a step-function ρ \rho ρ , using the analytical solution for B B B in Eqs. (165) , (166) and (167) . Parameter values: as in main text figures 1, 2 and 3, λ w = r w L 2 / D = 75.6 \lambda_w = r_w L^2/D = 75.6 λ w = r w L 2 / D = 75.6 (yielding P e max = 16.6 \mathrm{Pe}_{\max} = 16.6 Pe m a x = 16.6 ), k / F i n = 5 × 10 − 3 k/F_{\mathrm{in}} = 5 \times10^{-3} k / F in = 5 × 1 0 − 3 , α = 200 \alpha= 200 α = 200 .
Washout condition
Beyond a certain flow velocity, washout occurs in the system, meaning that all bacteria get washed out of the system [8 ] . Mathematically, the washout condition corresponds to a bifurcation point where the trivial steady state solution F ( x ) = F i n F(x)=F_{\mathrm{in}} F ( x ) = F in and B ( x ) = 0 B(x)=0 B ( x ) = 0 becomes stable [24 ] . In previous works [8 , 9 , 24 ] , the washout condition was determined by comparing key length scales and time scales of the system. Two conditions yielding two branches were thus identified. Assuming that the division rate profile is a step function allows us to perform an exact determination of the washout condition within that approximation. We further show that the two known branches are found as asymptotic limits of this exact condition.
Within our step-function approximation, washout is obtained when X 0 = 1 X_0=1 X 0 = 1 , meaning that the step occurs at the downstream boundary of the system. Thus, we aim to determine the value P e max = v max L / D \mathrm{Pe}_{\max}=v_{\max}L/D Pe m a x = v m a x L / D of the Péclet number P e \mathrm{Pe} Pe for which X 0 = 1 X_0=1 X 0 = 1 . Eq. (161) then gives the condition
tan ( K max ) = K max P e max K max 2 − P e max 2 / 4 , (168) \tan(K_{\max})=\frac{K_{\max}\mathrm{Pe}_{\max}}{K_{\max}^{2}-\mathrm{Pe}_{\max}^{2}/4}, \tag*{(168)} tan ( K m a x ) = K m a x 2 − Pe m a x 2 /4 K m a x Pe m a x , (168)
where we introduced
K max = P e 0 2 1 − ( P e max / P e 0 ) 2 , (169) K_{\max}=\frac{\mathrm{Pe}_0}{2}\sqrt{1-\left(\mathrm{Pe}_{\max}/\mathrm{Pe}_0\right)^2}, \tag*{(169)} K m a x = 2 Pe 0 1 − ( Pe m a x / Pe 0 ) 2 , (169)
and used P e 0 = 2 λ w \mathrm{Pe}_0=2\sqrt{\lambda_w} Pe 0 = 2 λ w and K w = P e 0 2 − P e 2 / 2 K_w=\sqrt{\mathrm{Pe}_0^2-\mathrm{Pe}^2}/2 K w = Pe 0 2 − Pe 2 /2 (see Section II A). Note that, as in the previous section, we assume P e < P e 0 \mathrm{Pe}<\mathrm{Pe}_0 Pe < Pe 0 , and in particular P e max < P e 0 \mathrm{Pe}_{\max}<\mathrm{Pe}_0 Pe m a x < Pe 0 . Eq. (168) can be reformulated as
tan ( K max ) = 2 ( P e max / P e 0 ) 1 − ( P e max / P e 0 ) 2 1 − 2 ( P e max / P e 0 ) 2 . (170) \tan(K_{\max})=\frac{2(\mathrm{Pe}_{\max}/\mathrm{Pe}_0)\sqrt{1-(\mathrm{Pe}_{\max}/\mathrm{Pe}_0)^2}}{1-2(\mathrm{Pe}_{\max}/\mathrm{Pe}_0)^2}. \tag*{(170)} tan ( K m a x ) = 1 − 2 ( Pe m a x / Pe 0 ) 2 2 ( Pe m a x / Pe 0 ) 1 − ( Pe m a x / Pe 0 ) 2 . (170)
Since 0 ≤ P e max / P e 0 < 1 0\leq\mathrm{Pe}_{\max}/\mathrm{Pe}_0<1 0 ≤ Pe m a x / Pe 0 < 1 , let us introduce θ = arcsin ( P e max / P e 0 ) ∈ [ 0 , π / 2 ) \theta=\arcsin(\mathrm{Pe}_{\max}/\mathrm{Pe}_0)\in[0,\pi/2) θ = arcsin ( Pe m a x / Pe 0 ) ∈ [ 0 , π /2 ) . This leads to
tan ( K max ) = 2 sin ( θ ) cos ( θ ) 1 − 2 sin 2 ( θ ) = tan ( 2 θ ) . (171) \tan(K_{\max})=\frac{2\sin(\theta)\cos(\theta)}{1-2\sin^2(\theta)}=\tan(2\theta). \tag*{(171)} tan ( K m a x ) = 1 − 2 sin 2 ( θ ) 2 sin ( θ ) cos ( θ ) = tan ( 2 θ ) . (171)
Combining Eq. (162) (written for X 0 = 1 X_0=1 X 0 = 1 ) with Eq. (168) provides K max = arctan [ tan ( 2 θ ) ] + ℓ π K_{\max}=\arctan[\tan(2\theta)]+\ell\pi K m a x = arctan [ tan ( 2 θ )] + ℓ π . Recall that 0 ≤ 2 θ < π 0\leq2\theta<\pi 0 ≤ 2 θ < π . For 0 ≤ 2 θ < π / 2 0\leq2\theta<\pi/2 0 ≤ 2 θ < π /2 , the principal branch of the arctangent gives arctan [ tan ( 2 θ ) ] = 2 θ \arctan[\tan(2\theta)]=2\theta arctan [ tan ( 2 θ )] = 2 θ , and we determined above that ℓ = 0 \ell=0 ℓ = 0 , which gives K max = 2 θ K_{\max}=2\theta K m a x = 2 θ . For π / 2 < 2 θ < π \pi/2<2\theta<\pi π /2 < 2 θ < π , the principal branch of the arctangent gives arctan [ tan ( 2 θ ) ] = 2 θ − π \arctan[\tan(2\theta)]=2\theta-\pi arctan [ tan ( 2 θ )] = 2 θ − π , and we determined above that ℓ = 1 \ell=1 ℓ = 1 , which also gives K max = 2 θ K_{\max}=2\theta K m a x = 2 θ . Thus, we have
K max = 2 θ = 2 arcsin ( P e max / P e 0 ) . (172) K_{\max}=2\theta=2\arcsin(\mathrm{Pe}_{\max}/\mathrm{Pe}_0). \tag*{(172)} K m a x = 2 θ = 2 arcsin ( Pe m a x / Pe 0 ) . (172)
Using Eq. (169) , this yields the washout condition
P e 0 = 4 arcsin ( P e max / P e 0 ) 1 − ( P e max / P e 0 ) 2 . (173) \mathrm{Pe}_0=\frac{4\arcsin(\mathrm{Pe}_{\max}/\mathrm{Pe}_0)}{\sqrt{1-(\mathrm{Pe}_{\max}/\mathrm{Pe}_0)^2}}. \tag*{(173)} Pe 0 = 1 − ( Pe m a x / Pe 0 ) 2 4 arcsin ( Pe m a x / Pe 0 ) . (173)
Asymptotic regimes. First, for P e max ≪ P e 0 ≪ 1 \mathrm{Pe}_{\max}\ll\mathrm{Pe}_0\ll1 Pe m a x ≪ Pe 0 ≪ 1 , Eq. (173) gives
P e max ≈ P e 0 2 4 = λ w = r w L 2 D , (174) \mathrm{Pe}_{\max}\approx\frac{\mathrm{Pe}_0^2}{4}=\lambda_w=\frac{r_wL^2}{D}, \tag*{(174)} Pe m a x ≈ 4 Pe 0 2 = λ w = D r w L 2 , (174)
and thus
v max ≈ r w L . (175) v_{\max}\approx r_wL. \tag*{(175)} v m a x ≈ r w L . (175)
Second, in the opposite regime P e 0 ≫ 1 \mathrm{Pe}_0\gg1 Pe 0 ≫ 1 , Eq. (173) gives P e max → P e 0 \mathrm{Pe}_{\max}\to\mathrm{Pe}_0 Pe m a x → Pe 0 , and we have
P e max ≈ P e 0 = 2 λ w = 2 r w L 2 D , (176) \mathrm{Pe}_{\max}\approx\mathrm{Pe}_0=2\sqrt{\lambda_w}=2\sqrt{\frac{r_wL^2}{D}}, \tag*{(176)} Pe m a x ≈ Pe 0 = 2 λ w = 2 D r w L 2 , (176)
and hence
v max ≈ 2 r w D . (177) v_{\max}\approx2\sqrt{r_wD}. \tag*{(177)} v m a x ≈ 2 r w D . (177)
These two asymptotic regimes are in agreement with those found in Refs. [8 , 24 ] . Figure S10 illustrates the exact washout condition found here and these two asymptotic regimes.
Figure S10. Exact washout condition in the step-function division-rate case, and asymptotic regimes. The Péclet number above which washout occurs is plotted as a function of P e 0 \mathrm{Pe}_0 Pe 0 . Solid blue line: Péclet number P e max \mathrm{Pe}_{\max} Pe m a x given by Eq. (173) . Dashed yellow line: small P e 0 \mathrm{Pe}_0 Pe 0 asymptotic regime in Eq. (174) : P e max = P e 0 2 / 4 \mathrm{Pe}_{\max} = \mathrm{Pe}_0^2/4 Pe m a x = Pe 0 2 /4 . Dashed red line: large P e 0 \mathrm{Pe}_0 Pe 0 asymptotic regime in Eq. (176) : P e max = P e 0 \mathrm{Pe}_{\max} = \mathrm{Pe}_0 Pe m a x = Pe 0 .
Fixation probability
Moderate selection regime
In Section I D 2, we performed a perturbative calculation of the fixation probability in the moderate selection regime where [ 1 + c v 2 ( f ) ] / N a c t i v e ≪ s ≪ 1 [1+c_v^2(f)]/N_{\mathrm{active}} \ll s \ll1 [ 1 + c v 2 ( f )] / N active ≪ s ≪ 1 (see Section I G), and we obtained the following result (see Eqs. (61) and (49) , written using the dimensionless variables from Section II A):
ϕ ( X ) = s ⟨ f ⟩ ⟨ f 2 ⟩ f ( X ) + O ( s 2 ) , (178) \phi(\mathrm{X})=s\frac{\langle f\rangle}{\langle f^2\rangle}f(\mathrm{X})+O(s^2), \tag*{(178)} ϕ ( X ) = s ⟨ f 2 ⟩ ⟨ f ⟩ f ( X ) + O ( s 2 ) , (178)
with
f ( X ) = B ( X ) e − P e X , (179) f(\mathrm{X})=B(\mathrm{X})e^{-\mathrm{PeX}}, \tag*{(179)} f ( X ) = B ( X ) e − PeX , (179)
where B ( X ) B(\mathrm{X}) B ( X ) is the steady-state wild-type bacteria concentration profile in the absence of mutants. In the case of the step-function division rate profile, B ( X ) B(\mathrm{X}) B ( X ) has an explicit analytical expression, given by Eqs. (165) , (166) and (167) . Furthermore, since ρ ( X ) = Θ ( X 0 − X ) \rho(\mathrm{X})=\Theta(\mathrm{X}_0-\mathrm{X}) ρ ( X ) = Θ ( X 0 − X ) , the division-event-weighted averages involved in Eq. (178) can be expressed as
⟨ f ⟩ = ∫ 0 X 0 d X B ( X ) f ( X ) ∫ 0 X 0 d X B ( X ) and ⟨ f 2 ⟩ = ∫ 0 X 0 d X B ( X ) f 2 ( X ) ∫ 0 X 0 d X B ( X ) . (180) \langle f\rangle=\frac{\int_0^{X_0}\mathrm{dX}\,B(\mathrm{X})f(\mathrm{X})}{\int_0^{X_0}\mathrm{dX}\,B(\mathrm{X})}
\quad\text{and}\quad
\langle f^2\rangle=\frac{\int_0^{X_0}\mathrm{dX}\,B(\mathrm{X})f^2(\mathrm{X})}{\int_0^{X_0}\mathrm{dX}\,B(\mathrm{X})}. \tag*{(180)} ⟨ f ⟩ = ∫ 0 X 0 dX B ( X ) ∫ 0 X 0 dX B ( X ) f ( X ) and ⟨ f 2 ⟩ = ∫ 0 X 0 dX B ( X ) ∫ 0 X 0 dX B ( X ) f 2 ( X ) . (180)
Hence, with the step-function division rate profile, we obtain an explicit analytical representation of the first-order spatial fixation profile from Eqs. (178) , (165) , (166) and (167) . Consequently, Eq. (62) gives an explicit analytical representation of the division-event-weighted average of ϕ \phi ϕ as well. Computing the integrals yields the explicit formula
⟨ ϕ ⟩ = s 4 λ w ( 9 λ w − 2 P e 2 ) ( P e + λ w X 0 ) 2 ( 1 + 8 e P e X 0 / 2 ) ( P e 3 − 4 λ w P e ) 2 + O ( s 2 ) . (181) \langle\phi\rangle=s\frac{4\lambda_w(9\lambda_w-2\mathrm{Pe}^2)(\mathrm{Pe}+\lambda_wX_0)^2}{(1+8e^{\mathrm{Pe}X_0/2})(\mathrm{Pe}^3-4\lambda_w\mathrm{Pe})^2}+O(s^2). \tag*{(181)} ⟨ ϕ ⟩ = s ( 1 + 8 e Pe X 0 /2 ) ( Pe 3 − 4 λ w Pe ) 2 4 λ w ( 9 λ w − 2 Pe 2 ) ( Pe + λ w X 0 ) 2 + O ( s 2 ) . (181)
Introducing β = arcsin ( P e / P e 0 ) \beta=\arcsin(\mathrm{Pe}/\mathrm{Pe}_0) β = arcsin ( Pe / Pe 0 ) yields
⟨ ϕ ⟩ = s ( 9 − 8 sin 2 β ) ( β + sin β cos β ) 2 4 ( 1 + 8 e 2 β tan β ) sin 2 β cos 6 β + O ( s 2 ) , (182) \langle\phi\rangle=s\frac{(9-8\sin^2\beta)(\beta+\sin\beta\cos\beta)^2}{4(1+8e^{2\beta\tan\beta})\sin^2\beta\cos^6\beta}+O(s^2), \tag*{(182)} ⟨ ϕ ⟩ = s 4 ( 1 + 8 e 2 β t a n β ) sin 2 β cos 6 β ( 9 − 8 sin 2 β ) ( β + sin β cos β ) 2 + O ( s 2 ) , (182)
which shows that to first order in s s s , ⟨ ϕ ⟩ \langle\phi\rangle ⟨ ϕ ⟩ only depends on P e / P e 0 = v / v F \mathrm{Pe}/\mathrm{Pe}_0=v/v_F Pe / Pe 0 = v / v F , where v F = 2 r w D v_F=2\sqrt{r_wD} v F = 2 r w D is the Fisher speed.
Note that the differential equation for the fixation probability (Eq. (26) ) linearized around ϕ = 0 \phi= 0 ϕ = 0 in the step-function division rate profile case has a nontrivial solution if and only if
tan ( K m X 0 ) K m P e [ K m 2 − P e 2 4 ] = 1 , (183) \frac{\tan(K_mX_0)}{K_m\mathrm{Pe}}\left[K_m^2-\frac{\mathrm{Pe}^2}{4}\right]=1, \tag*{(183)} K m Pe tan ( K m X 0 ) [ K m 2 − 4 Pe 2 ] = 1 , (183)
where we assume cos ( K m X 0 ) ≠ 0 \cos(K_mX_0) \ne0 cos ( K m X 0 ) = 0 . For K m = K w K_m = K_w K m = K w , or equivalently λ m = λ w \lambda_m = \lambda_w λ m = λ w or r m = r w r_m = r_w r m = r w , this is the same condition as for the stationary wild-type profile B ( X ) B(X) B ( X ) , namely Eq. (161) . This provides a consistency check that s = 0 s = 0 s = 0 is the critical point, in agreement with the general branching-process result above, see § 0.1 D 1.
Impact of the step-function division rate approximation
The validity of the step-function division rate approximation is expected to depend on the rescaled Monod constant k / F i n k/F_{\mathrm{in}} k / F in : if it is very small, the real profile of ρ \rho ρ is close to a step function, while if it is large, it is substantially smoother. Figure S11 reports the division-event-weighted mutant fixation probability ⟨ ϕ ⟩ \langle\phi\rangle ⟨ ϕ ⟩ versus the rescaled Monod constant k / F i n k/F_{\mathrm{in}} k / F in . It shows that the step-function division rate approximation leads to an error that grows with k / F i n k/F_{\mathrm{in}} k / F in , but remains smaller than ten percent for k / F i n < 10 − 2 k/F_{\mathrm{in}} < 10^{-2} k / F in < 1 0 − 2 . This is in the realistic range for the human colon, see § 0.5 .
Figure S11. Comparison of the mutant fixation probability in the exact system and in its step-function approximation. (a) The division-event-weighted mutant fixation probability ⟨ ϕ ⟩ \langle\phi\rangle ⟨ ϕ ⟩ is plotted versus the rescaled Monod constant k / F i n k/F_{\mathrm{in}} k / F in , for a mutant relative fitness advantage s = 1 s = 1 s = 1 . Numerical solutions of the branching process Eq. (18) use either the steady-state mutant-free profile of the division rate ρ \rho ρ (“BP num. ρ = F / [ k + F ] \rho= F/[k + F] ρ = F / [ k + F ] ”) or its step approximation (“BP num. step ρ \rho ρ ”). Note that the Moran model for large populations, which is the well-mixed reference, gives ⟨ ϕ ⟩ = s / ( 1 + s ) = 0.5 \langle\phi\rangle= s/(1+s) = 0.5 ⟨ ϕ ⟩ = s / ( 1 + s ) = 0.5 for s = 1 s = 1 s = 1 . (b) Relative error between the two curves plotted in (a). Parameters: same λ w \lambda_w λ w (and P e max \mathrm{Pe}_{\max} Pe m a x ), α \alpha α , and P e = v L / D = 15.3 = 0.92 P e max \mathrm{Pe} = vL/D = 15.3 = 0.92\mathrm{Pe}_{\max} Pe = v L / D = 15.3 = 0.92 Pe m a x (with P e max = 16.6 \mathrm{Pe}_{\max} = 16.6 Pe m a x = 16.6 corresponding to washout) as in main text Figure 1 and Figure 2 .
Mean number of division events and mean exit time
Here, we focus on the mean number R 1 ( x ) R_1(x) R 1 ( x ) of division events of a tracked mutant parental branch starting at x x x before it exits the system (see § 0.1 E), first in the case of constant division rate throughout the system, and then in the case of a step-profile division rate. By definition, R 1 ( x ) R_1(x) R 1 ( x ) (see Eq. (71) ) is the expectation value over all stochastic trajectories X t X_t X t such that X 0 = x X_0=x X 0 = x of the number of division events undergone along the tracked parental branch. Hence,
R 1 ( x ) = E x [ ∫ 0 t e x i t r m ρ ( X t ) d t ] (184) R_1(x)=\mathbb{E}_x\left[\int_0^{t_{\mathrm{exit}}}r_m\rho(X_t)\,\mathrm{d}t\right] \tag*{(184)} R 1 ( x ) = E x [ ∫ 0 t exit r m ρ ( X t ) d t ] (184)
where E x \mathbb{E}_x E x denotes the expectation value over all stochastic trajectories X t X_t X t starting at x x x , and t e x i t t_{\mathrm{exit}} t exit denotes the time at which the tracked parental branch exits the system. Thus, we investigate how R 1 ( x ) R_1(x) R 1 ( x ) is related to the mean exit time T ( x ) T(x) T ( x ) of a bacterium.
Mean exit time. Let us first consider the mean time T ( x ) T(x) T ( x ) until the tracked branch, starting at x x x , exits the system through the downstream boundary x = L x=L x = L . This mean exit time satisfies
D T ′ ′ ( x ) + v T ′ ( x ) = − 1 , (185) D T^{\prime\prime}(x)+vT^{\prime}(x)=-1, \tag*{(185)} D T ′′ ( x ) + v T ′ ( x ) = − 1 , (185)
and the backward boundary conditions Eqs. (84) and (S76). We find the explicit solution
T ( x ) = D v 2 ( 1 − e − v x / D ) + L − x v . (186) T(x)=\frac{D}{v^2}\left(1-e^{-vx/D}\right)+\frac{L-x}{v}. \tag*{(186)} T ( x ) = v 2 D ( 1 − e − v x / D ) + v L − x . (186)
Note that this result holds for any division rate profile ρ ( x ) \rho(x) ρ ( x ) . Indeed, the time spent by one bacterium in the system depends on transport and not on division. This equation entails in particular that T ( 0 ) = L / v T(0)=L/v T ( 0 ) = L / v , and that T ( L ) = D v 2 ( 1 − e − v L / D ) > 0 T(L)=\frac{D}{v^2}\left(1-e^{-vL/D}\right)>0 T ( L ) = v 2 D ( 1 − e − v L / D ) > 0 : a branch starting at the downstream boundary stays a finite mean time in the system, consistent with the boundary conditions employed.
R 1 R_1 R 1 for a constant division rate. R 1 ( x ) R_1(x) R 1 ( x ) , formally defined in Eq. (71) , satisfies the differential equation Eq. (83) and the boundary conditions Eqs. (84) and (S76). In the specific case where the division rate is constant throughout the system, r m ρ ( x ) = r m r_m\rho(x)=r_m r m ρ ( x ) = r m (i.e. ρ ( x ) = 1 \rho(x)=1 ρ ( x ) = 1 ), Eq. (83) becomes
D R 1 ′ ′ ( x ) + v R 1 ′ ( x ) = − r m . (187) D R_1^{\prime\prime}(x)+vR_1^{\prime}(x)=-r_m. \tag*{(187)} D R 1 ′′ ( x ) + v R 1 ′ ( x ) = − r m . (187)
We notice that R 1 / r m R_1/r_m R 1 / r m satisfies the same differential equation as T T T (see Eq. (185) ), and the same boundary conditions. Hence, in the case of a constant division rate, we have R 1 ( x ) = r m T ( x ) R_1(x)=r_mT(x) R 1 ( x ) = r m T ( x ) , with T ( x ) T(x) T ( x ) given in Eq. (186) : the expected number of division events is the division rate times the expected residence time. More formally, Eq. (184) simplifies when the division rate is constant, as it can be taken out of the integral and of the expectation value, yielding the simple product R 1 ( x ) = r m T ( x ) R_1(x)=r_mT(x) R 1 ( x ) = r m T ( x ) .
R 1 R_1 R 1 for a step division rate. Let us now return to the case where ρ ( X ) = Θ ( X 0 − X ) \rho(X)=\Theta(X_0-X) ρ ( X ) = Θ ( X 0 − X ) , and let us also return to dimensionless variables, as elsewhere in this Section. In this case, Eq. (83) becomes
R 1 ′ ′ ( X ) + P e R 1 ′ ( X ) = − λ m Θ ( X 0 − X ) , (188) R_1^{\prime\prime}(X)+\mathrm{Pe}R_1^{\prime}(X)=-\lambda_m\Theta(X_0-X), \tag*{(188)} R 1 ′′ ( X ) + Pe R 1 ′ ( X ) = − λ m Θ ( X 0 − X ) , (188)
and we find the following analytical expression for R 1 R_1 R 1 :
R 1 ( X ) = { λ m P e ( 1 − e − P e X P e + X 0 − X ) , if X < X 0 , λ m P e 2 e − P e X ( e P e X 0 − 1 ) , else. (189) R_1(X)=
\begin{cases}
\frac{\lambda_m}{\mathrm{Pe}}\left(\frac{1-e^{-\mathrm{Pe}X}}{\mathrm{Pe}}+X_0-X\right), & \text{if }X<X_0,\\[6pt]
\frac{\lambda_m}{\mathrm{Pe}^2}e^{-\mathrm{Pe}X}\left(e^{\mathrm{Pe}X_0}-1\right), & \text{else.}
\end{cases} \tag*{(189)} R 1 ( X ) = ⎩ ⎨ ⎧ Pe λ m ( Pe 1 − e − Pe X + X 0 − X ) , Pe 2 λ m e − Pe X ( e Pe X 0 − 1 ) , if X < X 0 , else. (189)
The second line shows that for X > X 0 X>X_0 X > X 0 , we have R 1 ( X ) = R 1 ( X 0 ) e − P e ( X − X 0 ) R_1(X)=R_1(X_0)e^{-\mathrm{Pe}(X-X_0)} R 1 ( X ) = R 1 ( X 0 ) e − Pe ( X − X 0 ) : a tracked parental branch starting there cannot divide locally, and its nonzero R 1 R_1 R 1 arises entirely from the possibility of diffusing back into the region where division is possible before exiting the system. Note also that, from the above explicit formula for R 1 R_1 R 1 , we can check that the division-event-weighted average is ⟨ R 1 ⟩ = 1 + s \langle R_1\rangle=1+s ⟨ R 1 ⟩ = 1 + s , consistent with our general result in Eq. (108) .
Above, we saw that in the case of a constant division rate, R 1 ( x ) = r m T ( x ) R_1(x)=r_mT(x) R 1 ( x ) = r m T ( x ) , i.e. R 1 ( X ) = λ m T ( X ) R_1(X)=\lambda_mT(X) R 1 ( X ) = λ m T ( X ) (with the dimensional T ( x ) T(x) T ( x ) related to the dimensionless one T ( X ) T(X) T ( X ) via T ( x ) = T ( X ) L 2 / D T(x)=T(X)L^2/D T ( x ) = T ( X ) L 2 / D ). To see how this is modified for a heterogeneous division rate, let us consider the initial-position division rate multiplied by the total residence time, namely λ m ρ ( X ) T ( X ) \lambda_m\rho(X)T(X) λ m ρ ( X ) T ( X ) , and compare it to R 1 ( X ) R_1(X) R 1 ( X ) . Using Eq. (186) with dimensionless variables and ρ ( X ) = Θ ( X 0 − X ) \rho(X)=\Theta(X_0-X) ρ ( X ) = Θ ( X 0 − X ) provides
λ m ρ ( X ) T ( X ) = λ m P e Θ ( X 0 − X ) ( 1 − X + 1 − e − P e X P e ) . (190) \lambda_m\rho(X)T(X)=\frac{\lambda_m}{\mathrm{Pe}}\Theta(X_0-X)\left(1-X+\frac{1-e^{-\mathrm{Pe}X}}{\mathrm{Pe}}\right). \tag*{(190)} λ m ρ ( X ) T ( X ) = Pe λ m Θ ( X 0 − X ) ( 1 − X + Pe 1 − e − Pe X ) . (190)
Comparing this result to Eq. (189) , we notice that
λ m T ( X ) = R 1 ( X ) + λ m P e ( 1 − X 0 ) for X < X 0 . (191) \lambda_mT(X)=R_1(X)+\frac{\lambda_m}{\mathrm{Pe}}(1-X_0)\quad\text{for }X<X_0. \tag*{(191)} λ m T ( X ) = R 1 ( X ) + Pe λ m ( 1 − X 0 ) for X < X 0 . (191)
Taking the division-event-weighted average, where only X < X 0 X<X_0 X < X 0 contributes, thus yields
⟨ λ m ρ T ⟩ = ⟨ R 1 ⟩ + λ m P e ( 1 − X 0 ) . (192) \langle\lambda_m\rho T\rangle=\langle R_1\rangle+\frac{\lambda_m}{\mathrm{Pe}}(1-X_0). \tag*{(192)} ⟨ λ m ρT ⟩ = ⟨ R 1 ⟩ + Pe λ m ( 1 − X 0 ) . (192)
This result reduces to ⟨ R 1 ⟩ = ⟨ λ m ρ T ⟩ \langle R_1\rangle=\langle\lambda_m\rho T\rangle ⟨ R 1 ⟩ = ⟨ λ m ρT ⟩ in the limit X 0 → 1 X_0\to1 X 0 → 1 , consistent with our constant division rate result above. By contrast, for X 0 ∈ ( 0 , 1 ) X_0\in(0,1) X 0 ∈ ( 0 , 1 ) , we have ⟨ R 1 ⟩ < ⟨ λ m ρ T ⟩ \langle R_1\rangle<\langle\lambda_m\rho T\rangle ⟨ R 1 ⟩ < ⟨ λ m ρT ⟩ . The extra positive term in ⟨ λ m ρ T ⟩ \langle\lambda_m\rho T\rangle ⟨ λ m ρT ⟩ quantifies the overestimate of ⟨ R 1 ⟩ \langle R_1\rangle ⟨ R 1 ⟩ obtained by assuming that division is possible during the whole time the tracked parental branch spends in the system, while division only occurs in the region X < X 0 X<X_0 X < X 0 .
Deterministic growth of the mutant concentration
Here, we apply the method described in § 0.1 F to the case of a step-function growth profile. Rewriting the differential equation for the mutant concentration M M M , namely Eq. (S3), in terms of dimensionless variables (see Section II A), and looking for a separable solution of the form M ( X , τ ) = g ( X ) h ( τ ) M(X,\tau)=g(X)h(\tau) M ( X , τ ) = g ( X ) h ( τ ) , gives
1 h ( τ ) d h d τ ( τ ) = g ′ ′ ( X ) g ( X ) − P e g ′ ( X ) g ( X ) + λ m Θ ( X 0 − X ) = γ ~ , (193) \frac{1}{h(\tau)}\frac{\mathrm{d}h}{\mathrm{d}\tau}(\tau)=\frac{g^{\prime\prime}(X)}{g(X)}-\mathrm{Pe}\frac{g^\prime(X)}{g(X)}+\lambda_m\Theta(X_0-X)=\tilde{\gamma}, \tag*{(193)} h ( τ ) 1 d τ d h ( τ ) = g ( X ) g ′′ ( X ) − Pe g ( X ) g ′ ( X ) + λ m Θ ( X 0 − X ) = γ ~ , (193)
where γ ~ \tilde{\gamma} γ ~ is an eigenvalue of the problem, and can be interpreted as a dimensionless deterministic growth exponent. Indeed, solving the differential equation for h h h yields h ( τ ) = h 0 e γ ~ τ h(\tau)=h_0e^{\tilde{\gamma}\tau} h ( τ ) = h 0 e γ ~ τ , where h 0 h_0 h 0 is a constant. The dimensionless γ ~ \tilde{\gamma} γ ~ is related to γ \gamma γ from § 0.1 F via γ ~ = L 2 γ / D \tilde{\gamma}=L^2\gamma/D γ ~ = L 2 γ / D . As in § 0.1 F, our goal is to find the largest eigenvalue γ ~ max \tilde{\gamma}_{\max} γ ~ m a x , which determines the mutant invasion growth rate. Let us consider the differential equation for g g g :
g ′ ′ ( X ) − P e g ′ ( X ) + [ λ m Θ ( X 0 − X ) − γ ~ ] g ( X ) = 0 , (194) g^{\prime\prime}(X)-\mathrm{Pe}\,g^\prime(X)+[\lambda_m\Theta(X_0-X)-\tilde{\gamma}]g(X)=0, \tag*{(194)} g ′′ ( X ) − Pe g ′ ( X ) + [ λ m Θ ( X 0 − X ) − γ ~ ] g ( X ) = 0 , (194)
with boundary conditions given by the dimensionless forms of Eqs. (S4) and (S5), namely g ′ ( 0 ) − P e g ( 0 ) = 0 g^\prime(0)-\mathrm{Pe}g(0)=0 g ′ ( 0 ) − Pe g ( 0 ) = 0 and g ′ ( 1 ) = 0 g^\prime(1)=0 g ′ ( 1 ) = 0 . Note that Eq. (194) corresponds to Eq. S211 in [25 ] , but that the limit L → ∞ L\to\infty L → ∞ was taken there. On the downstream side X > X 0 X>X_0 X > X 0 , Eq. (194) reduces to
g d ′ ′ ( X ) − P e g d ′ ( X ) − γ ~ g d ( X ) = 0. (195) g_d^{\prime\prime}(X)-\mathrm{Pe}\,g_d^\prime(X)-\tilde{\gamma}g_d(X)=0. \tag*{(195)} g d ′′ ( X ) − Pe g d ′ ( X ) − γ ~ g d ( X ) = 0. (195)
The solution is
g d ( X ) = A d e r + X + C d e r − X , (196) g_d(X)=A_de^{r_+X}+C_de^{r_-X}, \tag*{(196)} g d ( X ) = A d e r + X + C d e r − X , (196)
where A d A_d A d and C d C_d C d are constants and
r ± = P e ± P e 2 + 4 γ ~ 2 . (197) r_\pm=\frac{\mathrm{Pe}\pm\sqrt{\mathrm{Pe}^2+4\tilde{\gamma}}}{2}. \tag*{(197)} r ± = 2 Pe ± Pe 2 + 4 γ ~ . (197)
The downstream boundary condition g d ′ ( 1 ) = 0 g_d^\prime(1)=0 g d ′ ( 1 ) = 0 yields
g d ( X ) = A d ( e r + X − r + r − e r − X + r + − r − ) . (198) g_d(X)=A_d\left(e^{r_+X}-\frac{r_+}{r_-}e^{r_-X+r_+-r_-}\right). \tag*{(198)} g d ( X ) = A d ( e r + X − r − r + e r − X + r + − r − ) . (198)
Since we are interested in the dominant eigenvalue in the case of a beneficial mutant, which is expected to satisfy γ ~ max > 0 \tilde{\gamma}_{\max} > 0 γ ~ m a x > 0 (see § 0.1 D 1 and the first-order result in § 0.1 F), we assume that γ ~ > 0 \tilde{\gamma} > 0 γ ~ > 0 . This ensures that P e 2 + 4 γ ~ > 0 \mathrm{Pe}^{2} + 4\tilde{\gamma} > 0 Pe 2 + 4 γ ~ > 0 and r − < 0 r_{-} < 0 r − < 0 .
On the upstream side X < X 0 X < X_{0} X < X 0 , Eq. (194) reduces to
g u ′ ′ ( X ) − P e g u ′ ( X ) + ( λ m − γ ~ ) g u ( X ) = 0 , (199) g_{u}^{\prime\prime}(X) - \mathrm{Pe}\,g_{u}^{\prime}(X) + (\lambda_{m} - \tilde{\gamma})g_{u}(X) = 0, \tag*{(199)} g u ′′ ( X ) − Pe g u ′ ( X ) + ( λ m − γ ~ ) g u ( X ) = 0 , (199)
with the upstream boundary condition g u ′ ( 0 ) − P e g u ( 0 ) = 0 g_{u}^{\prime}(0) - \mathrm{Pe}\,g_{u}(0) = 0 g u ′ ( 0 ) − Pe g u ( 0 ) = 0 .
There are now a priori two cases to consider, depending on the sign of the discriminant P e 2 − 4 ( λ m − γ ~ ) \mathrm{Pe}^{2} - 4(\lambda_{m} - \tilde{\gamma}) Pe 2 − 4 ( λ m − γ ~ ) . Let us make the transformation to a Sturm-Liouville problem introduced in § 0.1 F. Introducing y ( X ) = e − P e X / 2 g ( X ) y(X) = e^{-\mathrm{Pe}X/2}g(X) y ( X ) = e − Pe X /2 g ( X ) , Eq. (194) becomes
y ′ ′ ( X ) = [ γ ~ + P e 2 4 − λ m Θ ( X 0 − X ) ] y ( X ) . (200) y^{\prime\prime}(X) = \left[\tilde{\gamma} + \frac{\mathrm{Pe}^{2}}{4} - \lambda_{m}\Theta(X_{0} - X)\right]y(X). \tag*{(200)} y ′′ ( X ) = [ γ ~ + 4 Pe 2 − λ m Θ ( X 0 − X ) ] y ( X ) . (200)
When γ ~ > λ m − P e 2 / 4 \tilde{\gamma} > \lambda_{m} - \mathrm{Pe}^{2}/4 γ ~ > λ m − Pe 2 /4 , the coefficient on the right-hand side is positive everywhere. The principal eigenfunction of this Sturm-Liouville problem does not change sign and can be chosen positive [32 ] . With y ( X ) > 0 y(X) > 0 y ( X ) > 0 for X ∈ [ 0 , 1 ] X \in[0,1] X ∈ [ 0 , 1 ] , we also have y ′ ′ ( X ) > 0 y^{\prime\prime}(X) > 0 y ′′ ( X ) > 0 for X ∈ [ 0 , 1 ] X \in[0,1] X ∈ [ 0 , 1 ] , and thus, y ′ y^{\prime} y ′ is strictly increasing. However, the boundary conditions give
y ′ ( 0 ) = P e 2 y ( 0 ) > 0 , y ′ ( 1 ) = − P e 2 y ( 1 ) < 0 , (201) y^{\prime}(0) = \frac{\mathrm{Pe}}{2}y(0) > 0,\qquad y^{\prime}(1) = -\frac{\mathrm{Pe}}{2}y(1) < 0, \tag*{(201)} y ′ ( 0 ) = 2 Pe y ( 0 ) > 0 , y ′ ( 1 ) = − 2 Pe y ( 1 ) < 0 , (201)
which is incompatible with y ′ ( X ) y^{\prime}(X) y ′ ( X ) being strictly increasing. Hence γ ~ max ≤ λ m − P e 2 / 4 \tilde{\gamma}_{\max} \leq\lambda_{m} - \mathrm{Pe}^{2}/4 γ ~ m a x ≤ λ m − Pe 2 /4 , so all eigenvalues γ ~ \tilde{\gamma} γ ~ satisfy γ ~ ≤ λ m − P e 2 / 4 \tilde{\gamma} \leq\lambda_{m} - \mathrm{Pe}^{2}/4 γ ~ ≤ λ m − Pe 2 /4 .
Let us thus focus on the case where γ ~ < λ m − P e 2 / 4 \tilde{\gamma} < \lambda_{m} - \mathrm{Pe}^{2}/4 γ ~ < λ m − Pe 2 /4 . In this case, we have
g u ( X ) = e P e X / 2 [ A u cos ( Q m X ) + C u sin ( Q m X ) ] , (202) g_{u}(X) = e^{\mathrm{Pe}X/2}\left[A_{u}\cos(Q_{m}X) + C_{u}\sin(Q_{m}X)\right], \tag*{(202)} g u ( X ) = e Pe X /2 [ A u cos ( Q m X ) + C u sin ( Q m X ) ] , (202)
with
Q m = 4 λ m − 4 γ ~ − P e 2 2 . (203) Q_{m} = \frac{\sqrt{4\lambda_{m} - 4\tilde{\gamma} - \mathrm{Pe}^{2}}}{2}. \tag*{(203)} Q m = 2 4 λ m − 4 γ ~ − Pe 2 . (203)
The upstream boundary condition yields
C u = P e 2 Q m A u . (204) C_{u} = \frac{\mathrm{Pe}}{2Q_{m}}A_{u}. \tag*{(204)} C u = 2 Q m Pe A u . (204)
We now determine γ ~ \tilde{\gamma} γ ~ by matching the upstream and downstream solutions so that
g u ( X 0 ) = g d ( X 0 ) , (205) g_{u}(X_{0}) = g_{d}(X_{0}), \tag*{(205)} g u ( X 0 ) = g d ( X 0 ) , (205)
g u ′ ( X 0 ) = g d ′ ( X 0 ) . (206) g_{u}^{\prime}(X_{0}) = g_{d}^{\prime}(X_{0}). \tag*{(206)} g u ′ ( X 0 ) = g d ′ ( X 0 ) . (206)
This yields the system of equations
A u e P e X 0 / 2 [ cos ( Q m X 0 ) + P e 2 Q m sin ( Q m X 0 ) ] = A d ( e r + X 0 − r + r − e r − X 0 + r + − r − ) , A u e P e X 0 / 2 [ P e cos ( Q m X 0 ) + ( P e 2 4 Q m − Q m ) sin ( Q m X 0 ) ] = A d ( r + e r + X 0 − r − e r − X 0 + r + − r − ) . (207) \begin{aligned}
A_{u}e^{\mathrm{Pe}X_{0}/2}\left[\cos(Q_{m}X_{0}) + \frac{\mathrm{Pe}}{2Q_{m}}\sin(Q_{m}X_{0})\right] &= A_{d}\left(e^{r_{+}X_{0}} - \frac{r_{+}}{r_{-}}e^{r_{-}X_{0}+r_{+}-r_{-}}\right),\\
A_{u}e^{\mathrm{Pe}X_{0}/2}\left[\mathrm{Pe}\cos(Q_{m}X_{0}) + \left(\frac{\mathrm{Pe}^{2}}{4Q_{m}} - Q_{m}\right)\sin(Q_{m}X_{0})\right] &= A_{d}\left(r_{+}e^{r_{+}X_{0}} - r_{-}e^{r_{-}X_{0}+r_{+}-r_{-}}\right). \tag*{(207)}
\end{aligned} A u e Pe X 0 /2 [ cos ( Q m X 0 ) + 2 Q m Pe sin ( Q m X 0 ) ] A u e Pe X 0 /2 [ Pe cos ( Q m X 0 ) + ( 4 Q m Pe 2 − Q m ) sin ( Q m X 0 ) ] = A d ( e r + X 0 − r − r + e r − X 0 + r + − r − ) , = A d ( r + e r + X 0 − r − e r − X 0 + r + − r − ) . (207)
This system admits nontrivial solutions if the associated determinant vanishes, which gives
r + [ e ( r + − r − ) ( X 0 − 1 ) − 1 ] [ 1 + P e 2 Q m tan ( Q m X 0 ) ] − [ e ( r + − r − ) ( X 0 − 1 ) − r + r − ] [ P e + ( P e 2 4 Q m − Q m ) tan ( Q m X 0 ) ] = 0. (208) r_{+}\left[e^{(r_{+}-r_{-})(X_{0}-1)} - 1\right]\left[1 + \frac{\mathrm{Pe}}{2Q_{m}}\tan(Q_{m}X_{0})\right] - \left[e^{(r_{+}-r_{-})(X_{0}-1)} - \frac{r_{+}}{r_{-}}\right]\left[\mathrm{Pe} + \left(\frac{\mathrm{Pe}^{2}}{4Q_{m}} - Q_{m}\right)\tan(Q_{m}X_{0})\right] = 0. \tag*{(208)} r + [ e ( r + − r − ) ( X 0 − 1 ) − 1 ] [ 1 + 2 Q m Pe tan ( Q m X 0 ) ] − [ e ( r + − r − ) ( X 0 − 1 ) − r − r + ] [ Pe + ( 4 Q m Pe 2 − Q m ) tan ( Q m X 0 ) ] = 0. (208)
Note that this form assumes cos ( Q m X 0 ) ≠ 0 \cos(Q_{m}X_{0}) \ne0 cos ( Q m X 0 ) = 0 . Note also that the special case where γ ~ = λ m − P e 2 / 4 \tilde{\gamma} = \lambda_{m} - \mathrm{Pe}^{2}/4 γ ~ = λ m − Pe 2 /4 corresponds to Q m = 0 Q_{m} = 0 Q m = 0 and can be obtained by taking the Q m → 0 Q_{m} \to0 Q m → 0 limit of the expressions above. The largest solution γ ~ max \tilde{\gamma}_{\max} γ ~ m a x of Eq. (208) yields the effective mutant invasion growth rate:
γ max = D γ ~ max L 2 . (209) \gamma_{\max} = \frac{D\tilde{\gamma}_{\max}}{L^{2}}. \tag*{(209)} γ m a x = L 2 D γ ~ m a x . (209)
Overall, compared to the general calculation in § 0.1 F, the step-function division rate profile allowed us to obtain an explicit equation to determine γ ~ max \tilde{\gamma}_{\max} γ ~ m a x , namely Eq. (208) . This calculation did not require expanding in small s s s , and is thus not restricted to the weak-selection regime of Eq. (121) .
In addition, in the case of a step-function division rate profile, Eq. (121) reduces to
γ max = s r w ∫ 0 X 0 B 2 ( X ) e − P e X d X ∫ 0 1 B 2 ( X ) e − P e X d X + O ( s 2 ) , (210) \gamma_{\max}=s r_w\frac{\int_{0}^{X_0}B^2(X)e^{-\mathrm{Pe}X}\,\mathrm{d}X}{\int_{0}^{1}B^2(X)e^{-\mathrm{Pe}X}\,\mathrm{d}X}+O(s^2), \tag*{(210)} γ m a x = s r w ∫ 0 1 B 2 ( X ) e − Pe X d X ∫ 0 X 0 B 2 ( X ) e − Pe X d X + O ( s 2 ) , (210)
which can be evaluated using the analytical expressions of B ( X ) B(X) B ( X ) in Eqs. (165) and (S158) and of X 0 X_0 X 0 in Eq. (167) . We find
γ max = s r w 2 P e ( P e + λ w X 0 ) P e 2 + 2 λ w ( 2 + P e X 0 ) + e − P e ( 1 − X 0 ) ( P e 2 − 4 λ w ) + O ( s 2 ) . (211) \gamma_{\max}=s r_w\frac{2\mathrm{Pe}(\mathrm{Pe}+\lambda_wX_0)}{\mathrm{Pe}^2+2\lambda_w(2+\mathrm{Pe}X_0)+e^{-\mathrm{Pe}(1-X_0)}(\mathrm{Pe}^2-4\lambda_w)}+O(s^2). \tag*{(211)} γ m a x = s r w Pe 2 + 2 λ w ( 2 + Pe X 0 ) + e − Pe ( 1 − X 0 ) ( Pe 2 − 4 λ w ) 2 Pe ( Pe + λ w X 0 ) + O ( s 2 ) . (211)
Introducing β = arcsin ( P e / P e 0 ) \beta=\arcsin(\mathrm{Pe}/\mathrm{Pe}_0) β = arcsin ( Pe / Pe 0 ) as in Eq. (182) gives
γ max = s r w 2 tan β ( β + sin β cos β ) 1 + sin 2 β + 2 β tan β − cos 2 β e − ( P e 0 sin β − 4 β tan β ) + O ( s 2 ) . (212) \gamma_{\max}=s r_w\frac{2\tan\beta\,(\beta+\sin\beta\cos\beta)}{1+\sin^2\beta+2\beta\tan\beta-\cos^2\beta\,e^{-(\mathrm{Pe}_0\sin\beta-4\beta\tan\beta)}}+O(s^2). \tag*{(212)} γ m a x = s r w 1 + sin 2 β + 2 β tan β − cos 2 β e − ( Pe 0 s i n β − 4 β t a n β ) 2 tan β ( β + sin β cos β ) + O ( s 2 ) . (212)
For reference, we also calculate γ W M \gamma_{\mathrm{WM}} γ WM given in Eq. (123) in the case of the step-function division rate profile:
γ W M = s r w P e P e + λ w ( 1 − X 0 ) = s r w P e P e + ( 1 − X 0 ) P e 0 2 / 4 = s r w 2 sin 2 β 2 sin 2 β + P e 0 cos β − 4 β , (213) \begin{aligned}
\gamma_{\mathrm{WM}}=s r_w\frac{\mathrm{Pe}}{\mathrm{Pe}+\lambda_w(1-X_0)}=s r_w\frac{\mathrm{Pe}}{\mathrm{Pe}+(1-X_0)\mathrm{Pe}_0^2/4} \\
&=s r_w\frac{2\sin2\beta}{2\sin2\beta+\mathrm{Pe}_0\cos\beta-4\beta}, \tag*{(213)}
\end{aligned} γ WM = s r w Pe + λ w ( 1 − X 0 ) Pe = s r w Pe + ( 1 − X 0 ) Pe 0 2 /4 Pe = s r w 2 sin 2 β + Pe 0 cos β − 4 β 2 sin 2 β , (213)
where the expression in the second line is written in terms of β = arcsin ( P e / P e 0 ) \beta=\arcsin(\mathrm{Pe}/\mathrm{Pe}_0) β = arcsin ( Pe / Pe 0 ) and P e 0 \mathrm{Pe}_0 Pe 0 .
Figure S12 shows that the principal eigenvalue γ max \gamma_{\max} γ m a x of A s † A_s^\dagger A s † indeed describes well the mutant invasion growth rate. We also note that γ max \gamma_{\max} γ m a x is convex beyond the first-order approximation given in Eq. (121) . Furthermore, we observe that γ max \gamma_{\max} γ m a x grows with the Péclet number, and that, as P e → P e max \mathrm{Pe}\to\mathrm{Pe}_{\max} Pe → Pe m a x , γ max / r w → s \gamma_{\max}/r_w\to s γ m a x / r w → s , which is the well-mixed expectation for k ≪ F i n k\ll F_{\mathrm{in}} k ≪ F in . Finally, Figure S12 shows that the expression in Eq. (208) within the step-function growth rate approximation provides an excellent approximation of the exact mutant invasion growth rate for k / F i n = 10 − 4 k/F_{\mathrm{in}}=10^{-4} k / F in = 1 0 − 4 .
Figure S12. Mutant invasion growth rate γ max \gamma_{\max} γ m a x versus mutant relative fitness advantage s s s , for different values of the Péclet number P e \mathrm{Pe} Pe . The mutant invasion growth rate γ max \gamma_{\max} γ m a x , scaled by the wild-type division rate r w r_w r w , is reported from different approaches. First, numerical integrations of Eqs. (S1), (S2), (S3) were performed with an initial small concentration of mutants, and the initial growth rate of mutant number was determined by a linear fit in a semilogarithmic plot (“PDE numerics”). Second, the principal eigenvalue γ max \gamma_{\max} γ m a x of the operator A s † A_s^\dagger A s † was determined numerically (“Principal eigenvalue”). Its explicit first-order approximation is also shown (“First-order approx.”). Finally, the principal eigenvalue was also determined using Eq. (208) in the case where ρ \rho ρ is approximated by a step function (“Princ. eigval., step ρ \rho ρ ”). (a) Parameter values: same λ w \lambda_w λ w (and hence P e max \mathrm{Pe}_{\max} Pe m a x ), k / F i n k/F_{\mathrm{in}} k / F in and α \alpha α as in main text Figure 1 , Figure 2 and Figure 3 . (b) Same parameter values, except that k / F i n = 10 − 4 k/F_{\mathrm{in}} = 10^{-4} k / F in = 1 0 − 4 . In this case, the solid and dashed lines are superposed.
Fixation probability of a neutral mutant and active population size
In Section I G, we showed that the fixation probability of a neutral mutant can be related to the active population size, see Eq. (143) . In the case where the division rate profile ρ \rho ρ is a step function, we obtain the explicit expression
N a c t i v e N = 4 λ w + P e 2 + 2 λ w P e X 0 + e − P e ( 1 − X 0 ) ( P e 2 − 4 λ w ) 2 ( λ w + P e − λ w X 0 ) ( P e + λ w X 0 ) (214) \frac{N_{\mathrm{active}}}{N} = \frac{4\lambda_w + \mathrm{Pe}^{2} + 2\lambda_w\mathrm{Pe}X_0 + e^{-\mathrm{Pe}(1-X_0)}(\mathrm{Pe}^{2} - 4\lambda_w)}{2(\lambda_w + \mathrm{Pe} - \lambda_w X_0)(\mathrm{Pe} + \lambda_w X_0)} \tag*{(214)} N N active = 2 ( λ w + Pe − λ w X 0 ) ( Pe + λ w X 0 ) 4 λ w + Pe 2 + 2 λ w Pe X 0 + e − Pe ( 1 − X 0 ) ( Pe 2 − 4 λ w ) (214)
which can be rewritten in terms of β = arcsin ( P e / P e 0 ) \beta= \arcsin(\mathrm{Pe}/\mathrm{Pe}_0) β = arcsin ( Pe / Pe 0 ) and P e 0 \mathrm{Pe}_0 Pe 0 as
N a c t i v e N = 4 cos 2 β [ 1 + sin 2 β + 2 β tan β − cos 2 β e − ( P e 0 sin β − 4 β tan β ) ] ( 2 β + sin 2 β ) ( P e 0 cos β − 4 β + 2 sin 2 β ) (215) \frac{N_{\mathrm{active}}}{N} = \frac{4\cos^{2}\beta\left[1+\sin^{2}\beta+2\beta\tan\beta-\cos^{2}\beta e^{-(\mathrm{Pe}_0\sin\beta-4\beta\tan\beta)}\right]}{(2\beta+\sin2\beta)(\mathrm{Pe}_0\cos\beta-4\beta+2\sin2\beta)} \tag*{(215)} N N active = ( 2 β + sin 2 β ) ( Pe 0 cos β − 4 β + 2 sin 2 β ) 4 cos 2 β [ 1 + sin 2 β + 2 β tan β − cos 2 β e − ( Pe 0 s i n β − 4 β t a n β ) ] (215)
Comparison with Ref. ghosh2022emergent
In Ref. [25 ] , the dynamics of a selected mutant lineage in the gut was also studied in the regime where mutants are rare. However, there are several differences from our analysis, which we describe here.
First, here, we focus on the case where D D D and v v v are constant, and we neglect bacterial death. Ref. [25 ] formally addressed the more general case where D D D and v v v may depend on x x x and included bacterial death. However, their subsequent analytical work also mainly focused on constant D D D and v v v , and no bacterial death. Here, we restrict our comparison to this case.
Second, formally, in Ref. [25 ] , the change in local mutant number density over one short time interval was separated into deterministic and stochastic parts. The deterministic change contains the mean effects of birth, death, advection, and diffusion. Meanwhile, fluctuations around these means in the stochastic increment are approximated using independent, zero-mean, unit-variance Gaussian variables associated with the different microscopic event types. Here, we did not employ such an approximation.
Third, derivations in Ref. [25 ] are based on the Laplace generating functional of the fluctuating spatial mutant number density field. Combining the generating-functional representation in Eq. S28 of Ref. [25 ] with the nonzero long-time fixed point in Eq. S101 shows that the extinction probability, starting from a single initial mutant at position x x x , is u ~ ( x ) = e − w ~ ( x ) \tilde{u}(x) = e^{-\tilde{w}(x)} u ~ ( x ) = e − w ~ ( x ) . Eq. 13 of Ref. [25 ] is the stationary equation satisfied by the logarithmic field w ~ ( x ) = − log [ u ~ ( x ) ] \tilde{w}(x) = -\log[\tilde{u}(x)] w ~ ( x ) = − log [ u ~ ( x )] . Note that we denote their logarithmic field by w ~ \tilde{w} w ~ , while henceforth, w w w will denote the corresponding exact log-extinction field in our branching process. These two fields are a priori not identical, because w ~ \tilde{w} w ~ follows from the Gaussian approximation of Ref. [25 ] , while w w w follows from our exact branching process.
Starting from our Eq. (25) on the mutant extinction probability u ( x ) u(x) u ( x ) in the exact fixed-environment branching process, and introducing w ( x ) = − log [ u ( x ) ] w(x) = -\log[u(x)] w ( x ) = − log [ u ( x )] , we obtain
0 = D w ′ ′ ( x ) + v w ′ ( x ) − D [ w ′ ( x ) ] 2 + r m ρ ( x ) [ 1 − e − w ( x ) ] . (216) 0 = D w''(x) + v w'(x) - D [w'(x)]^2 + r_m \rho(x) \left[1-e^{-w(x)}\right]. \tag*{(216)} 0 = D w ′′ ( x ) + v w ′ ( x ) − D [ w ′ ( x ) ] 2 + r m ρ ( x ) [ 1 − e − w ( x ) ] . (216)
Note that a gradient-square term is generated by the logarithmic change of variables. Performing a Taylor expansion of the exponential term for small w w w leads to
0 = D w ′ ′ ( x ) + v w ′ ( x ) − D [ w ′ ( x ) ] 2 + r m ρ ( x ) w ( x ) − r m ρ ( x ) 2 w 2 ( x ) + O ( w 3 ( x ) ) . (217) 0 = D w''(x) + v w'(x) - D [w'(x)]^2 + r_m \rho(x)w(x) - \frac{r_m \rho(x)}{2}w^2(x) + O\left(w^3(x)\right). \tag*{(217)} 0 = D w ′′ ( x ) + v w ′ ( x ) − D [ w ′ ( x ) ] 2 + r m ρ ( x ) w ( x ) − 2 r m ρ ( x ) w 2 ( x ) + O ( w 3 ( x ) ) . (217)
Neglecting terms whose leading contribution is O ( w 3 ) O(w^3) O ( w 3 ) , this is the same bulk differential equation as Eq. 13 in Ref. [25 ] , specialized to constant D D D and v v v , zero mutant death rate (d m = 0 d_m = 0 d m = 0 in their notations), and with mutant division rate b m = r m ρ ( x ) b_m = r_m \rho(x) b m = r m ρ ( x ) . Thus, up to second order, the equation satisfied by our w w w has the same form as the equation satisfied by their w ~ \tilde{w} w ~ . Indeed, the Gaussian approximation reproduces the first and second cumulants of demographic terms. Note that in our branching process, higher demographic cumulants generate cubic and higher-order terms absent from Eq. 13 of Ref. [25 ] .
Despite this agreement up to second order in the logarithmic field w w w , it is important to note that
ϕ ( x ) ≡ 1 − u ( x ) = 1 − e − w ( x ) = w ( x ) − w 2 ( x ) 2 + O ( w 3 ( x ) ) . (218) \phi(x) \equiv1-u(x) = 1-e^{-w(x)} = w(x) - \frac{w^2(x)}{2} + O\left(w^3(x)\right). \tag*{(218)} ϕ ( x ) ≡ 1 − u ( x ) = 1 − e − w ( x ) = w ( x ) − 2 w 2 ( x ) + O ( w 3 ( x ) ) . (218)
Hence, the mutant log-extinction field w w w and the mutant fixation probability ϕ \phi ϕ only match to first order. Ref. [25 ] interprets its stationary logarithmic field as a fixation probability. Overall, beyond leading order, the two approaches differ both in the stochastic description and in the relation between the logarithmic field and fixation probability.
Finally, another difference is that although Ref. [25 ] specifies finite-L L L boundary conditions for the bacterial density, their explicit minimal-model establishment calculation takes the downstream part of the colon to be infinite, with w ~ ( x ) → 0 \tilde{w}(x) \to0 w ~ ( x ) → 0 as x → ∞ x \to\infty x → ∞ . Here, we retain the finite colon model throughout.
Figure S13 compares our results from Eq. (18) and from our stochastic simulations to the results obtained using Eq. (217) , matching Eq. 13 in Ref. [25 ] . We observe that all results agree in the limit of small relative mutant fitness advantage (consistent with the fact that the first-order results coincide), but that our results are in better agreement with those of stochastic simulations for larger s s s . These conclusions hold both for the fixation probability ϕ ( x ) \phi(x) ϕ ( x ) of a mutant introduced at a given location x x x along the gut (Figure S13 ) and for the division-event-weighted mutant fixation probability ⟨ ϕ ⟩ \langle\phi\rangle ⟨ ϕ ⟩ (Figure S13 ).
Figure S13. Comparison between the present results and those of [25 ] for the mutant fixation probability. (a) Mutant fixation probability ϕ ( X ) \phi(X) ϕ ( X ) versus normalized initial mutant position X = x / L X=x/L X = x / L along the gut, for different values of the mutant relative fitness advantage s s s . Stochastic simulations are described in Section IV A. Numerical solutions of the branching process Eq. (18) use the steady-state mutant-free profile of the division rate ρ \rho ρ (“BP numerics”). Numerical solutions of Eq. (S209), matching Eq. 13 in [25 ] , use the same steady-state mutant-free profile of the division rate ρ \rho ρ (“Ref. [25 ] ”). Parameter values: same as in main text Figure 1 and Figure 2 . (b) Division-event-weighted mutant fixation probability ⟨ ϕ ⟩ \langle\phi\rangle ⟨ ϕ ⟩ versus mutant relative fitness advantage s s s , for different values of the Péclet number P e \mathrm{Pe} Pe . Stochastic simulations are described in Section IV A. Numerical solutions of the branching process Eq. (18) use the steady-state mutant-free profile of the division rate ρ \rho ρ (“BP numerics”). Numerical solutions of Eq. (S209), matching Eq. 13 in [25 ] , use the same steady-state mutant-free profile of the division rate ρ \rho ρ (“Ref. [25 ] ”). The Moran model for large populations, ⟨ ϕ ⟩ = s / ( 1 + s ) \langle\phi\rangle=s/(1+s) ⟨ ϕ ⟩ = s / ( 1 + s ) , gives the well-mixed reference. Parameters: same λ w \lambda_w λ w (and P e max \mathrm{Pe}_{\max} Pe m a x ), k / F i n k/F_{\mathrm{in}} k / F in and α \alpha α as in main text Figure 1 , Figure 2 and Figure 3 .
Numerical methods
Stochastic simulations
Our stochastic simulation method extends that of Ref. [24 ] , which considered the neutral mutant case. Space and time are discretized, and we denote the corresponding discretization steps by δ x \delta x δ x and δ t \delta t δ t , respectively. Specifically, as in § 0.1 B 1 and I C 1, the system is discretized into K K K intervals of length δ x = L / K \delta x=L/K δ x = L / K , resulting into K + 1 K+1 K + 1 discrete sites, located at x i = i δ x x_i=i\delta x x i = i δ x , with 0 ≤ i ≤ K 0\le i\le K 0 ≤ i ≤ K (see Figure S1 ). Boundary conditions are also implemented as specified there: there is no upstream jump from x 0 x_0 x 0 , and there are only advective downstream jumps from x K x_K x K .
We denote by n w ( x i , t ) n_w(x_i,t) n w ( x i , t ) and n m ( x i , t ) n_m(x_i,t) n m ( x i , t ) the numbers of wild-type and mutant bacteria at site x i x_i x i , respectively, and by F ( x i , t ) = F ( x i , t ) δ x F(x_i,t)=\mathcal{F}(x_i,t)\delta x F ( x i , t ) = F ( x i , t ) δ x the amount of food at this site. Bacteria are discrete, while food is treated as a continuous quantity. The stochastic model is constructed to recover the continuous equations Eqs. (S1), (S2), (S3) in the continuum limit (where δ x \delta x δ x and δ t \delta t δ t tend to zero and bacterial number to infinity, and fluctuations become negligible).
Transport and division. During each time step δ t \delta t δ t , bacteria undergo transport and division, while food is consumed and transported by advection-diffusion. The corresponding rules are the following:
p − = D δ t ( δ x ) 2 (219) p_- = \frac{D\delta t}{(\delta x)^2} \tag*{(219)} p − = ( δ x ) 2 D δ t (219)
to move to its upstream neighboring site, and a probability
p + = D δ t ( δ x ) 2 + v δ t δ x (220) p_+ = \frac{D\delta t}{(\delta x)^2} + \frac{v\delta t}{\delta x} \tag*{(220)} p + = ( δ x ) 2 D δ t + δ x v δ t (220)
to move to its downstream neighboring site. The probability to remain at the same site is 1 − p − − p + 1-p_- -p_+ 1 − p − − p + .
p w ( x i , t ) = r w δ t F ( x i , t ) k ~ + F ( x i , t ) , (221) p_w(x_i,t) = r_w\delta t \frac{\mathcal{F}(x_i,t)}{\tilde{k}+\mathcal{F}(x_i,t)}, \tag*{(221)} p w ( x i , t ) = r w δ t k ~ + F ( x i , t ) F ( x i , t ) , (221)
where k ~ = k δ x \tilde{k}=k\delta x k ~ = k δ x , while each mutant bacterium divides with probability
p m ( x i , t ) = r m δ t F ( x i , t ) k ~ + F ( x i , t ) . (222) p_m(x_i,t) = r_m\delta t \frac{\mathcal{F}(x_i,t)}{\tilde{k}+\mathcal{F}(x_i,t)}. \tag*{(222)} p m ( x i , t ) = r m δ t k ~ + F ( x i , t ) F ( x i , t ) . (222)
Here, r w r_w r w and r m r_m r m denote the maximal division rates of wild-type and mutant bacteria, respectively.
Each division event produces one additional bacterium of the same type at the same site and consumes an amount 1 / α 1/\alpha 1/ α of food. Consequently, if n r e p ( x i , t ) n_{\mathrm{rep}}(x_i,t) n rep ( x i , t ) division events occur at site x i x_i x i during δ t \delta t δ t , the local amount of food is decreased by
Δ F ( x i , t ) = − n r e p ( x i , t ) α . (223) \Delta\mathcal{F}(x_i,t)=-\frac{n_{\mathrm{rep}}(x_i,t)}{\alpha}. \tag*{(223)} Δ F ( x i , t ) = − α n rep ( x i , t ) . (223)
As in Ref. [24 ] , this discretization may lead to transient negative local amounts of food. Whenever this occurs, the division probability is set to zero.
F ( x i , t + δ t ) = F ( x i , t ) + D δ t ( δ x ) 2 [ F ( x i + 1 , t ) − 2 F ( x i , t ) + F ( x i − 1 , t ) ] − v δ t 2 δ x [ F ( x i + 1 , t ) − F ( x i − 1 , t ) ] . (224) \mathcal{F}(x_i,t+\delta t)=\mathcal{F}(x_i,t)+\frac{D\delta t}{(\delta x)^2}\left[\mathcal{F}(x_{i+1},t)-2\mathcal{F}(x_i,t)+\mathcal{F}(x_{i-1},t)\right]-\frac{v\delta t}{2\delta x}\left[\mathcal{F}(x_{i+1},t)-\mathcal{F}(x_{i-1},t)\right]. \tag*{(224)} F ( x i , t + δ t ) = F ( x i , t ) + ( δ x ) 2 D δ t [ F ( x i + 1 , t ) − 2 F ( x i , t ) + F ( x i − 1 , t ) ] − 2 δ x v δ t [ F ( x i + 1 , t ) − F ( x i − 1 , t ) ] . (224)
The boundary sites are updated separately to account for the prescribed inlet conditions and the downstream boundary conditions. Note that this implementation of food transport slightly differs from Ref. [24 ] . However, the relative difference between the associated effective diffusion coefficients is v δ x / ( 2 D ) = P e / ( 2 K ) v\delta x/(2D)=\mathrm{Pe}/(2K) v δ x / ( 2 D ) = Pe / ( 2 K ) , where K K K is the number of intervals between discretized sites. Hence, the two schemes match for large enough K K K . In practice, we used K = 300 K=300 K = 300 .
Simulation procedure. Simulations are performed as follows:
Initialization. We first determine the stationary wild-type bacterial and food profiles by numerically solving the deterministic reaction-advection-diffusion equations. The stationary solution is obtained by iterating the discretized equations until the total absolute change in the bacterial and food profiles between two consecutive iterations falls below a prescribed convergence threshold. The initial total number of wild-type bacteria is obtained from the stationary bacterial profile, rounded with the floor function. Individual bacteria are then randomly distributed among the sites, with probabilities proportional to the local stationary bacterial density. The initial food distribution is taken directly from the deterministic stationary profile.
Stochastic equilibration. Starting from this initial configuration, the wild-type population is left to relax to its stochastic steady-state by simulating its dynamics for a duration t i n i t t_{\mathrm{init}} t init . At each time step, the following operations are performed:
Bacterial transport is simulated by drawing, at each site, the numbers of bacteria moving upstream, moving downstream, or remaining at the same site from a multinomial distribution. Boundary sites are treated separately to account for the boundary conditions.
The number of dividing bacteria at each site is drawn from a binomial distribution, with the division probability determined by the local food amount. The bacterial population and food amount are updated accordingly.
Food is transported deterministically according to the discretized advection-diffusion equation. The resulting bacterial and food distributions are used as the initial configuration for the subsequent fixation simulations.
Dynamics until fixation or extinction. Following mutant introduction, both wild-type and mutant populations are transported in the same way, but they divide with their respective maximal division rates r w r_w r w and r m r_m r m . The simulation continues until one of the two populations disappears. Three outcomes are distinguished: extinction of the mutant, fixation of the mutant, and complete washout of both populations. Specifically, a mutant is considered fixed when no wild-type bacteria remain while at least one mutant bacterium is still present. Conversely, mutant extinction occurs when all mutant bacteria disappear while wild-type bacteria remain. Complete washout corresponds to the disappearance of both populations. Although this outcome is possible in principle, it was never observed in our simulations, which were conducted below the washout threshold.
The stochastic procedure is repeated over N s i m N_{\mathrm{sim}} N sim realizations. As mentioned above, between successive realizations, the wild-type population is left to relax for a duration t i n t e r t_{\mathrm{inter}} t inter , starting from the configuration used to initialize the preceding realization. This procedure allows us to sample different configurations of the wild-type population in the stochastic steady state, rather than systematically starting from the same initial configuration, thereby reducing potential biases in the estimation of the fixation probability.
The fixation probability is estimated from the fraction of realizations resulting in mutant fixation:
ϕ ^ = N f i x N s i m , (225) \hat{\phi} = \frac{N_{\mathrm{fix}}}{N_{\mathrm{sim}}}, \tag*{(225)} ϕ ^ = N sim N fix , (225)
where N f i x N_{\mathrm{fix}} N fix denotes the number of fixation events.
Parameter values. The parameter values employed in our stochastic simulations are listed below:
Table 1.
Note that the linear concentrations used throughout this work are related to volume ones used in Ref. [24 ] via F l i n e a r = S F v o l u m e F_{\mathrm{linear}} = S F_{\mathrm{volume}} F linear = S F volume . These values give the dimensionless parameter values λ w = 75.6 \lambda_w = 75.6 λ w = 75.6 and k / F i n = 5 × 10 − 3 k/F_{\mathrm{in}} = 5 \times10^{-3} k / F in = 5 × 1 0 − 3 . In addition, v v v is varied from 0.28 c m / h 0.28\ \mathrm{cm}/\mathrm{h} 0.28 cm / h to 0.54 c m / h 0.54\ \mathrm{cm}/\mathrm{h} 0.54 cm / h while keeping F i n F_{\mathrm{in}} F in fixed, giving Péclet numbers from 0.5 P e max 0.5\ \mathrm{Pe}_{\max} 0.5 Pe m a x to 0.97 P e max 0.97\ \mathrm{Pe}_{\max} 0.97 Pe m a x , and total population sizes in the 1200–2400 range, with active population sizes around 500.
Our discretization employs K = 300 K = 300 K = 300 (corresponding to δ x = L / K = 0.02 c m \delta x = L/K = 0.02\ \mathrm{cm} δ x = L / K = 0.02 cm ) and δ t = 2 × 10 − 4 h \delta t = 2 \times10^{-4}\ \mathrm{h} δ t = 2 × 1 0 − 4 h , as in Ref. [24 ] . To obtain each marker in our figures, N s i m = 10 5 N_{\mathrm{sim}} = 10^5 N sim = 1 0 5 simulation replicates were performed. The values of t i n i t t_{\mathrm{init}} t init and t i n t e r t_{\mathrm{inter}} t inter used in the stochastic simulations reported in our figures are respectively 10 7 10^7 1 0 7 and 10 4 10^4 1 0 4 time steps, i.e. 2000 hours and 2 hours.
Numerical solutions
We performed numerical integration of the coupled partial differential equations in Eqs. (S1), (S2) and (S3) in Python, using an explicit Euler scheme in time and finite differences in space. Our discretization uses time step δ t \delta t δ t and spatial step δ x \delta x δ x . The values of δ t \delta t δ t and δ x \delta x δ x we employed in our figures are as follows:
Main text Figs. 1 and 4, and Figs. S4, S5, S9: D δ t / L 2 = 1.4 × 10 − 7 D\delta t/L^2 = 1.4 \times10^{-7} D δ t / L 2 = 1.4 × 1 0 − 7 and δ x / L = 1.7 × 10 − 3 \delta x/L = 1.7 \times10^{-3} δ x / L = 1.7 × 1 0 − 3 .
Main text Figs. 2 and 3, and Figs. S2, S3, S6, S7, S12, S13: D δ t / L 2 = 5.6 × 10 − 7 D\delta t/L^2 = 5.6 \times10^{-7} D δ t / L 2 = 5.6 × 1 0 − 7 and δ x / L = 3.3 × 10 − 3 \delta x/L = 3.3 \times10^{-3} δ x / L = 3.3 × 1 0 − 3 .
Fig. S11: D δ t / L 2 = 2 × 10 − 7 D\delta t/L^2 = 2 \times10^{-7} D δ t / L 2 = 2 × 1 0 − 7 and δ x / L = 2 × 10 − 3 \delta x/L = 2 \times10^{-3} δ x / L = 2 × 1 0 − 3 .
Stationary solutions were obtained by using the first time point where the absolute difference between two successive time points was smaller than 10 − 10 10^{-10} 1 0 − 10 .
Numerical solutions of ordinary differential equations such as Eq. (18) were obtained using the function solve_bvp of the Python scipy.integrate library with a tolerance of 10 − 9 10^{-9} 1 0 − 9 and a maximum number of mesh nodes of 2 × 10 5 2 \times10^{5} 2 × 1 0 5 .
Realistic parameter values in the human gut
Let us now discuss the realistic range of values of the dimensionless parameters in the human colon.
Relevant values of k / F i n k/F_{\mathrm{in}} k / F in . Let us start by considering k / F i n k/F_{\mathrm{in}} k / F in , and for this, let us first estimate F i n F_{\mathrm{in}} F in . Bacteria in the large intestine consume a mix of different nutrients that have not (or not completely) been absorbed in the small intestine. It is estimated that about 20 g of fibers per day and about the same weight of undigested starch reach the colon for the standard British diet (and potentially more for non-Western diets richer in fiber) [46 ] . Given that the inflow of digesta in the colon is about 2 liters per day [47 ] , the order of magnitude of the incoming food concentration F i n F_{\mathrm{in}} F in in the colon is of the order of 20 g/L. The Monod constant k k k depends on many factors, including the substrate and the bacterial strain. Even restricting to Escherichia coli growing on glucose, k k k can range from 0.03 to 5 mg/L depending on adaptation [48 ] , and it is typically higher for other substrates (e.g. 5 to 900 mg/L for different substrates [49 ] ). Realistic values for k / F i n k/F_{\mathrm{in}} k / F in thus span a wide range, but in all cases, they are much smaller than 1, at most of order 0.05. In practice, as long as k k k is small relative to F i n F_{\mathrm{in}} F in , we obtain similar results, and the analytical results in the limit of a step function, which is the limit of a very small k / F i n k/F_{\mathrm{in}} k / F in , are a good approximation of the full system (see Figure S11 ).
Relevant values of λ w \lambda_w λ w . The effective diffusion coefficient D D D models mixing of the digesta [8 ] , and is thus challenging to measure directly. However, based on analysis of experiments from Ref. [50 ] of the transport of markers through the gut, Ref. [9 ] estimated D D D to be in the range of ( 5 − 20 ) × 10 5 μ m 2 / s (5-20) \times10^{5}\ \mu\mathrm{m}^{2}/\mathrm{s} ( 5 − 20 ) × 1 0 5 μ m 2 / s .
A lower bound for the bacterial replication time is given by the minimal doubling time of fast replicating bacteria such as Escherichia coli in good conditions, which can be as low as 20 minutes [51 ] , yielding a growth rate around 6 × 10 − 4 / s 6 \times10^{-4}/\mathrm{s} 6 × 1 0 − 4 / s . Besides, an upper bound for the bacterial replication time in the gut is what is needed to survive turnover. Feces weigh about 130 g/day and contain 25 - 50% of bacteria in mass [52 ] . The typical mass of a bacterium being 1 pg, this means that about ( 3 − 6 ) × 10 13 (3-6) \times10^{13} ( 3 − 6 ) × 1 0 13 bacteria per day are lost in feces, to be compared with about 4 × 10 13 4 \times10^{13} 4 × 1 0 13 bacteria in the colon [53 ] , leading to about one renewal per day. However, this upper bound assumes that bacteria replicate at their maximal rate everywhere in the colon, so it is very likely that the bacteria maximal division rate is significantly higher. The growth rate of Bacteroides thetaiotaomicron in the mouse digestive tract has been measured to be of about 0.4 /h [54 ] , i.e. about 10 − 4 / s 10^{-4}/\mathrm{s} 1 0 − 4 / s . This probably better reflects the expected range for commensal bacteria. Overall, it is reasonable to take r w r_w r w between 0.6 × 10 − 4 / s 0.6 \times10^{-4}/\mathrm{s} 0.6 × 1 0 − 4 / s and 6 × 10 − 4 / s 6 \times10^{-4}/\mathrm{s} 6 × 1 0 − 4 / s .
The total length of the colon is 190 ± 26 190 \pm26 190 ± 26 cm, with 23 ± 7 23 \pm7 23 ± 7 cm for the ascending colon [55 ] , where most of the microbial activity takes place [9 ] . So the length L L L of the system of interest is in the 20 − 200 20-200 20 − 200 cm range, depending on whether the focus is on the ascending colon only, or on the whole colon (with reduced downstream bacterial activity due to nutrient depletion).
Taken together, these estimates lead to λ w = r w L 2 / D ≈ [ ( 0.6 − 6 ) × 10 − 4 ] × [ ( 0.2 − 2 ) × 10 6 ] 2 / [ ( 5 − 20 ) × 10 5 ] ≈ 1 − 5000 \lambda_w = r_wL^2/D \approx[(0.6-6) \times10^{-4}] \times[(0.2-2) \times10^{6}]^2/[(5-20) \times10^{5}] \approx1-5000 λ w = r w L 2 / D ≈ [( 0.6 − 6 ) × 1 0 − 4 ] × [( 0.2 − 2 ) × 1 0 6 ] 2 / [( 5 − 20 ) × 1 0 5 ] ≈ 1 − 5000 . The values used in our figures are in this range. Note that P e 0 = 2 λ w \mathrm{Pe}_0 = 2\sqrt{\lambda_w} Pe 0 = 2 λ w is thus of the order of 2 − 140 2-140 2 − 140 .
Relevant values of P e \mathrm{Pe} Pe . It is empirically well demonstrated that there is a strong gradient of bacterial concentration along the colon [56 ] , and that most nutrients that could be used by bacteria are consumed by the end of the colon [46 ] . The washout condition (Section II C) is P e max ≈ P e 0 2 / 4 \mathrm{Pe}_{\max} \approx\mathrm{Pe}_0^2/4 Pe m a x ≈ Pe 0 2 /4 for P e 0 < 1 \mathrm{Pe}_0 < 1 Pe 0 < 1 , and P e max ≈ P e 0 \mathrm{Pe}_{\max} \approx\mathrm{Pe}_0 Pe m a x ≈ Pe 0 for P e 0 > 10 \mathrm{Pe}_0 > 10 Pe 0 > 10 . When D D D increases, the system becomes more mixed, so for small P e \mathrm{Pe} Pe , gradients will be weaker. Thus, realistic Péclet numbers are smaller than P e max \mathrm{Pe}_{\max} Pe m a x , since observed gradients are strong. As P e 0 > 1 \mathrm{Pe}_0 > 1 Pe 0 > 1 , the regime where P e max ≈ P e 0 \mathrm{Pe}_{\max} \approx\mathrm{Pe}_0 Pe m a x ≈ Pe 0 is most relevant, and we thus expect P e \mathrm{Pe} Pe to be in the 1 − 140 1 - 140 1 − 140 range.
A second way to estimate P e \mathrm{Pe} Pe is to directly use its definition: P e = v L / D \mathrm{Pe} = vL/D Pe = v L / D . As mentioned above, D D D is in the range of ( 5 − 20 ) × 10 5 μ m 2 / s (5 - 20) \times10^{5}\ \mathrm{\mu m}^{2}/\mathrm{s} ( 5 − 20 ) × 1 0 5 μ m 2 / s , and L L L in the ( 2 − 20 ) × 10 5 μ m (2 - 20) \times10^{5}\ \mathrm{\mu m} ( 2 − 20 ) × 1 0 5 μ m range. The average diameter of the ascending colon is approximately 46 mm [57 ] . As mentioned above, the volume entering the colon per day is about 2 liters. Taken together, this gives an estimate of v ≈ 14 μ m / s v \approx14\ \mathrm{\mu m}/\mathrm{s} v ≈ 14 μ m / s . We thus obtain a range of 1.4 − 56 1.4 - 56 1.4 − 56 for P e \mathrm{Pe} Pe , which is compatible with our first estimate, while using different arguments.
Note also that P e / P e 0 = v / ( 2 r w D ) \mathrm{Pe}/\mathrm{Pe}_0 = v/(2\sqrt{r_wD}) Pe / Pe 0 = v / ( 2 r w D ) . Using the previously mentioned value for v v v , and ranges for r w r_w r w and D D D , we obtain P e / P e 0 \mathrm{Pe}/\mathrm{Pe}_0 Pe / Pe 0 in the range 0.2 − 1.3 0.2 - 1.3 0.2 − 1.3 . If P e max ≈ P e 0 \mathrm{Pe}_{\max} \approx\mathrm{Pe}_0 Pe m a x ≈ Pe 0 , this entails that P e / P e max \mathrm{Pe}/\mathrm{Pe}_{\max} Pe / Pe m a x is around washout, with a substantial fraction of the range below washout and a smaller fraction above it. The range considered in our figures is below washout but close to it.
Relevant values of s s s . In Escherichia coli bacteria well-adapted to their environment, most non-lethal mutations have small fitness effects: an average fitness cost of 0.3% was reported in Ref. [58 ] , and for beneficial mutants, fitness advantages s < 0.1 s < 0.1 s < 0.1 were reported in Ref. [59 ] . However, large fitness differences (up to s = 0.4 s = 0.4 s = 0.4 ) between evolved lineages have been observed in Escherichia coli during adaptation to the gut as a new environment [39 ] . This illustrates the importance of making predictions both for small fitness advantages and for larger ones.
References