Biophysical aspects underlying the swarm to biofilm transition

Bacteria organize in a variety of collective states, from swarming—rapid surface exploration, to biofilms—highly dense immobile communities attributed to stress resistance. It has been suggested that biofilm and swarming are oppositely controlled, making this transition particularly interesting for understanding the ability of bacterial colonies to adapt to challenging environments. Here, the swarm to biofilm transition is studied in Bacillus subtilis by analyzing the bacterial dynamics both on the individual and collective scales. We show that both biological and physical processes facilitate the transition. A few individual cells that initiate the biofilm program cause nucleation of large, approximately scale-free, stationary aggregates of trapped swarm cells. Around aggregates, cells continue swarming almost unobstructed, while inside, trapped cells are added to the biofilm. While our experimental findings rule out previously suggested purely physical effects as a trigger for biofilm formation, they show how physical processes, such as clustering and jamming, accelerate biofilm formation.


S1 Data Acquisition
The data for Fig. 2 is obtained from five individually recorded movies in the transition zone. All movies were captured within ≈ 5 minutes. Three movies were taken at 40× magnification and two movies at 20x magnification. One movie of each magnification is recorded for 5000 frames, whereas the rest is recorded for 2000 frames each. Movies were captured at 50 frames per second.

S2.1 Flow computation and aggregate identification
The raw image data obtained from the experiments is used to compute the flow and identify different regions as illustrated in Fig. S1. First, the optical flow is computed via the Farnebäck algorithm (45), which provides the local velocity field v(x, t) shown in Fig. S1B. Parameters of the Farnebäck algorithm are provided in table S1. We then identify stationary clusters in four steps: First, the original image is smoothed once with a Gaussian kernel. Then, cells are separated from the background by thresholding the smoothed image. Based on the flow, nearly stationary regions are identified (i.e. regions below a certain magnitude of the flow). Finally, connected stationary regions above a certain size are labeled as a stationary cluster, see Fig. S1C. We require stationary aggregates to at least cover the same area as roughly ten bacteria. From our data, we estimate the surface coverage of a typical cell to be roughly 200 pixels (at 40× magnification), hence we set a size threshold of 2000 pixels (at 40× magnification).

S2.2 Binning
To estimate quantities such as the local velocity and speed, we divide each snapshot into 8×8 (40× magnification) or 16×16 (20× magnification) bins, see Fig. S2. For each bin, the surface coverage as well as the average speed of cells is measured. Due to the large size of the bins, we averaged the resulting data in

S2.3 Aggregate size distribution
We assume that the aggregate size distribution (ASD) shown in Fig. 2A can be reasonably well approximated by a statistical model. To compare the relative quality of different models, we use the Akaike information criterion (AIC) (46). Our choice of models is motivated by the empirical complementary cumulative distribution function of the data. In particular, we consider an exponential distribution a power-law and a power-law with exponential cut-off where Γ(s, x) = ∞ x r s−1 e −r dr is the upper incomplete gamma function. Note that one can obtain an exponential distribution and a power-law from the the power-law with exponential cut-off in the limits α → 0 and λ → 0 respectively. The minimal value x min is given by the threshold value we used to identify aggregates, see SM S2.1. That is, we assume that the statistical model holds for the entire range of the data. Estimates for the parameters λ and α are obtained from a maximum likelihood approach.
Computing the AIC for the data recorded at 20× magnification for the three candidate models reveals that the power-law with exponential cut-off is several times more likely to produce the data than the alternatives. In Fig. 2A the tail distribution of a power-law with exponential cut-off, i.e. P (x) = ∞ x f α,λ (r) dr, is shown as a visual guide.

S2.4 Single-cell tracking
To track single cells as well as the collective behavior simultaneously, the colony was prepared as described in section 2. This procedure results in two images, obtained at the same position within the colony at the We compute mean-square displacements (MSD) of individual trajectories ⟨r 2 (τ )⟩ = ⟨|r(t) − r(t + τ )| 2 ⟩, where r(t) is the position of a cell at time t and the average is taken over all suitable times t. For large times one expects the relation ⟨r 2 (τ )⟩ ∼ τ β , where β indicates diffusive (β ≈ 1), subdiffusive (β ≪ 1) or superdiffusive (β ≫ 1) behaviour. Based on a fit of the MSD to a power-law, we classify trajectories into the aforementioned categories. Furthermore, we introduce a transitive category to account for trajectories which fit poorly to a power-law, i.e. if the standard deviation of the fit of β is large. When fitting to an power-law, we log transform the τ and ⟨r 2 (τ )⟩ data and use linear regression to get the best linear approximation.