# Latent evolution of biofilm formation depends on life-history and genetic background

Amandine Nucci, Eduardo P C Rocha, Olaya Rendueles

► To cite this version:

Amandine Nucci, Eduardo P C Rocha, Olaya Rendueles. Latent evolution of biofilm formation depends on life-history and genetic background. npj Biofilms and Microbiomes, 2023, 9 (1), pp.53. 10.1038/s41522-023-00422-3. pasteur-04177373

HAL Id: pasteur-04177373

https://pasteur.hal.science/pasteur-04177373

Submitted on 4 Aug 2023

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
ARTICLE **OPEN**

<figure><img src="image_2.png" /></figure>

Check for updates

# Latent evolution of biofilm formation depends on life-history and genetic background

Amandine Nucci<fnref n="1" />, Eduardo P. C. Rocha<fnref n="1" /> and Olaya Rendueles<fnref n="1" />✉

Adaptation to one environment can often generate phenotypic and genotypic changes which impact the future ability of an organism to thrive in other environmental conditions. In the context of host-microbe interactions, biofilm formation can increase survival rates in vivo upon exposure to stresses, like the host's immune system or antibiotic therapy. However, how the generic process of adaptation impacts the ability to form biofilm and how it may change through time has seldomly been studied. To do so, we used a previous evolution experiment with three strains of the *Klebsiella pneumoniae* species complex, in which we specifically did not select for biofilm formation. We observed that changes in the ability to form biofilm happened very fast at first and afterwards reverted to ancestral levels in many populations. Biofilm changes were associated to changes in population yield and surface polysaccharide production. Genotypically, mutations in the tip adhesin of type III fimbriae (*mrkD*) or the *fim* switch of type I fimbriae were shaped by nutrient availability during evolution, and their impact on biofilm formation was dependent on capsule production. Analyses of natural isolates revealed similar mutations in *mrkD*, suggesting that such mutations also play an important role in adaptation outside the laboratory. Our work reveals that the latent evolution of biofilm formation, and its temporal dynamics, depend on nutrient availability, the genetic background and other intertwined phenotypic and genotypic changes. Ultimately, it suggests that small differences in the environment can alter an organism's fate in more complex niches like the host.

npj Biofilms and Microbiomes (2023)9:53; https://doi.org/10.1038/s41522-023-00422-3

## INTRODUCTION

One of the central questions in microbial evolutionary biology is understanding the mechanisms by which bacteria expand their ecological breadth. The niche shift hypothesis postulates that the process of adaptation to a different environment can result from rapid adaptive changes via mutation or horizontal gene transfer<fnref n="1" />,², leading to diversification and opening the possibility of exploiting novel niches³. Bacteria may have to contend with novel stresses to adapt. This may often involve forming a biofilm, which generically increases tolerance to a broad range of stresses⁴. Such resilient surface-attached multicellular structures are ubiquitous and the prevalent prokaryotic lifestyle⁵.

In the context of host-microbe interactions, it has been shown that increased ability to form biofilm correlates with the capacity to replicate and colonize multiple hosts, whereas bacteria with narrow host ranges are usually poor biofilm-formers⁶,⁷. Within a host, biofilm formation offers numerous specific advantages, such as higher resistance to antimicrobials⁸ and to antibody-mediated killing and phagocytosis⁹. During competition with other members of the microbiome, it can also lead to niche exclusion of direct competitors¹⁰.

The *Klebsiella pneumoniae* species complex (KpSC) is a metabolically versatile group of seven distinct and closely related taxa of Klebsiella belonging to the Enterobacteriaceae family. KpSC includes the best-studied *K. pneumoniae sensu stricto* but also other species like *K. variicola* and *K. africana*¹¹. KpSC are characterised by a very large carbon and nitrogen core metabolism¹². This may partly explain its ubiquity and ecological breadth¹³⁻¹⁵. These bacteria can adopt a free-living lifestyle in the soil or in the water, but they are mostly studied in its host-associated form, colonizing plants, insects and mammals, including humans, where they can be a found as gut commensals. Hypervirulent strains of *K. pneumoniae* cause community-acquired

infections which may result in pyogenic liver abscesses, but most of *K. pneumoniae* infections are opportunistic and health-care associated. They typically require a precolonization of the gastrointestinal epithelia prior to infecting other body sites¹¹.

Several factors impact the ability of *K. pneumoniae* to form biofilm and colonise host tissue, most notably two chaperon-usher systems¹⁶: the type I fimbriae encoded by the *fimA-K* operon and the type III fimbriae encoded by the *mrkA-I* operon. The former has been shown to preferentially bind to mannose residues in *E. coli* but not in *K. pneumoniae*¹⁷, whereas the latter has high affinity to collagen¹⁸,¹⁹ and mediates adhesion to abiotic surfaces²⁰. In silico studies have predicted the existence of many other chaperon-usher systems that could have specific tropism or be expressed in response to specific environmental cues²¹.

In addition to surface adhesins, another important factor determining biofilm formation in *K. pneumoniae* is the extracellular capsule²²⁻²⁵ produced by most isolates²⁶. On the one side, some studies revealed that the capsule can strongly inhibit biofilm formation by masking surface adhesins²⁴ or by altering surface physico-chemical properties and thus limiting surface attachment and inter-cellular interactions²⁷,²⁸. On the other side, presence of some *Klebsiella* capsules has been shown to increase the formation of biofilm and be required for its maturation²². Thus, the role of the capsule in biofilm formation is convoluted and depends both on the physical interactions between the capsule and the environment²⁵, and the genetic interactions between the capsule locus and the rest of the genome²³.

Numerous studies have focused on how different microbes increase biofilm formation by positively selecting for this trait²⁹⁻³¹. Yet, how biofilm formation evolves when it is not under strong selection, or just as a mere by-product of the generic processes of adaptation is not currently understood. Indeed, adaptation of a given population to different novel environments may impact the

<footnote n="1">¹Institut Pasteur, Université de Paris Cité, CNRS, UMR3525, Microbial Evolutionary Genomics, F-75015 Paris, France. ✉email: olaya.rendueles-garcia@pasteur.fr</footnote>
ability of the population to adhere and form a biofilm. This can have important consequences, for instance, in host colonisation or increased tolerance to antibiotics. Here, we measured the evolution of biofilm formation to determine whether it latently changes when it is not specifically selected. If it does, we sought to enquire if this evolutionary process takes place in a progressive manner or evolves by leaps. We hypothesise that changes in biofilm could be the result of alterations in other phenotypic traits that were under strong selection in our evolution experiment, and which are known to affect biofilm formation. We thus specifically tested for correlation in changes in population yield or surface-attached polysaccharide production (capsule or others), and changes in biofilm formation. To link phenotype with genotype, we investigated whether the changes in biofilm formation were contingent with the presence of mutations in the two main types of fimbrial adhesins. Taken together our work highlights how the generic process of adaptation to non-biotic structured environments may promote the ability of a bacteria to form biofilm, and thus potentially expand its niche from the free-living environment to host colonisation.

## RESULTS

### Changes in biofilm formation occur fast and depend on nutrient availability in the environment

To study how biofilm formation changed through time, we took advantage of a previous evolution study in which we evolved in parallel three different strains from the *Klebsiella pneumoniae* species complex³². Specifically, we propagated two hypervirulent *K. pneumoniae* strains (Kpn NTUH and Kpn BJ1; with K1 and K2 capsule serotypes, respectively) and one environmental *K. variicola* strain (Kva 342, K30 capsule serotype) as well as their non-capsulated isogenic mutants. The latter were generated by in-frame deletions of *wcaL*, the first gene of the biosynthetic pathway and the gene most commonly mutated in lab-evolved non-capsulated clones³² and in genomic datasets²⁶. From each of the six ancestral genotypes, six replicate populations were propagated in different liquid static environments varying in nutrient availability and thus, carrying capacity. Here, we analysed four of these environments: two with high carrying capacity (artificial sputum -ASM- and LB), and two with low carrying capacity (M02 and artificial urine -AUM-) (Supplementary Figure 1)³². The soil environment was not included here due to a very low carrying capacity of the media which was below the limit of detection of the biofilm assay. Each evolving population was grown for 24 h in 2 mL of media in 24-welled microtiter plates. Prior to the daily transfer, populations were re-homogenised by vigorous pipetting. Thus, biofilm formation either at the bottom of the well or in the air-liquid interface was not under positive selection. Then, 1% of the population was inoculated in fresh media. The evolution experiment ran for 102 days (~675 generations).

To understand how adaptation shapes the ability of a bacterium to form biofilm, we quantified biofilm formation in all evolving populations at regular intervals during the evolution experiment (day 15, 45, 75 and 102 – i.e. 100, 300, 500 and 675 generations) using the crystal violet staining method (see “Methods” section). This method measures attached biofilm biomass. Taking all populations together, there was a fast and significant increase in the biofilm formation capacity by day 15 of *ca* + 36%, which continued until day 45 (*ca* + 50%; One-sample Wilcoxon Rank-Sum test, difference from 1, *P* < 0.001). Afterwards, a significant decrease is observed, to end up with total increase of *ca* ~ 27% at the end of the experiment (One-sample Wilcoxon Rank-Sum test, difference from 1, *P* = 0.01). We observed a high degree of parallel evolution across replicates of the same ancestral genotype in each environment (Supplementary Fig. 2A). Notwithstanding, there were large across-treatment differences between environments

and genotypes (Supplementary Figure 2A). For instance, in Kva 342 populations, little change is observed in biofilm formation in populations evolving in M02, a steady increase is observed in LB, and divergent evolutionary paths were observed across capsule genotypes in ASM.

We had previously observed that the presence or absence of the capsule drives the direction and magnitude of evolutionary change in endpoint populations³², yet how it affects the evolutionary dynamics remained to be tested. Initial changes in biofilm formation were similar across both capsule genotypes (Fig. 1a). However, we observed divergent evolution between non-capsulated and capsulated populations towards the end of the evolution experiment, as biofilm formation in the latter decreased almost to ancestral levels (Fig. 1a). Such decrease was mostly observed in Kpn strains in environments with low carrying capacity, namely M02 and AUM (Supplementary Fig. 2A). We thus tested whether the nutrient availability of the environment influenced evolutionary dynamics. In nutrient-rich environments with high carrying capacities (ASM and LB), populations increased biofilm formation steadily throughout the duration of the experiment (Fig. 1b). In environments with lower carrying capacities, there was a similar increase in the ability to form biofilm compared to those in nutrient-rich, but this reverted fast to ancestral values (Fig. 1c). Multifactorial ANOVA revealed that changes in biofilm were strongly dependent on the interaction between capsule genotype and nutrient availability (*F* = 123.4, *P* < 0.001). Independently, nutrient availability (*F* = 59.95, *P* < 0.001) and the ancestral capsule genotype (*F* = 3.14, *P* = 0.01) also affected the evolution of biofilm formation.

We then tested how end-point populations had evolved as a function of the ancestral capacity of biofilm formation in each environment. We observed a strong negative correlation across all environments between the ancestral ability of each genotype to form biofilm and the relative change in biofilm formation (Fig. 1c, *P* < 0.05 for all except M02). The less biofilm the ancestor could produce, the larger the increase in biofilm formation observed at the end of the experiment. Inversely, genotypes that were already proficient biofilm formers tended to decrease biofilm production, for example, capsulated Kpn NTUH in LB and ASM. This suggests that biofilm formation could be under stabilising selection in KpSC.

Taken together, large changes in the capacity of forming biofilm are observed during the first steps of adaptation to novel environments. At longer evolutionary times, such changes seem to be vary depending on the environment, and more precisely, in nutrient availability.

### The environment determines how changes in population yield and surface polysaccharides influence biofilm formation

Adaptation to novel environments latently altered the ability of populations to form biofilm. Yet, our methodology to evaluate biofilm, i.e. by staining the extracellular matrix and attached cells with crystal violet, could be influenced by other variables, such as the changes in total population yield or in the production of surface polysaccharides. We tested how these two traits evolved throughout our evolution experiment (Supplementary Fig. 2B, C and Supplementary Table 1). Unfortunately, population yield in some capsulated populations could not be tested due to the emergence of hypermucoviscosity, which precludes accurate CFU assessment³². On average, evolving populations significantly increased yield (x̄ = +60%, One-sample Wilcoxon Rank-Sum test, *P* < 0.001) (Supplementary Fig. 2B and Supplementary Table 1), but as observed for biofilm formation, most changes occurred early during the evolution experiment. Similarly, surface polysaccharide production also increased (x̄ = +30%, One-sample Wilcoxon Rank-Sum test, *P* = 0.0001), but only in environments with high carrying capacity (Supplementary Fig. 2C and Supplementary Table 1).
<figure><img src="image_3.png" /><figcaption>**Fig. 1** Changes in biofilm formation during ~675 generations. Biofilm formation was assessed using the crystal violet staining assay (see "Methods" section). Each population was tested in its evolutionary conditions, i.e. in 24-welled microtiter plates and different growth media. **a** Dynamics of biofilm formation in populations descending from capsulated (grey, *N* = 69) or non-capsulated ancestor (dotted, black, *N* = 72), relative to their respective ancestor, across all environments and strains. Grey points are shifted not to overlap with black points for visualisation purposes. Error bars indicate interval of confidence (α = 0.05). Statistics represent One-sample Wilcoxon Rank-Sum test, difference from 1. **P** < 0.01 and ***P** < 0.001. **b** Dynamics of biofilm formation in populations evolving in high carrying capacity environments (ASM and LB, dotted black, *N* = 36 in both) compared to low carrying capacities (AUM -*N* = 33- and M02 -*N* = 36-, in grey) relative to their respective ancestor, across all ancestral strains. Error bars indicate interval of confidence (α = 0.05). **c** Linear regression between the ancestral formation of biofilm per genotype (x-axis) and formation of biofilm after ~675 generations (grey line). Each point represents the average of the independently evolving populations. Vertical error bars reflect the diversity of evolutionary outcomes (standard deviation from the mean). Horizontal error bars represent experimental variance of the phenotype (interval of confidence, 95%). R² is indicated (P-values *P* < 0.05, except for M02 where *P* = 0.09).</figcaption></figure>

To specifically test how changes in either yield or surface polysaccharides could influence biofilm formation, we correlated the degree of change relative to the ancestor of each of these two variables and the degree of change in biofilm formation. Despite the differences across ancestral genotypes, changes in both yield and surface polysaccharides were associated with changes in biofilm formation. However, such associations were different across environments and strongly depend on the carrying capacity of each environment (Fig. 2). In environments with high carrying capacity, we observed a positive correlation between both yield and surface polysaccharides with biofilm formation. But in environments with low carrying capacity (AUM and M02), biofilm formation negatively correlated with changes in yield and surface polysaccharides. Despite such general trends, there are many exceptions. For instance, Kva 342 populations evolving in ASM increased population yield, yet biofilm formation was reduced. The correlations explain only a small fraction of the

observed changes in biofilm formation, as indicated by their low rho values.

Overall, changes in adaptive traits like population yield and surface polysaccharide production correlated with changes in a latent phenotype, i.e. biofilm formation, but did not fully explain changes in the latter and depended on the environment to which populations were adapting.

### Parallel adaptation in *mrk* operon

To understand the genotypic factors involved in changes in biofilm formation, we analysed the genomic sequences of one randomly chosen clone from each population. We hypothesised that the adaptation by repeated mutations in the *mrk* locus, which encodes for type III fimbriae, could be largely responsible for changes in biofilm formation (Supplementary Table 2). Indeed, our results show that populations in which mutations were detected in *mrkD*, the tip adhesin, but not in the rest of
<figure><img src="image_4.png" /><figcaption>**Fig. 2** Correlation between changes in biofilm formation and co-evolving traits. Each shape corresponds to different days during the evolution experiment, and colours indicate different ancestral genotypes. Each dot is the average of at least three independent biological replicates. *P*-values correspond to a Spearman correlation test. Blue lines represent a linear regression model, and the grey shadow the confidence interval.</figcaption></figure>

the operon, were associated with increased biofilm formation (Fig. 3a). Mutations in *mrkD* tend to accumulate in populations evolving in rich environments (56% population in ASM or LB vs only 9% of populations in AUM or M02) (Fig. 3b and Supplementary Fig. 3). This fits our abovementioned observation that populations evolving in environments with high carrying capacities form more biofilm. Despite a lower mutational supply in populations evolving in low-nutrient environments, changes in biofilm in these populations can be observed after just fifteen days. The absence of mutations in *mrkD* in these populations strongly suggests that other mutations present in the population can also impact biofilm formation (Figs. 1a and 2). Of note, most mutations in *mrkD* accumulate in the lectin binding domain (89%) which determines the binding specificity of the pili, in this case to type V collagen, as opposed to mutations in the pilin domain (11%), which would mostly influence the structure. Thus, this suggests that most mutations could be affecting surface affinity (Fig. 3d).

The abovementioned correlations were performed based on the sequence of one randomly chosen clone in the population. To get a finer view of the effect of *mrkD* on biofilm formation, we followed the frequency of *mrkD* alleles in a subset of evolving populations and searched to understand if the frequency of the evolved allele correlated with changes in biofilm formation (Fig. 3c). We focused on Kva 342, an environmental strain which displayed the highest percentage of populations with mutations in the *mrk* operon (47% vs 22% and 29% in Kpn BJ1 and NTUH respectively) (Supplementary Table 2 and Supplementary Fig. 3) in ASM, a host-mimicking environment. We tested all evolving populations (including those that did not have *mrkD* mutations at the end of the evolution experiment). Surprinsingly, 10 out of the 12 populations had clones with mutations in *mrkD* at some point during the evolution experiment, even if most of them did not reach high frequencies or fix. Our data revealed that changes in biofilm formation were associated with changes in the frequency of evolved *mrkD* alleles in the population (GLM, $R^2 = 0.6$, $P = 0.005$).

Because non-capsulated clones readily emerge in capsulated populations$^{23,32}$, we also included the proportion of capsulated

clones in the generalised linear model. This revealed that the changes in biofilm formation are also associated with the frequency of capsulated clones ($P < 0.0001$). We observed that in the two capsulated clones in which the *mrkD* allele fixated (i.e. population 1A3 or 1A5), the increase in biofilm formation correlated with an increase in frequency of *mrkD* evolved alleles (Fig. 3c). Further, these two populations were the only ones where newly emerged non-capsulated clones outcompeted all capsulated clones by the end of the experiments. In populations 1A4 and 1A6, the emergence of *mrkD* clones correlated with decreased frequency of capsulated clones, even though neither non-capsulated clones nor *mrkD* alleles fixated. These population dynamics could suggest that *mrkD* mutations do not emerge in capsulated backgrounds readily. Indeed, among the 141 evolving populations, mutations in the *mrk* operon are more frequent in the non-capsulated ones (46% vs 19% in capsulated populations, Fisher's exact test $P = 0.005$). Alternatively, the observation that *mrkD* mutations only fix in non-capsulated backgrounds could suggest that *mrkD* mutations in a capsulated background emerge as readily but do not offer such a large fitness advantage (compared to those in non-capsulated backgrounds) and are outcompeted.

We thus tested whether *mrkD* mutations preferentially emerged in non-capsulated clones spontaneously appearing in the originally capsulated population, or whether there is no initial bias in the genetic background where these mutations appear but that milder selection in capsulated backgrounds limit their frequency in the population. We isolated six capsulated and six non-capsulated clones from each originally capsulated population at the time point in which the different *mrkD* alleles had reached a frequency of 0.5 in the population (Supplementary Table 3). Our results show that in some populations (1A5 and 1A6) *mrkD* mutations emerged in non-capsulated clones, suggesting that capsule inactivation precedes mutations in *mrkD*. But the opposite seems to occur in population 1A3. The mutation in *mrkD* emerges in a capsulated background, implying that capsule production is abolished later, leading to fixation of a non-capsulated *mrkD*-bearing clone shortly after (Supplementary Table 3). In population 1A2, the *mrkD* mutation emerged in capsulated clones, but
<figure><img src="image_5.png" /></figure>

eventually the genotype goes extinct. Interestingly, in population 1A4, two different mutations, G167C and T139P, emerge in either a capsulated and non-capsulated backgrounds, respectively. These data indicate that *mrkD* mutations can appear in both genetic backgrounds (Supplementary Table 3), but they seem to

fix only when they are in a non-capsulated background. And the latter is independent of the background in which the mutations first emerged (Fig. 3c and Supplementary Table 3). Overall, our data shows that mutations in *mrkD* can be associated to changes in biofilm formation, but the latter seems to depend on more
**Fig. 3** Analyses of evolved populations with mutations in *mrkD*. **a** Biofilm formation of end-point evolved populations relative to their respective ancestor. Data is presented in the form of violin plots, with a line across the violin plot indicating the median. Additionally, each dot represents the average biofilm formation of at least three independent replicates of each individual evolving population. Different dot colours represent different ancestors. Populations were divided into four categories corresponding to whether the sequenced randomly chosen clone from each population had a mutation in *mrkD*, elsewhere in the *mrk* operon, on both *mrkD* and elsewhere, or no mutations in the operon (x-axis). Only populations with mutations in *mrkD* have increased biofilm formation. Statistics on top of violin plots represent One-sample Wilcoxon Rank-Sum test, difference from 1, \*\*P < 0.01 and \*\*\*P < 0.001. **b** Number of clones in which each category of mutation was found, depending on the carrying capacity of the evolutionary environment: high carrying capacity (nutrient-rich) and low carrying capacity (nutrient-poor). \*\*\*P < 0.001, Fisher's Exact test. **c** Frequency of different *mrkD* alleles in each population as estimated by QSVAnalyzer (blue lines), and capsulated clones (dashed grey lines) as per CFU counts. The difference in biofilm formation between each evolved population and the ancestor is depicted by the green lines. No mutations in *mrkD* were identified in populations 1A1 or 1D1 and are not represented here. **d** Identified mutations in *mrkD* in Kva 342 strain. Protein structure was predicted with AlphaFold<sup>60</sup>, and colored according to the pLDDT (predicted local distance difference test), that is, the AlphaFold score for confidence per residue. All base-pair deletions resulted in in-frame deletions. Dotted boxes correspond to mutations that were found in multiple populations, but not always observed at the end of the experiment.

<figure><img src="image_6.png" /></figure>

**Fig. 4** Effect on biofilm formation and aggregation of evolved *mrkD* alleles in ancestral capsulated or non-capsulated Kva 342. **a** Biofilm formation is expressed relative to the ancestor (dashed line). **b** Aggregation is quantified by the absorbance (OD600) of the top layer of culture in static conditions after 4.5 h. High absorbance results from low aggregation levels. Calculation of the area under the aggregation curve results in qualitatively similar results. Each dot represents a clone with an independently evolved mutation. Full points represent mutants in which *mrkD* allele originally emerged in a clone descending from a capsulated ancestor whereas empty points represent mutants bearing *mrkD* alleles that emerged in non-capsulated ancestors. For individual visualisation of each mutation, and individual statistics see Supplementary Fig. 5. Statistics: two-sided paired t-tests. \*P < 0.05, \*\*P < 0.01, \*\*\*P < 0.001.

complex interactions between the capsule and the different evolved alleles.

## Mutations in *mrkD* increase biofilm formation and reduce aggregation in *K. variicola* but not in *K. pneumoniae*

To disentangle the role of the different evolved *mrkD* alleles in biofilm formation and intercellular interactions, and how the capsule may affect these traits, we reverted mutations in *mrkD* to the ancestral state in all three strains. The reversion of mutations did not result in consistent changes in biofilm formation in *K. pneumoniae* or in *K. variicola* 342, (Supplementary Figs. 4A and S5A), except for the reversion of Δ37–40 in a capsulated background (1A2) that significantly reduced biofilm formation (Supplementary Fig. 5A). We hypothesised that mutations occurring after the mutation in *mrkD* could mask changes in the biofilm phenotype. Indeed, insertion of selected *mrkD* evolved alleles in both capsulated and non-capsulated backgrounds in Kva 342, revealed that *mrkD* mutations increased biofilm formation significantly, but only when the capsule was present (Fig. 4a and Supplementary Fig. 5B). Such increase was independent of the genetic context in which the mutation originated, that is, whether it had originally emerged in a capsulated or non-capsulated clone (Multiple-way ANOVA, df = 1, *P* > 0.05). Given previous studies showing that the capsule limits adhesin exposure³³, we expected mutations in non-capsulated clones to have larger effects on biofilm formation. But, contrary to our expectations, we found no

effect (Fig. 4a). Analysis of variance confirms that the presence of capsule strongly impacts the effect of *mrkD* mutations (Multiple-way ANOVA, df = 1, *P* < 0.001). In *K. pneumoniae*, the results were different: only the simultaneous insertion of two SNPs in *mrkD* resulted in significant increases of biofilm formation (Supplementary Fig. 5B). Our data implies that mutations in *mrkD* were not selected for their role in biofilm formation, as the repeated emergence of such mutations is not followed by similar changes at the functional level.

Because most mutations in *mrkD* were found in the lectin (collagen) binding domain (Fig. 3d), we tested whether these mutations could specifically impact cell-to-cell interactions. To do so, we measured the absorbance of the top layer of sitting cultures through time as a proxy for sedimentation. In such tests, high absorbance represents low sedimentation. Aggregation results confirm what was observed in biofilm formation, namely that in Kva 342, the *mrkD* allele (Multiple-way ANOVA, df = 1, *P* < 0.001), as well as the presence of the capsule (Multiple-way ANOVA, df = 1, *P* = 0.008), but not the ancestral background in which the mutation originally emerged (Multiple-way ANOVA, df = 1, *P* > 0.05), impacts aggregation. Specifically, most mutations significantly reduced aggregation relative to the ancestor in Kva342 (Fig. 4b and Supplementary Fig. 5C). No changes in aggregation were observed in *mrkD* mutants of *K. pneumoniae*.

Taken together, our data show that irrespective of the ancestral capsule genotype, mutations in *mrkD* increase biofilm formation in
<figure><img src="image_7.png" /></figure>

<figure><img src="image_8.png" /><figcaption>**Fig. 5 Analyses of reversal of fim switch in evolved populations.** a Tropism of fim switch reversal. The dashed horizontal line indicates the total frequency of fim switch in evolved clones. Fisher's Exact test was used to compute difference in the distribution of mutations depending on media carrying capacity. ***P < 0.001. b Biofilm formation was assessed in the evolutionary treatment in which this mutation evolved. Each dot represents the average of three independent experiments of each individual population. Blue dots depict populations evolved in media with high carrying capacity and green indicates media with low carrying capacity. Statistics: Two-tailed One-sample t-test, difference from 1. ***P < 0.001, ns not significant.</figcaption></figure>

capsulated clones whilst diminishing cell-to-cell interactions in *K. variicola* but not in *K. pneumoniae*.

## Non-capsulated *K. pneumoniae* populations revert the *fim* switch and form less biofilm

Analyses of mutations observed in end-point populations revealed that some Kpn NTUH population had clones that reversed the *fim* switch. The *fim* switch is a phase-variable inversion of a short DNA element (comprising the promoter), which results in an ON/OFF expression of the *fim* operon, responsible for the production, or not, of type I fimbriae³⁴. Whereas in a wild-type population of Kpn NTUH type 1 fimbriae transcription is activated³⁵, seventeen out of the 56 Kpn NTUH clones we sequenced had reverted *fim* switch, which should result in silencing of type I fimbriae. The reversions of the promoter did not depend on the ancestral capsule genotype but were dependent on the environment in which the population evolved. Switch reversal accumulated preferentially in environments with low-carrying capacities (Fisher's test, *P* = 0.002), as opposed to mutations in *mrkD* which mostly accumulated in environments with high carrying-capacities (Fig. 5).

We then tested whether Kpn NTUH populations with the reversed *fim* promoter displayed changes in biofilm formation. Analysis of variance revealed that variation in biofilm formation was not dependent on the environment (Multi-way ANOVA, df = 3, *P* > 0.05) nor on mutations in the *fim* promoter (Multi-way ANOVA, df = 1 and *P* > 0.05). In contrast, it was strongly associated with the ancestral capsule genotype (Multiway ANOVA, df = 1, *P* = 0.0003). Whereas in capsulated backgrounds, populations displaying changes in the *fim* switch did not result in differences in biofilm formation, in non-capsulated populations, populations with switch reversal produced less biofilm than those without (Fig. 5b). Despite the fact that the reversion of the *fim* switch is equally frequent in capsulated and in non-capsulated populations, it only seems to reduce biofilm formation in non-capsulated *K. pneumoniae* NTUH.

## Mutations in mrkD are also found in natural and clinical isolates

The frequency of mrkD mutations prompted us to enquire whether mutations driving latent phenotypes in laboratory evolution experiments could reflect evolutionary paths occurring in natural isolates. To do so, we analysed all *K. variicola* and almost 10,000 random *K. pneumoniae* genomes available in the Pathosystems Resource Integration Center (PATRIC) genome database³⁶. In *K. variicola*, we identified a total 689 MrkD proteins in 671 genomes (prevalence of 93.6%) (Supplementary Fig. 6). From these, 384 protein sequences differed from our ancestral Kva 342. A total of 55 different amino acid changes were identified, grouped in 42 unique MrkD protein sequences (Table 1). Among these, three mutations (found in ten different genomes) displayed amino acid changes in the same positions as proteins evolved in our evolution experiment (position #57, #73 and #249) (Fig. 6 and Table 1). Genomes with similar mutations were all host-associated, isolated from humans or cats, including one human sample isolated from lung sputum. In *K. pneumoniae*, we found a similarly high prevalence of MrkD (93.7%). Fourteen out of the 22 (~63%) different amino acid positions that were mutated in our evolution experiment, were also mutated in the natural isolates (Fig. 6 and Table 1). Taken together, the comparison of the mutations in MrkD in wild isolates and that observed in the laboratory reveals that the evolution experiments captured a broad range of the genetic diversity observed in natural populations.

## DISCUSSION

Latent phenotypes evolve neutrally during adaptation to novel environments. Such phenotypes do not significantly impact fitness, but they can be adaptive if the environmental conditions change. Recently, numerous experimental evolution studies have tested how adaptation to novel environments may impact latent phenotypes as they contribute to diversification³⁷,³⁸ or to exaptation³⁹,⁴⁰. Indeed, the resulting genetic variation has been called "evolution's hidden substrate"⁴¹. Here we studied the diversification and evolution of one such latent phenotype,
<table><caption>**Table 1.** Summary statistics of genomes and comparison of MrkD sequences analysed from the public repository PATRIC.</caption><thead><tr><th>Species</th><th># of genomes</th><th># mrkD sequences (evalue &lt; 10e-5)</th><th>Prevalence (&gt; 90% identity)</th><th># Sequences &lt; 100% &gt; 90% identity</th><th># Unique alleles</th><th># Common positions modified</th><th>Positions</th></tr></thead><tbody><tr><td>K. variicola</td><td>717</td><td>1661</td><td>671</td><td>384</td><td>42</td><td>3</td><td>57,73, 249</td></tr><tr><td>K. pneumoniae</td><td>9761</td><td>26,065</td><td>9154</td><td>6794</td><td>237</td><td>14</td><td>26, 36, 37, 41, 57, 58,70, 73, 98, 109, 137, 166, 185, 249</td></tr></tbody></table>

namely the ability to form biofilm. To do so, we took advantage of a previous evolution experiment where we analysed changes in capsule in end-point populations³². Here, we examined the temporal dynamics of 141 evolving populations, grown in static liquid cultures for over 675 generations. We evaluated how the environment and ancestral genotypes impact changes in population yield, surface polysaccharide production, and most importantly, biofilm formation throughout the course of evolution. We also tested association between biofilm formation, aggregation and the emergence of mutations in surface adhesins, and namely mrkD. We observed little within-treatment diversity in the evolutionary outcomes in latent evolution of biofilm formation. This contrasted with the divergent evolutionary outcomes observed across treatments. These were driven by the ancestral genotypes, but more importantly by nutrient availability.

The presence or absence of the capsule not only impacts the magnitude of change of adaptive phenotypes like yield at the end of the experiment, as shown previously³². It also impacts the evolutionary dynamics of latent phenotypes. The effects of the capsule on biofilm formation seem to be stronger at longer evolutionary time scales. For example, in the first one hundred generations, both capsulated and non-capsulated populations across all environments followed a similar dynamic of fast and large changes in biofilm formation. The impact of the capsule in biofilm dynamics could be a consequence of its effect on an adaptive trait, like increased population yield. Changes in yield are frequent at the beginning of evolution experiments⁴². This is expected as the most beneficial mutations are incorporated early in the process⁴³. At longer evolutionary time scales, divergent evolutionary paths are observed in terms of biofilm formation depending on the presence of the capsule and on the carrying capacity of the environment. This suggests that these two factors critically alter the future ability of microbes to form biofilm, which affects the way they prevail and better colonise a surface (including the host).

We hypothesised that the repeated accumulation of mutations across the three strains in the type III fimbriae tip adhesin mrkD, would phenotypically impact the formation of biofilm because MrkD mediates the adhesion to cells and several extracellular matrix proteins⁴⁴. However, the phenotypic consequences of such mutations were not similar. Specifically, we observed that mrkD mutations increased biofilm formation in the K. variicola strain, but not in the K. pneumoniae strains. Further, we observed that reversions of fim switch accumulate in only one K. pneumoniae (NTUH), but not in BJ1 or in the K. variicola strain. This suggests that the importance of this adhesin in biofilm formation could be strain-dependent. Computational analyses have revealed that K. pneumoniae strains have a rich arsenal of chaperon-usher (CU) systems. Most of these systems are cryptic in laboratory conditions²¹ and little is known about their expression and conservation patterns. In light of our results, further research evaluating the precise role of each system in the presence and absence of the other CU-systems would be a promising research venue to unravel the inter-adhesin interactions and how they influence biofilm formation. The relative expression of each CU-system across different strains and environments could significantly alter the contribution of each system in biofilm formation²¹.

A major finding of this study is that differences in nutrient availability led to the differential accumulation of mutations in mrkD. This raises the question of why mrkD mutations are selected specifically in nutrient rich but not in nutrient poor environments? We speculate that in nutrient rich medium, when higher carrying capacities are sustained, fitness advantages may often be the result of higher growth rates. Because single cells have higher intrinsic growth rates than aggregates, mutations leading to decreased cell aggregation would be selected⁴⁵. However, when competition is high and resources scarce, cell aggregates have higher fitness than single cells⁴⁵, thus mutations in mrkD may be counter-selected in nutrient-poor environments. Alternatively, there may be a specific tropism of the fimbriae. Selection can only act on what is being expressed in each environment. Thus, we can speculate that changes in fimbriae expression across the different environments are driving mechanisms of adaptation. For instance, we observe reversions of the fim switch in nutrient-poor environments, like AUM, where they are expressed and known to play an important role⁴⁶. On the contrary, we do not observe many reversions of the fim switch in nutrient-rich environments, where they are not expressed i.e. during lung infection⁴⁶. A similar tropism could explain accumulation of mutations in mrkD in certain environments but not in others. Finally, given that the mutations in mrkD do not result in consistent changes in biofilm formation and/or aggregation across ancestral genotypes (strain and capsule), we may also speculate that selection is acting on another phenotype influenced by mrkD and of particular relevance in nutrient-rich environments. If so, it would suggest that this CU-system may fulfil roles unrelated to biofilm formation.

Our study reveals an intricate relationship between the capsule and extracellular proteins. The effect of the fim switch is only visible in non-capsulated cells. This is not unexpected as it was initially shown that the capsule in Klebsiella limited biofilm formation, notably by masking the effect of type I fimbriae³³ and other short adhesins such as Ag-43 and AIDA-1²⁴. Accordingly, when the capsule contributes to biofilms' maturation and is highly expressed²², type I fimbriae are downregulated¹⁶ and not involved in intestine or lung colonisation³⁴. However, in these conditions, type III fimbriae are highly expressed, suggesting a positive interaction between the capsule and this fimbriae during biofilm formation. Similarly, a recent report showed that, in conditions in which type III fimbriae is expressed, biofilm formation increases when capsule production is enhanced⁴⁷. Indeed, in K. variicola, the mutations in MrkD only significantly increase biofilm in capsulated strains, but not in non-capsulated strains. Such differential increase of biofilm is interesting, as mrkD mutations indiscriminately impact aggregation irrespective of the presence or absence of the capsule. This highlights that the interaction between the capsule and type III fimbriae during biofilm formation cannot be reduced to a mere masking of surface receptors and depending on the context, they may act synergistically.

The repeated evolution of mutations on the lectin domain of the tip adhesin MrkD is similar to that recently observed in the lectin domain of the tip adhesin FimH of type I fimbriae in E. coli, in a study in which biofilm formation under continuous flow was positively selected³⁰. The nature of the mutations was also found to be very similar between the two studies, especially the
<figure><img src="image_9.png" /><figcaption>**Fig. 6** Comparison of MrkD mutations observed in natural isolates and our evolution experiment. Smoothed density plot (default parameters) of the distribution of SNPs in MrkD from *K. variicola* (green) and *K. pneumoniae* (blue). The inset recapitulates the frequency of amino acid changes in each position. The intensity of red represents the frequency.</figcaption></figure>

emergence of several short in-frame deletions across independent populations. Of note, some clones with mutations in *fimH*, as observed with clones with mutations in *mrkD*, did not significantly increase biofilm formation relative to the ancestor. This reinforces our hypothesis that there may be other selective pressures underlying the emergence and rise to such high proportions of mutations in the tip adhesin of chaperon-usher dependent fimbriae. Alternatively, they may play roles other than formation of biofilm, either directly or as a result of epistasis with other surface structures. Despite the differences in selection regimes between the two studies, the mutagenic convergence in the lectin domain of the tip adhesins in *Klebsiella* and *E. coli* suggests that proteins with similar functions undergo similar evolutionary trajectories.

At the population level, we observed a remarkable correlation between the presence of mutations in the tip adhesin *mrkD* and increased biofilm formation (Fig. 3a). Yet, this effect could not be fully recapitulated when these mutations were analysed individually in an ancestral background. This could be due to complex epistatic interactions, for instance, with the capsule or other surface structures. Alternatively, the effects of these mutations could be altered by the presence of other mutations in the genome. We had previously reported that some populations also had mutations in *ramA*<sup>32</sup>, involved in the stability of the outer membrane<sup>48</sup>. These could alter molecular interactions at the cell surface, including the adhesin-capsule interactions. Further, in *Salmonella enterica* Typhimurium, expression of *ramA* directly impacts biofilm formation<sup>49</sup>. Finally, the formation of biofilm can be regarded as a social behaviour and thus, strongly influenced by the within-population diversity. Indeed, our initial tests were performed with populations that we expected to have some

genetic diversity. The effect of mutations in *mrkD* were analysed in isolation, and we could have missed some important clonal interference that could be influencing changes observed at the population level.

The impact of direct selection on important virulence-associated traits has been largely studied, yet, changes in traits that evolve latently are rarely addressed. This could be caused by the challenges of analysing the genetic basis of their evolution, since these phenotypes may not have a direct impact on fitness. The phenotypic changes resulting from specific mutations may not be easy to reveal and may strongly rely on complex epistatic interactions or within-population diversity. Previously, we showed how susceptibility to antimicrobials latently evolves as a result of mutations in *ramA*<sup>32</sup>. Here, we have shown that the ability to form biofilm changes greatly during evolutionary time, depending on the ecological conditions in which *mrkD* mutations emerge, and on the genetic context in which it is expressed. In conclusion, our studies highlight the need to include analyses of latent phenotypic evolution in the general framework of microbial adaptation, and more particularly in the evolution of virulence-associated traits of bacterial pathogens<sup>37,38</sup>.

# MATERIALS AND METHODS

## Bacterial strains and growth conditions

i. *Strains.* Three different strains from the *Klebsiella pneumoniae* species complex were used in this study<sup>32</sup>: one environmental strain, isolated from maize in the USA, *K. variicola* 342 (Kva 342, serotype K30)<sup>50</sup>, *K. pneumoniae* BJ1 from clonal group 380 (Kpn BJ1, serotype K2) isolated in France from a liver abscess<sup>12</sup> and the
hypervirulent *K. pneumoniae* NTUH K2044 (Kpn NTUH, serotype K1) from clonal group 23 isolated in Taiwan from a liver abscess⁵¹. *ii. Environment description.* AUM (artificial urine medium) and ASM (artificial sputum medium) were prepared as described previously⁵²,⁵³. AUM is mainly composed of 1% urea and 0.1% peptone with trace amounts of lactic acid, uric acid, creatinine and peptone. ASM is composed of 0.5% mucin, 0.4% DNA, 0.5% egg yolk and 0.2% amino acids. LB is composed of 1% tryptone, 1% NaCl and 0.5% yeast extract. M02 corresponds to minimal M63B1 supplemented with 0.2% of glucose as the sole carbon source. *iii. Primers.* Primers used in this study are listed in Supplementary Table 4.

## Mutant construction

Isogenic mutants were constructed by allelic exchange. We inserted evolved *mrkD* alleles in capsulated and non-capsulated ancestors. We also reverted evolved alleles into ancestral state in evolved clones. To do so, the cloning vector pKNG101 plasmid was amplified using Q5 High Fidelity Master Mix (New England Biolabs) and digested by DpnI (NEB BioEngland) restriction enzyme for 30 minutes at 37 °C. The *mrkD* allele of interest (ancestor or evolved) was amplified using Q5 High Fidelity Master Mix (New England Biolabs). The vector and allele of interest were then assembled using the GeneArt™ Gibson Assembly HiFi kit (Invitrogen), electroporated into competent *E. coli* DH5α strain and selected on streptomycin LB plates. pKNG101 plasmids containing *mrkD* alleles were verified by PCR and purified using the QIAprep Spin Miniprep Kit. These were then electroporated again into *E. coli* MFD λ-pir strain, used as a donor strain for conjugation in Kva 342 ancestral strains or evolved clones. Single cross-over mutants (transconjugants) were selected on Streptomycin plates and double cross-over mutants were selected on LB without salt, supplemented with 5% sucrose, after 48 h of growth at room temperature. From each double-recombination, an evolved allele and an ancestral allele were isolated. Mutants were verified by Sanger sequencing.

## Emergence of mrk mutants

To test the allele frequencies of *mrkD* in the evolved populations, we took aliquots from the glycerol stock from days 7, 15, 30, 45, 75 and 100. These were diluted in water and used for PCR reaction using Phusion Master Mix (Thermo Scientific). Purified PCR products were sequenced by Sanger. The frequency of the mutations was calculated using high quality chromatograms analysed by QSVanalyzer⁵⁴ with default parameters. Of note, the limit of detection of QSVanalyzer is estimated at 5%.

## Trait quantification

To initiate the different measurements, each population was grown overnight and 20 µL of each culture was inoculated into 1980 µL of the relevant growth media in 24-well microtiter plates and allowed to grow for 24 h without shaking at 37 °C. Populations evolving in poor media (M02 and AUM) were diluted 1:100 and allowed to grow for another 24-hours extra prior to the experiment, as we noticed that preconditioning was important for reproducibility. Overnight cultures were not adjusted as all populations had time to reach stationary phase and reach the maximum carrying capacity of the growth media (i) Biofilm formation. The capacity of a population or an isolated clone to form a biofilm was measured using the crystal violet staining method as previously described⁵⁵, with minor volume modifications to cover the 24-welled microtiter plate wells. Briefly, unbound cells were removed by washing once in distilled water. To stain biofilms, 2100 µL of 1% crystal violet was added to each well for 20 min. The crystal violet was decanted and washed thrice with distilled water. The plates were allowed to dry under a

laminar flow hood. Then, the biofilm was solubilized for 10 min in 2300 µL of a mix with 80% ethanol and 20% acetone. Then, 200 µL of each solubilized stain was transferred into a well of a 96-well plate. The absorbance of the sample was read at OD<sub>590nm</sub>. (ii) Population yield. Each well was homogenised by vigorous pipetting and then serially diluted in fresh LB and plated to count CFU after 24 h of growth. For most capsulated populations in LB and ASM, due to the extreme hypermucoviscous phenotype³², CFUs could not be accurately assessed as the populations cannot be resuspended and homogenised. Thus, the serial dilution process was biased and distorted because either a randomly large or a randomly small proportion of the population would be transferred, due to the abovementioned hypermucoviscosity. These populations were not taken into account in our analyses. (iii) Surface polysaccharide extraction and quantification. The bacterial capsule was extracted as described in ref.⁵⁶ and quantified by the uronic acid method⁵⁷ using glucuronic acid as a standard. (iv) Aggregation test. An isolated colony was allowed to grow in 5 mL overnight in M02 medium at 37° under shaking conditions. Prior to the experiment, the absorbance (OD<sub>600nm</sub>) was measured and adjusted to OD<sub>600</sub> = 2, and the cultures were transferred to static test tubes. Two hundred µL samples were transferred to a 96-well microtiter plate and the absorbance (OD<sub>600nm</sub>) measured at defined time points (0; 1.5; 3; 4.5 and 24 h) using an automatic plate reader Spark Control Magellan (TECAN). Samples were removed from the uppermost layer of tube cultures, roughly at the 4 mL mark. Decreasing absorbance represents the settling of agglutinated cell clumps. Figures represent aggregation after 4.5 h. We also calculated the area under the aggregation curve (trapz function included in the pracma R package). Results were qualitatively similar to those observed when only the measurement of 4.5 h is taken into account.

## Search for MrkD proteins

All genomes corresponding to *K. variicola* in the Pathosystems Resource Integration Center (PATRIC) genome database, filtered by good quality and text mined for *K. variicola* species (751 out of the 767) were downloaded on 11 March 2022. Same procedure was applied for the first 10,000 genomes of *K. pneumoniae* (of which 239 were discarded). The genomes were checked for quality control and annotated with the pipeline PaNaCoTa⁵⁸ and the -prodigal option. Protein-Protein Blast (BLAST 2.7.1+) against either the Kva 342 MrkD or Kpn NTUH MrkD was performed with the following option -max_target_seqs 100000 and an E-value smaller than 10<sup>-5</sup>. Sequences covering less than 70% of the protein length were discarded (only 50 for *K. pneumoniae*). The distribution of MrkD protein identities revealed a bimodal distribution (Supplementary Fig. 6A, C). To analyse bona fide MrkD proteins, we applied a cut-off of 90% identity. Of note, some genomes had two MrkD homologues (18 out of 671 in *K. variicola*, and 97 out of 9154 in *K. pneumoniae*). Most of the unique MrkD protein sequences in the databases differed by one or two amino acids from our ancestral sequences, but these could go up to 20 (Supplementary Fig. 6B, D). Protein sequences were aligned using mafft v7.22 with the options -localpair -maxiterate 1000. Amino acid mismatches were then identified using the R package Biostrings.

## Reporting summary

Further information on research design is available in the Nature Research Reporting Summary linked to this article.

## DATA AVAILABILITY

Raw data is available in the figshare repository under the doi 10.6084/m9.figshare.22559890⁵⁹. Raw reads for this project can be accessed in the European Nucleotide Archive (ENA), project number PRJEB54810³².
Received: 7 April 2023; Accepted: 20 July 2023;
Published online: 03 August 2023

REFERENCES

1. Boto, L. Horizontal gene transfer in evolution: facts and challenges. *Proc. B R Soc. **277** , 819–827 (2010).

2. Soucy, S. M., Huang, J. & Gogarten, J. P. Horizontal gene transfer: building the web of life. *Nat. Rev. Genet. **16*** , 472–82 (2015).

3. Travisano, M. & Rainey, P. Studies Of Adaptive Radiation Using Model Microbial Systems. *Am. Nat. **156*** , S35–S44 (2000).

4. Costerton, J. W., Lewandowski, Z., Caldwell, D. E., Korber, D. R. & Lappin-Scott, H. *M. Microb. Biofilms. Annu. Rev. Microbiol. **49*** , 711–745 (1995).

5. Flemming, H. C. & Wuertz, S. Bacteria and archaea on Earth and their abundance in biofilms. *Nat. Rev. Microbiol. **17*** , 247–260 (2019).

6. MacKenzie K. D., Palmer M. B., Köster WL and A. P. White. examining the link between biofilm formation and the ability of pathogenic salmonella strains to colonize multiple host species. *Front. Vet. Sci. **4*** , 138 (2017).

7. Martín-Rodríguez, A. J. Respiration-induced biofilm formation as a driver for bacterial niche colonization. *Trends Microbiol. S0966-842X*, 00219-0 (2022).

8. Otto, M. Bacterial evasion of antimicrobial peptides by biofilm formation. *Curr. Top. Microbiol. Immunol. **306*** , 251–8 (2006).

9. Fux, C. A. et al. Survival strategies of infectious biofilms. *Trends Microbiol. **13*** , 34–40 (2005).

10. Schlüter, J., Nadell, C. D., Bassler, BL & Foster, K. R. Adhesion as a weapon in microbial competition. *ISME J. **9*** , 139–149 (2015).

11. Wyres, K. L., Lam, M. M. C. & Holt, K. E. Population genomics of Klebsiella pneumoniae. *Nat. Rev. Microbiol. **18*** , 344–359 (2020).

12. Blin, C. et al. Metabolic diversity of the emerging pathogenic lineages of Klebsiella pneumoniae. *Environ. Microbiol. **19*** , 1881–1898 (2017).

13. Bagley, S. T. Habitat association of Klebsiella species. *Infect. Control **6*** , 52–8 (1985).

14. Podschun, R., Pietsch, S., Höller, C & Ullmann, U. Incidence of Klebsiella species in surface waters and their expression of virulence factors. *Appl. Environ. Microbiol. **67*** , 3325–3327 (2001).

15. Thorpe, H. A., Booton, R., Kallonen, T., Gibbon, M. J. & Couto, N. et al. A large-scale genomic snapshot of Klebsiella spp. isolates in Northern Italy reveals limited transmission between clinical and non-clinical settings. *Nat. Microbiol. **7*** , 2054–2067 (2022).

16. Schroll C., Barken K. B., Krogfelt KA and C. Struve. Role of type 1 and type 3 fimbriae in Klebsiella pneumoniae biofilm formation. *BMC Microbiol. **10*** , 179 (2010).

17. Stahlhut, S. G. et al. Comparative structure-function analysis of mannose-specific FimH adhesins from Klebsiella pneumoniae and Escherichia coli. *J. Bacteriol. **191*** , 6592–6601 (2009).

18. Tarkkanen, A. M. et al. Type V collagen as the target for type 3 fimbriae, enterobacterial adherence organelles. *Mol. Microbiol. **4*** , 1353–61 (1990).

19. Jagnow, J. & Clegg, S. Klebsiella pneumoniae MrkD-mediated biofilm formation on extracellular matrix- and collagen-coated surfaces. *Microbiology **149*** , 2397–2405 (2003).

20. Di Martino, P., Cafferini, N., Joly, B & Darfeuille-Michaud, A. Klebsiella pneumoniae type 3 pili facilitate adherence and biofilm formation on abiotic surfaces. *Res. Microbiol. **154*** , 9–16 (2003).

21. Khater, F. et al. In silico analysis of usher encoding genes in klebsiella pneumoniae and characterization of their role in adhesion and colonization. *PLoS ONE **10*** , e0116215 (2015).

22. Balestrino, D. et al. The characterization of functions involved in the establishment and maturation of Klebsiella pneumoniae in vitro biofilm reveals dual roles for surface exopolysaccharides. *Environ. Microbiol. **10*** , 685–701 (2008).

23. Buffet, A., Rocha, E. P. C. & Rendueles, O. Nutrient conditions are primary drivers of bacterial capsule maintenance in Klebsiella. *Proc. R. Soc. B-Biol. Sci. **288*** , 20202876 (2021).

24. Schembri, M. A., Dalsgaard, D. & Klemm, P. Capsule shields the function of short bacterial adhesins. *J. Bacteriol. **186*** , 1249–1257 (2004).

25. Dzul, S. P., Thornton, M. M. & Hohne, D. N. Contribution of the Klebsiella pneumoniae capsule to bacterial aggregate and biofilm microstructures. *Appl. Environ. Microbiol. **77*** , 1777–1782 (2011).

26. Haudiquet, M., Buffet, A., Rendueles, O. & Rocha, E. P. C. Interplay between the cell envelope and mobile genetic elements shapes gene flow in populations of the nosocomial pathogen Klebsiella pneumoniae. *PLoS Biol. **19*** , e3001276 (2022).

27. Rendueles, O., Kaplan, J. B. & Ghigo, J. M. Antibiofilm polysaccharides. *Environ. Microbiol. **15*** , 334–46 (2013).

28. Valle, J. et al. Broad-spectrum biofilm inhibition by a secreted bacterial polysaccharide. *Proc. Natl Acad. Sci. USA **103*** , 12558–63 (2006).

29. Smith, T. M. et al. Rapid adaptation of a complex trait during experimental evolution of Mycobacterium tuberculosis. *eLife **11*** , e78454 (2022).

30. Yoshida M., Thiriet-Rupert S., Mayer L., Beloin C., Ghigo J. M. Selection for non-specific adhesion is a driver of FimH evolution increasing Escherichia coli biofilm capacity. *MicroLife **3*** , uqcac001 (2022).

31. Nordgaard, M. et al. Experimental evolution of Bacillus subtilis on Arabidopsis thaliana roots reveals fast adaptation and improved root colonization. *iScience **25*** , 104406 (2022).

32. Nucci, A., Rocha, E. P. C. & Rendueles, O. Adaptation to novel spatially-structured environments is driven by the capsule and alters virulence-associated traits. *Nat. Commun. **13*** , 4751 (2022).

33. Schembri, M. A., Blom, J., Krogfelt, K. A. & Klemm, P. Capsule and fimbria interaction in Klebsiella pneumoniae. *Infect. Immun. **73*** , 4626–33 (2005).

34. Struve, C., Bojer, M. F. & Krogfelt, K. A. Characterization of Klebsiella pneumoniae type 1 fimbriae by detection of phase variation during colonization and infection and impact on virulence. *Infect. Immun. **76*** , 4055–65 (2008).

35. Horváth, M. et al. Virulence characteristics and molecular typing of carbapenem-resistant ST15 Klebsiella pneumoniae clinical isolates, possessing the K24 capsular type. *Antibiotics **12*** , 479 (2023).

36. Davis, J. J. et al. The PATRIC Bioinformatics Resource Center: expanding data and analysis capabilities. *Nucleic Acids Res. **48*** , D606–D612 (2020).

37. Rendueles, O. & Velicer, G. J. Hidden paths to endless forms most wonderful: complexity of bacterial motility shapes diversification of latent phenotypes. *BMC Evol. Biol. **20*** , 145 (2020).

38. La Fortezza, M., Rendueles, O., Keller, H & Velicer, G. J. Hidden paths to endless forms most wonderful: ecology latently shapes evolution of multicellular development in predatory bacteria. *Commun. Biol. **5*** , 977 (2022).

39. Wagner, A. The white-knight hypothesis, or does the environment limit innovations? *Trends Ecol. Evol. **32*** , 131–140 (2017).

40. Zheng, J., Payne, J. L. & Wagner, A. Cryptic genetic variation accelerates evolution by opening access to diverse adaptive peaks. *Science **365*** , 347–353 (2019).

41. Paaby, A. B. & Rockman, M. V. Cryptic genetic variation: evolution's hidden substrate. *Nat. Rev. Genet. **15*** , 247–258 (2014).

42. Lenski, R. Experimental evolution and the dynamics of adaptation and genome evolution in microbial populations. *ISME J. **11*** , 2181–2194 (2017).

43. de Visser, J. A. G. M. & Lenski, R. E. Long-term experimental evolution in Escherichia coli. *XI. Rejection of non-transitive interactions as cause of declining rate of adaptation*. *BMC Evol. Biol. **2*** , 19 (2002).

44. Sebghati, T. A., Korhonen, T. K., Hornick, D. B. & Clegg, S. Characterization of the type 3 fimbrial adhesins of Klebsiella strains. *Infect. Immun. **66*** , 2887–2894 (1988).

45. Kragh, K. N. et al. Role of multicellular aggregates in biofilm formation. *mBio **7*** , e00237 (2016).

46. Struve, C., Bojer, M. & Krogfelt, K. A. Characterization of Klebsiella pneumoniae type 1 fimbriae by detection of phase variation during colonization and infection and impact on virulence. *Infect. Immun. **76*** , 4055–65 (2008).

47. Horng, Y. T. et al. A protein containing the DUF1471 domain regulates biofilm formation and capsule production in Klebsiella pneumoniae. *J. Microbiol. Immunol. Infect. **55*** , 1246–1254 (2022).

48. De Majumdar, S. et al. Elucidation of the RamA regulon in Klebsiella pneumoniae reveals a role in LPS regulation. *PLoS Pathog. **11*** , e1004627 (2015).

49. Holden, E. R. & Webber, M. A. Rama, Rama, and SoxS as mediators of the stress response: survival at a cost. *Front. Microbiol. **11*** , 828 (2020).

50. Fouts, D. E. et al. Complete genome sequence of the N2-fixing broad host range endophyte Klebsiella pneumoniae 342 and virulence predictions verified in mice. *PLoS Genet. **4*** , e1000141 (2008).

51. Wu, K. M. et al. Genome sequencing and comparative analysis of Klebsiella pneumoniae NTUH-K2044, a strain causing liver abscess and meningitis. *J. Bacteriol. **191*** , 4492–501 (2009).

52. Brooks, T. & Keevil, C. W. A simple artificial urine for the growth of urinary pathogens. *Lett. Appl. Microbiol. **24*** , 203–6 (1997).

53. Fung, C. et al. Gene expression of Pseudomonas aeruginosa in a mucin-containing synthetic growth medium mimicking cystic fibrosis lung sputum. *J. Med. Microbiol. **59*** , 1089–100 (2010).

54. Carr, I. M. et al. Inferring relative proportions of DNA variants from sequencing electropherograms. *Bioinformatics **25*** , 3244–3250 (2009).

55. O'Toole, G. A. Microtiter dish biofilm formation assay. *J. Vis. Exp. **47*** , 2437 (2011).

56. Domenico, P., Schwartz, S. & Cunha, B. A. Reduction of capsular polysaccharide production in Klebsiella pneumoniae by sodium salicylate. *Infect. Immun. **57*** , 3778–82 (1989).

57. Blumenkrantz, N. & Asboe-Hansen, G. New method for quantitative determination of uronic acids. *Anal. Biochem. **54*** , 484–9 (1973).

58. Perrin, A. & Rocha, E. P. C. PanACoTA: a modular tool for massive microbial comparative genomics. *NAR Genomics Bioinform. **3*** , Iqaa106 (2021).

59. Nucci A., Rocha, E. P. C. & Rendueles, O. *Latent Evolution Of Biofilm Formation Depends On Life-history And Genetic Background*. Raw Data Sets figShare https://doi.org/10.6084/m9 figshare.22559890.
60. Jumper, J. et al. Highly accurate protein structure prediction with AlphaFold.
*Nature* **596**, 583–589 (2021).

## ACKNOWLEDGEMENTS

This work was funded by an ANR JCJC (Agence national de recherche) grant [ANR 18
CE12 0001 01 ENCAPSULATION] awarded to O.R. The laboratory is funded by a
Laboratoire d'Excellence 'Integrative Biology of Emerging Infectious Diseases' (grant
ANR-10-LABX-62-IBEID) and the FRM [EQU201903007835]. The funders had no role in
study design, data collection and interpretation, or the decision to submit the work
for publication.

## AUTHOR CONTRIBUTIONS

O.R. conceived and designed the details of the study with input from EPCR. O.R. and A.N. performed the experiments and the statistical analyses. O.R. performed the bioinformatics work, analysed the data and wrote the manuscript. O.R. and E.P.C.R. secured funding, provided the resources and materials necessary for this study and revised the manuscript. All authors approved the final version of the manuscript.

## COMPETING INTERESTS

The authors declare no competing interests.

## ADDITIONAL INFORMATION

**Supplementary information** The online version contains supplementary material available at https://doi.org/10.1038/s41522-023-00422-3.

**Correspondence** and requests for materials should be addressed to Olaya Rendueles.

**Reprints and permission information** is available at http://www.nature.com/reprints

**Publisher's note** Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

<figure><img src="image_10.png" /></figure>

**Open Access** This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/.

© The Author(s) 2023