Abstract
BACKGROUND: Host-associated bacteria must balance the benefits of motility through flagella against the offsets of energetic costs and immune surveillance. Understanding the interplay of evolutionary forces shaping this complex trait can provide insights in the dynamics and extent of within-host adaptations of flagellar assembly. We compared prevalence, redundancy, and homology of 55 known flagellar assembly genes across genomes of free-living and host-associated bacteria from a collection covering the entire Pseudomonadota phylum. RESULTS: Our results indicate that host-associated bacteria have a lower prevalence and reduced sequence conservation of flagellar genes than free-living taxa. However, genome size explains substantially more variation than lifestyle classification, suggesting that genome erosion and genetic drift are the primary factors associated with flagellar gene loss. While host-associated taxa display heterogeneous patterns of sequence divergence across flagellar components, these patterns are consistent with relaxed selective constraint rather than pervasive adaptive or diversifying selection. CONCLUSIONS: Our results provide valuable insights into the distribution of flagellar genes in the phylum Pseudomonadota and its relation to bacterial lifestyle.