Introduction

Natural bacterial communities usually form highly organized structures that are important for the functioning of the community, with strong impacts on health, ecology, and industry1,2,3. It is therefore essential to understand the principles that drive the organization in space and time of the diversity of phenotypes, stemming from different species or from phenotypic differentiation in isogenic populations, which are encountered in these structures. Although biochemical factors are well known to be at play2,4, the physics of microbial communities is also increasingly realized to play important roles in shaping their spatial organization. This includes external physical constraints, chiefly shear flows experienced in many confined environments, e.g., the soil, aquatic sediments, or the gastrointestinal tract5,6,7,8,9, but also sedimentation10,11, as well as physical interactions between bacteria, particularly when active motility drives the population far from equilibrium12,13,14.

Most natural bacterial populations indeed feature motile bacteria, which are often mixed with non-motile bacteria in proportions that can vary widely between environments13,15,16. The most widespread motility is flagellar swimming, most studied in the model organism Escherichia coli, in which the micrometric bacteria propel themselves by rotating their helical flagella and randomly explore the environment by alternating between forward runs at 10 − 100 μm/s and short reorienting tumbles17. During swimming, low Reynolds number fluid flows are elicited by the flagellum and the cell body, which can be modeled at first order as an extensile ("pusher”) dipole of forces18. These flows induce long-range hydrodynamic interactions with other bacteria and the physical boundaries of the environment, which add to short-range interactions to affect single-cell and population behaviors19. The interactions with boundaries lead to swimmers accumulating at the surface20,21,22,23, where they swim with a small inward tilt24,25,26,27,28 and describe circular trajectories29,30,31,32. At population level, in addition to the well-known collective motion emerging in pure suspensions of swimmers at high density33,34,35,36, these physical interactions have been recently found to also have the potential to shape more complex microbial communities, even at low cell densities14,37,38,39,40,41. In particular, in mixed motile and non-motile bacterial communities, non-equilibrium fluctuating density patterns of the non-motile species emerge from the interplay between sedimentation and fluid flows induced by the circular swimmers located near surfaces14. The curved swimmer trajectories on the surface induce vertical fluid flows that shuffle around the sedimenting non-motile cells, leading to strong horizontal density heterogeneities on scales of tens (up to hundreds) of bacterial length14,38. These results showed how swimmer-induced hydrodynamics produces large-scale heterogeneous behavior far from equilibrium, at much lower densities than previous collective motion studies, in mixed bacterial communities at rest. Their response under an external constraint like shear flow, which is ubiquitous in their natural environments, however, remained to be explored.

Shear flow is known to strongly impact the physical single-cell behavior of both motile and non-motile bacteria, and should thus strongly modify the picture obtained in suspensions at rest. Under shear, rod-shaped bacteria rotate following Jeffery’s orbits42, which combines when swimming with the ability to cross streamlines to produce non-trivial behaviors, including cycloid trajectories43,44 and migration toward regions of high shear rates in Poiseuille flow45,46,47,48,49. The shape of the flagellum, a left-handed helix during propulsion for E. coli, also leads to sideways rheotaxis: Shear induces a lift force on the chiral flagellum but not on the body, and the resulting rheotactic torque orients the swimmer towards the flow vorticity direction, thus generating a rheotactic drift perpendicular to the flow50,51,52. At surfaces, the interaction of the swimmer with the flow and the boundary further leads to an upstream reorientation (weathervane-like effect) that produces upstream motility, so long as it is not overcome by downstream advection at high flow rate53,54,55. The tilt toward the surface is reduced56, which is associated with reduced surface trapping57. Finally, chirality-induced rheotaxis still prevails for low to moderate flow rates53,58,59,60,61, but oscillations can emerge at very high shear under the combination of the former surface effects56,61. How these single-cell effects play on the organization of a multispecies community remains, however, relatively underexplored. Most studies at the population level under flow have focused on how shear flow mechanically reshapes surface-attached bacterial biofilm colonies7,8, which may stretch, redistribute, and ripple62,63, especially in complex geometries64,65,66, with high shear rate enhancing or disrupting biofilms depending on its dynamics67,68,69,70. In multispecies communities, the focus has primarily been on flow reshaping the landscape of chemical interactions, which affects their composition, dynamics, and evolution71,72,73,74,75,76. Despite the importance of flow for heterogeneous microbial communities and the latter showing specific physics-driven self-organization behaviors even at rest, the physics of microbes under flow is thus almost exclusively studied at the level of individual swimmers in homogeneous populations.

Here, we addressed how the physics of active systems under flow affects the organization of heterogeneous communities. We used a binary mixture of motile and non-motile E. coli, which we previously established as a tractable model system for heterogeneous bacterial communities14. We found that the mixture actively segregates in a microfluidic Poiseuille flow. Non-motile cells are advected in the opposite direction to flow vorticity and accumulate to the “left” side of the channel, defined facing the upcoming flow, at a speed that depends on motile cell density and shear rate. We demonstrate experimentally and in simulations that this transport is caused by a backflow that results from the collective chirality-induced rheotactic drift of the surface-oriented motile cells. We also demonstrate that the accumulation of non-motile cells requires sedimentation, which counteracts the incompressibility of the conveyor-belt-like backflow to take effect. Finally, we demonstrate that this rapid accumulation, as the population grows over long times under flow, leads to asymmetric channel colonization through biofilm formation, highlighting the relevance of this effect to long-term microbial community organization.

Results

Leftwards segregation of non-motile bacteria in binary mixtures under flow

To isolate the physical effects of shear flow on the spatial organization of heterogeneous bacterial communities, we employed as a model system a binary mixture of a motile and a non-motile strain of the bacterium E. coli. To minimize biological complexity, the strains derive from the same ancestor and differ only in the deletion of the flagellin gene fliC in the non-motile strain and their tagging with different fluorescent markers (mNeonGreen for non-motile, mCherry for motile). We mix the individually pre-grown strains in controlled proportions in a no-growth motility buffer. The mixture was subjected to Poiseuille flow, initially with a maximum speed at the channel centerline of vx,max = 80 μm/s, which we later vary, in a microfluidic channel (height H = 56 μm, width W = 1 mm, total length L = 370 mm, if not otherwise stated), where long straight sections are connected by short serpentine meanders [Fig. 1a].

Fig. 1: Active leftward segregation of the non-motile bacteria in binary mixtures under Poiseuille flow.
figure 1

a Sketch of the experimental set-up. The spatial organization of the mixture of motile and non-motile E. coli is observed under flow at the highlighted positions throughout the channel. b Schematic side view of the microfluidic channel. The “left” side of the channel is defined as facing the flow direction x, i.e., opposite the direction y of the shear vorticity Ωf at the bottom of the channel. c,d Example channel cross-sections of the non-motile (c) and motile (d) bacterial density, measured via fluorescence at indicated times and 10.5 μm above the bottom surface. The white dotted lines separate the images at different time points. The 200 μm wide scale bars are valid for all time points. e Non-motile density profiles across the channel width at indicated times for a representative experiment (dots; ϕM = 0.17%, ϕNM = 0.17%, shear rate at the top and bottom surfaces \(\dot{\gamma }\) = 5.6 s−1, corresponding to a maximum flow velocity in the center of vx,max = 80 μm/s) and the corresponding simulation results of the one-dimensional advection-diffusion equation Eq. (2) (solid lines; vy = 0.18 μm/s, D = 4.0 μm2/s). (Inset) Same data but showing the full extent of the leftward density accumulation.

We followed the spatial organization of the mixture via time-lapse fluorescence microscopy over two hours close to the bottom (z = 10.5 μm), where the non-motile cells sediment. We observed that the non-motile cells gradually re-distribute and accumulate on the “left” side of the channel when facing the upcoming flow, corresponding to the opposite of the flow vorticity direction at this height [Fig. 1b, c, Supplementary Fig. 1a]. In contrast, the distribution of motile bacteria remained homogeneous [Fig. 1d and Supplementary Fig. 2]. Segregation is absent in control experiments without motile cells, indicating that it is driven by their swimming activity. It also results from a local effect: The non-motile density profiles indeed evolve simultaneously and identically across the different straight sections of the channel [Supplementary Fig. 1b], the accumulation dynamics is independent of the number of meanders, and a similar segregation dynamics is observed for a smaller channel width (W = 0.5 mm) [Supplementary Fig. 1c].

We quantified the evolution of the density profile ρ(y) of non-motile bacteria under flow, which shows simultaneous leftward accumulation and rightward depletion of non-motile cells [Fig. 1e]. At low non-motile volume fractions (ϕNM ≤ 0.17%), this dynamics is well-described by a one-dimensional advection-diffusion equation [Fig. 1e]:

$$\frac{\partial \rho }{\partial t}=\frac{\partial }{\partial y}\left[D\frac{\partial \rho }{\partial y}-{v}_{y}\rho \right],$$
(1)

where the non-motile advection at velocity vy leads to an accumulation at the wall and is eventually balanced by the resulting diffusive counterflux (diffusion coefficient D) when reaching steady state. We found that, at a given motile cell density and flow rate, taking vy (and D) time independent and spatially uniform through the bulk of the channel is sufficient to fit very well the experimental data, indicating that the mechanism of non-motile advection must have these properties. At higher concentrations of non-motile bacteria (ϕNM = 1.7%), although still qualitatively correct, this model does not quantify well the density profiles [Supplementary Fig. 1a], likely due to excluded volume effects at this very high density.

The rheotactic motion of active swimmers drives the drift of passive non-motile cells

To understand the mechanism underlying this segregation, we analyzed how the non-motile advection velocity \({v}_{y}^{NM}\) depends on such possible control parameters as the motile cell density ϕM and the flow rate. We measured \({v}_{y}^{NM}\) from the fluorescence density profiles via the center of mass of the distribution of non-motile cells along the width of the channel:

$$\langle {y}_{NM}\rangle =\frac{\int\,y\rho (y)dy}{\int\rho (y)dy}=\frac{{\sum }_{i}{I}_{i}{y}_{i}}{{\sum }_{i}{I}_{i}},$$
(2)

with Ii the mNeonGreen fluorescence intensity at pixel i with lateral coordinate yi, used as a proxy for the local non-motile density ρ(y). The center of mass 〈yNM〉 starts at mid-channel, reflecting the initially homogeneous non-motile distribution, and drifts leftwards after flow actuation [Fig. 2a, b]. The drift velocity \({v}_{y}^{NM}\) of the non-motile bacteria is the initial slope of 〈yNM〉(t), which we fitted with saturating exponential or linear functions depending on motile cell density [Fig. 2a]. Both smooth-swimming (ΔcheY) and run-and-tumbling (wild type) E. coli drive accumulation, the latter at a slightly lower rate [Fig. 2a, c]. This indicates that the rate at which swimming direction reorients is a control parameter of the system. Focusing on mixtures with smooth swimmers at a fixed flow rate, we found that the drift velocity first increases linearly with the motile volume fraction, before an inflection above ϕM = 0.17% [Fig. 2c]. Hence, the effect of the motile cells is mostly additive, except at higher density where motile cells appear to interact destructively and reduce their individual efficacy (see Discussion). The rate of left-side accumulation of non-motile bacteria was found to be independent of their concentration ϕNM [Supplementary Fig. 3a]. Colloidal beads with a similar size and slightly higher but comparable volumetric mass to the bacteria also have a similar rate of accumulation [Supplementary Fig. 3b], as do non-motile bacteria expressing paralyzed flagella (ΔmotA) [Supplementary Fig. 3a]. This indicates that the mechanism of segregation is purely physical and dependent on motile cell activity.

Fig. 2: The rheotactic flux of motile cells induces the non-motile cell advection in the opposite direction.
figure 2

a,b Position of the center of mass of non-motile cells as a function of time (a) for different motile volume fractions ϕM, at fixed non-motile volume fraction ϕNM = 1.7% and shear rate \(\dot{\gamma }\) = 5.6 s−1, and (b) for increasing applied shear rates, at fixed ϕM = 0.17% and ϕNM = 1.7%. Solid lines are linear (ϕM ≤ 0.051%) or saturated exponential fits. c Drift velocity of the non-motile center of mass, obtained as the initial slope of the fitting curves of a. The dashed line represents a linear fit for non-tumbling data for ϕM ≤ 0.17% (slope = 0.96 μm.s−1.%−1). d Drift velocities of non-motile cells \({v}_{y}^{NM}\), extracted from b, and the rheotactic velocity of motile cells \({v}_{y}^{M}\), measured with particle tracking at 2.6 μm from the bottom surface (ϕM = 0.17%, ϕNM = 1.7%), as a function of shear rate. Positive y-direction is defined in Fig. 1b. The dashed horizontal line marks v = 0. e Relation between the drift of non-motile cells and the rheotactic flux of the motile cells \({\phi }_{M}{v}_{y}^{M}\). The dashed line represents a linear fit of all the points, with a slope of 20.4. a–e Error bars represent the standard deviation (SD) over n = 3 biological replicates. Each biological replicate is the average of four positions through the channel. f Schematics of the putative mechanism driving particle accumulation under shear.

The accumulation dynamics is also strongly affected by the flow rate experienced by the cells. We observed that the non-motile drift velocity increases linearly as a function of flow rate, quantified by the shear rate at the bottom surface \(\dot{\gamma }\), which was inferred from the Poiseuille flow velocity profile as \(\dot{\gamma }=4{v}_{x,max}/H\) (Methods), until it reaches a saturation above \(\dot{\gamma }\) = 5.6 s−1 [Fig. 2b]. The accumulation dynamics was almost identical in experiments with a thicker microfluidic chip (H = 80 μm) but the same shear rate at the surface \(\dot{\gamma }\) [Supplementary Fig. 4], showing that the latter is indeed the relevant control parameter. We tracked the motion of the motile cells close to the bottom surface (z = 2.6 μm) and found that they performed a rheotactic drift in the vorticity direction (the “right”), as previously reported50,56. The lateral drift velocities of the motile (\({v}_{y}^{M}\)) and the non-motile cells (\({v}_{y}^{NM}\)) show a similar dependence as a function of shear rate [Fig. 2d], with \({v}_{y}^{M}\) independent of volume fraction [Supplementary Fig. 5].

Bringing all these results together, we found that the drift of the non-motile cells \({v}_{y}^{NM}\) follows a single, essentially linear, function of the lateral flux of motile cells \({\phi }_{M}{v}_{y}^{M}\), for all the volume fractions of motile cells and shear rates we probed [Fig. 2e]. This strongly suggests that the non-motile cells are advected by a backflow in reaction to the rheotactic drift of motile cells [Fig. 2f]. The motile cells, which tend to accumulate in equal proportions close to the top and bottom surfaces [Supplementary Fig. 6]20,21, generate low Reynolds number flow fields when swimming that are additive. The net swimmer flux due to chirality-induced rheotaxis in Poiseuille flow appears to generate a net backflow in the negative y-direction, which is hence proportional to the strength of the rheotaxis and the number of rheotactic cells [Fig. 2e]. The weaker non-motile drift induced by wild-type swimmers would then come from the reduced rheotactic drift of tumbling swimmers that randomize their swimming direction more rapidly52. However, two elements of this scenario remain to be elucidated: How is the backflow generated, and how does this incompressible backflow lead to non-motile cell accumulation?

Sedimentation allows for non-motile bacteria accumulation by countering the conveyor-belt-like recirculation induced by motile cells

We first address the question of how the drifting non-motile cells accumulate. We previously showed that sedimentation is necessary for pattern formation in non-flowing binary mixtures14. We thus investigated the effect of sedimentation under flow. We prevented sedimentation of the bacteria by matching the volumetric mass of the suspending medium with that of the cells (1.1  g.cm−3), supplementing it with the innocuous density-matching agent iodixanol (Methods). We observed that, under the same experimental conditions as previous experiments, the non-motile cell distribution stayed homogeneous in absence of sedimentation [Fig. 3a].

Fig. 3: Sedimentation is necessary for the accumulation of non-motile bacteria that follow a recirculating backflow.
figure 3

a Position of the center of mass of non-motile bacteria as a function of time with (ΔG = 1) and without (ΔG = 0, density-matched medium) sedimentation (ϕM = 0.51%, ϕNM = 1.7%, \(\dot{\gamma }=5.6\) s−1), with ΔG the non-motile sedimentation speed relative to its value in motility buffer. b,c Drift of motile and non-motile cells at increasing distances z from the bottom surface, along (b) and perpendicular (c) to the direction of the main flow, with and without sedimentation, away from the side walls of the channel (ϕM = 0.51%, ϕNM = 1.7%, \(\dot{\gamma }=5.6\) s−1). Vertical error bars represent the standard deviation (SD) over n = 3 biological replicates, horizontal error bars represent the depth of field (4 μm) of the fluorescence microscope. The drift is measured via φDM image velocimetry, except for non-motile cells at z > 35 μm, where particle tracking was used to increase measurement precision (Methods). d Scheme of the accumulation mechanism. Perpendicular to the main flow, motile cells perform chirality-induced rheotaxis (red arrows), resulting in a recirculating, conveyor-belt-like, backflow that advects non-motile cells (blue arrows). Accumulation happens only in the presence of sedimentation (right).

Nonetheless, the non-motile cells kept being advected. We indeed measured the average drift of both motile and non-motile cells across the height of the channel using φDM image velocimetry77 and a high motile volume fraction (ϕM = 0.51%) to induce a large non-motile drift that can be accurately measured by this method. For both strains, there are no significant differences between the average drift velocities in sedimenting and non-sedimenting conditions, when they are measurable [Fig. 3b, c]. Indeed, non-motile drifts cannot be measured above z 20 μm under sedimentation because few if any non-motile cells are visible in the field of view, while velocities are measurable throughout the channel in the non-sedimenting case. We thus used the density-matched medium to characterize the z-dependence of the motion of both strains.

Along the main flow direction (vx(z)), both strains follow the Poiseuille flow profile [Fig. 3b], with minor deviations close to the surface as noted previously78. Perpendicular to the flow direction, the measurements captured the rheotactic drift of motile bacteria in the vorticity direction and the drift of non-motile cells in the opposite direction [Fig. 3c]. The rheotactic drift \({v}_{y}^{M}(z)\) is a linear function of the distance to mid-height, being therefore proportional to the local shear rate at the given height z as previously reported50. In particular, the motile rheotactic drift is oriented leftward at the top of the channel. The non-motile lateral drift \({v}_{y}^{NM}(z)\) has an opposite sign to \({v}_{y}^{M}(z)\), and increases as a function of z, also changing sign around mid-channel height, becoming rightward-oriented under the influence of the leftward-rheotactic motile cells at the channel top.

From these measurements in density-matched suspending medium, we deduce that the backflow generated by the rheotactic motile cells takes the form of a recirculating conveyor belt in the y-z plane [Fig. 3d]. The fluid incompressibility indeed imposes that the recirculation flows upwards on the left side of the channel, and downwards on the right. Similarly to its role in the absence of flow14, sedimentation then counteracts the upward flow, effectively compressing the non-motile cells and constraining them to accumulate on the left side. On the contrary, the motile cells are symmetrically distributed relative to mid-channel height, because swimming counteracts gravity [Supplementary Fig. 6], and they recirculate along the lateral walls, hence keeping a homogeneous distribution on the surfaces.

A force dipole model explains the backflow generation by tilted rheotactic swimmers at surfaces

Since the extensile dipolar flow created by the motile bacteria should be fore-aft symmetric18, it might be surprising at first that the rheotactic bias in the swimming direction induces a net backflow. However, most swimmers are located close to the surfaces [Supplementary Fig. 6], where swimming bacteria are known to be tilted a few degrees (<10°) inwards24,25,26,27,28,78. This tilt is also predicted to persist at our shear rates56. We note that short-range entrainment and repulsion by the swimmer as it moves can induce fluid transport, called Darwin drift, even for a swimmer parallel to the surface79,80,81,82. We used previous theoretical analyses of this drift for surface-aligned bacteria80,81 to estimate it to be about an order of magnitude lower than measured and therefore very unlikely to explain our observation [Supplementary Note 1]. We hence hypothesized that the tilt might be critical, by rendering the swimmer-induced fluid flow asymmetric, due to a larger effect of friction closer to the wall, and thus allowing the emergence of the backflow78. To test this hypothesis, we derived a model for the instantaneous flow generated by the bacteria.

We modeled the swimmers as a population of pusher force dipoles located close to the surfaces, with an inward tilt θ and a distribution of orientations in the x-y plane φ relative to the main flow [Fig. 4a]. We measured this distribution of φ from the instantaneous bacterial swimming directions, corrected for advection by the Poiseuille flow, in our experimental tracking data close to the bottom surface (Methods). It shows an increasing rightward (φ > 0) bias as shear rate increases, similar to previous bulk measurements52, but also an upstream bias, which reflects the expected upstream rheotaxis54 [Fig. 4b]. We then place the model dipoles in equal numbers at the top and bottom surfaces, and we account for the change of vorticity direction at the top surface by a change of sign of φ for the swimmers there. The tilt angle θ is similarly symmetrized. We derived an analytical solution for the average Stokes flow generated between two no-slip walls by the swimmers, working in Fourier space14,83,84 with open boundary conditions in the x and y directions, so that the model is valid far from the lateral walls of the channel (Methods). We first consider the case of a single swimmer, and then use the additivity of Stokes flows to get the average flow induced by the whole population. The model predicts a swimmer-generated backflow in both the x and y directions.

Fig. 4: A model of rheotactic tilted force dipoles at surfaces explains the experimentally observed backflow generation.
figure 4

a System of reference for swimmers, with φ the x-y in-plane angle and θ the tilt towards the surface. b Distribution of the in-plane orientation angle φ of smooth-swimming E. coli under indicated shear rates, measured with particle tracking in binary mixtures at 2.6 μm from the bottom surface as the instantaneous velocity direction corrected from Poiseuille flow velocity. Dots are data points and lines their spline interpolation. c Computed mean flow velocity in the y direction vy(z) generated in the volume of the channel by a population of swimmers modeled as tilted force dipoles equally distributed across the upper and lower surfaces, for varying tilts θ toward the surface. Swimmers drift corresponds to a volume fraction ϕ = 0.17 % and a shear rate \(\dot{\gamma }=5.6\) s−1. d,e Comparison between the predicted average drift of non-motile cells in the y direction, accounting for sedimentation (Eq. (32)) and experimental results as a function of shear rate (d) and motile volume fraction (e). Error bars are standard deviation (SD) over n = 3 biological replicates for the experimental data.

Each inward-tilted surface swimmer generates on average a flow in the opposite direction of its motion, because the backward-pointing flagellar force induces larger fluid flows, being farther from the no-slip wall, than the forward-pointing body force. Away from the small bands where swimmers are located near the walls, our model predicts the flow speed, averaged over the x-y plane of area W2, that a tilted dipole (j) induces in directions α = xy at position relative to mid-channel z [ − h, + h], with h half the channel height, as:

$${v}_{\alpha }^{\, j}(z)=-\frac{\tilde{\kappa }{v}_{0}}{2{W}^{2}}\sin \theta \left(1-{s}_{j}\frac{z}{h}\right){u}_{\alpha }^{j}.$$
(3)

Here, \(\tilde{\kappa }=6\pi {a}^{S}{l}_{d}\) is the normalized dipole strength – with aS the hydrodynamic radius of the cell body and ld the dipole length, v0 is the swimming speed, sj = +1 if the swimmer is at the bottom wall and  − 1 at the top, and uj is the unit vector indicating cell swimming direction. Eq. (3) shows both the increasing asymmetry as a function of tilt via \(\sin \theta\) and the backward orientation of the net flow via \(-{u}_{\alpha }^{j}\).

The bias in swimming direction induced by sideward and upstream rheotaxis is then responsible for the emergence of the net backflow when summing the contributions of all swimmers. Along the y-direction, the inversion of the direction of rheotaxis from the top to bottom wall selects for terms that are odd in z in the summation. The sideward backflow averaged over the x-y plane \({v}_{y}^{NM}={\sum }_{j}{v}_{y}^{\, j}\) that the swimmer population induces is then a linear function of z, directed toward the left (right) at the bottom (top) of the channel:

$${v}_{y}^{NM}(z)=\tilde{\kappa }\sin \theta \,{n}_{M}{v}_{y}^{M}\,z,$$
(4)

where nM = ϕM/Vc is the motile cell number density, Vc being the volume of the cell body, and \({v}_{y}^{M}={v}_{0}\langle \cos \theta \sin \varphi \rangle\) is the chirality-induced rheotactic drift of the motile cells at the bottom surface. The backflow being non-zero thus requires swimmers to be tilted towards the surface (θ ≠ 0). The model yields realistic flow values for realistic tilts of a few degrees [Figs. 3c, 4c].

We next estimated, from the predicted fluid backflow, the non-motile drift in the presence of sedimentation, and its dependence on swimmer density and shear rate. The population-averaged non-motile drift is a weighted average of the fluid backflow, \({\langle {v}_{y}\rangle }_{z}=\int\,p(z){v}_{y}(z)dz\). The vertical distribution of non-motile cells is given by Boltzmann, \(p(z)\propto \exp (-(z+h)/{L}_{sed})\), with the sedimentation length of non-motile bacteria Lsed = 8 μm, which we measured previously in presence of motile cells14. Integrating Eq. (4) over the Boltzmann distribution yields:

$$\langle {v}_{y}^{NM}\rangle =-\tilde{\kappa }\sin \theta \,h \; f\left(\frac{h}{{L}_{sed}}\right)\,{n}_{M}\,{v}_{y}^{M}.$$
(5)

The function f(h/Lsed) (Eq. (35)) increases from 0 to 1 as h/Lsed increases from 0 (density match case) to infinity. The predicted drift \({\langle {v}_{y}\rangle }_{z}\) is thus non-zero when p(z) is skewed to the bottom, and it accurately reflects the experimental dependence of the non-motile drift both on shear rate [Fig. 4d] and on motile volume fraction for ϕM ≤ 1.7% [Fig. 4e]. The expression also predicts the observed dependence in the bacterial flux \({\phi }_{M}\,{v}_{y}^{M}\propto {n}_{M}\,{v}_{y}^{M}\) [Fig. 2c]. The model matches the experimental values, given our estimated value of \(\tilde{\kappa }=50\,\mu {{{\rm{m}}}}^{2}\) (Methods), for a realistic tilt of θ 25,26,27,56. Note that the matching tilt decreases when the shear rate increases [Fig. 4d], in line with theoretical expectations56.

The model also predicts a backflow in the x-direction in response to the upstream swimming of the motile bacteria (Eq. (30)), \({v}_{x}^{NM}=-\tilde{\kappa }\sin \theta \,h\,{n}_{M}\,{v}_{x}^{M}\), which is independent of sedimentation and height, because now even terms in z are selected as cells swim upstream along both the top and bottom walls. This backflow should accelerate the downstream advection of the non-motile cells. However, combining Eqs. (30) and (31), we can estimate this predicted backflow as

$${v}_{x}^{NM}=\frac{\langle \cos \varphi \rangle }{\langle \sin \varphi \rangle }\frac{\langle {v}_{y}^{NM}\rangle }{f\left(h/{L}_{sed}\right)}.$$
(6)

Given the measured distributions of φ [Fig. 4b], Eq. (6) predicts a maximal swimmer-induced downstream advection of \({v}_{x}^{NM}\simeq 1\,\mu {{\rm{m}}}/{{\rm{s}}}\) for the highest shear rates and volume fractions. This is lower than our measurement error in this direction, which we estimate around 2–3 μm/s. More importantly, it is well below the observed advection speeds by the main Poiseuille flow even fairly close to the surface, where we measured \({v}_{x}^{NM} \sim 20\,\mu {{\rm{m}}}/{{\rm{s}}}\) [Fig. 3b]. This high speed, as well as that of the motile cells, likely come from the finite depth of field of the microscope, which causes bacteria from higher up in the sample—that are advected faster—to contribute to the measured value close to the surface. Also note that the advection speed of the motile bacteria \({v}_{x}^{M}\) is lower than that of the non-motile bacteria close to the surface [Fig. 3b], because motile bacteria swim upstream on all surfaces. This speed difference should cause motile and non-motile bacteria to segregate up and down the flow, primarily because of the upstream motility of the swimmers, predicted as \({v}_{x}^{M}=\langle \cos \varphi \rangle /\langle \sin \varphi \rangle {v}_{y}^{M}\), with a maximum value of 6 μm/s, while the contribution of non-motile downstream advection by the backflow (Eq. (6)) is secondary. However, we did not detect it in our system since we continuously inject bacteria into the channel.

Although fairly simple, our model of the underlying physics thus captures well the main features of the system and in particular highlights the importance of the tilt of the motile cells at the surface.

Rheotactic-induced accumulation reshuffles biofilm formation

Finally, we explored the implications of rheotaxis-induced accumulation for microbial communities at long time. For this, we used a binary mixture of a wild-type and a non-motile E. coli strain that both are capable of aggregating through the expression of curli fibers and antigen 43 (Ag43). As the mixture grows over 48 h at 30 °C in the microfluidic device under Poiseuille flow (shear rate at the surface \(\dot{\gamma }=5.6\) s−1), we observed that the non-motile fraction accumulates at the left side of the channel, advected by the rheotactic backflow, and forms an asymmetric biofilm at the edge of the channel [Fig. 5a]. The biofilm reaches a width of 100–150 μm from the edge within 48 h, and is therefore not able to clog the 1 mm-wide channel we used, although smaller channels might have gotten clogged65. This asymmetric biofilm formation is absent in controls with homogeneous populations of non-motile bacteria, which form biofilm uniformly on the surface of the channel [Fig. 5b]. The composition and development of the biofilm are influenced by the ability of motile bacteria to aggregate through the expression of Ag43.

Fig. 5: Rheotaxis-induced accumulation leads to asymmetric biofilm formation in aggregating strains.
figure 5

a Biofilm formation on the left side of the channel in a mixture of wild-type motile and non-motile E. coli (initial volume fractions: ϕM = 0.17%, ϕNM = 0.051%). The mixture is imaged after 40 h under continuous flow, with a shear rate at the surface of \(\dot{\gamma }=5.6\) s−1. b Homogeneous biofilm formation in a control with only non-motile bacteria. The 200 μm wide scale bar is valid for panels (a) and (b). c,d Evolution of the density profile of non-motile cells in the channel for the aggregating mixture (c) and the control (d). In both cases, the profile is calculated as the median over n = 2 biological replicates of the fluorescence signal at the four positions in the channel that are highlighted in Fig. 1a.

When motile cells can aggregate, they integrate within the asymmetric biofilm produced by non-motile cells, with most motile cells eventually localizing within the biofilm [Fig. 5a and Supplementary Fig. 7a]. The biofilm gradually builds up on the left side of the channel during the first 27 h. Suspended non-motile cells grow and accumulate leftward, where aggregation, both among themselves and with motile cells, and attachment to the wall create mixed biofilm aggregates that gradually grow and connect with one another. Once established, the cobiofilm is morphologically very stable. The relative fraction of motile and non-motile cells stays fairly constant in the biofilm region throughout the experiment [Supplementary Fig. 7a], despite the expected larger growth rate of non-motile cells13. This likely stems from a combination of new cells continuously integrating the aggregates, swimming increasing the rate of initial surface attachment in E. coli85, flagella playing a role in anchoring cell aggregates to the glass surface86, and a probable, relatively slow growth of both motile and non-motile cells within aggregates. After about 40 h, those non-motile cells that remained suspended and were left-segregated start to diffuse back towards the right, suggesting that the number of swimming motile cells finally starts dropping. This nonetheless did not affect the stability of the left-segregated biofilm itself.

In contrast, when the motile bacteria cannot express Ag43, they remain distributed as single cells throughout the channel even after an extended period of time, as expected in our growth conditions where Ag43 is important for efficient aggregation and biofilm formation87,88. The biofilm is then almost exclusively composed of non-motile cells, it is generally smaller and less regular in thickness, but it remains strongly asymmetric [Supplementary Fig. 7b]. Like in the aggregating motile cell case, non-motile cells accumulate to the left side of the channel, but they only aggregate with each other and these aggregates attach less efficiently to the wall, consistently with the known structural role of flagella in forming robust surface-attached biofilms in E. coli85,86. After 25–30 h, the number of suspended non-motile cells and thus their total biomass tend to diminish, leaving a smaller but still exclusively left-segregated surface-attached biofilm of non-motile cells [Supplementary Fig. 7b]. In both cases, our observations thus show that the interplay between motility and flow can indeed significantly alter the patterns of biofilm formation in heterogeneous microbial communities over long timescales.

Discussion

Fluid flows are a ubiquitous environmental constraint that strongly affects many facets of the behavior of complex microbial communities, particularly in confined and tortuous environments, such as the animal gut, plant vessels, or the soil6,7,9. In particular, the consequences of flow affecting the physics of individual bacterial swimming53,54,55,56,58,59,60,61 on the structuration of complex, phenotypically, and/or genetically heterogeneous bacterial populations are still being unraveled. Here, we discovered a mode of population structuration under confined flow where non-motile bacteria in mixed communities with motile ones segregate at the bottom “left” side of microchannels. Combining experiments and modeling, we uncovered the purely physical mechanism driving segregation. The motile cells, which drift rheotactically in the flow vorticity direction ("rightwards” at the bottom), induce a backflow because they swim with a tilt at the surface that produces asymmetric dipolar flows. Non-motile cell advection by this backflow, combined with sedimentation, breaks vertical symmetry and counters the fluid incompressibility, allowing the passive cells to cross streamlines and accumulate on the left side of the channel. Lastly, this relatively fast segregation mechanism cements at long time in the asymmetric formation of dual biofilms. Hence, this active mechanism drives the spatial organization of heterogeneous bacterial communities at multiple time scales and over a wide range of physiological densities and relevant shear rates, showing its relevance for the many natural microbial communities and biofilms that experience flow.

Our measurements of motile E. coli rheotaxis agree well with previous works, although the latter were limited to very diluted regimes50,52,53,58, while we worked over a wider range of higher densities [Figs. 2c, 3c]. In particular, the distribution of swimming orientation under shear, which we measured here at the surface, is relatively similar to the one previously measured in bulk52. It is also consistent with simulations at the surface56, except for the peak of probability of downstream motion that we observe at higher shear rates [Fig. 4b], due to downstream swimmers situated further above the surface that Mathijssen et al. do not consider56. For a fixed chiral shape of the flagellum, the strength of rheotaxis depends on the Péclet number \(Pe=\dot{\gamma }/{D}_{r}\)52, explaining why tumbling, which increases the effective rotational diffusion coefficient Dr, reduces the elicited non-motile drift [Fig. 2a, c]. Since the rheotactic velocity of motile cells is independent of their volume fraction [Supplementary Fig. 5], the saturation of \(\langle {v}_{y}^{NM}\rangle\) at high motile cell density ϕM [Fig. 2] likely comes from the decrease in the fraction of motile cells located at the surface compared to the bulk, as we previously observed in the absence of flow at these high densities14. Steric collisions becoming more prominent at high density could also contribute to this reduction, by causing entrainment toward the direction of swimming37,39. Over the range of shear rates we studied, \(\dot{\gamma }=0-10\) s−1, the motile rightward orientation bias, and conversely the non-motile leftward drift kept increasing, only reaching saturation at the highest shear rates \(\dot{\gamma }\ge 7\) s−1 [Figs. 2d, 4b]. At higher shear rates, we expect that the motile rightward drift52,58, and therefore non-motile counter-advection, is maintained at a high level. Finally, the differences in vx between motile and non-motile cells close to the surface (Fig. 3b) should primarily come from upstream motility. The enhanced non-motile downstream entrainment that the model does predict in its response (Eq. (30)) indeed has very low magnitude, consistently with previous simulations78.

Our model took a simple approach, assuming that swimmers are force dipoles that are all located at the surface, neglecting steric interactions and higher-order terms in the flow field expansion. Although short-range steric interactions were clearly negligible for our relatively small and slow sedimenting non-motile bacteria, as they are expected to induce forward (and not backward) entrainment, they might become more prominent for very large and/or heavy non-buoyant particles39. We neglected a volumetric short-range hydrodynamics effect, the Darwin drift, the sign and magnitude of which depend on the dipolar and quadrupolar terms in the expansion of the flow fields induced by the bacterium80,81. Although it could be in the correct direction, we estimated this drift to be an order of magnitude lower than our measurement [Supplementary Note 1], using models without near-surface tilt80,81, highlighting the importance of the latter to quantitatively explain our observations. We further neglected the effect of swimmers in the bulk, although shear could confer them an average tilt, which would then make them contribute to the rheotactic backflow45. Assuming a constant tilt ( ~ 2°) fits the experiments relatively well, although our results are also consistent with the expected reduced tilt at higher shear rates46. The fitted tilt values are close to those expected from simulations56, although on the lower side of the range, consistently with a possible slight overestimation of the flow by the analytical model (Methods and Supplementary Fig. 8). Despite its simplicity, the model therefore captures the main physics of the system.

The mixed microbial community, considered as a non-equilibrium complex system, had been found to exhibit large-scale density fluctuations in the absence of external constraints14. We investigated here its response to external constraints, and we showed its strong susceptibility to flow, in the form of the sideward segregation. In both cases, the behavior results from the interplay of swimmer-induced flow and sedimentation. The external constraint of shear nonetheless profoundly transforms the structure of the swimmer-induced flows experienced by the cells, as strikingly illustrated by the density fluctuations, which establish in the channel before flow starts, disappearing rapidly (≤1 min) as soon as flow is actuated. Consistently, whereas the tilt toward the surface is a negligible feature and the spatial variations of flow are critical to explain the behavior at rest14, tilt is essential, and the average swimmer-induced flow suffices to explain the behavior under shear. Our study reinforces the idea that the long-range nature of hydrodynamic interactions plays critical roles in the structuration of complex active systems like bacterial suspensions, here in the susceptibility to external constraints, even far below the critical motile cell density for collective motion emergence35,36.

The presence of backflow in the channel and the advection of non-motile bacteria against the motile cell motion contrasts with previous models and experiments in which passive tracers are entrained towards the mean direction of motion of active droplets82. This difference comes from contrasting mechanisms, with bacteria inducing an asymmetric dipolar flow field by swimming at the surface with a tilt, which results from short-range interactions with the surface24,25,26,27,28, whereas the Darwin drift is dominant in the other system79,82. From a technological standpoint, similarly to how upstream rheotaxis is used for the selection of motile sperm89, rheotaxis-induced segregation could be exploited to separate the motile from the non-motile fraction of natural communities51, and, because it relies on a different mechanism, would then add to several other modes of passive particle transport by synthetic or nature-derived microswimmers10,39,78,82 to broaden the palette of available actions for microrobotic manipulation of active particles and passive cargoes90.

Finally, we believe our findings are relevant to many microbial communities in confined environments, in particular, the soil, plant roots, or aqueous sediments. Indeed, the accumulation mechanism is effective in a wide range of shear rates and physiological volume fractions of motile cells. We observed it in channels of a few tens of microns height, which corresponds to the typical mode of the very broad distribution of mesopore sizes in the soil91,92 and to typical plant vessel sizes93. The backflow is a local effect that results primarily from local shear on swimmers at the closest surface, which should thus be modulated but not abolished by channel irregularities and tortuosity that are typical of natural porous networks. Hence, we expect the occurrence of accumulation to be fairly robust against slow variations in channel geometry (constrictions, openings, or turns) and to some extent against surface roughness, albeit with possibly strong spatial modulations in its strength. In support, the backflow speed was found to be independent of channel width, leftward non-motile accumulation was also observed in the meanders, and the surface irregularities due to cells attaching to all channel walls during biofilm formation did not impair backflow induction and advection. A full investigation of such effects would nonetheless require more complex setups76,92 than ours, which traded off naturally relevant complexity for control and ease of conceptual analysis. Furthermore, a behavior closer to our idealized experiment could also occur in natural channels that are quite straight at the bacterial scale, such as sections of plant xylems and phloems. However, since the constraint of gravity is central for accumulation, we expect that segregation would only occur in the relatively horizontal portions of natural porous networks (e.g., the lateral roots of plants). In addition, since the rheotactic mechanism is conserved among many motile bacterial species50, so would the rheotaxis-induced accumulation and biofilm asymmetrization. Since the direction of chirality-induced rheotaxis must depend on flagella handedness52, bacteria with right-handed flagella should drift, and thus elicit a backflow, in the opposite direction to the left-handed ones like E. coli. However, many of the known bacterial flagella are left-handed, suggesting that a net segregation of non-motile cells could occur even in highly diverse bacterial communities. The asymmetric biofilm formed by the segregated non-motile cells can incorporate motile cells, only if they express Ag43 as observed in static cultures87,88, to form a robust mixed biofilm. In this case, the motile cells thus constructed via pure physics a habitat in the channel that required the non-motile partner, because motile biofilm formation was otherwise weak. This effect might benefit the many species that split between motile and non-motile subpopulations upon entry into biofilm-prone stationary phase13. Sideward accumulation could benefit biofilm-forming bacteria in several ways. It can first enhance the aggregation and attachment during biofilm establishment, due to the local increase in cell density enhancing collisions between cells and with the walls [Figs. 1e and 5a]. The accumulation on the side of the channel, where flow rates are lower due to the lateral wall, can also protect the community from flushing by strong flows67,68, and from the growth rate reduction that was observed due to tighter surface attachment at high shear rates (\(\dot{\gamma } > 20\) s−1)94. The consequences of the sideward accumulation are nonetheless not necessarily all beneficial. The accumulation could, e.g., make the bacteria more susceptible to infection by co-advected phages. Further work is therefore necessary to fully unravel the physiological consequences of the physical behavior we report here. In summary, our results highlighted a mode of spatial reorganization by shear specific to heterogeneous bacterial communities, which may lastingly impact them in their natural environment.

Methods

Strains

All strains are derivatives of Escherichia coli wild-type strain W3110 (RpoS+)95 and are listed in Supplementary Table 1. Except for biofilm growth, strains lack the gene flu that encodes for the protein Ag43 mediating cell-cell adhesion to prevent confounding effects of cell aggregation when analyzing segregation dynamics96. If not otherwise stated, the motile strain is a ΔcheY non-tumbling, smooth swimming mutant, and the non-motile strain is a ΔfliC mutant that lacks flagellar filaments. The fluorescent markers are expressed from a plasmid carrying the fluorescent protein gene under the control of the Isopropyl-β-d-1-thiogalactopyranoside (IPTG)-inducible Tac promoter and an ampicillin (Amp) resistance marker. The non-motile strain is tagged with mNeonGreen and the motile one with mCherry14. We have extensively characterized these strains in previous works14,35,96. The wild-type motile strain swims at about v0 = 23 μm/s. The ΔcheY mutant swims faster, at v0 = 30 μm/s on average, as measured from particle tracking in our conditions. The cell bodies have a length of 2.5 μm on average, a width of 0.8 μm in our growth conditions. The volume fractions are computed from the optical density at 600 nm (OD600) measured with a previously calibrated photometer as ϕ = 1.7 10−3 × OD60035.

Microfluidics and microfabrication

The microfluidic chip consists of a serpentine channel with rectangular cross-section (height H = 56 μm and width W = 1 mm if not otherwise stated), made of 40 mm-long straight parts that are connected by curved meanders, for a total channel length of L = 370 mm. Molds were fabricated using standard soft photolithography techniques. The SU82050 photoresist (MicrochemTM) was spin-coated on a silicon wafer, covered with a negative mask produced using AutoCAD and printed by JD Photo Data (UK), exposed to UV light, baked, and developed according to manufacturer instructions, and silanized. Chips are made of poly-di-methylsiloxane (PDMS, Sylgard 184, Dow) in a 1:10 crosslinker-to-base ratio, which was poured on the cast, degassed, baked overnight (ON) at 65 °C, peeled off, cut to shape, hole-punched and covalently bound on isopropanol-rinsed microscopy glass slides via oxygen plasma treatment.

PDMS to glass covalent bonds were allowed to form for 25 min at room temperature. The device was then primed with the binary mixture solution to prevent bubble formation, before connecting it to the pressure pump. For biofilm experiments, the mixture was instead injected 4 h after the bonding to increase surface hydrophobicity and favor adhesion of the bacteria to the walls of the channel. The flow in the channel is actuated using a pressure pump (Elveflow OB1 MK4 microfluidic flow controller, Elvesys), that applies a constant pressure difference in the range of 0.2–0.9 mbar between the inlet and outlet. We computed the shear rate at the surface \(\dot{\gamma }\) by measuring for each experiment the maximum advection speed \({v}_{x,\max }\) of the non-motile cells that were used as tracers, away from the lateral walls at the mid-height of the channel, and by assuming a Poiseuille flow velocity profile, \(\dot{\gamma }=4{v}_{x,\max }/H\), with H the known channel height. The range of shear rates \(\dot{\gamma }=0-10\) s−1 corresponded to \({v}_{x,\max }=0-130\,{{\rm{\mu}}} {{\rm{m}}}/{{\rm{s}}}\). The exact applied pressure necessary to deliver a given flow rate, and thus shear rate, was determined at the beginning of each experiment via a short initial measurement of the relation between pressure difference and \({v}_{x,\max }\).

Segregation dynamics experiments

Motile and non-motile cells are grown separately ON in tryptone broth (TB) medium (10 g/L tryptone, 5 g/L NaCl) and 0.1 g/L Amp at 37 °C. The ON culture is diluted 1/100 in 10 mL fresh TB supplemented with 0.1 g/L Amp and 100 μM IPTG. The strains are then grown separately in a shaking incubator at 270 rpm and 34 °C for 4 h. The bacteria are washed and re-suspended in no-growth motility buffer (MB - 3.914 g/L NaCl, 6.15 mM K2HPO4, 3.85 mM KH2PO4, 0.1 mM Ethylenediaminetetraacetate, pH 7) supplemented with 0.01%v/v Tween80 to prevent adhesion to surfaces and 10 g/L glucose to ensure sustained motility throughout the experiment. In experiments with density-matching media, the cells are instead re-suspended in a solution of motility buffer supplemented with 20% iodixanol (ρ = 1.11 g.cm−3). In this medium, bacteria are intact, alive and keep swimming for much longer than the duration of the experiment, as in motility buffer, while the diffusion of the non-motile cells and the speed of the non-tumbling swimmers is only slightly reduced (no more than 20%), due to a corresponding increase in medium viscosity14. The OD600 of the resuspended cells is measured and the desired concentrations of motile and non-motile cells are obtained by further dilutions and mixing in appropriate amount. The resulting binary mixture is continuously injected into the microfluidic channel throughout the experiment. For experiments with beads, the mixture is prepared using the same protocol, substituting non-motile cells with FluoGreen-tagged PMMA particles of diameter 1.33 ± 0.1 μm, density 1.19 g.cm−3 (Microchem GmbH), and the mixture is initially injected into the channel but flow is generated by injecting MB to save material.

Biofilm experiments

The bacteria used for the biofilm experiments are E. coli wild type (RC144) or Ag43 knockout (RC101 - Supplementary Fig. 7), both tagged with mCherry, for the motile strain and E. coli ΔfliC tagged with mNeonGreen (SEB21). The strains are grown separately ON in TB with 0.1 g/L Amp at 37 °C. Non-motile cells are then diluted 1/50 in M9 medium (48 mM Na2HPO4, 22 mM KH2PO4, 8.4 mM NaCl, 18.6 mM NH4Cl, 2 mM MgSO4, 1 mM CaCl2) supplemented with 4 g/L succinate and 2 g/L casaminoacids, 0.1 g/L Amp and 100 μM IPTG. The motile strain is prepared in TB as described in the previous section. Cells are grown at T = 30 °C, where they can form robust biofilms97, in a shaking incubator at 270 rpm. The motile strain is grown for 5 h, and the non-motile strain for 8 h, to ensure that bacteria are in the late exponential/early stationary phase where curli expression is high. The bacteria are then washed and re-suspended in the filtered spent M9 medium in which the non-motile strain was grown, since it promotes biofilm formation, in contrast to fresh medium that induces biofilm-repressing exponential growth. The mixture is injected into the microfluidic channel and left to rest for one hour, before flowing filtered spent M9 medium into the channel. The evolution of the mixture is observed at several positions through the channel for a total duration of 42 hours under a constant applied pressure, yielding a measured shear rate of 5.6 s−1 at the beginning of the experiment, and at T = 30 °C.

Images and video acquisition

The images and videos are acquired using a Nikon TI-E inverted fluorescence wide-field microscope with a 20 × objective (NA 0.75), mCherry (excitation filter 572/25, emission 645/90) and GFP (excitation filter 470/40, emission 525/50) filter cubes, and an Andor Zyla sCMOS Camera (1 px = 0.35 μm), piloted via the Nikon NIS software. The depth of field of the objective is around 4 μm. Focus is maintained using the Nikon perfect focus system. Since the objective is dry, we correct the heights measured with the micrometric screw of the microscope by the refractive index of water (n = 1.33). For the measurements of bacterial drift, videos of 5 s at 100 frames/s are captured at different distances from the bottom surface away from the lateral walls. For the analysis of swimming trajectories with particle tracking, videos are captured at 50 frames/s for 40 s with a 2 × 2 pixel binning at 2.6 μm from the bottom surface.

Density profile measurement and analysis

Images are captured at 6 different points (respectively at 25, 130, 210, 255, 300, and 345 mm from the inlet) halfway through the straight portion of the channel, at 10.5 μm from the bottom surface. Images are recorded before (0 min) and every 5 min after flow actuation. Since the image size for 20x magnification is 665 × 665 μm2, two images are captured to visualize the whole channel width (1 mm) at each point. The fluorescence intensity profiles of each image are extracted with ImageJ after subtracting black noise and correcting for the inhomogeneous illumination profile. At each position, fluorescence intensity profiles are then stitched, normalized to the total fluorescence intensity of the image, and plotted with custom Python scripts.

The center of mass is computed from the fluorescence intensity profiles via Eq. (2) at each position and averaged over the four furthest positions from the inlet, to limit the effect of wash-out close to the inlet. The center of mass is then fitted with a linear function 〈YNM〉(t) = a t + b for ϕM < 0.17% or a saturating exponential \(\langle {Y}_{NM}\rangle (t)=a\tau (1-{e}^{-\frac{t}{\tau }})+(S-a\tau )\) otherwise. The drift of the particles is the initial slope \(a={v}_{y}^{NM}\).

Measurements of bacteria drift

To measure the drift of both motile and non-motile particles, videos are acquired in the relevant fluorescence microscopy channel at different distances from the bottom surface and at least 100 μm away from the lateral walls. To prevent the accumulation of non-motile cells on the sides, the videos are captured 30 s after the actuation of the flow, and then the flow is reversed for 30 s. The videos are then analyzed with the φDM image velocimetry algorithm to extract the population-averaged drift in the field of view77. For measurements with density-matching media in the top part of the microfluidic channel (z > 35 μm), we used particle tracking instead of φDM image velocimetry to minimize the influence of particles below the focal plane, which can appear as background drift in the field of view and reduce the precision of velocimetry measurements.

Swimming trajectories analysis with particle tracking

The trajectories of the rheotactic swimmers were measured on binary mixtures of a non-fluorescent non-motile strain at 1.7% volume fraction and a non-tumbling motile strain at different volume fractions (0.51, 0.17, 0.051, and 0.017%). Since particle tracking works best at low cell density, we mixed non-labeled and fluorescent motile cells, keeping the labeled volume fraction ϕM,labeled = 3.4 10−3% constant. Using fluorescence microscopy, we captured videos of swimming cells away from the lateral walls, 2.6 μm from the bottom surface for different imposed shear rates. Using a custom-made particle tracking ImageJ plugin85, we analyzed the trajectories of the swimming bacteria and extracted the instantaneous orientation of the cells as \(\varphi =\arctan ({v}_{y}/({v}_{x}-{v}_{P}({z}_{0})))\), with vx and vy the instantaneous cell velocities in the x and y directions. We account for the flow advection by subtracting from vx the Poiseuille flow velocity at z0 = 2.6 μm, \({v}_{P}({z}_{0})={v}_{x,\max }(2-{z}_{0}/h){z}_{0}/h\), where \({v}_{x,\max }\) is the maximal advection speed measured at mid-channel height z = h = H/2 in the given condition.

Unidimensional drift-diffusion simulations

In Fig. 1e, we employed a finite difference method to solve the advection-diffusion equation describing the system (Eq. (1)). We discretized the advection-diffusion equation with the Euler integration method as

$$\rho (y,t+\Delta t)= \, \rho (y,t)+F\left(\rho (y+\Delta y,t)-2\rho (y,t)+\rho (y-\Delta y,t)\right) \\ -G(y)\left(\rho (y,t)-\rho (y-\Delta y,t)\right)$$
(7)

where

$$F=\frac{D\cdot \Delta t}{{(\Delta y)}^{2}}$$
(8)

and

$$G(\, y)=\frac{V(y)\cdot \Delta t}{\Delta y}.$$
(9)

We set the initial density as ρ(yt = 0) = 1, i.e., homogeneous across the spatial domain. We simulated the system for a total time of T = 7200 s, with a diffusion constant of D = 4 μm2/s and a total length of L = 1000 μm. The spatial grid spacing is Δy = 5 μm and the integration time step Δt = 1s. Using a smaller time step gave identical results. Zero-flux boundary conditions are set at both ends of the domain, y = 0 and y = L. The velocity V(y) takes everywhere a constant value vy, i.e., that measured from the center of mass displacement for the given experiment, except in the first and last 50 μm of the spatial domain, where it rises linearly from 0 to vy to emulate the effect of lateral surfaces on the swimmer-induced flow. A fully constant velocity gave very similar results.

Analytical model for backflow generation

We developed an analytical model of the average backflow generated between two no-slip top and bottom walls by a population of tilted swimmers located close to these surfaces. The swimmers are modeled as a pusher dipole of point forces, one representing the body and the other the flagellum. The magnitude of both point forces is f0/6πη = aSv0, with η the fluid viscosity, aS = 0.7 μm the hydrodynamic radius of the cell body, and v0 = 30 μm/s the swimming speed. At low Reynolds numbers, the fluid flow v(rirjfj) at position ri = (xiyizi) generated by a point force fj positioned at rj = (xjyjzj) is given by

$${{\bf{v}}}({{{\bf{r}}}}_{i};{{{\bf{r}}}}_{j},{{{\bf{f}}}}_{j})={{{\mathbf{\Omega }}}}^{i\ne j}({{{\bf{r}}}}_{i},{{{\bf{r}}}}_{j})\cdot \frac{{{{\bf{f}}}}_{j}}{6\pi \eta }$$
(10)

where Ωij is the normalized hydrodynamic-interaction tensor (Oseen tensor), i.e., the normalized Green function of the incompressible Stokes equation:

$$-\nabla p+\eta {\nabla }^{2}{{\bf{v}}}+{{\bf{f}}}=0$$
(11)
$$\nabla \cdot {{\bf{v}}}=0$$
(12)

with f(r) = fjδ(r − rj) for the point force. Because the solutions of the Stokes equation are additive, we can solve this equation for a model dipolar swimmer with a given position and orientation, and sum the contributions of the swimmers, accounting for their distributions of orientations and positions, to obtain the population-averaged induced flow velocity ∑jv(rirjfj).

We model a section of the channel away from the lateral walls as a rectangular box of width and length W and height H = 2h, with open boundary conditions in the x and y directions and no-slip boundary conditions at the top and bottom walls z = ± h. The solution of the incompressible Stokes equation for a point force in this geometry was first written by Liron and Mochon as an infinite sum of the unbounded flow induced by mirror images of the point force98, which can be challenging to work with. However, since the swimmer density and the drift velocity of non-motile cells (far from the lateral walls) are independent of (x,y) in the experiments, we focus on the spatially averaged swimmer-induced flow velocity over the x and y directions within the box, \(\bar{{{\bf{v}}}}({z}_{i};{\{{z}_{j},{{{\bf{u}}}}_{j}\}}_{j})\), and explore the experimentally non-trivial dependences on the vertical positions zi and zj and on the shear-induced distributions of swimmer orientations uj. This allows us to take advantage of an alternative solving method based on the Fourier decomposition in 2D space of the flow field induced by a point force between two parallel plates that was developed by Mucha et al. and Hernandez-Ortiz et al.83,84 to simplify the calculations considerably.

Under this partial Fourier decomposition, the fluid velocity reads:

$${{\bf{v}}}({{{\bf{r}}}}_{i})=\frac{1}{{W}^{2}}\iint \hat{{{\bf{v}}}}({{\bf{k}}},{z}_{i})\exp ({{\rm{i}}}({k}_{x}{x}_{i}+{k}_{y}{y}_{i})){{{\rm{d}}}}^{2}{{\bf{k}}},$$
(13)

with the Fourier transformed fluid velocity \(\hat{{{\bf{v}}}}({{\bf{k}}},{z}_{i})=({\hat{v}}_{x},{\hat{v}}_{y},{\hat{v}}_{z})\) for the two-dimensional wave vector k = (kxky) reading

$$\hat{{{\bf{v}}}}({{\bf{k}}},{z}_{i})=\iint {{\bf{v}}}({{{\bf{r}}}}_{i})\exp (-{{\rm{i}}}({k}_{x}{x}_{i}+{k}_{y}{y}_{i})){{\rm{d}}}{x}_{i}{{\rm{d}}}{y}_{i}.$$
(14)

We can write the incompressible Stokes equation for this Fourier component as:

$$-\frac{{{\rm{i}}}\,{k}_{x}}{\eta }\hat{p}+| {{\bf{k}}}{| }^{2}{\hat{v}}_{x}-\frac{{{{\rm{d}}}}^{2}}{{{\rm{d}}}{z}_{i}^{2}}{\hat{v}}_{x}=6\pi {a}^{S}{v}_{0}\delta ({z}_{i}-{z}_{j}){u}_{x}$$
(15a)
$$-\frac{{\rm i}\,{k}_{y}}{\eta }\hat{p}+| {{\bf{k}}}{| }^{2}{\hat{v}}_{y}-\frac{{{{\rm{d}}}}^{2}}{{{\rm{d}}}{z}_{i}^{2}}{\hat{v}}_{y}=6\pi {a}^{S}{v}_{0}\delta ({z}_{i}-{z}_{j}){u}_{y}$$
(15b)
$$\frac{1}{\eta }\frac{{{\rm{d}}}}{{{\rm{d}}}{z}_{i}}\hat{p}+| {{\bf{k}}}{| }^{2}{\hat{v}}_{z}-\frac{{{{\rm{d}}}}^{2}}{{{\rm{d}}}{z}_{i}^{2}}{\hat{v}}_{z}=6\pi {a}^{S}{v}_{0}\delta ({z}_{i}-{z}_{j}){u}_{z}$$
(15c)
$${\rm i}\,{k}_{x}{\hat{v}}_{x}+{\rm i}\,{k}_{y}{\hat{v}}_{y}-\frac{{{\rm{d}}}}{{{\rm{d}}}{z}_{i}}{\hat{v}}_{z}=0,$$
(15d)

where \(| {{\bf{k}}}{| }^{2}={k}_{x}^{2}+{k}_{y}^{2}\) is the squared norm, zi is the height of observation and zj that of the point force, with zi, zj [ − hh], \(\hat{p}\) is the Fourier transformed pressure, the point force vector has an orientation uj = (uxuyuz) and its norm is f0 = 6πηaSv0. Since we are interested in the average flow generated by the point forces, we consider the k = 0 component, \(\hat{{{\bf{v}}}}({{\bf{k}}}={{\bf{0}}},{z}_{i})={W}^{2}\bar{{{\bf{v}}}}({z}_{i})\), with \(\bar{\cdot }\) the average over x and y.

We now solve Eq. 15 for the wave vector k = 0. The incompressibility Eq. (15d) combined with the no-flow boundary conditions in zi = ± h immediately give \({\bar{v}}_{z}=0\). Hence, no net flow takes place in the vertical direction far from the lateral walls, and the vertical components of the force vectors get absorbed in average pressure gradients via

$$\frac{{{\rm{d}}}}{{{\rm{d}}}{z}_{i}}\bar{p}=\frac{6\pi }{{W}^{2}}\eta {a}^{S}{v}_{0}\delta ({z}_{i}-{z}_{j}){u}_{z}.$$
(16)

The horizontal components α = xy of the average flow are then given by:

$$-\frac{{{{\rm{d}}}}^{2}}{{{\rm{d}}}{z}_{i}^{2}}{\bar{v}}_{\alpha }=\frac{6\pi }{{W}^{2}}{a}^{S}{v}_{0}\delta ({z}_{i}-{z}_{j}){u}_{\alpha }.$$
(17)

Following83,84, it is convenient to solve this equation by considering separately the cases zi > zj and zi < zj with their respective boundary conditions, \({\bar{v}}_{\alpha }=0\) in zi = h and zi = − h, and then to stitch the two solutions by enforcing continuity of \({\bar{v}}_{\alpha }({z}_{i})\) in zi = zj and considering the ϵ → 0 limit of

$$\int_{\!\!\!\!{z}_{j}-\epsilon }^{{z}_{j}+\epsilon }\frac{{{{\rm{d}}}}^{2}{\bar{v}}_{\alpha }}{{{\rm{d}}}{z}_{i}^{2}}{{\rm{d}}}{z}_{i}=-\frac{6\pi }{{W}^{2}}{a}^{S}{v}_{0}{u}_{\alpha }=\frac{{{\rm{d}}}{\bar{v}}_{\alpha }}{{{\rm{d}}}{z}_{i}}({z}_{j}+\epsilon )-\frac{{{\rm{d}}}{\bar{v}}_{\alpha }}{{{\rm{d}}}{z}_{i}}({z}_{j}-\epsilon ).$$
(18)

This simple procedure yields:

$${\bar{v}}_{\alpha }({z}_{i})=-\frac{3\pi }{{W}^{2}h}\tilde{\omega }({z}_{i},{z}_{j}){a}^{S}{v}_{0}{u}_{\alpha },$$
(19)

with

$$\tilde{\omega }({z}_{i},{z}_{j})=\left\{\begin{array}{ll}({z}_{j}-h)({z}_{i}+h) &{z}_{i} < {z}_{j}\\ ({z}_{j}+h)({z}_{i}-h) &{z}_{i} > {z}_{j}\end{array}\right.$$
(20)

that can be written more concisely as:

$$\tilde{\omega }({z}_{i},{z}_{j})=\left({z}_{j}{z}_{i}+| {z}_{j}-{z}_{i}| h-{h}^{2}\right).$$
(21)

The quantity \(\tilde{\omega }({z}_{i},{z}_{j})\) relates to the spatial average in the (x,y) plane of the normalized Oseen tensor Ωij(rirj) in our geometry via \(-\frac{3\pi }{h}\tilde{\omega }({z}_{i},{z}_{j})=\iint {{{\mathbf{\Omega }}}}^{i\ne j}({{{\bf{r}}}}_{i},{{{\bf{r}}}}_{j}){{\rm{d}}}{x}_{i}{{\rm{d}}}{y}_{i}\). Note that in Mucha et al. and Hernandez-Ortiz et al.83,84, a no-net-flow condition ( vd3ri = 0) is imposed via a constant pressure gradient across the box, which adds a term to the expression of \(\tilde{\omega }({z}_{i},{z}_{j})\). We do not impose this condition since we are precisely interested in the net flow induced by the swimmers. Moreover, because of its symmetry, this additional term has no net contribution to the problem at hand.

We will now derive the average fluid velocity induced by the whole population of swimmers in the box. We consider a population of N swimmers, with swimming direction

$${{{\bf{u}}}}_{j}=\left(\begin{array}{c}\cos {\varphi }_{j}\cos {\theta }_{j}\\ \sin {\varphi }_{j}\cos {\theta }_{j}\\ -\sin {\theta }_{j}\end{array}\right)$$
(22)

modeled as dipoles of point forces, where the cell body is located in zB,j = zj and produces the reduced force  + aSv0uj, while the flagellum is located in \({z}_{F,j}={z}_{j}+{l}_{d}\sin {\theta }_{j}\) and produces the reduced force  − aSv0uj [Supplementary Fig. 8a]. Because Stokes flows are additive, the mean fluid velocity induced by the swimmer j, \({\bar{v}}_{\alpha }^{i\leftarrow j}({z}_{i})\), is the sum of the contributions of the cell body and the flagellum:

$${\bar{v}}_{\alpha }^{i\leftarrow j}({z}_{i})=-\frac{3\pi }{{W}^{2}h}\delta {\tilde{\omega }}^{D}({z}_{i};{z}_{j},{\theta }_{j}){a}^{S}{v}_{0}{u}_{\alpha }^{j},$$
(23)

where the normalized dipolar Oseen tensor reads:

$$\delta {\tilde{\omega }}^{D}({z}_{i};{z}_{j},{\theta }_{j})=\tilde{\omega }({z}_{i},{z}_{j})-\tilde{\omega }({z}_{i},{z}_{j}+{l}_{d}\sin {\theta }_{j}).$$
(24)

Using Eq. (21), except in the small region \({z}_{i}\in [{z}_{j},{z}_{j}+{l}_{d}\sin {\theta }_{j}]\) [Supplementary Fig. 8b], it reads:

$$\delta {\tilde{\omega }}^{D}({z}_{i};{z}_{j},{\theta }_{j})=-\left[{z}_{i}+{{\rm{sign}}}({z}_{j}-{z}_{i})h\right]{l}_{d}\sin {\theta }_{j}.$$
(25)

The mean fluid velocity \(\bar{{{\bf{v}}}}({z}_{i})\) induced by the whole population of swimmer then sums their individual contributions:

$${\bar{v}}_{\alpha }({z}_{i})={\sum }_{j=1}^{N}{\bar{v}}_{\alpha }^{i\leftarrow j}({z}_{i})=-\frac{3\pi }{{W}^{2}h}{\sum }_{j=1}^{N}\delta {\tilde{\omega }}^{D}({z}_{i},{z}_{j};{\theta }_{j}){a}^{S}{v}_{0}{u}_{\alpha }^{j}.$$
(26)

We further assume that the swimmers are distributed at the top and bottom surfaces in equal numbers, at heights zj = sj( − h + δzj) with δzj a small distance (typically one cell size) and sj = 1 at the bottom, -1 at the top [Supplementary Fig. 8a]. Their orientation is given by the polar angle φj = sjφ(j), with φ(j) being drawn from the distributions of Fig. 4b, and a tilt θj = sjθ. The tilt angle towards the surface θ is taken constant here for simplicity, but the analysis is easily extended for a distribution of tilt angles. The multiplication by sj accounts for the mirroring at the top of the channel of both the tilt and the distribution of φ, due to the change in vorticity direction for the latter.

For this distribution of swimmers, we can divide the channel in three regions as a function of z [Supplementary Fig. 8a]: two bands, close to the top and bottom walls, which contain the point forces of all the dipoles and extend up to \((\max (\delta {z}_{j})+{l}_{d}\sin \theta )\) away from the wall, and a central region devoid of point forces. Because experimentally θ < 10°, \(\max (\delta {z}_{j}) < 1\,{{\rm{\mu}}} {{\rm{m}}}\) and ld 4 μm, the bands are thin (about 2 μm) even compared to the vertical distribution of non-motile bacteria (sedimentation length ~ 10 μm), and we can focus on the central region when computing the velocity of the swimmer induced flow. From Eqs. (23) and (25), and using sign(zj − zi) = − sj for zi in this region, the velocity of the fluid flow induced by one swimmer close to the surface in the central region can be derived as:

$${\bar{v}}_{\alpha }^{i\leftarrow j}({z}_{i})=-\frac{3\pi {a}^{S}{v}_{0}}{{W}^{2}h}{l}_{d}\sin \theta \left(h-{s}_{j}{z}_{i}\right){u}_{\alpha }^{j},$$
(27)

which is valid until the position of the flagellum \({z}_{i}={z}_{F,j}={z}_{j}+{s}_{j}{l}_{d}\sin {\theta }_{j}\) [Supplementary Fig. 8b]. Since (h − sjzi) > 0 for zi [ − hh] and sj = ± 1, each swimmer indeed generates on average a backflow, in the direction opposite its motion, \(-({u}_{x}^{\,j},{u}_{y}^{\,j})\), due to the tilt θ. Indeed, the contribution to \(\delta {\tilde{\omega }}^{D}({z}_{i},{z}_{j};{\theta }_{j})\) of the backward push of the flagellum, which then is farther from the wall, is larger than that of the forward push of the body. Moreover, the induced flow in the central region does not depend on the absolute height of the swimmer, but only on the tilt-dependent relative vertical distance between the flagellum and the body \({l}_{d}\sin \theta\).

When summing the contributions of all the swimmers, we can omit the odd terms in sj, which change sign, and thus will cancel out, between the top and bottom wall contributions. We thus keep only the even terms in sj, which are different in the x and y directions since \({u}_{x}^{j}=\cos {\varphi }_{j}\cos {\theta }_{j}=\cos \varphi (j)\cos \theta\) and \({u}_{y}^{j}=\sin {\varphi }_{j}\cos {\theta }_{j}={s}_{j}\sin \varphi (j)\cos \theta\), where we remind that φ(j) is drawn from the same distribution (Fig. 4b) at the top and bottom walls. This yields:

$${\bar{v}}_{x}({z}_{i})=-\frac{3\pi }{{W}^{2}}{\sum }_{j=1}^{N}{l}_{d}\sin \theta \cos \varphi (j)\cos \theta \,{a}^{S}{v}_{0},$$
(28)
$${\bar{v}}_{y}({z}_{i})=\frac{3\pi }{{W}^{2}h}{\sum }_{j=1}^{N}{z}_{i}{l}_{d}\sin \theta \sin \varphi (j)\cos \theta \,{a}^{S}{v}_{0}.$$
(29)

Note that \({\bar{v}}_{x}\) is independent of zi. This stems from the top and bottom swimmer populations both moving upstream on average in the x direction (\({u}_{x}^{j}\) is even in sj). This vertical mirror symmetry selects for terms that are even in zi, with in fact only a \({z}_{i}^{0}\) term for the central region we considered. Conversely, the vertical mirror antisymmetry for chirality induced rheotaxis in the y direction (i.e., \({u}_{y}^{\,j}\) odd in sj) instead selects for odd zi terms, hence the linear dependence of \({v}_{y}^{NM}\) in zi.

We finally introduce the motile cell number density nM = N/HW2 = N/2hW2, and the average motile cell rheotactic drifts \({v}_{y}^{M}={\langle {v}_{0}\sin \varphi (j)\cos \theta \rangle }_{j}\), due to chirality-induced rheotaxis, and \({v}_{x}^{M}={\langle {v}_{0}\cos \varphi (j)\cos \theta \rangle }_{j}\) due to upstream surface rheotaxis, where 〈j is here an average over the cells, and thus over the distribution of φ(j). We also assume pure advection of the non-motile cells, hence their drift velocity vNM(zi) equals the average swimmer-induced fluid velocity \(\bar{{{\bf{v}}}}({z}_{i})\), and we obtain:

$${v}_{x}^{NM}=-6\pi {a}^{S}{l}_{d}\sin \theta \,h\,{n}_{M}{v}_{x}^{M},$$
(30)
$${v}_{y}^{NM}({z}_{i})=6\pi {a}^{S}{l}_{d}\sin \theta \,{z}_{i}\,{n}_{M}{v}_{y}^{M}.$$
(31)

Eqs. (30) and (31) are only valid in the central region. The presence of the point forces in the bands at the top and bottom walls modifies the dependence in zi. The full zi dependence of \({v}_{y}^{NM}({z}_{i})\), i.e., Eq. (26) with \({\tilde{\omega }}^{D}\) from Eqs. (24) and (21), notably shows the expected decay to 0 at zi = ± h [Supplementary Fig. 8c]. For simplicity, we, however, use Eq. (31) over the whole range of zi in the next step. This likely causes a slight overestimation of the non-motile population-averaged drift. In the top and bottom bands, steric interactions between swimmers and non-swimmers and higher-order terms in the multipolar expansion of the swimmer-induced flows, which we neglected here, are also likely to further modify the picture.

Finally, focusing on the chirality-induced effect \({v}_{y}^{NM}({z}_{i})\), we compute the population-averaged drift of non-motile cells in Fig. 4d, e as

$${\langle {v}_{y}^{NM}\rangle }_{\!\!z}=\int_{\!\!\!z = 0}^{z = H}{p}_{B}(z){v}_{y}^{NM}(z-h)dz$$
(32)

where z = zi + h, and pB(z) is the vertical distribution of non-motile cells, which is skewed by sedimentation and is given by the Boltzmann distribution:

$${p}_{B}(z)=\frac{1}{{L}_{sed}}\frac{\exp (-z/{L}_{sed})}{1-\exp (-H/{L}_{sed})}$$
(33)

where Lsed = 8 μm is the sedimentation length of non-motile particles from ref. 14. Integrating Eq. (32) with Eqs. (31) and (33), and thus neglecting the above-mentioned drop in velocity \({v}_{y}^{NM}({z}_{i})\) very close to the wall, we obtain the mean advection speed

$${\langle {v}_{y}^{NM}\rangle }_{\!\!z}=-6\pi {a}^{S}{l}_{d}\sin \theta \,h \; f\left(\frac{h}{{L}_{sed}}\right)\,{n}_{M}\,{v}_{y}^{M}$$
(34)

with

$$f(x)=\frac{1}{\tanh \left(x\right)}-\frac{1}{x}$$
(35)

increasing from 0 to 1 as h/Lsed increases from 0 (density matched case) to infinity.

Since Eqs. (31) and (34) explicitly depend on the motile rheotactic drift \({v}_{y}^{M}\) at the surface, we use directly the experimental measurement of this quantity, rather than an inference from the distribution of φ, when comparing the model with experiments. We also define \(\tilde{\kappa }=6\pi {a}^{S}{l}_{d}\), which we estimate using the equivalent hydrodynamic radius of the body modeled as a rod99, \({a}^{S}={L}_{b}/\left(3\left(\ln ({L}_{b}/{d}_{b})-0.207+0.98{d}_{b}/{L}_{b}-0.133{d}_{b}^{2}/{L}_{b}^{2}\right)\right)\simeq 0.7\) µm, given the typical cell body length Lb = 2.5 μm and diameter db = 0.8 μm, and the dipole length ld = (Lb + lf)/2 4 μm, given the typical flagellar length lf 6 μm100. We find \(\tilde{\kappa }\simeq 50\, {{{\rm{\mu m}}}}^{2}\), which is compatible with a previous estimate from Drescher et al., \(\tilde{\kappa }\simeq 40\,\mu {{{\rm{m}}}}^{2}\), for a similar but not identical E. coli strain, that was obtained by fitting an unbound dipolar flow to the flow field induced by swimmers in the middle plane between two glass slides that are 100 μm apart18, which should lead to a slight underestimation of the value.

Reporting summary

Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article.