Substrate stiffness impacts early biofilm formation by modulating Pseudomonas aeruginosa twitching motility

Surface-associated lifestyles dominate in the bacterial world. Large multicellular assemblies, called biofilms, are essential to the survival of bacteria in harsh environments and are closely linked to antibiotic resistance in pathogenic strains. Biofilms stem from the surface colonization of a wide variety of substrates encountered by bacteria, from living tissues to inert materials. Here, we demonstrate experimentally that the promiscuous opportunistic pathogen Pseudomonas aeruginosa explores substrates differently based on their rigidity, leading to striking variations in biofilm structure, exopolysaccharides (EPS) distribution, strain mixing during co-colonization and phenotypic expression. Using simple kinetic models, we show that these phenotypes arise through a mechanical interaction between the elasticity of the substrate and the type IV pilus (T4P) machinery, that mediates the surface-based motility called twitching. Together, our findings reveal a new role for substrate softness in the spatial organization of bacteria in complex microenvironments, with far-reaching consequences on efficient biofilm formation.


Introduction
The transition of bacteria from a planktonic to a surface-attached state is of paramount importance in biofilm formation. In consequence, the way bacteria sense and respond to the close proximity of a surface has been the subject of intense scrutiny (Dufrêne and Persat, 2020;Laventie and Jenal, 2020). This interaction involves different aspects of bacterial motility: swimming toward the surface, but also swarming, gliding or twitching that are used by attached bacteria to explore the surface collectively or individually (Wadhwa and Berg, 2022;Conrad et al., 2011). Eventually, permanent bacterial adhesion and microcolony structuration may arise, through mechanisms which essential ingredients are known (production of matrix, loss of motility), but in response to cues that remain unclear.
Bacteria are ubiquitous and can successfully colonize a wide range of biological tissues and abiotic surfaces (Stoodley et al., 2002;Mann and Wozniak, 2012). Different environments often result in different phenotypes for a given microorganism (Dötsch et al., 2012;Cornforth et al., 2018).
However, although chemical signaling has long been known to impact bacterial gene regulation, it remains unclear how the mechanical properties of the encountered surface might impact bacterial behavior (Persat et al., 2015b). In this paper, we investigate how the rigidity of a substrate modifies bacterial motility, and by doing so impacts microcolony morphogenesis and early biofilm development.
Pseudomonas aeruginosa (PA) is an opportunistic rod-shaped pathogen that contaminates a wide range of substrates, from very soft tissues to rigid implants (Moradali et al., 2017;Chang, 2017). A particularly gifted and versatile biofilm-former, it is extremely prone to developing antibiotic resistance (Pang et al., 2019;Boucher et al., 2009). PA has developed an arsenal of techniques to move on surfaces: among them is twitching motility, that allows single bacteria to translocate across surfaces using type IV pili (T4P) (Maier and Wong, 2015). T4P are thin protein filaments on the bacterial surface that can extend and contract by assembly and disassembly of the protein subunit PilA. The tip of T4P acts as a promiscuous hook that can grasp most surfaces. Attachment, contraction, detachment and extension cycles propel bacteria (Merz et al., 2000;Maier and Wong, 2015;Skerker and Berg, 2001;Talà et al., 2019). This surface motility is important for bacteria to efficiently settle on surfaces, but the exact mechanisms at play are unknown (O'Toole and Kolter, 1998;Leighton et al., 2015;Craig et al., 2019). The function of T4P and the fact that it exerts forces on its environment make it an obvious candidate for surface-sensing mechanisms (Merz et al., 2000;Dufrêne, 2015;Sahoo et al., 2016). Recent results have shown that the polar localization of pili in PA could happen in response to surface-sensing (Cowles and Gitai, 2010). Polarly localized pili lead to persistent rather than random displacements, as well as specific effects such as the upstream migration of bacteria submitted to strong flows (Shen et al., 2012). Reversal of twitching bacteria is rapidly induced upon meeting obstacles, suggesting a mechanical feedback from T4P (Kühn et al., 2021). In addition, PA can exert different types of virulence, from acute attacks to chronic infections (Furukawa et al., 2006;Valentini and Filloux, 2016), and specific host-pathogen interactions have traditionally been considered as the key players in the regulation of these virulence pathways (Gellatly and Hancock, 2013). However, surface-sensing in itself has recently appeared as a potential signal that could trigger the upregulation of virulence-associated genes (Islam and Krachler, 2016;Persat et al., 2015a;Siryaporn et al., 2014). Although the global effect of surface rigidity on bacterial adhesion and biofilm formation has sometimes been addressed (Saha et al., 2013;Song and Ren, 2014;Song et al., 2018), so far how the micromechanical environment experienced by individual bacteria impacts their behavior is still unclear, possibly because of the difficulty to design and control microenvironments that allow for a fine tuning of mechanical properties at the bacterial scale, along with negligible changes of the chemical environment.
In this study, we use a home-designed microfluidic setup to investigate at the single-cell level the influence of substrate rigidity on PA bacteria adhering to an open surface, under controlled flow conditions. We first demonstrate that substrate elasticity strongly impacts early microcolony development. Focusing on single-cell behavior, we then study quantitatively how rigidity modulates bacterial motility and propose a purely mechanistic model to account for our observations. Finally, we demonstrate that this mechanical tuning of the motility explains rigidity-induced changes in early surface colonization: we explore its consequences in terms of microcolony morphology, matrix deposition, strain mixing, and long-term gene expression.

Results
In order to explore in situ the effect of substrate rigidity on the behavior of adhering bacteria, we have developed an experimental approach to include mechanically well-defined hydrogel pads in a microfluidic channel providing controlled flow conditions and allowing confocal imaging ( Figure 1A). We use the biocompatible hydrogel polyacrylamide (PAA), which has been extensively used to investigate cell-substrate interaction and mechanotransduction in mammalian cells. By varying the amount of bisacrylamide cross-linker during its preparation, PAA can span a biologically-relevant range of rigidities (from ∼1-100 kPa) while keeping a low viscous dissipation. Several pads, with different's modulus values ranging from ∼3 to 100 kPa (see Figure 1-figure supplement 1, and Materials and methods), are used in each single experiment, and bacteria adhering on PAA and glass surfaces are imaged with high-resolution phase-contrast and fluorescence time-lapse imaging, from very low surface coverage up to the formation of microcolonies (1 frame/min over ∼10 hr).

Substrate elasticity modifies bacterial colonization of PAA in a T4Pdependent manner
We first focus on the effect of substrate rigidity on early microcolony formation. Straightforward observations with phase-contrast imaging show a striking impact on the shape of microcolonies after a few hours ( Figure 1B and Video 1): on the softest hydrogels (<10 kPa), bacteria form well-defined, dense hemispherical colonies; in contrast, on stiff hydrogels, bacteria are distributed in a thin layer covering most of the surface, a morphology closer to what we observe on glass. To rule out any effect due to changes in the bacterial growth rate, we quantified the division time of bacteria ( Figure 1C), and the volume occupied by bacterial colonies after a few hours ( Figure 1D and E) on different substrates:    both were found to be unaffected, suggesting that bacteria develop and colonize substrates at the same rate irrespective of rigidity, but that the processes that drive their self-organization into colonies are modified. In contrast, a change in the morphology of the colonies could be confirmed by quantifying the characteristic roughness of the bacterial layer, which decreases as rigidity increases ( Figure 1E), and the distribution of bacteria with the distance from the surface, which spreads further for soft hydrogels ( Figure 1F). To control that this is a robust phenomenon driven by substrate elasticity rather than specific chemical interactions, we reproduced this assay using polyethylene glycol (PEG) hydrogels, which are chemically different from PAA but can span a similar range of rigidities. We obtained very similar results regarding the phenotype of colonies, which further confirms a role for the mechanical properties of the substrate in bacterial self-organization ( Figure 1-figure supplement 2). Finally, because shear flow can orient polarly-attached bacteria, direct motility, disperse quorum-sensing molecules, and generally impact spatial organization into colonies, we carried out experiments on hydrogels immobilized at the bottom of wells, without any agitation of the above medium. Although long-term observations are rendered difficult in that case by swimming bacteria, we clearly observed the formation of denser colonies on softer PAA Video 1. surface colonization on 2.7 kPa (left) and 65 kPa (right) PAA hydrogels, imaged with phase contrast microscopy with one image/min over 6 hours. The two gels were included in the same microfluidic channel and imaged quasi-simultaneously. Scale bar, 20 m. https://elifesciences.org/articles/81112/figures#video1 Figure 2. Bacterial surface motility is impaired on soft hydrogels. (A) Surface explored (dark blue) and current surface coverage (cyan) after 100 min on soft and stiff PAA surfaces. Scale bar: 20 μm. (B) Surface coverage A(t) (broken lines) and cumulative explored area S(t) (full lines) for all tested rigidities (the initial surface coverage was normalized to 0.1%). Shaded areas are standard errors of the mean (84 kPa: 6 data sets from independent experiments, 18.5 kPa: 10 data sets from five independent experiments, 2.7 kPa: 8 data sets from independent experiments).
(C) Global bacterial motility Vg averaged over the first 100 min, inferred from the difference between A(t) and S(t) (16 different surfaces, 6 independent experiments). The black line is the fit with the kinetic model using equation A11. with values Vmax = 0.77 ± 0.35µ m.min -1 and E 0 = 84 ± 68 kPa.
(D) Ingredients of the minimal 1D model for bacterial T4P-powered displacement.
The online version of this article includes the following source data and figure supplement(s) for figure 2: Source data 1. Surface coverage and explored area vs time. ( Figure 1-figure supplement 3), which further demonstrates that substrate stiffness modifies bacterial behavior after attachment in a wide variety of environments.
Since surface motility is known to be important for initial self-organization of PA, we hypothesize that it could play a role in the different microcolony shapes that we observe. This link was explored by carrying out experiments using a mutant deprived of type IV pili (T4P), and thus unable to twitch on surfaces (mutant PAO1 pilA ::Tn5, Figure 1-figure supplement 4). In these assays, the dependence of microcolony morphology on substrate rigidity is abolished and bacteria form dense hemispherical colonies on all PAA substrates. We therefore conclude that T4P-mediated surface motility ('twitching') plays a key role in the rigidity modulation of microcolony formation by WT PAO1 on soft elastic substrates.

Substrate elasticity modulates twitching motility Experimental results -global motility
To quantify the coupling between the elasticity of the substrate and the twitching motility of bacteria, we analyzed time-lapse phase contrast images of adhering bacteria in flow cells. These images allow segmentation of individual bacteria (SI subsection I.A) from the start of the acquisition (with a few isolated bacteria per field of view) until the transition to out-of-plane growth, after which individual bacteria cannot be easily separated anymore. From segmented binary images at early imaging stages (<100 min), we obtain the surface coverage A(t) as the fraction of occupied pixels, and the cumulative explored area S(t) as the fraction of pixels that has been explored at time t (Figure 2A). The evolution of A(t) reflects the exponential growth of initially attached bacteria on the surface, as well as potential attachment and detachment events during the acquisition. However, in our experiments initial surface coverage is extremely low, and at early times the number of bacteria in the clean flowing medium is negligible so that attachment events are rarely observed. We can thus consider that The bacterial division rate k di does not depend on the substrate ( Figure 1C), and was measured for each experiment ( k −1 di =27.8 ± 1.4 min). Figure 2B shows the experimental time evolution of A(t) depending on the gel rigidity, which can indeed be well described by a simple exponential (straight line in the semi-log presentation with slope k di − k de ). The slope of A(t) slightly increases with gel rigidity, suggesting a higher detachment rate k de on softer hydrogels at early acquisition times.
Compared to A(t) , there is a quantitatively much larger dependence of the cumulative surface coverage S(t) on the substrate rigidity ( Figure 2B). We propose that this result directly reflects a change of the global motility Vg of bacteria on the surface. Indeed, neglecting bacterial surface attachment, the evolution of S can be written as where N denotes the number of bacteria on the surface, and the typical size of a rod-shaped bacterium is w b l b (width × length), so that the occupied area is A = Nw b l b . Here we have assumed that bacteria tend to move along their major axis, neglecting reorientations, based on previous findings about the polar localization of T4P (Cowles and Gitai, 2010;Jin et al., 2011;Kühn et al., 2021) and our own observations. (Considering that bacteria can move in any direction would lower velocity values by a factor √ lb wb ≈ √ 3 , and not change significantly the coming discussion.) The average bacterial size was measured in each experiment (l b =2.8 ± 0.13 µm , w b =0.8 ± 0.13 µm ). For each monitored position, we determined dS/dt and A(t) experimentally. The global bacterial velocity Vg was then estimated using Equation 2, by averaging over the first 100 experimental time points.
During the first 100 min under flow, Vg exhibits a clear dependence on substrate elasticity ( Figure 2C). Motility values are close to zero on very soft substrates (3-6 kPa), and progressively increase to reach ∼ 0.5 ± 0.25 μm/min on the stiffest hydrogels tested in this study (84 kPa). We wondered whether this dependence of surface motility on substrate elasticity could result from intracellular modifications in response to bacterial surface-sensing. In P. aeruginosa, two main surface-sensing systems have been unveiled so far: the Pil-Chp system that involves T4P retraction-mediated force sensing Webster et al., 2021, and the Wsp system believed to be activated by cell envelop stress O'Neal et al., 2022; both systems have been shown to activate biofilm formation pathways following bacterial adhesion Chang, 2017. Sessility and matrix production are promoted by increasing intracellular c-di-GMP levels, which production is catalyzed by diguanylate cyclases (DGCs). We carried out experiments with wspR and sadC mutants, two DGCs known to be involved in the surface-sensing response. Although impaired in c-di-GMP regulation, both mutants still exhibited a stiffness-dependent twitching motility ( Figure 2-figure supplement 1). Even though other DGCs might be involved, these initial results suggests that our observations at early timescales could be mainly governed by the mechanical interaction of bacteria with their substrate, with gene regulation playing a secondary role. This rational motivates the simple kinetic modeling presented next.

Minimal kinetic modeling
Because a difference in twitching velocity is observed almost immediately upon attachment of bacteria onto the surface, a simple hypothesis could be that a modulation of the twitching efficiency arises through mechanical factors -the interplay between the T4P extension/retraction mechanism and the linear elasticity of the substrate -without the need for mechanotransduction mechanisms. To test this minimal hypothesis, we have developed a kinetic model, schematically described on Figure 2D.
Briefly (more details can be found in appendix 1), we consider a bacterium adhering onto an elastic substrate with a single effective pilus. The pilus is modelled as a rigid inextensible filament (Beaussart et al., 2014) and attaches to the substrate via its extremity with a typical adhesion size λ . This simple choice is motivated by microscopic observations of pilus straightening over its whole length during retraction Talà et al., 2019 and an estimation of the pilus attachment spot size of ≈ 1 nm from traction force microscopy measurements Koch et al., 2022. Note, that multiple attachments of pili over extended regions to the substrate have also been suggested Lu et al., 2015. However, in our simple approach, we do not consider this possibility. The cell actively retracts its pilus until it detaches from the substrate with the force dependent velocity v R (F) = v 0 (1 − F FR ) (Marathe et al., 2014), where F denotes the tensile load on the pilus, F R the retraction stall force and v 0 the retraction speed at zero load. Assuming linear elasticity, the tensile load F is related to the substrate displacement u at the pilus adhesion patch by F = Yu , where Y ∼ Eλ and E is the Young's modulus of the substrate. Since the typical size of the bacterial body l b is much larger than λ , we neglect the deformation of the substrate induced by the bacterial body. Instead we assume that the pilus tension leads to a forward sliding of the bacterial body with a linear force-velocity relationship v B (F) = v 0 F FB (see SI subsection II.B and Sens, 2013), reducing the substrate deformation and the load in the pilus. Here, the ratio η = FB v0 denotes the mobility constant of the cell on the substrate. With this model, the evolution of the pilus tension F is thus given by which is solved by with the naturally arising force scale From dxB dt = v B (F) we obtain the bacterial sliding distance during the pilus retraction While retracting the pilus will detach with a rate constant k off from the substrate. Assuming a forceindependent off-rate constant k off = k 0 off (and hence a mean pilus adhesion time ) and a pilus retraction frequency kp , we obtain an effective bacteria velocity: Here, ⟨x B ⟩ denotes the mean bacterial sliding distance per pilus retraction event and Vmax denotes the maximum effective speed a bacterium can reach on a given substrate at infinite rigidity. It is given by E 0 denotes the rigidity at half-maximal speed and is given by Fitting (A11) against experimentally measured effective bacterial velocities Vg provides a quantitative description of the data for Vmax = 0.77 ± 0.35 μm.min -1 and E 0 = 84 ± 68 kPa. The error estimates for Vmax and E 0 were calculated directly from the co-variance matrix of the fit function and the variance of residuals (chi-squared sum divided by the number of degrees of freedom) and are reflective of the wide scattering of measured velocities between different experiments. Conversely, we can estimate Vmax and E 0 from values of the parameters used in the model: assuming a typical pilus retraction speed v 0 = 1 m.s -1 (Marathe et al., 2014), a stall force of the order F R = 100 pN (Marathe et al., 2014;Koch et al., 2022), a pilus off-rate constant k 0 off = 1 s -1 (Talà et al., 2019), a contact size of λ = 1 nm (Koch et al., 2021), a high friction surface with F B = 1 nN and a typical pilus retraction frequency (Here we assume that one single effective pilus is active during a retraction event. Using a typical pilus length of 5 μm with retraction speed of v 0 = 1 μm.s -1 we obtain a duration of 5 s per retraction and a retraction frequency of 0.2 s -1 ) of kp = 0.2 s -1 we obtain Vmax ∼ 1 μm.min -1 and a substrate rigidity at half maximum speed of E 0 = 100 kPa, which are within 30% of the fitted values.
In addition, our model [Equation 8] shows that two separate effects translate a (fast) load-free microscopic pilus retraction speed v 0 into a (slow) macroscopic bacterial speed Vmax . First, the bacterium only translocate during a fraction of the pilus cycle of extension and retraction kp koff over the substrate. Second, the pilus retraction speed slows down in a load dependent manner F R /(F B + F R ) . Both effects together reduce the local speed by an order of magnitude from µm.s −1 to µm.min −1 .
Together this demonstrates that our experimental results on bacterial effective motility on elastic substrates can be interpreted as the result of a simple interplay between the pilus retraction mechanism, the deformation of the elastic substrate, and the friction of the bacterial body on this substrate.

Analysis of individual trajectories
The simple approach presented Figure 2 yields a population-averaged value of the bacterial velocity Vg . Yet, bacterial populations can be heterogeneous, and moreover the model we have used Equation 2 to determine Vg relies on a number of strong assumptions, such as neglecting detachment and re-attachment events. To go further in dissecting bacterial motility on PAA substrates, we developed a segmentation and tracking protocol in order to obtain the individual tracks of all the bacterial cells visible over the course of the acquisiton ( Figure 3A, Video 2 and Materials and methods for details). This thorough approach allows us to measure the velocity associated with each 1 min displacement step.
Can a characteristic twitching velocity be defined for all bacteria? or do phenotypically distinct populations of slow and fast bacteria cohabit on the surface? To answer these questions, we labeled each track, defined as the displacement of a bacterium between two successive division events ( Figure 3A). We expected track duration to be similar to the characteristic division time shown on Figure 1C. However, we obtained a bimodal distribution, with two peaks centered at times unaffected by the substrate rigidity: one peak indeed centered on the division time (∼27 min), and a second one that corresponds to bacteria spending 5-10 min on the surface before detaching (Figure 3-figure  supplement 1A). The velocity distribution corresponding to each population is similar (Figure 3figure supplement 1B). This observation is consistent with a phenotypical difference between daughter cells, in agreement with the results of Laventie et al., 2019 Indeed, the duration of the track before detachment tends to be shorter on soft substrates, but the fraction of bacteria that detach from the substrate ( 35 ± 2 %) is independent of the substrate rigidity. We thus assume that at early experimental timepoints, after moving in sync with the first daughter cell, the second one sometimes detaches from the substrate (about 70% of the time). This feature might change at later timepoints -bacterial tracking was interrupted at the onset of 3D spatial organization (∼100 min on the softest hydrogels, see next section for a full description).
Considering only adhering offsprings, for which full tracks were recorded, we normalized tracks with respect to their initial position, yielding Figure 3A. These homogeneous radial distributions confirm that shear does not influence bacterial orientation in our experiments. As expected, track      extension becomes larger as substrate rigidity increases. The distribution of the mean velocity of tracks does not allow us to distinguish different bacterial sub-populations: it reaches higher values on stiffer hydrogels, but it is broad, continuous with an exponential decay (reflecting the diversity of behaviors expected in a population of cells; Figure 3B). In addition, for each track the standard deviation of this mean velocity is comparable and proportional to its mean (Figure 3-figure supplement 2), suggesting a stochastic distribution of twitching steps within a given trajectory.
Focusing next on 1 min displacement steps, and pooling all monitored events during the first 100 min of experiments (which provides more data than only analysing full tracks within the same time window), we obtained the typical velocity distributions shown on Figure 3C. These distributions further confirm that bacterial displacements are very heterogeneous, and present an exponentially decreasing tail which fitting yields a characteristic velocity V C for the bacterial population on a given substrate, that is: (V 0 =0.08 μm/min denotes a visual cutoff for low velocities).
To rationalize the meaning of V C , we reasoned that displacement steps are the sum of a passive velocity due to bacterial elongation, local reorganizations and experimental noise, and an active velocity powered by T4P. The velocity distribution obtained using a pilA mutant is purely exponential, and was used to determine the characteristic passive motility, which does not significantly depend on substrate rigidity ( V C (pilA) = V C,p = 0.044 μm/min, see Figure 3D). In the case of motile strains, assuming that active and passive displacements are incoherent, our numerical calculations (Figure 3figure supplement 3) show that in the limit V C > V C,p , the fitted characteristic velocity V C obtained as described above reflects the active twitching motility of the population, and is not significantly affected by passive movements. A detailed justification for our analysis of the probability distributions of displacement steps is given in the Methods section.
This analysis, which does not rely on any strong assumption, yields active velocity values for the WT strain ( Figure 3D) in very good qualitative agreement with the global velocity analysis described earlier ( Vg , Figure 2C, and Figure 3-figure supplement 4). Again, our kinetic model describes the data quantitatively with values very close to the ones fitted and calculated in the previous subsection ( Vmax = 0.48 ± 0.12 μm.min -1 and E 0 = 32 ± 30 kPa). The large error bars on fitting parameters reflect the dispersion of experimental measurements, despite our efforts to reproduce identical experiments. However, velocity values measured in a given experiment always exhibit a similar dependence on substrate rigidity, that is a clear increase of motility as rigidity increases. In addition, we characterized the velocity of the 5% fastest bacterial displacement steps ( Figure 3E) on each type of substrate. This analysis confirms the dependence of twitching velocity on substrate rigidity, but also yields higher velocity values, in good quantitative agreement with those reported in the literature using other experimental approaches (Talà et al., 2019), which might be biased toward more active bacteria. Finally, this approach was used to quantify bacterial motility in experiments on PEG hydrogels (shown Rigidity-modulated bacterial motility governs the spatial characteristics of early surface colonization In-plane to 3D transition of emerging colonies To understand the way rigidity-modulated bacterial motility impacts the process of microcolony formation, we studied in details the way colonies transition to out-of-plane growth. Several experimental and theoretical approaches have been developed in the past to decipher this process: for confined colonies, the switch from planar to 3D growth takes place when it becomes energetically too costly to push neighboring cells outwards. In that case, the adhesion forces between the bacteria and their underlying substrate play a key role: strongly adhering bacteria transition to 3D colonies earlier in their development (Duvernoy et al., 2018;Grant et al., 2014). In our experiments, there is no strong vertical or lateral confinement: bacteria can move on the substrate or away from it, so that cells stemming from a given progenitor do not necessarily stay in contact with each other. However, the twitching velocity determines how much cells, on average, move away from one another between two successive division events, thereby creating space to accommodate new offsprings on the surface. To investigate the possible link between twitching motility and 2D to 3D transition of growing microcolonies, we sought to determine Nc , the number of adhered cells in a progeny (i.e. stemming from successive divisions of a given bacterium) when the 2D to 3D transition takes place, as a function of the twitching velocity. For softer substrates, all bacteria can be imaged, and Nc is directly measured; we also determined the average number of colonies per unit area. On stiffer substrates, it is impossible to track all bacteria stemming from a mother cell, since they are very motile and sometimes move out of the field of view. We assume that bacteria from other progenies are equally likely to move inside the field of view, so that measuring the number of bacteria on the image at t c (the time at which transition to 3D is first observed), divided by the average microcolony density determined on softer substrates earlier gives a good approximation of Nc . Figure 4A shows Nc as a function of the center-of-mass characteristic velocity V C determined above ( Figure 3D), on different substrates and for nine different experiments. Nc consistently increases with the twitching velocity, indicating a strong correlation between the twitching efficiency and the shape of early colonies and shedding light on our initial observations of variations in microcolony morphology as a function of the substrate rigidity ( Figure 1B and D-F).
To decipher the link between Nc and V C , we have built a simple kinetic model with a single unknown parameter (see appendix 2 for details). Briefly, we assume that the 2D to 3D transition takes place when the area occupied by bacteria reaches a fraction of the equivalent 'microcolony size', defined as the characteristic area explored by bacteria in a progeny. Assuming that bacteria explore the surface through a random walk with persistence (Marathe et al., 2014), the characteristic area accessible to bacteria in a microcolony over time can be written as a(t) = a 0 (1 + αV C t) where a 0 is the area of one bacterium and α is a parameter related to the properties of the random walk. Our experimental data show that not only the velocity, but also the contour length of the trajectories of bacteria increases with the rigidity since the duration of these trajectories is mostly constant ( Figure 4B and Figure 3figure supplement 1). Area a(t) is related, but not equal, to the area over which the microcolony spreads. Indeed, bacteria are not evenly distributed within the microcolony area, and we observe strong local density fluctuations. If we now consider an exponential growth of the number of bacteria on the surface due to the balance of cell division and detachment, it follows that the increase in the number of cells, and hence the area required to accommodate these cells on the surface, grows faster than the accessible area, driving a transition to 3D growth. Expressing the number of cells Nc in the microcolony at the time when this transition stochastically occurs leads to the following dependence as a function of V C : γ is an unknown parameter related to the properties of the random walk and the growth rate of bacteria on the surface that can be measured for each experiment. On Figure 4A, we have plotted the corresponding curve using the average of experimental values for γ (solid line) ± their standard deviation (dotted lines). We observe an excellent agreement between this simple kinetic model and our experimental data over a wide range of velocities, including the T4P deficient mutant and the WT strain adhering on glass. This hints that elasticity is a key factor shaping the organization of early colonies on elastic substrates, and that it is the main determinant of the colony shapes observed in our experiments on chemically identical substrates with varying rigidities (rather than energy minimization whereby bacteria would either favor adhesion to other cells or to the substrate depending on its rigidity).

Surface decoration by extracellular matrix
One consequence of the modulation of twitching efficiency by the substrate elasticity could be a variation in matrix distribution on the surface. Indeed, P. aeruginosa can secrete an extracellular matrix mostly composed of exopolysaccharides (EPS), which was shown to result in the deposition of 'trails' by twitching bacteria on glass substrates. By mediating the attachment of the cell body to the underlying substrate such deposits are inferred to facilitate further colonization by bacteria and to impact microcolony formation (Liu et al., 2007;Zhao et al., 2013). To investigate matrix deposition on hydrogel substrates, we introduced a fluorescent dye (lectin concanavalin A, see Materials and methods) in the nutrient medium infused in our device. The main component of PAO1 matrix, psl (Jackson et al., 2004), is rich in mannose, that conA specifically binds (Ma et al., 2007).
For high stiffness substrates where bacteria explore the surface efficiently, this staining confirms that trails of matrix decorate a significant fraction of the surface; on the contrary, nearly immobile bacteria on soft substrates accumulate matrix locally, leaving most of the surface unmodified ( Figure 4C and D). This difference in matrix distribution is maintained at a later stage of surface colonization ( Figure 4-figure supplement 1). While on rigid hydrogels, most of the surface is covered by bacteria-secreted matrix, lectin staining on soft hydrogels is only present on compact colonies separated by regions completely devoid of EPS. While proper quantification of the total amount of matrix produced in each case is difficult (staining efficiency might be impacted by lectin diffusion inside dense colonies), our results confirm that substrate rigidity impacts bacterial propensity to modify hydrogel substrates via matrix deposits.

Substrate rigidity affects bacterial mixing
Real-life biofilms generally comprise several species: pathogens can compete or help each other (DeLeon et al., 2014;Orazi and O'Toole, 2017), and commensal strains protect organisms from detrimental ones (Aoudia et al., 2016). To further investigate how modulation of surface colonization with rigidity impacts the structure of forming biofilms, we studied the model co-colonization of hydrogels by two PAO1 strains constitutively expressing two different fluorescent proteins. Beside their fluorescence, the two strains exhibit identical properties (motility, division rate, etc.), similar to that of WT PAO1. Through fluorescent confocal imaging, the strains were spectrally separated to study their spatial distribution at different stages of surface colonization. As expected, rigidity-modulated motility impacts the co-colonization of the hydrogels from early stages ( Figure 5-figure supplement 1): on rigid substrates, high motility promotes mixing of the offsprings of different cells, resulting in a spatial distribution of the two strains close to random (a residual correlation between the colour of neighboring cells is always found due to the presence of cells that have just divided). Conversely, nearly immobile cells on soft substrates exhibit strong correlations between neighboring cells, which mostly arise from a single progenitor cell. This striking difference in strain mixing during surface co-colonization is maintained at later stages of biofilm formation: on soft substrates, quasi-monoclonal colonies with complete spatial segregation are observed, while biofilms forming on rigid surfaces exhibit a close-to-random distribution of the two strains at the 10-μm scale ( Figure 5A). To quantify this effect, we have used Moran's I index, a statistical tool designed to quantify the spatial clustering of species. It provides a measure of the local spatial correlations and takes values ranging from 1 (perfectly correlated values) to -1 (perfectly anti-correlated values), with 0 corresponding to a spatially random distribution of the variable (see Materials and methods for details). The resulting quantitative analysis ( Figure 5B) confirms the decisive impact of rigidity on the structure of mixed biofilms, with potentially far-reaching consequences on the interactions of different strains in multi-species biofilms.

Surface rigidity impacts gene expression
Cell-cell communication, either via exported molecules or by direct contact is crucial during biofilm development . Modifications of bacterial distribution as described above could thus likely impact gene regulation in surface-attached bacteria. To start addressing this complex question, we focused on the expression level of cyclic-di-GMP (c-di-GMP), a second messenger that controls the motile-to-sessile transition in P. aeruginosa (Rodesney et al., 2017). We used a post-transcriptional fluorescent reporter build on the promoter of the gene cdrA, which encodes an exported protein involved in matrix cohesion, upregulated during biofilm formation by PAO1 (Reichhardt et al., 2018). The PcdrA-gfp intracellular reporter provides a measure of the integrated production of CdrA with a ∼40-min delay between expression of the gene and fluorescence detection (Rybtke et al., 2012). Figure 6 shows how crdA expression is modulated by rigidity on 4 substrates included in the same microfluidic device. For this reporter, the degradation rate of gfp occurs over several hours, and its dilution due to growth and division of bacteria occurs at the same rate on all surfaces (see Figure 1C). The increase rate of the fluorescence signal is thus a direct proxy to the expression rate of gene cdrA, and thus to the changes in c-di-GMP level.
During a first phase of surface colonization, fluorescence remains low on all surfaces. The signal subsequently starts increasing linearly, roughly at the same time for all surfaces (within the uncertainty of fluorescence quantification, that is ≈10 min). This second phase ends with the onset of a plateau, again around the same time for all surfaces, at the end of the exponential growth of bacteria adhered on the surface, possibly as a result of oxygen depletion in the flowing medium that would be sensed simultaneously on all surfaces ( Figure 6-figure supplement 1). This linear increase in fluorescence directly translates into a constant production rate of CdrA that can be compared for the 4 surfaces ( Figure 6C): our analysis shows a marked increase in CdrA expression with the substrate rigidity.

Discussion
In this study, we have designed an experimental approach to investigate early microcolony formation by P. aeruginosa on hydrogels with different elastic moduli, under constant flow rate. By continuously imaging surface-attached bacteria in situ, we show that substrate rigidity influences the twitching motility of individual bacteria, therefore strongly impacting the process of microcolony formation. Through two different analyses of the surface motility of the bacterial population, either via the global evolution of the explored area or via the tracking of individual cells, we find that the characteristic twitching velocity increases with substrate stiffness (from 0.02 to 0.4 μm/min when rigidity goes from ∼3 to 80 kPa).
The encounter between bacteria and a substrate generates mechanical stress. Deciphering surfacesensing, that is understanding how the mechanical feedback resulting from this interaction translates into chemical signals that will in turn tune bacterial behavior has been the focus of a lot of recent research. It is now clear, for instance, that T4P contraction acts as a force sensor that transmits signals to the bacterium at the single-cell level (Webster et al., 2021), and triggers a response that involves an increase in c-di-GMP level (Armbruster et al., 2019). Furthermore, recent results suggest that pili can differentiate substrate rigidity, yielding a maximum response for stiffness values ∼300 kPa Koch et al., 2022. However, in our experiments a difference in bacterial motility can be observed almost immediately upon surface adhesion to soft or rigid PAA, and this behavior is not modified in mutants impaired in c-di-GMP regulation ( wspR or sadC ). We thus propose a physical model to account for the modulation of the twitching motility. This 1D model is based on a force balance between (i) a pilus that extends, attaches and retracts with a defined frequency; (ii) the deformation of the underlying substrate at the pilus tip upon retraction; and (iii) the friction force due to adhesion of the bacterial body when it is dragged across the surface at the other end of the pilus. In this balance, the detachment rate of the pilus tip from the substrate is a key parameter in the resulting bacterial velocity. We have assumed a force-independent off-rate constant for the pilus. In a more complex scenario, the contact between the pilus and substrate may act as a slip bond or a catch bond. For completeness we show some numerical results for slip and catch bond behavior in the SI (section I.D), which do not increase however the quality of fit between experimental and theoretical velocity data. In addition, although we have explored the possibility that substrate rigidity, which is directly correlated to the mesh size of the hydrogel network, could impact the frequency of attachment of T4P, this was not necessary to efficiently account for the variation in motility we observe, which we instead solely attribute to the elastic deformation of the substrate.
Strikingly, our minimal mechanistic model thus suggests that a variety of observed phenomena (3D structure of colonies; EPS deposition on the surface; strain mixing during co-colonization) can all derive from a modulation of the efficiency of pili activity by the deformability of soft substrates. This purely mechanical model may be of particular importance for surface colonization, since the adaptation of bacterial behavior to the environment can thus be instantaneous -possibly a key to PA ability to efficiently colonize extremely different microenvironments.
While this model is sufficient to account for our observations (twitching velocity, microcolony formation), it certainly does not rule out a regulatory response of the bacteria, which probably takes place in parallel. Such a response can happen on two levels: at the single-cell level, mechanotransduction processes mediated for instance by adhesion and retraction of T4P can influence gene expression at short timescales (∼1 hour) Armbruster et al., 2019;Song et al., 2018. At longer timescales, in developing microcolonies, cell-cell interactions could in turn modulate the bacterial transcriptome, which depends on microcolony characteristics (e.g. shape, cell density, matrix content) Livingston et al., 2022. Our attempt at quantifying c-di-GMP expression using a fluorescent intracellular reporter does evidence a difference in bacterial regulatory response depending on substrate stiffness. While the level of expression of the gene is clearly impacted by the substrate rigidity, differences in expression level are detected only 6-7 hr after the onset of surface colonization, with a first phase characterized by low c-di-GMP level on all surfaces. This timeframe suggests that the difference in gene expression that we observe is probably not due to a direct sensing of the substrate rigidity by individual bacteria, but rather a consequence of their organization into more or less dense colonies. Of note, when the increase in c-di-GMP takes place bacteria have stopped twitching and immobilized into colonies. We do not observe the early increase in c-di-GMP described in the litterature, possibly because we initially only track a very small number of bacteria on the surface, and the expression signal is stochastic. Further investigating c-di-GMP expression in WT and mutant strains upon adhesion to mechanically different substrates could help reveal which pathways are differently activated on soft substrates.
Interestingly, our results show that microcolony phenotype may not be indicative of a specific c-di-GMP regulation. The dense colonies observed on soft hydrogels correspond to lower c-di-GMP levels than the flat bacteria carpets that grow on rigid substrates, a somehow counter-intuitive result given the paradigm that c-di-GMP production upregulates biofilm-inducing genes, in particular matrix production, while downregulating motility. Here, we describe a case when motility is rendered impossible by the micromechanical properties of the environment rather than by the absence of functional pili, thus resulting in the rapid formation of compact colonies on soft substrates. Further exploring the density and the exact composition of the extracellular matrix in these colonies would be interesting since this parameter could influence the subsequent fate of bacteria on the surface. EPS distribution, composition and concentration may also be significant for the recruitment of new cells on the surface: indeed, previously deposited matrix is thought to strengthen adhesion of P.aeruginosa bacteria (Zhao et al., 2013), and could also possibly mediate adhesion of other microorganisms.
In a wider context, the process we observe could also be envisioned as a strategy to optimize bacterial colonization of mechanically heterogenous environments by ensuring accumulation of bacteria into dense colonies located in the softer regions of their environment, for example over cellular tissues. Recently, Cont et al., 2020 have shown that dense colonies were able to deform soft substrates and exert forces that could disrupt an epithelium layer: rigidity-modulated twitching could thus provide Pseudomonas aeruginosa with a convenient means of targeting soft tissues for cooperative disruption and subsequent invasion.
The phenotypic differences that we report for colonies are likely to impact subsequent interactions of bacteria with their environment: response to changes in nutrient or oxygen availability, and chemical signals in general which will not efficiently penetrate inside dense colonies. This could in particular influence susceptibility to antibiotics, as confirmed by very recent work Cont et al., 2023. This is all the more relevant that PA can invade many different environments, and might have to be treated differently when it settles in the lungs of cystic fibrosis patients, or on the surface of rigid implants.
Finally, our data show that rigidity-modulated twitching has a striking impact on the mixing of different strains upon surface colonization. Understanding the mechanisms governing the formation of mixed-species communities is one of the key challenges of current biofilm research. Since the motility modulation mechanism described here is quite general and should be marginally affected by the particulars of different strains/species moving through elongation/retraction of an appendage, we expect it to provide a relevant framework to study co-colonization in different mechanical micro-environments.
Bacteria were inoculated in Luria-Bertani (LB) medium from glycerol stocks, and grown overnight at 37 °C at 250 rpm. The next morning, 10 μL of the stationary phase culture were diluted in 3 mL of LB medium and placed in a shaking incubator (37 °C, 250 rpm) for 3.5 hr, to reach mid-exponential phase (OD 600 =0.6-0.8). Bacteria were then diluted to OD 600 =0.005 in our working medium, TB:PBS, and inoculated into the channel. TB:PBS is obtained by mixing TB (Tryptone broth, Euromedex, 10 g.L -1 ) and PBS (w/o calcium and magnesium) with a volume ratio of 1:2. We found that this minimal medium favors bacterial twitching for a few hours after adhesion.

Microfluidic device
Microfluidic channels were cut into 100 μm-thick double-sided sticky tape (7641 W #25, Teraoka, Japan) with a die-cutter. Typically, a 5 cm-long x 1 mm-wide channel was used to bind together a rectangular glass coverslip bearing the hydrogel patches, and a flat 5 mm-thick slab of polydymethylsiloxane (PDMS, Sylgard prepared by mixing crosslinker and monomer solutions 1:10 and baking at 65 °C for 1 hr). Two channels were stuck together to obtain a height of 200 μ m, in order for the flow through the channel to not be significantly modified by the 25-μm-thick PAA hydrogels. These sticky-tape channels were first adhered onto the PDMS piece and then placed onto the dehydrated hydrogels. To ensure proper binding, the whole device was placed under vacuum for 30 min. Next, the channel was rinsed with TB:PBS (1:2) for a minimum of 1 hr, in order to rehydrate the hydrogels. Medium was placed in a plastic container and withdrawn into the channel with a syringe pump (Harvard Apparatus, USA, 30 μL/min) to avoid the formation of bubbles.
Rectangular glass coverslips (24 × 60 mm) were used as substrates for gel casting. They were plasma-cleaned and immersed in a solution of Bind-silane (60 μL of Bind-silane, 500 μL of 10% acetic acid, 14.5 mL of ethanol) for 1 hr before being rinsed with ethanol, water, and blow-dried with nitrogen before use. Round glass coverslips (12 mm diameter) were used as counter-surfaces for gel casting. After plasma cleaning, they were immersed in Sigmacote for 1 hr before rinsing with acetone, ethanol and water, and blow-dried before use.
Bulk solutions of AA/Bis and PEGDA were prepared in phosphate buffer saline (PBS) and stored at 4 °C until use. The final stiffness of the gels was tuned by adjusting the AA/Bis or PEGDA content according to Table 1. PAA gels were obtained by adding 1 μL of TEMED and 1 μL of a freshly made APS solution (10 w% in water) to a volume of 168 μL of AA/Bis solution. A 3 μL droplet of the mixture was immediately placed on the surface of a bindsilane-treated glass coverslip, sandwiched by a Sigmacote-treated round coverslip, and left for curing for 1 hr in a water vapor-saturated atmosphere. After curing, the round coverslip was lifted off using the tip of a scalpel blade, resulting in a circular pad of gel, of thickness ∼ 25 − 30 μm, covalently bound to the bottom rectangular coverslip and exposing its free top surface. Circular gel pads were then scrapped with a razor blade in order to adjust their lateral size to the width of the microfluidic channels into which they would eventually be installed. Gel pads were then copiously rinsed with ultrapure water, and left for drying in a laminar flow cabinet. Up to three such pads, with different elastic properties, were prepared simultaneously on the same coverslip, arranged to fit along the length of the microfluidic channel. PEG gels were obtained by adding 5 μL of a 10 wt% solution of Irgacure in ethanol to 0.5 mL of PEGDA solution. A 3 μL droplet of the mixture was placed in between coverslips as described above, and irradiated under UV light (365 nm, 180 mW. cm -2 ) for 15 min for curing. Subsequent steps were as described above for PAA gels.

Mechanical characterization
The viscoelastic properties of the various gels were characterized by AFM microrheology, using the 'contact force modulation' technique described recently and validated on hydrogels (Abidine et al., 2015). It allows determining elastic and loss shear moduli, G ′ and G ′′ , as a function of frequency over the range 1 − 300 Hz. The Young moduli reported in Table 1 have been computed as E = 3G ′ 0 , with G ′ 0 the low frequency plateau modulus obtained by microrheology, assuming a Poisson ratio ν = 0.5 for all gels. All gel samples displayed elastic behavior with G ′ ≫ G ′′ . Measurements were performed on a JPK Nanowizard II AFM, with pyramidal-tipped MLCT probes (Bruker) of spring constant 15 mN/m. Data were analyzed using a home-written software for microrheology. Thirty-μm-thick gels were prepared, as described above, on round coverslips mounted at the bottom of 35 mm petri dishes. They were then either characterized immediately or left to dry to mimick the protocol used for inclusion in the flow chamber. Experiments were performed in PBS +1 % vol. tween 20 (Sigma), with Tween used to prevent adhesion of the AFM tip to the gel. All measurements were carried out at 37 °C to mimic experimental conditions with bacteria. Results were compared with force-distance indentation curves that gave consistent results at low rigidities ( < 20 kPa) but overestimated the rigidity for higher values (Figure 1-figure supplement 1a). Homogeneity of the gels was assessed at the μm and mm scales by multiposition measurements. We found very good repeatability of the measurements and homogeneity of the gels at all scales ( Figure 1-figure supplement 1b). Subsequent measurements were hence acquired at three to six different points in the gels and the average and standard error of the mean are provided (Table 1). Rigidity was also measured before and after drying and rehydration of the gel to check for possible damage to the structure. In addition, confocal images of the surface of fluorescently labelled gels were used to track default on the gel surface before and after drying. We found no evidence of damage to the hydrogel upon drying, except for very soft gels of rigidity below 1 kPa that were not used in this study (Figure 1-figure supplement 1c).

Microscopy experiments
Diluted bacterial solution was injected into the channel, and kept without flow for 30 min to allow bacteria to attach. During that time, clean tubing was connected to a syringe and filled with TB-PBS medium supplemented with 3 mM glucose and connected to the inlet of the device. 30 min after injecting bacteria into the device, the flow of clean medium was initiated. The flow rate was first set at 25 μl/min for 3 min in order to flush out unattached bacteria, and then lowered to 1 μL/min and maintained constant with a syringe pump (Pico Plus, Harvard Apparatus) throughout the acquisition (yielding a wall shear stress of 2.5 mPa). The set up was immediately placed into the incubation chamber (37 °C) of a Leica SP8 confocal microscope, and acquisition was started at 1 frame/minute.
For matrix staining experiments, concanavalin A (Alexa Fluor 647 conjugate, ThermoFisher Scientific) was added to the medium (3 μl/ml of a 1 mg/ml stock solution) and infused in the flow cell for at least 30 min prior to imaging. Since the tetravalent conA interferes with the structure of the matrix, it was used either for short-term imaging of bacterial twitching at early stages (t<1 h, Figure 4D), or added at the end of an acquisition to assess matrix distribution on and around colonies (t ∼ 8 h, Figure 4-figure supplement 1).
For control experiments in wells (Figure 1-figure supplement 3), the protocol was modified as follows: PAA gels were prepared as described above, but at the center of a 35 mm round glass coverslip. The coverslip was then glued (5 min epoxy, Araldite) to the bottom of the well of a six-well plate (Costar, Corning), previously cut-out to open a circular 32 mm hole. One mL of diluted bacteria suspension (OD 600 =0.005) were deposited on the gel, incubated for 30 min, and then carefully pipetted out, and the well was filled with 3 mL fresh medium (TB-PBS +3 mM glucose) and kept at 37 °C. This setup allowed continuous imaging of bacteria on a Zeiss Axio-observer 7 inverted microscope in phase contrast mode (63 x objective) equipped with an Orca-Flash 4.0 LT camera (Hamamatsu).

Surface coverage analysis and tracking of individual bacteria
All image processing and analysis, unless otherwise noted, was performed with Fiji using available plugins and home-written macros. In order to quantify the movements of individual bacteria, time series of phase-contrast images were registered using the Fiji plugin "MultiStackReg" Thévenaz et al., 1998 and segmented with the plugin "weka trainable segmentation" Arganda-Carreras et al., 2017. The resulting segmentation was checked and corrected manually.
For the analysis of the global velocity Vg , segmented binary images were used to estimate the surface coverage A(t) and the explored surface area S(t) , using a home-written MATLAB script. Briefly, at each timepoint 2 binary images were generated: one where pixels occupied by bacteria were assigned the value 1, and all others zero (providing A(t) ), and another image obtained by adding all binary images up to this timepoint, so that all visited pixels were assigned the value 1 (providing S(t) ).
For the analysis of individual displacement steps, segmented bacteria were fitted with an ellipse, and the 'analyze particle' imageJ function was subsequently used to locate the center of mass of each bacterium. The Fiji plugin 'TrackMate ' Tinevez et al., 2017 was used to track all individual bacteria, again followed by manual validation and correction (see Video 2). The function importTrackMa-teTracks (Tinevez et al., 2017, https://github.com/fiji/TrackMate/blob/master/scripts/importTrackM ateTracks.m) was used to import tracking data into MATLAB, and homemade scripts were used to sort data, plot tracks and obtain velocity distributions.
The analysis of the histograms of displacement steps were performed as follows: we assume that the measured steps are the incoherent sum of two displacement vectors, the active displacement ⃗ Va due to T4P activity, and a vector ⃗ Vp that includes passive effects due to both the noise on measurements, and displacements resulting from bacterial growth and local crowding. First, we considered the experimental distribution obtained with the pilA mutant, for which ⃗ Va = ⃗ 0 : this allows extracting the probability distribution for ∥ ⃗ Vp∥ , which can be well fitted with a decreasing exponential with a characteristic passive velocity V C,p : p( ⃗ Vp ) = exp(− ∥ ⃗ Vp∥ VC,p ) , with V C,p = 0.044 µm/min . We then considered the case of twitching bacteria. Here, we observed that the tail of the displacement step distribution also follows a decreasing exponential trend. Based on the reasoning that passive displacements are shortranged and should not significantly modify the distribution for large displacement values, we deduce that the tail of the probability distribution for ∥ ⃗ Va∥ is a decreasing exponential, p(∥ ⃗ V a∥) = exp(− ∥ ⃗ Va∥ VC ) , with V C the characteristic active twitching velocity of bacteria.
We confirmed the validity of this hypothesis by calculating the probability distribution functions. We assumed that the distribution of measured displacement steps, ∥ ⃗ Vtot∥ = ∥ ⃗ Va + ⃗ Vp∥ is the sum of two uncorrelated exponential distributions with different scales and a random angle between the two vectors. There is no analytical expression for this sum, hence we performed numerical calculations of the distributions obtained in the general case. In the limit ∥ ⃗ Vtot∥ >> V C > V C,p an exponential distribution is retrieved with a characteristic velocity V C , unaffected by V C,p (Figure 3-figure supplement  3, left). A fitting of the range p(∥ ⃗ Vtot∥) < 0.3 (which excludes the first few points that do not follow an exponential trend) confirms that V C is obtained accurately provided that V C > V C,p (Figure 3-figure  supplement 3, right). Below this limit, only V C,p is detected since active displacements are in the range of passive 'noisy' ones.
Experimentally, we have used a lower cutoff of ∥ ⃗ Vtot∥ > 0.08 µm/min ≃ 2V C,p for the fitting range, to restrict it to the exponential part of the distribution. To account for the noise in the measurement, we have also considered that fitted values below V C,p = 0.044µm/min were in the range [0;0.044] m/min.

Quantification of the morphology of colonies
Quantification was performed on confocal fluorescence 3D resolved images. First, signal attenuation with depth was compensated by decreasing exponential fitting of the mean pixel values inside the colony with depth, and normalization by the corresponding function. A 2D 3x3 smoothing operation was then performed on each image of the z-stack, and the colonies were subsequently segmented using a simple thresholding operation: while this procedure does not permit segmentation of individual bacteria, it provides a good estimate of the 3D envelope of the colonies. The topology of the colonies was then quantified by calculating the roughness of this envelope using the widely used arithmetic average roughness Ra where summation is over all 2D positions i in the 3D image, z i is the height of the highest segmented pixel at position i and ⟨⟩ is the averaging operator over all positions. The occupied volume V is calculated as with px the pixel size. The occupied area as a function from the distance to the coverslip is the histogram of z i values with bin size 0.5 μm (corresponding to the vertical sampling of the 3D images).
Quantification of the mixing of two strains co-colonizing the same soft substrate, as a function of the softness This quantification is performed both at the low density stage with isolated bacteria, and at a later stage on maturing colonies. To this aim, we used a statistical tool, Moran's I index, designed to quantify the spatial clustering of species and widely used in the field of ecology and geography Moran, 1950. Moran's I is a measure of the local spatial correlations that includes a notion of spatial proximity, either in the form of a spatial cut-off for the calculation of the heterogeneity (in other words, a characteristic distance), or a number of neighbors. It takes values ranging from 1 (perfectly correlated values) to -1 (perfectly anti-correlated values), with 0 corresponding to a spatially random distribution of the variable.
Considering a variable y that can take two different values (in our case, green (1) or yellow (-1)) with n realisations, Moran'I is expressed as: where w ij is the matrix of weights that contains the spatial information (with w ii = 0 ). In our experiment, the relevant spatial scale (and hence the matrix of weights) varies greatly over time because of the change in the density of the bacteria on the surface. While at high density (maturing colonies) defining a length scale is a suitable way of testing the presence of local correlations, this is more challenging at earlier times when the distance between neighbors exhibits large stochastic variations, in particular for stiff substrates. Hence, different matrices of weights were chosen for early-stage and later-stage colonization of the surface: • At early stages of colonization, when the bacteria are sparse on the surface, we chose to focus on the nearest neighbors of each bacteria. To this aim, individual bacteria are segmented in the green and yellow images, and their center of mass location is collated into a list of 2D coordinates and colour for all bacteria in the field of view. Moran's I is then calculated based on this list using the following weight matrix: We arbitrarily chose p = 5 as a significant number of neighbors, although similar results are found for values of p ranging from 4 to 10. Lower numbers are biased by cell division: at the time of division, the closest neighbor is necessarily of the same strain as the bacteria under consideration, so that there is always a positive correlation between them. As a result, testing for mixing requires to mitigate this effect by choosing a large enough value for p . In practice, we found that p = 5 was a good compromise to limit this bias while maintaining a 'local' approach, that is not considering the correlation between bacteria further apart than half of the field of view (i.e. 160 μm).
1 if j is one of the p nearest neighbours of bacteria i 0 otherwise • At later stages with dense, 3D colonies, individual segmentation of bacteria becomes challenging and the correlation measure is performed on individual pixels: first, a simple thresholding operation is performed on the green and yellow image, and each pixel is attributed a value: 1 (green pixel), 0 (black pixel) or -1 (yellow pixel). From this new image, Moran's I is calculated using the following weight matrix: Again, the cut-off distance d is arbitrarily chosen as 5 μm although values between 3 and 10 μm yield similar results: it permits limiting fluctuations by averaging over a significant number of bacteria, while maintaining a local measure of mixing. In addition, because individual bacteria cover more than one pixel in the acquired images, a number of pixels of the same colour as pixel i are removed to avoid correlating the bacteria with itself. In our data the average number of pixels covered by one bacteria is measured to be 40.
  1 if the distance between i and j (i ̸ = j) is smaller than or equal to d 0 otherwise While there is some degree of freedom on the choice of the weight matrix, it is important to note that we use the same weight to compare data obtained on three different rigidities, hence minimising the impact of the exact chosen parameters on the comparison. In contrast, values obtained on one surface at the two different time points should not be directly compared as they have not been obtained with the same weight matrix. The funders had no role in study design, data collection and interpretation, or the decision to submit the work for publication. Additional files

Supplementary files • MDAR checklist
Data availability Figure 2-source data and Figure 3-source data contain the numerical data used to generate the figures.

Appendix 1
Modeling twitching velocity on soft substrates The principle of our modeling of rigidity-modulated twitching in 1D is shown in Figure 2D (main text), and incorporates three main ingredients: modeling of the substrate deformation (subsection A), of cell body friction on the surface (subsection B) and of the pilus retraction dynamics (subsections C and D).

A. Modeling substrate deformation
We have based our approach on the theory of linear elasticity for the description of the substrate: in this framework, the deformation of the substrate occurs over a typical length scale given by the size of the adhesion, λ , and it is proportional to the applied force. Finally, the proportionality coefficient Y scales as the product of the substrate elastic modulus, E , and the adhesion size λ , that is Y = Eλ . This simple relation is valid only for small displacements on rigid substrates. It is likely to fail quantitatively on very soft substrates with large displacements, low cross-linker densities and non-affine deformations, but is a reasonable first approximation for the simple model we propose here. This modeling introduces characteristic length scales that depend on the part of the bacteria under consideration: both the pilus and the cell body form contact with the substrate. The pilus attaches at its tip over size λ ≈ 1 nm, while the cell body has a typical size of l b ≈ 1 μm. In addition, a third length scale is the typical length of the pilus, L , which varies during retraction but is most of the time > 1 μm. Introducing these three quantities permits to simplify the description of the deformation of the substrate: the pilus tension F and the displacement at the adhesion site in the substrate u are linearly related by F = Yu , with Y being an effective spring constant. We model the substrate as an infinite (thickness ≈ 25 μm ≫ λ , lateral extension ≈ 1 − 10 mm ≫ λ ), isotropic, elastic and incompressible half space. Furthermore, we neglect the influence of the cell body on the deformation around the pilus tip since L >> λ so that the deformation of the substrate has decayed to zero at the cell body.
The 2D Boussinesq Green's tensor at the surface z = 0 for a point-like shear force f at the origin is given by Landau and Lifschitz, 2004 Considering an adhesive T4P tip of length λ and half-width d and using slender body approximations, the total force F on the pilus for a "lengthside" displacement u is given by Here we have implicitly introduced a 1D setting, that is we will neglect the vectorial nature of forces and displacements and restrict ourselves to a 1D setting. We find, as expected, that Y scales linearly with λ . This holds equivalently for the cell body by replacing λ with l b >> λ : as a result, the substrate deformation at the cell body caused by the same pilus tension F is of amplitude smaller by a factor λ/l b ≪ 1 and will be neglected for the sake of simplicity. In contrast, we consider the pilus tip to be firmly attached to the substrate until detachment while the cell body can slide on the surface. Note that this asymmetry between bacterial body (macroscopic sliding over the substrate) and the supposedly small pilus/substrate contact (point-like force deforming the substrate) is the essential difference to the pulling process described in Simsek et al., 2019, where the contact of the bacterial body and the pilus extremity are mechanically treated as equivalent.

B. Modeling cell body friction
As stated above, the model requires a description of the sliding motion of the cell body on the substrate as a function of the force F applied by the pilus. We base our modeling on the theory from Sens, 2013 that considers stochastic friction by an ensemble of N elastic linkers (not necessarily all bound at all times) between an elastic substrate and a cell, submitted to a sliding velocity v . The bonds are modeled as slip bonds with a critical force f * , an off-rate constant at zero force k 0 off and an on-rate constant k on . The linkers' stiffness is k b .
In the case of an infinitely rigid substrate, the mean total force on the cell body ⟨ F ⟩ as a function of its velocity v is non-monotonous and is given by , x] is the Euler gamma function. Equation (A3) exhibits a complex dependence of ⟨ F ⟩ on ṽ that requires estimating typical values of the parameters in our experiments. Putting in numbers to obtain the typical speed v β , we can estimate that • k 0 off ≈ 1 − 10 s −1 (slightly higher than for specific ligand/receptor bonds Robert et al., 2007) • f * = k B T/x β with x β ≈ 0.1 − 10 nm being the transition state distance between bound and unbound state as proposed by Evans, 2001 andothers Pereverzev et al., 2005. • k b is more difficult to estimate. Here we assume that bacterial adhesion is mediated by the bacteria produced extracellular matrix, of which a major constituent are exopolysaccharides. Using a worm-like chain (WLC) model for a polymer of persistence length Lp ≈ 10 nm (as calculated for bacteria produced exopolysaccharides in Kuik et al., 2006) and contour length L 0 ≈ 100 nm (assuming a chain length of about 100 monomers with size 1 nm), the linear force-elongation relationship in the regime of weak forces Marko and Siggia, 1995 yields a force constant k b ≈ 3kT 2LpL0 ≈ 6 × 10 −3 pN. nm -1 . Taking extreme values this leads to typical velocities in the range v β = 1 − 100 μm.s -1 . In our experiments the bacteria are not expected to move faster than the pilus retraction velocity (i.e. 1 μm.s -1 Skerker and Skerker and Berg, 2001, if one excepts the case of slingshots that were not frequently observed in our experiments). Taking into account that the pilus retraction speed slows down considerably as the tension in the pilus increases, the bacterial speed during one pilus retraction is rather smaller than this maximum value. Hence, we always have ṽ = v/v β < 1 , and Equation (A3) can be linearized to In addition, the elasticity of the substrate should be considered. Sens, 2013 proposes that this situation is equivalent to having a system of springs in series, one stemming from the substrate elasticity and the second being the collection of individual bond springs (in parallel). In this case and using once again the theory of linear elasticity, the previous analysis holds if ṽ is rescaled by a factor E lb kb+E lb , with E > 3 kPa the substrate Young's modulus and l b ≈ 1 μm the characteristic size of the bacterial cell body, a = l b ≈ 1 μm. Hence El b ≥ 3 pN. nm -1 ≫ k b and the scaling factor E lb kb+E lb ≈ 1 , so that the elasticity of the substrate does not influence the friction of the cell body. In summary, we find that we can reasonably use a linear approximation for the bacterial sliding speed in response to the pulling force due to the pilus retraction, F = ηv with η a friction coefficient. Finally, we consider η as independent from the substrate rigidity, which is reasonable if we assume that the number of bonds is limited by the number of molecules/appendages of the cell body that can interact with the substrate, rather than the number of binding sites on the substrate itself (PAA mesh size ≈ 3 − 10 nm), and that the interaction may in addition be mediated by adsorbed exopolysaccharides deposited by the bacteria. However, other non-linear dependencies can be easily included into the modeling.

C. Basic modeling of pilus retraction
The relevant step during twitching which induces bacterial motion is the active pilus retraction when attached to the substrate. Here we assume, that the limiting effect for bacterial motion is the detachment of the pilus from the substrate, and not the complete retraction of the pilus by the bacterium. To understand the role in substrate rigidity on the bacterial twitching speed we will therefore concentrate on this crucial step without describing the whole cycle of pilus dynamics, for which the kinetics is not completely understood Koch et al., 2021;Talà et al., 2019. We consider the retraction of a single effective pilus pulling on the bacterial body until it detaches from the substrate. We treat the pilus as rigid and inextensible filament: assuming a force constant of 2 pN.μm -1 for the pilus elasticity Beaussart et al., 2014, a substrate rigidity of E = 100 kPa, an adhesion size of λ = 1 nm and a maximum force exerted by the pilus of F R = 100 pN, the substrate displacement is u ∼ F R /Eλ = 1 μm. In contrast, the pilus elongation is ∆L = 50 nm and can therefore be neglected for our conditions. However it would not pose any difficulty to include the pilus elasticity into the calculations.
Let v R be the retraction speed of the attached pilus inducing a displacement u in the substrate. At the same time the bacterium will slide forward with speed v B , reducing the tension in the pilus and the displacement in the substrate: Both motions (substrate displacement and bacterial sliding) are coupled via the tension in the pilus F . Its retraction speed is described by a simple linear dependence that has been well documented Marathe et al., 2014;Koch et al., 2022 with F R a stall force. As established in the previous subsection, the bacterial sliding speed depends linearly on the pilus tension with friction F B denotes the force necessary to pull the bacterium at maximum retraction speed v 0 over the substrate. From Equation A5 we recover the increase in the pilus tension over time during the retraction with the force scale Incorporating solution (A8) into Equation (A7) with v B = dxB dt we recover for the bacterial sliding distance during pilus retraction While retracting the pilus will detach with a rate constant k off (F) from the substrate. Assuming a force independent off-rate constant k off = k 0 off the detachment times are distributed exponentially with mean 1/k 0 off . Furthermore, we assume that the single effective pilus considered in our model retracts with frequency kp and thus gives rise to an effective velocity Here, ⟨x B ⟩ denotes the mean bacterial sliding distance per pilus retraction event. Vmax denotes the maximum effective speed that a cell can reach on a given substrate at infinite rigidity, given by E 0 denotes the rigidity at half-maximal speed and is given by Here we have assumed a force-independent off-rate constant for the pilus. In a more complex scenario, the contact between the pilus and the substrate may act as a slip bond or catch bond. For completeness we will show some numerical results for slip and catch bond behavior below, which do not increase however the quality of fit between experimental and theoretical velocity data.

D. Force dependent detachment rate constants
Increasing the complexity of the model, we assume that the pilus detachment rate is force dependent Kramers, 1940;Björnham and Axner, 2010;Pereverzev et al., 2005;Talà et al., 2019 and takes the form ε = 0 denotes a slip bond and ε > 0 denotes a catch bond behavior. F C and F S denote positive force constants Pereverzev et al., 2005. Equation (A14) implies that the pilus detachment times are not distributed exponentially. We now consider the evolution equation for the probability density p(u) that a pilus attached to the substrate is retracting and is thereby inducing a displacement u The first term denotes (tension dependent) pilus detachment from the substrate and the second term captures the advection of the displacement due to pilus retraction and bacterial sliding. It is formulated as a divergence of a flux ju with The pilus retraction v R (F) and bacterial sliding speed v B (F) is given by Equations (A6) and (A7). To facilitate the analysis of the equations we use the transformation p(u) = p(u[F]) = P(F) and ∂u = Y∂ F which gives rise to the evolution equation To reduce the number of parameters we introduce the timescale t 0 = 1/k 0 off , the length scale l 0 = v 0 t 0 and the force scale F 0 = (F R F B )/(F R + F B ) . The adimensional quantities are then denoted F = F/F 0 , t = t/t 0 , and ũ = u/l 0 . The adimensional evolution equation of P (F) takes the form where µ = Yv 0 /(F 0 k 0 off ) denotes the adimensional substrate rigidity and κ denotes an adimensional force dependent off-rate, that is κ = k off /k 0 off . Solving Equation (A18) in the steady state we find In Equation (A20) the force constants F C and F S have been rescaled by F 0 . The normalization factor P 0 is defined by the integral condition ´1 0P (F) dF = 1. Ei(x) denotes the exponential integral. At detachment the distribution of forces F d is given by with the normalization factor P d0 determined by the integral condition ´1 0P d (F d ) dF d = 1 . Using the forces and bacterial sliding distance at detachment from the substrate Following the same argument as for Equation A11, the effective bacterial speed (dimensional) is then given by Appendix 1- figure 2 shows exemplarily the off-rate constants for force independent, slip and catch bond behavior (Appendix 1-figure 2a) and the effective velocity of a slip-bond and catchbond model along with a force independent detachment in comparison to the measured bacterial velocity using the local velocity analysis (Appendix 1-figure 2b). Thereby we chose arbitrarily a slip-bond constant F S = 1.1F 0 corresponding for example to the case of a high friction substrate with F R = F S = F B /10 , that is as used previously F R = F S = 100 pN and F B = 1 nN. The catch-bond force constant was chosen to be small, that is F S ≪ F 0 , following the idea of Talà et al., 2019 that pilus-substrate attachment is stabilized for small pilus tension. Futhermore, we chose ε = 2 , that is pilus detachment at zero loads is three times faster than for a slip-bond model. Fixing E 0 = 32 kPa [obtained from fitting the force-independent model (see Appendix 1- figure 1a)]., the theoretical curves with the force-dependent off-rate constant were fitted using a least square fit in the parameter Vmax . The catch-bond behavior captures qualitatively better the velocities at low rigidities but neither slip-bond nor catch-bond seem to perform better than the simple analytical force-independent detachment model for medium and high rigidities. To further analyze the microscopic meaning of γ , we note that it is the inverse of a velocity and is related to the compactness of the colony, with higher values indicating a sparser distribution of bacteria with a lesser probability that growing/twitching bacteria will encounter several others and move to 3D because of local crowding. However it is misleading to compare it to values that could be derived from random walks with persistence because of the above-mentioned discrepancy between the colony area and the area accessible to bacteria for further spreading. Relating γ to experimentally measured quantities on the cell movement would require a detailed analysis of the cell density fluctuations on the surface which is beyond the scope of this paper.
B. Comparison of experimental data with the model All available data from which characteristic velocities were extracted (main text, Figure 3B) were analysed and included, with the exception of one data point on glass due to the presence of an air bubble on the surface before the onset of the 2D→3D transition. The characteristic velocities for each experiment and each rigidity were taken from Figure 3B. The characteristic number of bacteria Nc per colony was estimated as follows.
• First, for low-and medium-ridigity surfaces (2.7 kPa, 6.1 kPa and 18.5 kPa), colony formation from isolated bacteria was monitored over time until the 2D to 3D transition occurs. The number of bacteria on the surface stemming from the initial isolated bacteria were then counted, and the count for all the colonies were averaged to calculate Nc . In addition, the average number of colonies forming in the observed area up to that point was also measured. • For higher-rigidity surfaces, the movement of bacteria is too large to keep track of all bacteria stemming from the same progenitor as they mix or leave the field of view, while others are incoming. As a result, Nc was calculated by counting the total number of bacteria in the field of view at the time of the onset of the 2D to 3D transition, and dividing this number by the estimated number of colonies as measured on low-rigidity surfaces. It should be noted that in this case, the simple model presented above is not valid as it considers only one isolated colony, and can be expected to yield overestimated values of Nc . Furthermore, our evaluation method of the number of colonies in the field of view may be prone to error so we used a "blind" evaluation procedure performed before the count of bacteria in the field of view, to avoid possible biases. A change of 1 (compared to a mean value around 4) in the number of colonies used to normalise the total number of bacteria provides a good estimate of the error bars on each individual data point, and is comparable to the spread of the data points (see Appendix 2- figure 1). When several surfaces of the same rigidity have been measured in one experiment, the different Nc values are averaged. (a) Comparison between the experimental data (markers) and the kinetic model (lines). Blue dots are data obtained with the pili-deficient mutant pilA: Tn5. Inset, residual of the fit of all the experimental data points as a function of the exponent value for V CM , indicating that the best fit is achieved for a value of or close to 1. (b) γexp values for all data points (black disks) and their average (red line). Gray squares are data points with v 0 < 2 μm.min -1 , showing a similar distribution and thus ruling out a significant bias at high velocities. (c) Same dataset as in a but the surface density at the transition is plotted; (d) same dataset as in a but the time at the transition is plotted. The same model is used to describe the data, but converted into the proper quantities.
The above cited procedure produced one doublet ( V CM , Nc ) for each rigidity of each experiment.
To match our simple model with the experimental data, Equation A27 can be used to calculate Nc as a function of V CM for a given value of γ . However, a direct fit of the experimental data is difficult as there is no analytical solution to Equation A27. Instead, an experimental value of γ was calculated from each experimental point using the expression γexp = Nc − 1 V CM ln(Nc) (A.30) An average experimental value is then calculated, along with a standard deviation, ⟨γexp⟩ = 56.8 min. μm -1 and δγ = 11.2 min.μm -1 .
Appendix 2- figure 1a shows the experimental data (Nc − 1)/Log(Nc) as a function of V CM (each marker corresponds to a different experiment), and the corresponding theoretical straight lines with slopes ⟨γexp⟩ (solid line), and ⟨γexp⟩ +/-1 standard deviation (dotted lines). To assess the deviation from the curve at high velocities, ⟨γexp⟩ was also calculated from all data points with v 0 < 2 μm.min -1 but the change in the value is minimal (58.2 min.μm -1 instead of 56.8 min.μm -1 , see Appendix 2- figure 1b).
Our strongest assumption in this modelling is the expression of a(t) as a function of V CM [ Equation  A26]: an obvious a posteriori evidence for its correctness is that the derived equation fits our data well over more than one decade in velocity. To strengthen our point, however, we have also calculated similar curves using an exponent for V CM ranging from 0.5 to 1.5 (steps of 0.1, Appendix 2-figure 1a, inset): the comparison with experimental data indicates that reasonable agreement is only obtained for exponent values between 0.8 and 1.1, at most.
Finally we would like to point out that the data do not collapse as well when plotting the density of bacteria, or the time of the 2D→3D transition (Appendix 2- figure 1c and d). A likely explanation is that the initial number of bacteria on the surface varies between different datasets, a bias that is cancelled when plotting the number of bacteria instead of the density or the time at the onset of the transition. The same model is used with the same average parameter and spread, but converted into the proper quantities: for the density, the curves in Appendix 2-figure 1a are multiplied by the average number of colonies per observed area (3 colonies), and divided by the image area (26,121 μm 2 ); for the transition time, the logarithm of the number of bacteria per colony at the transition is multiplied by the typical growth time of the number of bacteria on the surface (∼40 min). This time incorporates both the division time (∼30 min) and the departure of a fraction of the bacteria from the surface.