Hook length of the bacterial flagellum is optimized for maximal stability of the flagellar bundle

Most bacteria swim in liquid environments by rotating one or several flagella. The long external filament of the flagellum is connected to a membrane-embedded basal body by a flexible universal joint, the hook, which allows the transmission of motor torque to the filament. The length of the hook is controlled on a nanometer scale by a sophisticated molecular ruler mechanism. However, why its length is stringently controlled has remained elusive. We engineered and studied a diverse set of hook-length variants of Salmonella enterica. Measurements of plate-assay motility, single-cell swimming speed, and directional persistence in quasi-2D and population-averaged swimming speed and body angular velocity in 3D revealed that the motility performance is optimal around the wild-type hook length. We conclude that too-short hooks may be too stiff to function as a junction and too-long hooks may buckle and create instability in the flagellar bundle. Accordingly, peritrichously flagellated bacteria move most efficiently as the distance travelled per body rotation is maximal and body wobbling is minimized. Thus, our results suggest that the molecular ruler mechanism evolved to control flagellar hook growth to the optimal length consistent with efficient bundle formation. The hook-length control mechanism is therefore a prime example of how bacteria evolved elegant but robust mechanisms to maximize their fitness under specific environmental constraints.


Introduction
Bacterial flagella are complex rotary nanomachines and enable directed movement of cells through various environments. The ability for locomotion and the presence of external flagellar structures contribute to pathogenesis and biofilm formation of many bacterial pathogens [1][2][3][4].
The bacterial flagellum is composed of three main structural parts: (i) a membrane-embedded basal body; (ii) a several-micrometer-long external filament; and (iii) the hook, a linking structure that connects the basal body and the rigid filament [5]. The basal body complex functions as a motor to rotate the flagellum and includes a proton motive force (pmf)-dependent flagellum-specific protein export machine [6,7]. Assembly of the flagellum initiates with formation of the export machinery within the cytoplasmic membrane, followed by formation of a rod structure that traverses the periplasmic space. Assembly of the hook starts upon completion of the P-and L-rings, which form a pore in the outer membrane and polymerize around the distal rod [8,9]. The extracellular, flexible hook structure functions as a universal joint and allows the conversion of the torque generated by the cytoplasmic motor into rotational motion of the flagellar filament, irrespective of the cell body orientation [10]. The self-assembly of the rod, hook, and filament structures are controlled by different regulatory mechanisms. The length of the flagellar rod of approximately 25 nm is determined by the width of the periplasmic space [11], whereas the growth rate of flagellar filaments decreases with length and is controlled through pmf-dependent injection and diffusive movements of filament subunits inside the flagellar secretion channel [12]. The length of the hook structure is controlled to approximately 55 nm through a molecular ruler mechanism ( Fig 1A) [13,14]. Upon termination of hook growth, the export apparatus switches secretion specificity from early ("rod/hook" type) to late ("filament" type) substrate secretion [15]. This mechanism ensures that a functional hook-basal-body (HBB) complex is present, on top of which the long flagellar filament, made of several tens of thousands of flagellin molecules, can assemble [16]. The FliK protein is responsible for both the measurement of hook length and the transmission of the hook growth termination signal to the export apparatus, after which the switch in substrate specificity occurs. FliK functions as a molecular ruler that takes intermittent length measurements throughout the assembly of the hook structure and terminates further hook growth when the hook has reached a length of about 55 nm or longer [14,17,18].
In peritrichously flagellated bacteria, the hook as a flexible linking structure allows formation of flagellar bundles at either cell pole, irrespective of the relative position of the membrane-embedded motors. When all flagella turn counterclockwise (CCW), they form a bundle, causing the cell body to rotate in the opposite direction and propel the cell forward (run phase). Additionally, the body has a secondary motion superimposed on the rotating axis called body wobbling, because of the flagella bundle pushing the body off axis [19,20]. When one or more of the motors turn clockwise (CW), their associated flagella separate from the bundle, causing a random change in the cell orientation (tumble). After all the motors have reverted to CCW rotation, the flagellar bundle reforms and the bacterium swims in a new direction. In a homogenous environment (absence of gradient), the run-and-tumble behavior results in an effective diffusive motion over large distances. Biasing the tumbling rate allows chemotaxis, i.e., seeking attractants or escaping repellents in a chemogradient [21][22][23][24]. The relationship between hook length and motility is poorly studied. Loss of hook-length control diminishes motility [15]; however, the mechanisms have not yet been examined. The physiological benefit of tight hook-length control remains unclear and was highlighted recently as one of the big questions in bacterial hydrodynamics [25]. Here, we analyze the impact of variations in hook length on the motility performance in semisolid agar plates as well as liquid medium. Our results reveal an optimal motility performance for a wild-type hook length of about 55 nm with respect to swimming speed, directional persistence, and propulsive efficiency. We conclude that the molecular ruler mechanism evolved to control an optimal length of the hook structure for maximized motility performance via a more stable  bundle formation. Thus, a mechanism to control flagellar hook length optimizes the cell's motility performance by minimizing random directional change during the run phase.

FliK molecular ruler deletion and insertion variants are secreted and functional
The length of the flagellar hook is determined by secretion of a molecular ruler protein, FliK. We engineered FliK mutants varying from 310 to 785 amino acids (aa) in length using insertions of α-helical parts of a homologous molecular ruler of the related virulence-associated type III secretion system of Yersinia, YscP, or deletions of the central, α-helical domain of FliK ( Fig 1B) [14,17,26]. All FliK mutants were secreted and retained the ability to induce the switch in secretion specificity to late substrate secretion, as evidenced by comparable levels of external flagellin FliC and induction of a Class 3 gene reporter (Fig 1C, S1 Fig). The flagellation levels of the FliK mutants were not significantly different, with an average of 3.8 ± 1.5 flagella per cell (averaged across all FliK mutants) compared to 3.6 ± 1.3 flagella per cell for the wild type (wt), except for the shorter FliK variants FliK 310 and FliK 377 ( Fig 1D, S2 Fig, S1 Data). We next purified HBB complexes of the FliK length variation mutants and determined the length of the hook structures by transmission electron microscopy. FliK mutants ranging from 363 to 785 residues in length retained a tight control of hook length from 42 nm to 135 nm, with a linear increase in hook length of 0.2 nm per inserted amino acid ( Fig 1E, S3 Fig). An increase of 0.2 nm per inserted amino acid is consistent with an alpha-helical conformation of the ruler domain of FliK, as suggested before [17]. The two shortest FliK mutants, FliK 310 and FliK 335 , displayed partially uncontrolled hook lengths, indicating that a minimal FliK length is needed for effective hook-length control ( Fig 1E, S3 Fig).

Hook-length mutants display a pronounced motility defect in semisolid medium
We next analyzed the set of hook-length variation mutants for their motility phenotype in semisolid agar plates (Fig 1F and 1G, S4 Fig). The motility halo size was substantially decreased for mutants with shorter or longer hooks (FliK 363 aa and FliK ! 520 aa) and peaked at hook lengths around the wt length of 55 nm (FliK = 405 aa). The observed motility defect for long-and short-hook mutants was independent of the motility buffer (MB) and agar concentration, while prolonged incubation highlighted the motility differences (S4 and S5 Figs). These observations suggest that the hook length of the wt is in some way optimal (Fig 1F and  1G). We note, however, that the motility phenotype in semisolid agar plates is a complex combination of bacterial growth, motility, and chemotactic behavior [27,28]. We found that bacterial growth rate was not impaired in the FliK mutants (S5 Fig). Furthermore, the presence of motility halos for all hook-length mutants indicated functional chemotaxis. However, in order to decouple chemotaxis from motility and to reveal the effect of hook length on the swimming behavior, we next performed single-cell tracking experiments.

Single-cell tracking reveals that hook-length mutants have lower swimming speed and shorter directional persistence
To identify which behavioral parameter explains the phenotype of hook-length mutants in semisolid medium, we characterized single-cell behavior in a quasi-2D environment as described before [29]. In the absence of chemotactic signals, we observed the effect of hooklength variation on the basic run-and-tumble behavior. We found that cells with longer hook lengths (>75 nm; FliK > 520 aa) have reduced average swimming speed and tumble more frequently (Fig 2A and 2B, S1 Movie). Consequently, the directional persistence and the effective diffusion coefficient [30] of the mutants are reduced (Fig 2C and 2D). Therefore, longer hooks affect the cell's ability to explore their environment. We propose that these observations are largely responsible for the motility phenotypes that we observed in semisolid agar plates. We further note that the FliK variants FliK 363 and FliK 373 , which produce hooks of slightly shorter length than the wt, displayed in liquid culture a motility behavior similar or slightly better than the wt. However, the shorter FliK variants performed poorer in semisolid agar plates ( Fig 1F). We thus conclude that short hooks might have a decreased ability for productive tumble events because of increased stiffness and thus impair cell reorientation in semisolid agar and/or gradient environments.
We hypothesized that variations in the hook length increase instability during formation of the flagellar bundle. Indeed, events in which filaments underwent polymorphic transformations without filaments leaving the bundle (by contrast with a single tight bundle), leading to small deflections in swimming direction, have previously been observed and speculatively associated with motor reversal [31]. To determine if the apparent increase in tumble bias is the result of an increased rate of polymorphic changes in the bundle, which are not associated with reversions of the flagellar motor rotation, we characterized the behavior of the same hook mutants in non-chemotactic, smooth-swimming cells (ΔcheY). Mutants lacking CheY do not tumble and thus do not respond to chemical gradients and do not efficiently navigate the agar gel matrix of semisolid agar plates [27]. Accordingly, we assessed the motility behavior of smooth-swimming hook-length mutants using 2D single-cell tracking. In the ΔcheY genetic background (che − ), hook-length mutants still have reduced swimming speeds and smaller diffusion coefficients when compared to the wt hook length (Fig 2E and 2H). Cells with hooks longer than 75 nm have a higher probability of changing direction suddenly-events we will refer to as "pseudo-tumbles" (Fig 2F). In non-chemotactic, smooth-swimming ΔcheY mutants, these pseudo-tumbles cannot be caused by reversions of the flagellar motor.
Finally, che − hook-length mutants displayed a reduced directional persistence (Fig 2G) because of a general increase in the probability of large changes in swimming direction (S6 Fig). These observations suggest that the poorer swimming performance in hook-length mutants is likely to be primarily due to decreased stability of the flagellar bundle.
To further analyze the dependence of pseudo-tumble events on flagellar hook length and to estimate a tumbling rate, we calculated the directional autocorrelation function and mean square displacement (MSD) of selected non-chemotactic (ΔcheY), smooth-swimming hooklength mutants from the single-cell tracking experiments (S7 Fig, S1 Text). The autocorrelation function measures the persistence of bacterial motion and the MSD represents the spatial exploratory potential of each cell. The observed trajectories of non-chemotactic, hooklength mutants with a pseudo-tumble phenotype were fitted to a simple run-and-tumble migration model (S2 Text, S8 Fig), taking into account the curvature of the tracks due to hydrodynamic interactions of bacteria swimming in quasi-2D close to the surface. The fit of the run-and-tumble model to the trajectories of the non-chemotactic, hook-length mutants suggests that the directional persistence decreases with increasing hook length ( Fig 2G, S7  Fig). We concluded that the pseudo-tumble events of the non-chemotactic mutants arise from a mechanical instability of the hook, similar to the tumbling mechanism of Vibrio alginolyticus [32].

Non-chemotactic long-hook mutants display a pseudo-tumble behavior
The conclusion we have reached leads to an interesting prediction of the behavior of hook mutants in agar gels. Chemotactic (che + ) bacteria can navigate through an agar gel matrix because of their run-and-tumble motility behavior (Fig 3A) [27]. However, non-chemotactic, smooth-swimming (ΔcheY) cells are trapped because tumbling is required to efficiently escape the agar gel matrix (Fig 3B). Accordingly, if the increased flagellar bundle instability in hook mutants conferred on them a pseudo-tumble phenotype, then we may expect che − long-hook mutants to regain the ability to migrate through an agar gel matrix.
A similar pseudotaxis behavior has previously been observed for non-chemotactic Escherichia coli mutants, in which point mutations in the switch complex proteins FliG and FliM allowed random motor rotational switching in the absence of chemotactic stimuli [27], as well as in a non-chemotactic Agrobacterium tumefaciens strain, in which suppressor mutations in the hook, the fliK gene, and the motor force generators were isolated that allowed the che − cells to navigate through semisolid agar [33].
We analyzed the motility behavior of non-chemotactic, smooth-swimming hook-length mutants to test our prediction. The motility halo size of che + hook-length mutants peaked around the wt hook length (Figs 1F and 3A). In contrast, che − long-hook mutants performed substantially better than che − mutants with shorter and wt hook length (Fig 3B), in accordance with our suggestion that long hook lengths confer a pseudo-tumble phenotype. We also noticed a big difference in the speed of spreading; che − mutants needed to be incubated about five times longer to reach comparable halo sizes. This indicates that pseudo-tumbling events occur less frequently than tumbling, i.e., because of motor reversal. There is an interesting difference in appearance-che − colonies form disks rather than typical chemotactic rings, confirming that the pseudo-tumble events are not related to chemotaxis and thus not associated with motor reversal.

Motility parameters are optimal for wt hook length in 3D liquid environment
In peritrichously flagellated bacteria, CCW rotation of all flagella allows the formation of a flagella bundle rotating at speed ω and results in a run phase, with the cell moving forward at speed v. The flagella bundle further pushes the body off axis and results in body wobbling, which is characterized by an angular velocity, O [19,20]. For flagellated bacteria swimming in a Optimality of flagellar hook-length control Newtonian liquid, e.g., buffer, v is proportional to O and ω, which are determined by the geometry of both body and flagellar bundle [34].
All the experiments described so far pertain to bacteria swimming close to a hard surface or in a gel matrix. In a final set of experiments, we measured swimming speed v and body angular velocity O using high-throughput differential dynamic microscopy (DDM) and dark-field flicker microscopy (DFM) in a 3D liquid environment [34][35][36]. DDM and DFM experiments were performed with bacteria grown in tryptone broth (TB) medium at 30˚C, which did not affect the overall motility behavior (S9 Fig, S3 Text). We recorded over 10 4 cells swimming in a 3D liquid medium (i.e., in bulk) for each of the hook-length mutants. We found that the population-averaged swimming speed v was maximal, whereas the population-averaged body angular velocity O was minimal over the range FliK ! 363 aa and FliK 480 aa, encompassing the wt (FliK = 405 aa) (Fig 4A and 4B, S10A and S10B Fig). Some variation in v and O were observed between independent datasets, but this disappeared when we calculated the population-averaged propulsive efficiency (processivity) P ¼ v O , which is the average run length per revolution. We found a clear maximum in processivity near the wt hook length, in the range 363 aa FliK 405 aa (Fig 4C, S10C Fig). Moreover, the swimming speed distribution was narrower (the width of the speed distribution S is minimal), in the range 363 aa FliK 570 aa (S11 Fig), and swimming trajectory appeared to be straighter (R, the ratio of two speeds measured at two length scales, is minimal; see Materials and methods for more details), in the range 405 aa FliK 520 aa. Variations in R R WT (with R R WT > 1) with FliK length are indicative of decreased directional persistence in the cell trajectories (Fig 4D, S10D and S10E Fig). The increase in cell body angular velocity and the resulting decrease in processivity support the notion that deviations from the wt hook length increase instability in the flagellar bundle and affect both swimming speed and directional persistence.
These experimental findings are independent of the tumbling behavior, as run-and-tumble strains displayed similar hook-length dependency compared to the smooth swimmers (Fig 4,  S12 Fig). This was expected because the motility parameters are measured over a length scale corresponding to the run length (<15 μm, the distance between two tumble events). Differences are found in absolute values of R between run-and-tumble and smooth swimmers at a given hook length because of tumbling events (S12D Fig). However, the relative path straightness R R WT showed the same hook-length dependency for che + and che − hook mutants (Fig 4, S12  Fig).

Discussion
In summary, our results provide substantial evidence that hook-length control in peritrichously flagellated bacteria has been evolutionary selected to optimize the stability of the flagellar bundle and thus maximize swimming performance. We found that swimming speed and directional persistence of the trajectories of swimming bacteria are tightly related to the length of the hook structure. Recently, small polymorphic changes in the flagellar bundle have been observed without filaments leaving the bundle. These polymorphic changes create deflection in the swimming trajectory and have been associated speculatively with motor reversal [31]. Our present work suggests these events might be associated with the run phase rather than motor reversal, as they also occur in smooth-swimming mutants. Thus, the role of hook-length control may be to minimize such polymorphic changes by maximizing stability of the flagellar bundle during the run phase. Accordingly, we propose that the hook-length control mechanism evolved to match the requirements for effective formation of the flagellar bundle. Stiffness is an inverse function of the hook length, e.g., stiffness increases with decreasing hook length. Too-short hooks are too stiff to function as a universal joint, whereas too-long hooks Uncontrolled hook-length mutants are shown in red. All parameters were obtained by normalizing the time-dependent parameters to the wt (FliK405) and by averaging over the time window 10 min < t < 60 min. aa, amino acid; wt, wild type. may buckle and create too much instability, thus necessitating the need to control for an optimal length of the hook structure. Furthermore, the observed higher processivity of hooks with wt length appears to result in more efficient propulsion, i.e., the cells are able to achieve higher swimming speeds for the same energy expenditure. We further note that the mechanical instability of the hook might indicate polymorphic transitions of the hook [37] and, accordingly, the hook-filament flexibility could explain both the observed polymorphic changes in the flagellar bundle and instability.
Our results are also consistent with previous observations, in which the wt hook of E. coli was modified to be twice as rigid by binding of streptavidin, and the flagellar bundle was unable to form [38]. Hook-length control may also play a major role in other bacteria. Son and colleagues demonstrated for the polar flagellated V. alginolyticus that a buckling instability of the hook enables the cell to "flick" and reorient [32]. They suggested buckling occurs when the viscous loads, i.e., force and torque exerted on the hook by the cell body and flagellum, exceed the hook's buckling critical threshold. The associated critical torque and force are inversely proportional to the hook length and its square, respectively. Thus, we expect that changing the hook length of polar flagellated bacteria could dramatically alter the instability region and enable more "flicking" events, which in turn would affect motility and chemotactic behavior.
In summary, the function of the bacterial flagellum relies on the self-assembly of major components with defined or self-limiting lengths [11,12]. Incomplete assembly or small deviations from the blueprint result in a nonfunctional motility organelle, with devastating consequences for the organism. Thus, regulatory mechanisms evolved to determine the correct dimensions of flagellar subassemblies and to ensure robust assembly of a functional motility organelle. Our results demonstrate the selective advantage of a mechanism that controls the length of the hook structure. In particular, our findings suggest that the molecular ruler mechanism evolved to determine the optimal length of the flagellar hook. These results highlight the evolutionary forces that enable flagellated bacteria to optimize their motility performance and fitness in diverse environments.

Growth curve
FliC-locked bacteria were grown overnight at 37˚C and diluted to OD 600 of 0.001 in LB (final volume, 200 μL) in a honeycomb multiwall plate. The bacteria were incubated in the Bioscreen reader (EZExperiment software) at 37˚C with shaking, OD 600 was measured every 15 min, and the measurements were blank corrected.

Motility assay
Motility of the bacteria was assessed using semisolid agar plates containing a range of agar concentrations from 0.2%-0.35%, essentially as described before [42]. Semisolid agar plates were based on either minimal medium containing 2% yeast extract (Vogel-Bonner medium E, 2% yeast extract) or TB broth (1% tryptone and 0.5% NaCl). Equal amounts of overnight cultures were inoculated into the semisolid agar plates using a pin tool and incubated at 37˚C for 3-4 h (che + ) and 14-18 h (che − ), respectively. The areas of the swimming halos (che + ) or disks (che − ) were analyzed using ImageJ and normalized to the wt (hook length, about 55 nm; FliK = 405 aa).

SDS-PAGE and western blot
FliC-phase locked bacteria were grown until late exponential phase in LB. A total of 2 mL of culture was used for harvesting cells (whole cell lysate) and the supernatant by centrifugation (13,000g, 4˚C, 5 min). Proteins were precipitated using 10% TCA, and the samples were resuspended in SDS sample buffer normalized to their OD 600 . Proteins were separated by SDS PAGE and western blot was performed using anti-FliK, anti-FliC, and anti-DnaK antibodies.

HBB purification
Purification of hook-basal-body complexes without C-ring was performed as described [43], with slight modifications. Briefly, bacteria were grown in 500 mL culture until OD 600 1-1.5. Cells were harvested (8,000g, 4˚C, 10 min) and resuspended in 30 mL ice-cold sucrose solution (0.5 M sucrose, 0.1 M Tris-HCl, pH 8). A total of 3 mL lysozyme (10 mg/mL in sucrose solution) and 3 mL 0.1 M EDTA (pH 8) was added to digest the peptidoglycan (PG) layer and to prepare the spheroplasts. The suspension was stirred for 30 min on ice. A total of 3 mL 10% Triton-X and 3 mL 0.1 M MgSO 4 were added to lyse the spheroplasts. For complete lysis of the spheroplasts, the mixture was stirred overnight at 4˚C. Afterwards, 3 mL 0.1 M EDTA (pH 11) was added. Unlysed cells and cell debris were pelleted by centrifugation (17,000g, 4˚C, 20 min) and the pH was adjusted to pH 11 by adding 5 N NaOH. Following centrifugation (17,000g, 4˚C, 20 min), the flagella were pelleted by ultracentrifugation (100,000g, 4˚C, 1 h). The pellet was resuspended in 35 mL ice-cold pH 11 buffer (10% sucrose, 0.1 M KCl, 0.1% Triton-X) and centrifuged (17,000g, 4˚C, 20 min), and the flagella were pelleted by ultracentrifugation (100,000g, 4˚C, 1 h). The pellet was resuspended in 35 mL ice-cold TETsolution (10 mM Tris-HCl pH 8, 5 mM EDTA, 0.1% Triton-X) and the mixture again subjected to ultracentrifugation (100,000g, 4˚C, 1 h). For depolymerization of the filaments, the flagella were resuspended in 35 mL pH 2.5 buffer (50 mM glycine, 0.1% Triton-X) and left at room temperature (RT) for 30 min. The debris was pelleted by centrifugation (17,000g, 4˚C, 20 min) and the HBB were collected by ultracentrifugation (100,000g, 4˚C, 1 h). The pellet was air-dried and resuspended in 200 μL TE solution (10 mM Tris-HCl pH 8, 5 mM EDTA). The samples were stored at 4˚C and imaged the following day by negative staining electron microscopy.

Electron microscopy
Hook samples were stored at 4˚C to straighten the hooks and facilitate length measurements. The samples were negatively stained by 2% aqueous uranyl acetate on a carbon film. Samples were imaged using a Zeiss TEM 910 at an acceleration voltage of 80 kV with calibrated magnifications. Images were recorded using a Slow-Scan CCD camera (ProScan, 1,024 × 1,024, Scheuring, Germany) with ITEM-Software (Olympus Soft Imaging Solutions, Münster, Germany). The length of the hooks was measured using ImageJ.

Luciferase assay
The luciferase assay was performed as described before [18]. The plasmid pRG19 (motA::lux-CDABE) was used for monitoring the switch from early substrate secretion to late substrate secretion. The class 3 gene motA is expressed only upon HBB completion. Synchronization of flagellar gene expression was achieved by placing the AnTc inducible tetA promotor upstream of the flhDC gene [44]. Cells were grown in white clear-bottom 96-well plates (Greiner) and production of light and the OD 600 were measured over time using a Varioskan Flash multiplate reader (Thermo Fisher). After blank correction, relative light units (RLU) were calculated as:

2D single-cell tracking and behavioral analysis
Overnight cultures were incubated in a shaking (200 rpm) incubator at 37˚C in LB broth. Overnight cultures were diluted 1:100 into fresh LB medium and incubated shaking at 200 rpm at 37˚C for 2.5 h. After cells reached the mid-exponential growth phase (OD 600 , about 0.5), cultures were diluted 1:50 in fresh LB medium and 7 μL of the dilution were placed on a microscope slide, covered with a #1.5 22 × 22 mm coverslip, and sealed with VALAP (equal amount of petrolatum, lanolin, and paraffin wax). The trajectories of swimming cells were recorded as previously described [29]. Briefly, cell positions were recorded using time-lapse phase contrast microscopy (Nikon Eclipse TI-E with 10× Nikon CFI Plan Fluor, N.A. 0.30, W.D 16.0 mm) at 10 frames per second (fps) (Zyla 4.2, Andor Technology) for 100 s. The field of view contained about 200 cells on average over 1.3 mm 2 . Experiments were done in triplicate with independent biological samples. Individual trajectories were reconstructed as previously described using custom MATLAB (The MathWorks) script (https://github.com/ dufourya/SwimTracker) [29] and u-track 2.1 [45]. Tumbles were detected using a two-state Markov-chain model representing the "swimming" and "tumbling" states, with bivariate Gaussian distributions of the relative acceleration and angular acceleration. The Markov-chain model was trained on a reference dataset of wt S. enterica cell trajectories. The diffusion coefficient of individual trajectories was calculated using a covariance-based estimator [30] averaged over the timescales exceeding the timescale of rotational diffusion (>10 s), over which cell trajectories are diffusive. The directional persistence τ for each trajectory was calculated according to the relationship D = ½ v 0 2 τ, where D is the diffusion coefficient and v 0 is the average cell speed.

3D motility analyses using DDM and DFM
For DDM/DFM experiments of bacterial swimming behavior in 3D, cells were grown and washed, then loaded in sealed capillaries, placed onto a microscope, and movies were recorded. Importantly, these five steps are performed in parallel for a range of hook mutants, which allows precise measurement of potential small difference in motility. Details are given below.
As standard protocols, overnight cultures were grown in LB for about 16 h using a shaking incubator (200 rpm) at 30˚C. The overnight culture was diluted 1:100 in 35 mL TB and grown for 2.5-3 h at 30˚C with shaking (200 rpm) to an OD 600 of 0.4-0.5. In some cases (S9 Fig), overnight cultures were grown in LB for about 16 h using a shaking incubator (200 rpm) at 37˚C. The overnight culture was diluted 1:100 in 35 mL LB and grown for 1.5-2 h at 37˚C with shaking (200 rpm) to an OD 600 of 0.4-0.5.
Cells were washed three times with MB (pH = 7.0, 6.2 mM K 2 HPO 4 , 3.8 mM KH 2 PO 4 , 67 mM NaCl, and 0.1 mM EDTA) by careful centrifugation to minimize flagellar damage and were resuspended in MB to an OD 600 of 0.3. The washing step is performed simultaneously for several samples and takes typically about 30 min for six samples. We note that the viscosity of MB is similar to that of pure water, with about 10 −3 Pa Á s [34].
Commercial glass capillaries (Vitrocom) with dimensions L = 5 cm, W = 8 mm, H = 400 μm and volume about 150 μL were filled, sealed with petroleum jelly, and placed onto a fully automated inverted microscope (Nikon TE300 Eclipse), and time series of both phasecontrast (40-s long, Nikon Plan fluor 10× Ph1-NA = 0.3 objective, Ph1 phase ring, 4,000 images at 512 × 152, 100 fps) and dark-field (10 s long, Nikon Plan Fluor 10× Ph1-NA = 0.3 objective, Ph3 phase ring, 2,000 images at 512 × 152, 200 fps) movies are consecutively recorded continuously for about 1 h using an Hamamatsu ORCA-Flash 4.0 camera. One capillary at a time was prepared within 1-2 min, the movie was recorded immediately, and then we proceeded with next sample. Once all samples were prepared, continuous recording started. For six samples, this results in a movie recorded about every 5 min for each capillary. Movies were recorded in bulk conditions (i.e., 100 μm above inner glass wall) to avoid interactions with the wall.
From DDM analysis of the phase-contrast movies, the mean v and width σ (and consequently the relative width S = σ / v) of the swimming speed distribution P(v), averaged over 10 4 cells, were extracted. Details can be found elsewhere [35,36,46] and only an overview is given below. Based on low-optical resolution, DDM characterizes the spatiotemporal fluctuations of the cell density via the so-called temporal autocorrelation function of the q-th Fourier component of the number density fluctuations, f(q,τ), with τ being the delay time. q is the spatial frequency and defines a characteristic length scale L = 2π / q. Given a suitable model for f(q,τ), kinetic parameters can be extracted. In case of swimming bacteria, DDM allows the measurement of an advective speed over a range of q values or length scale L. The mean swimming speed v and width σ are extracted by averaging over the range 0.5 q 2, corresponding to 3 L 13 μm, and over the time window 10 min < t < 60 min.
A qualitative measure of the path straightness can also be estimated from DDM by calculating the ratio of speeds measured at two different length scales, R = v(L1) / v(L2), with, e.g., L1 < L2. Theoretically, swimmers with a straight path yield R = 1. Deviations from a straight path because of, e.g., rotational diffusion or tumbling events, will increase this ratio above 1.
From DFM analysis of the dark-field movies, the body angular velocity O averaged over about 10 4 cells in a few seconds was extracted. Details can be found elsewhere [34]. Briefly, the power spectrum of the flickering image of individual cells was Fourier transformed and the lowest frequency peak in the average power spectrum was identified as O / 2 π.
The numerical data used in all figures are included in S2, S3 and S4 Data.