Abstract
Bacterial swimming is mostly powered by the bacterial flagellar motor and the number of proteins involved in the flagellar motor can vary. Quantifying the proteins present in flagellar motors from a range of species delivers insight into how motility has changed throughout history and provides a platform for estimating from its genome whether a species is likely to be motile. We conducted sequence and structural homology searches for 54 flagellar pathway proteins across 11 365 bacterial genomes and developed a classifier with up to 95% accuracy that could predict whether a strain was motile or not. We then mapped the evolution of flagellar motility across the Genome Taxonomy Database bacterial tree of life. We confirmed that the last common bacterial ancestor had flagellar motility and that the rate of loss of this motility was four-fold higher than the rate of gain. We showed that the presence of filament protein homologues was highly phylogenetically correlated with motility and that all species classified as motile contained at least one filament homologue. We calculated the rate of gain and loss for each flagellar protein and that the filament protein FliC was highly correlated with motility across the tree of life. We then measured the correlation of each flagellar motor protein with FliC and showed that the filament, rotor, and rod and hook proteins were all highly correlated with FliC, and thus with motility. We calculated the differential rates of gain and loss for each flagellar protein and quantified which genomes encoded for partial sets of flagellar proteins, indicating potential pathways by which motility could be lost. Overall, we show that filament, rod and hook and rotor proteins are conserved when flagellar motility is preserved and that the presence or absence of a FliC homologue is a good, simple predictor of whether or not a species has flagellar motility.
Keywords: Flagellum, bacterial motility, flagellar motor, flagellin, gene loss, phylogenetic trait analysis, chemotaxis, structural homology, sequence homology
Introduction
Flagellar motility is widespread among bacteria, with the flagellar apparatus exhibiting diverse structures and arrangements across species [1]. Despite these structural differences, all flagellated bacteria share a common rotary nanomachine known as the bacterial flagellar motor (BFM), which generates thrust through coupling ion flux to torque generation [2]. The motor has conserved core structures with divergent structures surrounding them [3–5]. These additional components and modifications in the motor structure reveal its adaptation to diverse environments, increasing bacterial fitness [6–8].
Flagellar assembly and function are regulated by a complex network of genes that have evolved considerably across different bacterial lineages [8]. Although much is known about the structure and function of the BFM, little is known about the evolutionary origins of the gene clusters that define these diverse organelles. Early work identified 20 essential genes for flagellar assembly and function in Escherichia coli [9]. Over time, research revealed the involvement of nearly 40 genes in E. coli and Salmonella enterica [10], with some species like Vibrio parahaemolyticus possessing dual flagellar systems—each expressed as distinct gene sets comprising around 50 polar and 40 lateral flagellar genes [11]. A broader comparative study of 41 flagellated bacterial species identified a core set of 24 structural genes thought to have been present in the last common bacterial ancestor (LCBA) [8]. Subsequent rooting of the bacterial tree and reconstruction of the eubacterial ancestor further verified that the LCBA was flagellated [12].
Although flagellar motors and motility mechanisms have been extensively studied in model species, our understanding of motility across diverse bacterial groups remains limited. Recent research in Firmicutes reveals that flagellar motility and cell shape evolved independently challenging previous assumptions [13]. Moreover, flagellar motility which was an ancestral trait in Chlamydiae [14] and Dehalococcoidia [15], has been lost in various lineages, reflecting its adaptation to various environmental pressures. For instance, in Rhodanobacter, flagellar loss is associated with stress adaptation, such as enhanced biofilm formation [16]. These findings highlight the need to expand our perspective on flagellar evolution beyond model species and recognize the complexity and diversity of motility across bacterial phyla. Efforts have been made to quantify flagellar genes present in soil communities, but these were limited to specific species from a single site [17] making it difficult to generalize findings to other bacterial communities. A genome-based model for predicting flagellar motility was developed for soil bacterial communities [18], specifically Actinobacteriota, Firmicutes, and Proteobacteria, but this has not been extended to other phyla.
Sequence-based approaches struggle to capture flagellar protein-encoding genes across diverse species due to low sequence homology [8]. Protein structure searches offer greater sensitivity in detecting homology and resolving deep evolutionary relationships [19]. Although structural data exists for many flagellar components, including the basal body, filament, export apparatus, and regulatory proteins, some gaps remain particularly in understudied species with additional proteins [20].
Here, we used a dataset of 11 365 complete and non-redundant bacterial genomes from the PATRIC database, ensuring representation across diverse bacterial taxa. We employed a combination of sequence and structure-based methods to identify and quantify flagellar proteins within these genomes. Our analysis revealed a bimodal distribution in the number of different flagellar proteins that were present across the species. This allowed us to develop a classifier that predicted whether a genome was motile or non-motile based on the overall number of flagellar proteins that were present. Our classifier predictions were further validated through comparison with phenotypic data from published reports [13, 21]. By integrating structural homology with sequence-based searches we reduced the number of false positives and improved the detection of distant flagellar homologues. Lastly, we reconstructed motility as a trait across a microbial species tree to determine where motility was lost across this tree, and to measure the individual rates of protein gain and loss, as well as the correlation of protein loss with the loss of motility.
Materials and methods
Data collection
We downloaded all proteomes from 11 365 complete and non-redundant bacterial genomes from the PATRIC database (downloaded August 2023) [22] (Supplementary Table S1). As a core set of flagellar proteins for subsequent querying against the database, 54 proteins from the flagellar assembly reference pathway [map03040] of the Kyoto Encyclopaedia or Genes and Genomes (KEGG) database [23] were selected. We assembled query datasets of flagellar proteins from six model species: E. coli, Bacillus subtilis, Pseudomonas aeruginosa, Vibrio alginolyticus, Shewanella oneidensis, and V. alginolyticus. Flagellar proteins such as MotC, MotD, and FlgQ, which are found absent in the above species but present in other model organisms such as Sinorhizobium meliloti and Campylobacter jejuni, were retrieved from KEGG and added to query datasets.
Homologue identification
A total of 308 representative sequences of 54 key flagellar proteins assembled from the above species were used to identify homologs in complete genomes (Supplementary Table S2). Homologues were identified using default settings [jackhmmer —noali -A < alignment_output > —tblout < table_output > −o < output_file > <query_file > <database_file>] for iterative searches with jackhmmer with criteria evalue 1E–10 [24]. To further remove false positives, we utilized additional steps, including length filtering and structural information (Fig. 1A). We defined the length range for each flagellar protein based on the min and max of representative query sequences and excluded sequences longer than this range. Approximately 2% of sequences were removed due to length (Supplementary Table S3).
Figure 1.
Bimodal distribution of flagellar protein number across genomes. (A) Schematic overview of the flagellar protein homologue search in bacterial genomes. The query proteins assembled from six bacterial species were searched against the PATRIC database. The sequence homologues were further processed for downstream analysis such as length filtering and structural similarity checks to improve the confidence of the homology search. (B) Histogram depicts the bimodal distribution of flagellar proteins across 11 365 genomes. Genomes with ≤15 flagellar proteins were categorised as non-motile, whereas those with ≥32 were considered motile. (C) Schematic of the BFM indicating different substructures of the motor (left) and horizontal stacked bar plot (right) showing the normalised counts of flagellar protein homologues in motile and non-motile groups. (orange: Non-motile; blue: Motile). Counts are normalised across each class or substructure by dividing by the number of query proteins in each class. ``Others'' corresponds to the transporters and sigma factors involved in flagellar pathways. (D) UMAP visualisation of 11,365 genomes clustered based on the presence-absence matrix of flagellar proteins with DBSCAN clustering. Each dot represents a genome, with colours indicating motility classification from Fig. 1B: Blue for motile (genomes with ≥32 flagellar proteins), orange for non-motile (genomes with ≤15 flagellar proteins), and grey for genomes with between 15 and 32 flagellar proteins, which are classified as partial protein sets. Stacked bar plots placed on each cluster depict the relative abundance of major bacterial phyla within those clusters.
Homologous sequences for each protein were clustered at 90% identity using CD-HIT [25], and representative sequences were aligned using MAFFT [26] with default parameters. These alignments were then used to generate a distance matrix and perform PCA for dimensionality reduction. We selected the ten most distant points from the centre of the PCA plot, calculated by the mean, for further structural comparison to our query proteins. Our approach was to test whether the ten most distant protein sequences for structural homology as a measure of whether the overall set of sequences was representative of homologues with similar function, involved in flagellar motility. We first predicted structures for these 10 with AlphaFold2 [27] and then used Foldseek [28] to compare each of these 10 predicted structures with the original target query structures. Predicted structures were defined as structural homologues if the Foldseek Probability was equal to one. Otherwise, these were rejected as homologues for the target proteins.
Proteins FliG and FliI had no structural homologues for the 10 most distant sequences in the PCA sequence space. For these two cases, we tested a further 10 and again found no structural homologues. To better separate clusters for FliG and FliI we then employed UMAP (Uniform Manifold Approximation and Projection) for dimensionality reduction along with DBSCAN (Density-Based Spatial Clustering of Applications with Noise) [29]. UMAP is a nonlinear dimensionality reduction method that preserves both local and global structures [30]. We optimized UMAP parameters (n_neighbors = 200 and min_dist = 0.3), based on clear separation between and preservation of global structures (Supplementary Fig. S1). We searched within clusters for available AlphaFold structures and used Foldseek to determine whether they represented true FliG/FliI clusters based on Foldseek probability. Clusters were excluded as query hits if the cluster contained no structures that were structural homologs of a query protein. When structures were excluded, all sequences that shared the original sequence cluster from CD-HIT were also excluded.
Motility classifier
For determination of whether a specific species was motile or not we listed each bacterial species and the total number of flagellar query proteins for which a hit had been found. Histogram plots were generated using the ggplot2 package to examine distribution patterns. The bimodal distribution revealed two distinct peaks, which were classified into motile and non-motile clusters. The number of flagellar proteins (NFP, x-axis, Fig. 1B) at which these clusters separate was determined visually from the distribution and species were declared non motile species for NFP ≤ 15, motile for NFP ≥ 32, with species declared as partial protein sets for 15 < NFP < 32. UMAP visualization was employed to analyze the presence-absence matrix of flagellar proteins across the genomes to identify any clear clusters separating motile from non-motile genomes (Fig. 1D).
Phylogenetic trait analysis and flagellar protein distribution
The reference bacterial tree and taxonomy files were downloaded from the Genome Taxonomy Database (GTDB, release 220) to construct the phylogenetic framework for analysing flagellar protein distributions and conducting trait -based analysis. [31]. We then pruned taxa that were not in our species list using the ape package in R to construct a reference bacterial tree tailored to our data (Supplementary Phylogeny S1). To assess the distribution of flagellar protein homologues across bacterial genera, species were grouped into genera based on GTDB taxonomy, and a genus-level cladogram was constructed by selecting one representative species per genus from the pruned species tree (Supplementary Phylogeny S2). The 100 most represented genera in the dataset were chosen for genus-level tree (N_min =18, N_max =414). Presence-absence counts of flagellar protein homologues were aggregated at the genus level, then normalized in two steps: first, by the number of strains or species within each genus, and second, by the number of proteins in each functional class (Fig. 1C). The resulting normalized values were used to generate a heatmap, with genera arranged according to their taxonomic relationships, with the cladogram visualized in iTOL with genus names as tips. Similarly, to assess the abundance of flagellar protein homologues at the species level, presence-absence data from strains of 4125 species present in the classifier list were aggregated at the species level. The resulting counts were normalized based on the number of strains within each species and the number of proteins in each functional class. We then used BayesTraitsV4 to model the motility trait for each species to estimate transition rates. BayesTraits is a Bayesian framework designed for model-based analyses of evolutionary selection of phenotypic or molecular traits [32]. In this approach, we analysed the trait data (predicted motility) alongside the rooted phylogenetic tree (in Nexus format) for each taxon using different models by setting transition rates to be equal and unequal for traits.
To find the best-fitting model, we used the MCMC (Markov Chain Monte Carlo); chains ran for 5 million iterations with an additional burn-in of 300 000 iterations and a sampling interval of 5000 iterations implemented in BayesTraitsV4 [32] to estimate the log marginal likelihood for each model. The best-fitting model was determined using logarithm of Bayes Factor (logBF) to find the root probability and transition rates of different states. The mean of transition rate was calculated by taking the mean of 5000 iterations. Ancestral character states of all nodes were estimated to identify the most likely state at each internal node in the phylogenetic tree. Histograms were generated for the distribution of transition rates using ggplot2, and posterior probabilities for each state of select nodes were tabulated using the BioGeoBEARS package in R [33]. Similarly, a presence-absence matrix was generated for each flagellar protein (1 = present, 0 = absent) across the species list as the trait data for the gain/loss estimates using Bayestraits. The multistate model then estimates the transition rates q01: The rate of protein gain (0 → 1) and q10: The rate of protein loss (1 → 0) for each ancestral node using the same parameters described above.
Correlation of the filament protein (FliC) with motility was tested using Bayestraits. Discrete independent and dependent models were tested with the 4 states, such as 00: non-motile-no FliC, 01: non-motile FliC, 10: motile - no FliC, 11: motile-FliC. We then calculated Bayes Factors of models for each trait-fliC relationship to test whether the independent or dependent model of evolution was supported. We repeated the same analysis to test the correlation of FliC with each flagellar protein by defining the 4 possible states as follows: 00: no FliC-no Protein; 01: no FliC- Protein Presence; 10: FliC present-no Protein; 11: FliC present-Protein Presence.
Results
A total of 11 365 complete genomes were downloaded from the PATRIC database, and a search-query set of 54 flagellar proteins associated with key components of the flagellar motor from the KEGG flagellar assembly reference pathway [map03040] was curated [23] (Fig. 1A). This set includes proteins related to the C-ring, MSP and L rings, rod and hook, H and T rings, filament, stator, Type III secretion system, and various regulatory proteins. We then examined the presence or absence of these 54 flagellar proteins in all genomes in our dataset.
A bimodal distribution of flagellar protein counts was observed across the genomes indicating the presence of two distinct groups within the dataset. Based on this pattern, thresholds of 15 and 32 proteins were assigned to separate the groups (Fig. 1B). Specifically, 47% of the genomes had fewer than 15 proteins whereas 49% had more than 32. This distinct separation in flagellar protein counts allowed us to categorize the genomes into two groups: those with low counts (non-motile) and those with high counts (motile). The remaining 4% of the genomes that fall between these two groups have an intermediate number of flagellar proteins. These were classified as partial protein sets, potentially indicating an incomplete flagellar system.
The functional classes of flagellar proteins were examined in both the motile and non-motile groups (Fig. 1C). Filament proteins were found exclusively in the motile group (100% motile, 0% non-motile). Similar patterns were observed for the rod and hook (96% motile, 4% non-motile), C-ring (96% motile, 4% non-motile), MSP and L rings (94% motile, 6% non-motile), and Type-III secretion system (85% motile, 15% non-motile). Stator proteins were also predominantly found in motile group (73% motile, 36% non-motile). In contrast, proteins associated with other functional categories, such as transporters, sigma factors (59% motile, 41% non-motile), and regulators (60% motile, 40% non-motile), were more evenly distributed between the two groups. The most prevalent proteins in this group included FlrA, FliI, FlrC, RpoD, and FliY.
To explore the distribution of flagellar proteins across the genomes, clustering and dimensionality reduction techniques were applied. Distance matrices calculated from the presence-absence of flagellar proteins across genomes were reduced to low dimensional embeddings using UMAP (Uniform Manifold Approximation and Projection). Subsequent clustering with DBSCAN revealed three major clusters, with some of which contained subclusters with distinct compositions (Fig. 1D; Supplementary Fig. S2). These subclusters represent finer divisions within the major clusters. Cluster I comprised 47.1% of the genomes and consisted predominantly of non-motile genomes from the most abundant phyla, including Actinomycetota, Pseudomonadota, Bacillota, Bacteroidota, and Cyanobacteriota. Subclusters II, III, IV, and V together formed a major cluster, with Subclusters II, III, and IV accounting for 27.7%, 15.2%, and 6.3% of the genomes, respectively, and classified as motile. Subclusters III and V were primarily composed of genomes from the phylum Pseudomonadota, whereas Cluster IV contained genomes from Bacillota. Subcluster V and Cluster VI contained genomes classified as partial protein sets, with Cluster VI primarily consisting of genomes from the phylum Chlamydiota. The genomes classified as partial protein sets were nearer to the motile cluster than the non-motile cluster.
The classifier based on the counts of flagellar proteins was validated using published phenotypic data [13, 21, 34]. Motility observations for Firmicutes curated from Bergey’s Manual of Systematic Bacteriology [34] demonstrated an accuracy rate of 95%, with 159 accurate predictions and nine mismatches (Supplementary Fig. S3). Phenotypic data from 1937 species curated in a previous study [21] were also used for validation, resulting in accurate classification of 808 motile and 867 non-motile species, with an overall accuracy of 86.5% (Supplementary Fig. S4).
The proportion of flagellar proteins in each class was assessed for the most prevalent genera in our dataset (Fig. 2). Species from the phyla Pseudomonadota, Campylobacterota, and Spirochaetota consistently showed a high abundance of flagellar components, with nearly complete set of structural and regulatory proteins. In contrast, members from the phyla Bacteroidota, Bacillota, and Actinomycetota were missing proteins in the filament, C-ring and MSP- & L-ring clusters. Type-III Secretion System (T3SS) proteins and stator proteins were present in all genera (Supplementary Fig. S5). In particular, FliI, an ATPase [35, 36] in the T3SS, and FliA, a sigma factor [37, 38], were conserved across all genera (Fig. 2).
Figure 2.
Flagellar protein distribution across the reference GTDB bacterial tree. The heatmap shows the normalised abundance of flagellar protein homologues across the most prevalent genera in the dataset (18 < N < 414). Presence-absence counts were aggregated at the genus level and normalised based on both the number of strains within each genus and the number of proteins in each functional class (Fig. 1C). The adjacent cladogram illustrates the GTDB taxonomy of the top 100 most represented genera, selected from the 4125 species included in the classifier (Fig. 3). The tree was pruned from the GTDB reference tree by selecting a single representative species for each of the selected genera. Colour intensity corresponds to the relative presence of flagellar proteins with higher values indicating greater abundance of that class of gene in that genus. Pie-chart indicates proportion of species in the genus that are motile (blue) or non-motile (orange) or partial protein sets (grey).
The proportion of motile and non-motile genomes containing filament, stator, and T3SS proteins was further measured across all motile and non-motile proteomes (Supplementary Fig. S6). Filament proteins were present in 100% of motile proteomes, with 35% of motile genomes contained a hit for all four query proteins. In contrast, approximately 99% of the non-motile genomes showed no hit for any filament query protein, suggesting a strong correlation of filament proteins with motility. The full set of T3SS proteins was found in 21% of motile genomes and 57% of motile genomes had all T3SS proteins except FlhE. Conversely, 97% non-motile genomes had either FliH and FliI (57%) or FliI alone (40%). The split across motile and non-motile genomes for the stator proteins was more nuanced, with FliA, MotA, and MotB displaying the highest proportion of hits. FliA was hit in 41% of non-motile genomes, and FliA, MotA, and MotB were hit altogether in 20% on non-motile genomes.
Trait analysis was conducted using BayesTraits [32] to infer the ancestral states and transition rates between motile and non-motile across a pruned phylogenetic tree of 4125 bacterial species from GTDB matching our species list (Fig. 3). Among the models tested, the multistate model with qMN ≠ qNM rates provided the best fit (logBF = 76.4) for our data, Supplementary Table S4). The multistate model yielded a mean root probability of 0.99931 for the motile trait and 0.00069 for the non-motile trait. Transitions rates from motile to non-motile states (qMN) were more frequent, with a mean rate of 0.8058, whereas transitions from non-motile to motile (qNM) had a lower transition rate of 0.21987 (Supplementary Fig. S7). High probabilities for the motile state were observed in 54% of the internal nodes, whereas 45% of the nodes (predominantly Actinomycetota, Bacteroidota, Pseudomonadota, Bacillota, and Cyanobacteriota) displayed high probabilities for the non-motile state, suggesting shifts toward non-motility in these lineages. Additionally, trait analysis for MotA, MotB, FliC, FliH, and FliI were performed to compare cladding patterns across the same tree (Supplementary Fig. S8).
Figure 3.
Bayesian reconstruction of ancestral motility traits. Phylogenetic tree depicting the relationships among 4125 bacterial species common to our dataset and the Genome Taxonomy Database (GTDB). Tree is pruned from the GTDB reference tree for the matching 4125 bacterial species. Branch colours represent the posterior probabilities (Pmot(θ| X)) of the motility states estimated for each node using the Markov Chain Monte Carlo (MCMC) multistate model in BayesTraits. Branch colours indicate the following states: Orange for non-motile (Pmot(θ| X) > 0.5), blue for motile (Pmot(θ| X) < 0.5), and grey for nodes having equal probabilities for both traits (Pmot(θ| X) = 0.5), as detailed in the figure legend. The nine inner rings are color-coded according to represent functional class (blue: T3SS; orange: C-ring; green: MSP/L rings; purple: H and T rings; cyan: Filament; pink: Stator; grey: Regulator; olive: Other), whereas the outer ring is color-coded by phylum-level taxonomic classification. For each functional class, circular heatmaps depict the normalized abundance of flagellar protein homologues at the species level, with presence-absence counts aggregated at the species level and normalized by both the number of strains and proteins within each functional class (Fig. 1C).
Gain and loss rates were measured for each protein, along with their correlation with motility (Supplementary Fig. S9, Supplementary Table S5). Significant differences in gain and loss rates (logBF >2) were observed for all proteins except MotB, FliI, MotY, FlgD, and RpoN. Among the proteins showing distinct gain and loss rates, including all filament, rotor, secretion, and rod and hook proteins, had higher loss than gain (q10 < q01). Conversely, MotA, FliA, and MotX stood out as exceptions with higher gain than loss (q01 > q01). The strong correlation of FliC with motility (logBF = 1993.88) was confirmed and then measured the correlation of each protein with FliC (Supplementary Table S6). For non-filament proteins, those most correlated with FliC (logBF >1000), and thus motility, included FliEFGKLMNOPQR, FlhAB, and FlgBCDEGHIKLN, whereas all filament query proteins also showed strong correlation with FliC (logBF >300). Gain and loss of each protein with respect to FliC were further compared (Supplementary Fig. S10). Proteins with a higher rate of gain that was at least tenfold greater than the gain rate of FliC included FliA, FliH, MotX, and FlgD, and those with a lower rate of gain as least tenfold lower than that of FliC included FliI, FliT, MotC, FlhD, FlhE, FlgH, FlgI, and FlgQ. Similarly, proteins with a higher rate of loss that was at least tenfold greater than that of FliC included FliT, MotD, FlhC, FlhE, and FlgO, and with a lower rate of loss as least tenfold lower than that of FliC included FliI.
Discussion
Classifier for motility
In this work we developed a classification system that can accurately predict whether a taxon is motile by quantifying the presence and absence of flagellar proteins in a given genome. We validated this system across a large dataset of motility data using published datasets and Bergey’s Manual of Systematic Bacteriology [34]. Our system performs well: it is 95% accurate across Firmicutes (Supplementary Fig. S3) using annotations in Bergey’s Manual of Systematic Bacteriology [13, 34] and displays 87% sensitivity (true-positive rate) and 86% specificity (true-negative rate) across all prokaryotes using curated metadata from a previous study [21] (Supplementary Fig. S4).
Common bacterial ancestor was motile
We confirmed, as reported elsewhere [12], that the last bacterial common ancestor (LBCA) likely contained a flagellar motor (posterior probability of 0.99). Our approach uses a combination of methods combining sequence homology (Jackhmmer), structural homology (Foldseek, AlphaFold), dimensionality reduction (UMAP, PCA) and large well-curated databases (KEGG, PATRIC). We reconstructed motility across the phylogeny to show that motility was primarily lost in a few phyla (predominantly Actinomycetota, Bacteroidota, Pseudomonadota, Bacillota, and Cyanobacteriota).
Filament proteins are informative in simple motility assessment
By far the best, and most simple determinant for flagellar motility is the presence or absence of a filament. Considering only motile genomes, 49% contained hits for all four filament proteins in our query set (FliC, FliD, FliS, FliT), and 99.75% contained at least one filament hit. If our classification system were reduced to a search only for FliC, it would still be 99.5% accurate (Supplementary Fig. S11, Supplementary Fig. S12). Overall, a search for FliC is a good, coarse assessment of whether a species is motile or not.
What use is half a motor?
Cases where there were some, but not all, of the flagellar proteins are worthy of further consideration. To paraphrase Mivart “what use is half a motor?” [39, 40]. Our model, and experimental experience [41, 42], asserts that an incomplete flagellar system cannot confer motility, and we validate this, but the question remains how did a half motor come to be? If an essential rotor protein such as FliG was lost, are the other proteins only remnants of a motor long since lost? By and large these loss events were long ago. Non functional remnants of flagellar proteins have been observed in several species [43, 44]. We observed that <0.3% (34/11365) of all species had at least one filament protein but no rotor proteins. However, 4% of motile species had a filament but less than a full rotor (i.e. FliGMN). This raises the question of what is the minimal rotor that can sustain motility. There are species such as Aquifex aeolicus which have been observed to be missing FliM [45], however in our search we did observe a homolog for FliM in Aquifex aeolicus (GenBank AAC07248.1, RefSeq assembly GCF_000008625.1). Conversely, we saw that 11% of non-motile species had at least one rotor protein (FliG, FliM, FliN) but no filament proteins. Whilst we would expect to find a high number of T3SS and stator homologues in non-motile genomes as these are well known to have non-flagellar homologues [46–50] the presence of rotor proteins without a filament raises the possibility that rotor components could have an alternative function.
Incomplete modules of the motor may also represent remnants of a motor following gene loss. Rhodobacter sphaeroides possess two flagellar systems, with one acquired through HGT from a γ-proteobacterium, demonstrating that entire flagellar gene sets can be transferred between species across large phylogenetic distances [51, 52]. It is plausible that key flagellar genes could be lost to render a species non-motile. Filament proteins like FliC make up the vast mass of the flagella and demand a high energy cost for synthesis [53, 54]. If a bacterium invests such energy to make a filament, it requires a motor and stator complex to make that cost worthwhile and confer a selective advantage. However, if the filament gene is lost in a loss event, then the energy cost to maintain, for example, a few rotor proteins, is comparatively low.
Exceptions to the rule
We can generate hypotheses surrounding the few strains that appear misclassified using published datasets [13, 21] (≤13%, Supplementary. Fig. S3, Supplementary. Fig. S4, Supplementary Table S7). In the case of the Firmicutes data set [13], there were 8 exceptions, with 7 species reported as non motile that were classified as motile and one species reported as motile that was classified as non-motile (Supplementary Fig. S3). For the wider dataset of 1937 species [21], 119 were incorrectly classified as motile and 143 incorrectly classified as non-motile. We considered experimentally testing specific strains to execute our own single-cell motility tests, however many of these strains are hard to obtain and it is uncertain whether they would be amenable to lab-based motility assays which may require specific environmental stimuli to express motility genes [55]. Experimental testing of these outliers, such as by culturing and directly testing for and measuring motility [56, 57] could further validate and refine the accuracy of our classifier, and identify where phenotypic descriptions compiled in metastudies contained errors.
Comparing and correlating protein loss across all flagellar proteins
The majority of flagellar proteins (87%) had higher loss rates than gain rates demonstrating that flagellar motility is more easily lost than gained. We calculated the presence and absence of FliC along with motility traits and reconstructed it across our reference GTDB tree of 4125 species. We found strong evidence for a dependent model of trait evolution (logBF = 1993.88) (Supplementary Table S6) indicating a close interconnection between flagellar motility and the presence/absence of the FliC. This further shows the utility of searching for homologues of FliC as a quick assay for flagellar motility when exploring a new genome. Measuring correlation between each protein with FliC allows us to assert a hierarchy of the most important proteins for motility. Proteins in the MS- and C-rings—the rotor—are highly correlated with FliC, as are Rod, PL-rings, and hook. This is logical, these are essential components that couple rotation to the filament and assembly of the filament depends on their presence [58]. MotA and MotB are highly correlated with each other (logBFMotA-MotB = 622), comparable with their separate correlation with FliC (logBPMotA-FliC = 655; logBPMotB-FliC = 884). Ancestral state reconstruction across our bacterial phylogeny indicates that MotA and MotB have largely been lost in the same clades as FliC. (Supplementary Fig. S8). In contrast, conserved ATPase proteins of the T3SS [35], FliH and FliI, are present in both the Actinomycetota and Bacteroidota clades, whereas FliC is not, and FliI is present in nearly all (99.6%) of our proteomes. Overall, this validates our trait analysis of motility across the tree of life as well-known, conserved flagellar proteins display the same shared phylogenetic history.
Conclusions
Given the strong correlation of FliC with motility, the high energetic cost of filament assembly [58] and the benefit to host-associated pathogens to lose the filament [59], it is tempting to speculate that loss of motility begins with loss of FliC. However, we cannot ascertain the order of loss events and losing other proteins that assemble before the filament would also destroy filament formation [60].
Correlation with other traits (such as correlating loss of motility in the Bacteroidota with the gain of gliding motility via gldKLMN [61], remains to be tested across a larger reference tree. It may be interesting to consider exactly when additional flagellar genes such as those present only in Campylobacterota arose [60, 62, 63]. These loss and gain events are likely in the distant past and accordingly analyses will be subject to substantial noise. Overall, better reconciliation of gene trees with reference phylogenies, combined with ecological data, will help to quantify ecological shifts in flagellar motility throughout history.
Supplementary Material
Contributor Information
Jamiema Sara Philip, School of Biotechnology and Biomolecular Sciences, University of New South Wales, Sydney, New South Wales, 2033, Australia.
Sehhaj Grewal, School of Biotechnology and Biomolecular Sciences, University of New South Wales, Sydney, New South Wales, 2033, Australia.
Jacob Scadden, School of Biotechnology and Biomolecular Sciences, University of New South Wales, Sydney, New South Wales, 2033, Australia.
Caroline Puente-Lelievre, School of Biological Sciences, University of Auckland, Auckland, 1010, New Zealand.
Nicholas J Matzke, School of Biological Sciences, University of Auckland, Auckland, 1010, New Zealand.
Luke McNally, Institute of Ecology and Evolution, School of Biological Sciences, University of Edinburgh, Edinburgh, EH9 3FL, United Kingdom.
Matthew A B Baker, School of Biotechnology and Biomolecular Sciences, University of New South Wales, Sydney, New South Wales, 2033, Australia.
Author contributions
Jamiema Sara Philip (Investigation, Visualization, Formal Analysis, Writing—original draft, Writing—review & editing), Sehhaj Grewal (Investigation), Jacob Scadden (Validation, Writing—original draft, Writing—review & editing), Caroline Puente-Lelievre (Writing—review & editing), Nicholas J. Matzke (Formal Analysis, Writing—review & editing), Luke McNally (Formal Analysis, Visualization, Writing—review & editing), Matthew AB Baker (Investigation, Formal Analysis, Conceptualization, Supervision, Project administration, Visualization, Writing—original draft, Writing—review & editing).
Conflicts of interest
The authors declare no competing interests.
Funding
MABB is supported by US Navy Office of Naval Research, Research grant no. N62909–22-1-2051. MABB, LM, and NJM were supported by HFSP Project Grant RGY0072/21. MABB and NJM are supported by Australian Research Project Discovery Project DP240100462.
Data availability
All the data used are presented as tables in the Supplementary Information.
Code availability
The code used is available at https://github.com/BakerLabBABS/classifier.
References
- 1. Armitage JP, Berry RM. Assembly and dynamics of the bacterial flagellum. Ann Rev Microbiol 2020;74:181–200. 10.1146/annurev-micro-090816-093411 [DOI] [PubMed] [Google Scholar]
- 2. Sowa Y, Berry RM. Bacterial flagellar motor. Q Rev Biophys 2008;41:103–32. 10.1017/S0033583508004691 [DOI] [PubMed] [Google Scholar]
- 3. Minamino T, Imada K. The bacterial flagellar motor and its structural diversity. Trends Microbiol 2015;23:267–74. 10.1016/j.tim.2014.12.011 [DOI] [PubMed] [Google Scholar]
- 4. Terashima H, Kawamoto A, Morimoto YV. et al. Structural differences in the bacterial flagellar motor among bacterial species. Biophys Physicobiology 2017;14:191–8. 10.2142/biophysico.14.0_191 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 5. Beeby M, Ribardo DA, Brennan CA. et al. Diverse high-torque bacterial flagellar motors assemble wider stator rings using a conserved protein scaffold. Proc Natl Acad Sci USA 2016;113:E1917–26. 10.1073/pnas.1518952113 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 6. Chen S, Beeby M, Murphy GE. et al. Structural diversity of bacterial flagellar motors. EMBO J 2011;30:2972–81. 10.1038/emboj.2011.186 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 7. Carroll BL, Liu J. Structural conservation and adaptation of the bacterial flagella motor. Biomolecules 2020;10:1492. 10.3390/biom10111492 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 8. Liu R, Ochman H. Stepwise formation of the bacterial flagellar system. Proc Natl Acad Sci 2007;104:7116–21. 10.1073/pnas.0700266104 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 9. Hilmen M, Silverman M, Simon M. The regulation of flagellar formation and function. J Supramol Struct 1974;2:360–71. 10.1002/jss.400020225 [DOI] [PubMed] [Google Scholar]
- 10. Iino T, Komeda Y, Kutsukake K. et al. New unified nomenclature for the flagellar genes of Escherichia coli and salmonella typhimurium. Microbiol Rev 1988;52:533–5. 10.1128/mr.52.4.533-535.1988 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 11. McCarter LL. Dual Flagellar systems enable motility under different circumstances. Microb Physiol 2004;7:18–29. 10.1159/000077866 [DOI] [PubMed] [Google Scholar]
- 12. Coleman GA, Davín AA, Mahendrarajah TA. et al. A rooted phylogeny resolves early bacterial evolution. Science 2021;372:eabe0511. 10.1126/science.abe0511 [DOI] [PubMed] [Google Scholar]
- 13. El Baidouri F, Venditti C, Humphries S. Independent evolution of shape and motility allows evolutionary flexibility in Firmicutes bacteria. Nat Ecol Evol 2016;1:1–6. 10.1038/s41559-016-0009 [DOI] [PubMed] [Google Scholar]
- 14. Collingro A, Köstlbacher S, Mussmann M. et al. Unexpected genomic features in widespread intracellular bacteria: evidence for motility of marine chlamydiae. ISME J 2017;11:2334–44. 10.1038/ismej.2017.95 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 15. Palmer M, Covington JK, Zhou EM. et al. Thermophilic Dehalococcoidia with unusual traits shed light on an unexpected past. ISME J 2023;17:952–66. 10.1038/s41396-023-01405-0 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 16. Chen M, Trotter VV, Walian PJ. et al. Molecular mechanisms and environmental adaptations of flagellar loss and biofilm growth of Rhodanobacter under environmental stress. ISME J 2024;18:wrae151. 10.1093/ismejo/wrae151 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 17. Snyder C, Centlivre JP, Bhute S. et al. Microbial motility at the bottom of north america: digital holographic microscopy and genomic motility signatures in badwater spring Death Valley National Park. Astrobiology 2023;23:295–307. 10.1089/ast.2022.0090 [DOI] [PubMed] [Google Scholar]
- 18. Ramoneda J, Fan K, Lucas JM. et al. Ecological relevance of flagellar motility in soil bacterial communities. ISME J 2024;18:wrae067. 10.1093/ismejo/wrae067 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 19. Jambrich MA, Tusnady GE, Dobson L. How AlphaFold2 shaped the structural coverage of the human transmembrane proteome. Sci Rep 2023;13:20283. 10.1038/s41598-023-47204-7 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 20. Zhu S, Sun X, Li Y. et al. The common origin and degenerative evolution of flagella in Actinobacteria. mBio 14:e02526–3. 10.1128/mbio.02526-23 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 21. Madin JS, Nielsen DA, Brbic M. et al. A synthesis of bacterial and archaeal phenotypic trait data. Sci Data 2020;7:170. 10.1038/s41597-020-0497-4 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 22. Gillespie JJ, Wattam AR, Cammer SA. et al. PATRIC: the comprehensive bacterial bioinformatics resource with a focus on human pathogenic species. Infect Immun 2011;79:4286–98. 10.1128/iai.00207-11 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 23. Kanehisa M, Furumichi M, Sato Y. et al. KEGG: biological systems database as a model of the real world. Nucleic Acids Res 2025;53:D672–7. 10.1093/nar/gkae909 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 24. Finn RD, Clements J, Eddy SR. HMMER web server: interactive sequence similarity searching. Nucleic Acids Res 2011;39:W29–37. 10.1093/nar/gkr367 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 25. Fu L, Niu B, Zhu Z. et al. CD-HIT: accelerated for clustering the next-generation sequencing data. Bioinforma Oxf Engl 2012;28:3150–2. 10.1093/bioinformatics/bts565 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 26. Katoh K, Standley DM. MAFFT multiple sequence alignment software version 7: improvements in performance and usability. Mol Biol Evol 2013;30:772–80. 10.1093/molbev/mst010 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 27. Jumper J, Evans R, Pritzel A. et al. Highly accurate protein structure prediction with AlphaFold. Nature 2021;596:583–9. 10.1038/s41586-021-03819-2 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 28. van Kempen M, Kim SS, Tumescheit C. et al. Fast and accurate protein structure search with Foldseek. Nat Biotechnol 2024;42:243–6. 10.1038/s41587-023-01773-0 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 29.Ester M, Kriegel H-P, Sander J, Xu X. A density-based algorithm for discovering clusters in large spatial databases with noise. Proc 2nd Int Conf Knowl Discov Data Min (KDD-96). 1996:226–231.
- 30. McInnes L, Healy J, Saul N. et al. UMAP: uniform manifold approximation and projection for dimension reduction. J Open Source Softw 2018;3:861. 10.21105/joss.00861 [DOI] [Google Scholar]
- 31. Parks DH, Chuvochina M, Rinke C. et al. GTDB: an ongoing census of bacterial and archaeal diversity through a phylogenetically consistent, rank normalized and complete genome-based taxonomy. Nucleic Acids Res 2022;50:D785–94. 10.1093/nar/gkab776 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 32. Pagel M, Meade A. Bayesian analysis of correlated evolution of discrete characters by reversible-jump markov chain Monte Carlo. Am Nat 2006;167:808–25. 10.1086/503444 [DOI] [PubMed] [Google Scholar]
- 33. Matzke NJ. BioGeoBEARS: biogeography with bayesian (and likelihood) evolutionary analysis in R scripts. R Package Version 02 2013;1:2013. [Google Scholar]
- 34. Whitman WB, Rainey F, Kämpfer P. et al. Bergey’s Manual of Systematics of Archaea and Bacteria. Hoboken, NJ: Wiley Online Library; (2015). 10.1002/9781118960608. [DOI] [Google Scholar]
- 35. Matzke NJ, Lin A, Stone M. et al. Flagellar export apparatus and ATP synthetase: homology evidenced by synteny predating the last universal common ancestor. BioEssays 2021;43:2100004. 10.1002/bies.202100004 [DOI] [PubMed] [Google Scholar]
- 36. Bai F, Morimoto YV, Yoshimura SDJ. et al. Assembly dynamics and the roles of FliI ATPase of the bacterial flagellar export apparatus. Sci Rep 2014;4:6528. 10.1038/srep06528 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 37. Barembruch C, Hengge R. Cellular levels and activity of the flagellar sigma factor FliA of Escherichia coli are controlled by FlgM-modulated proteolysis. Mol Microbiol 2007;65:76–89. 10.1111/j.1365-2958.2007.05770.x [DOI] [PubMed] [Google Scholar]
- 38. Tlapák H, Rydzewski K, Schulz T. et al. Functional analysis of the alternative sigma-28 factor FliA and its anti-sigma factor FlgM of the nonflagellated legionella species L. oakridgensis. J Bacteriol 2017;199:e00018–17. 10.1128/jb.00018-17 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 39. Dial KP, Randall RJ, Dial TR. What use is half a wing in the ecology and evolution of birds? BioScience 2006;56:437–45. 10.1641/0006-3568(2006)056[0437:WUIHAW]2.0.CO;2 [DOI] [Google Scholar]
- 40. Mivart G. On the Genesis of Species. New York: Appleton, 1871, 10.5962/bhl.title.4594 [DOI] [Google Scholar]
- 41. Islam MI, Ridone P, Lin A. et al. Ancestral reconstruction of the MotA stator subunit reveals that conserved residues far from the pore are required to drive flagellar motility. microLife 2023;4:uqad011. 10.1093/femsml/uqad011 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 42. Islam MI, Lin A, Lai YW. et al. Ancestral sequence reconstructions of MotB are proton-motile and require MotA for motility. Front Microbiol 2020;11:625837. 10.3389/fmicb.2020.625837 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 43. Pallen MJ, Matzke NJ. From the origin of species to the origin of bacterial flagella. Nat Rev Microbiol 2006;4:784–90. 10.1038/nrmicro1493 [DOI] [PubMed] [Google Scholar]
- 44. Ren C-P, Beatson SA, Parkhill J. et al. The Flag-2 locus, an ancestral gene cluster, is potentially associated with a novel flagellar system from Escherichia coli. J Bacteriol 2005;187:1430–40. 10.1128/JB.187.4.1430-1440.2005 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 45. Takekawa N, Nishiyama M, Kaneseki T. et al. Sodium-driven energy conversion for flagellar rotation of the earliest divergent hyperthermophilic bacterium. Sci Rep 2015;5:12711. 10.1038/srep12711 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 46. Blocker A, Komoriya K, Aizawa S-I. Type III secretion systems and bacterial flagella: insights into their function from structural similarities. Proc Natl Acad Sci 2003;100:3027–30. 10.1073/pnas.0535335100 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 47. Celia H, Noinaj N, Buchanan SK. Structure and stoichiometry of the ton molecular motor. Int J Mol Sci 2020;21:375. 10.3390/ijms21020375 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 48. James RH, Deme JC, Kjær A. et al. Structure and mechanism of the proton-driven motor that powers type 9 secretion and gliding motility. Nat Microbiol 2021;6:221–33. 10.1038/s41564-020-00823-6 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 49. Hu H, Popp PF, Hughes TCD. et al. Structure and mechanism of the Zorya anti-phage defence system. Nature 2024;639:1093–101. 10.1038/s41586-024-08493-8 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 50. Nandel V, Scadden J, Baker MAB. Ion-powered rotary motors: where did they come from and where they are going? Int J Mol Sci 2023;24:10601. 10.3390/ijms241310601 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 51. Poggio S, Abreu-Goodger C, Fabela S. et al. A complete set of flagellar genes acquired by horizontal transfer coexists with the endogenous flagellar system in Rhodobacter sphaeroides. J Bacteriol 2007;189:3208–16. 10.1128/JB.01681-06 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 52. Ferreira JL, Coleman I, Addison ML. et al. The “jack-of-all-trades” flagellum from salmonella and E. Coli was horizontally acquired from an ancestral β-proteobacterium. Front Microbiol 2021;12:643180. 10.3389/fmicb.2021.643180 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 53. Schavemaker PE, Lynch M. Flagellar energy costs across the tree of life. eLife 2022;11:e77266. 10.7554/eLife.77266 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 54. Lisevich I, Colin R, Yang HY. et al. Physics of swimming and its fitness cost determine strategies of bacterial investment in flagellar motility. Nat Commun 2025;16:1731. 10.1038/s41467-025-56980-x [DOI] [PMC free article] [PubMed] [Google Scholar]
- 55. Ikeda T, Shinagawa T, Ito T. et al. Hypoosmotic stress induces flagellar biosynthesis and swimming motility in Escherichia albertii. Commun Biol 2020;3:1–7. 10.1038/s42003-020-0816-5 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 56. Martinez VA, Besseling R, Croze OA. et al. Differential dynamic microscopy: a high-throughput method for characterizing the motility of microorganisms. Biophys J 2012;103:1637–47. 10.1016/j.bpj.2012.08.045 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 57. Wilson LG, Martinez VA, Schwarz-Linek J. et al. Differential dynamic microscopy of bacterial motility. Phys Rev Lett 2011;106:018101. 10.1103/PhysRevLett.106.018101 [DOI] [PubMed] [Google Scholar]
- 58. Minamino T, Kinoshita M. Structure, assembly, and function of flagella responsible for bacterial locomotion. EcoSal Plus 11:eesp-0011–2023. 10.1128/ecosalplus.esp-0011-2023 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 59. Wolfgang MC, Jyot J, Goodman AL. et al. Pseudomonas aeruginosa regulates flagellin expression as part of a global response to airway fluid from cystic fibrosis patients. Proc Natl Acad Sci 2004;101:6664–8. 10.1073/pnas.0307553101 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 60. Feng X, Tachiyama S, He J. et al. The architecture, assembly, and evolution of a complex flagellar motor. bioRxiv. 2025; 2025.02.19.638559.
- 61. McBride MJ. Bacteroidetes gliding motility and the type IX secretion system. Microbiol Spectr 2019;7:PSIB-0002-2018. 10.1128/microbiolspec.psib-0002-2018 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 62. Chaban B, Coleman I, Beeby M. Evolution of higher torque in campylobacter-type bacterial flagellar motors. Sci Rep 2018;8:97. 10.1038/s41598-017-18115-1 [DOI] [PMC free article] [PubMed] [Google Scholar]
- 63. Gao B, Lara-Tejero M, Lefebre M. et al. Novel components of the flagellar system in Epsilonproteobacteria. mBio 2014;5:e01349–14. 10.1128/mbio.01349-14 [DOI] [PMC free article] [PubMed] [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Supplementary Materials
Data Availability Statement
All the data used are presented as tables in the Supplementary Information.



