Single mutation makes Escherichia coli an insect mutualist

Microorganisms often live in symbiosis with their hosts, and some are considered mutualists, where all species involved benefit from the interaction. How free-living microorganisms have evolved to become mutualists is unclear. Here we report an experimental system in which non-symbiotic Escherichia coli evolves into an insect mutualist. The stinkbug Plautia stali is typically associated with its essential gut symbiont, Pantoea sp., which colonizes a specialized symbiotic organ. When sterilized newborn nymphs were infected with E. coli rather than Pantoea sp., only a few insects survived, in which E. coli exhibited specific localization to the symbiotic organ and vertical transmission to the offspring. Through transgenerational maintenance with P. stali, several hypermutating E. coli lines independently evolved to support the host’s high adult emergence and improved body colour; these were called ‘mutualistic’ E. coli. These mutants exhibited slower bacterial growth, smaller size, loss of flagellar motility and lack of an extracellular matrix. Transcriptomic and genomic analyses of ‘mutualistic’ E. coli lines revealed independent mutations that disrupted the carbon catabolite repression global transcriptional regulator system. Each mutation reproduced the mutualistic phenotypes when introduced into wild-type E. coli, confirming that single carbon catabolite repression mutations can make E. coli an insect mutualist. These findings provide an experimental system for future work on host–microbe symbioses and may explain why microbial mutualisms are omnipresent in nature.

which were dwarf in size and dark in colour (Fig. 1h), tended to die early but some insects managed to survive, mate and produce a small number of eggs. We dissected and inspected these insects, and found that, surprisingly, although the symbiotic organ was atrophied ( Fig. 1i), E. coli localized to the midgut crypts just like the original symbiont, although the infection patterns were often patchy (Fig. 1j,k and Extended Data Fig. 2). Furthermore, E. coli cells were smeared on the eggshell and vertically transmitted to the offspring (Fig. 1l,m), although the transmission rates and the infection titres were unstable in comparison with those of the original symbiont (Fig. 1l). These results suggested that, although incipiently, E. coli is capable of localized infection, vertical transmission and supporting host survival in P. stali. Considering that E. coli belongs to the same Enterobacteriaceae as the original Pantoea symbiont, E. coli may be able to co-opt the mechanisms for infection and localization of the symbiont to establish the incipient symbiosis 10 . In this context, it seems relevant that, in the stinkbug family Pentatomidae, gut symbiotic bacteria have evolved repeatedly from the Enterobacteriaceae through recurrent acquisitions and replacements 15,16 .
Experimental evolution using hypermutating E. coli. This finding prompted us to apply experimental evolutionary approaches to the P. stali-E. coli relationship. By continuous inoculation to and maintenance with P. stali, would E. coli improve the symbiosis-related traits and finally evolve into a symbiont-like entity? Considering the expected difficulty in observing the evolution of elaborate symbiosis in a realistic time frame, we adopted the hypermutating the E. coli strain, ΔmutS, in which the DNA mismatch repair enzyme gene mutS is disrupted and the molecular evolutionary rate is elevated by two orders of magnitude 17 . The E. coli strain of the same genetic background, ΔintS, in which the phage integrase gene is disrupted without phenotypic consequences, was used as control. Two selection schemes, growth and colour selection, were conducted (Fig.  2). In growth selection lines (GmL for hypermutating ΔmutS lines; GiL for non-mutating ΔintS lines), the first-emerged adult insect was subjected to dissection of the symbiotic organ for inoculation to the next generation as well as freeze-storing (for example, GmL07G12 is Growth-selected ΔmutS Line 07, Generation 12). In colour selection lines (CmL for ΔmutS lines; CiL for ΔintS lines), the most greenish adult insect was subjected to dissection of the symbiotic organ for inoculation to the next generation as well as freeze storing (for example, CiL05G02 is Colour-selected ΔintS Line 05, Generation 02). Throughout the evolutionary experiments, the host insects were supplied from a mass-reared inbred population of P. stali, thereby homogenizing the host genetic background and focusing on the evolutionary changes of the E. coli side. Since it takes around 1 month for newborn nymphs of P. stali to become adults under the rearing condition, it was expected that, ideally, we would be able to run 12 host generations per year. Actually, however, it took almost two years because (1) the E. coli-inoculated insects generally exhibited high mortality and retarded growth, (2) for keeping the insects under a good condition, frequent care without overcrowding was essential, which limited the manageable number of insects per evolutionary line ranging from 50 to 100 and (3) consequently, extended generation time and stochastic extinction of the evolutionary lines occurred frequently, which had to be restarted from the frozen E. coli stocks.
Evolution of mutualistic E. coli. We established and maintained 12 CmL colour selection lines with 11 CiL control lines and 7 GmL growth selection lines with 7 GiL control lines (Fig.  3a,b). While the control ΔintS-infected lines almost constantly exhibited low adult emergence rates, some of the hypermutating ΔmutS-infected lines started to produce more adult insects. Notably, in the colour selection line CmL05, the adult emergence rate jumped up at generation seven and high emergence rates were maintained thereafter (Fig. 3a). In the growth selection line GmL07, the adult emergence rate improved as early as at generation two, which was maintained thereafter (Fig. 3b). In CmL05 and GmL07, coincident with the improvement of the adult emergence rate, the body colour of the adult insects improved from dark to greenish (Fig. 3a-c and Extended Data Fig. 3); furthermore, the colony morphology of E. coli changed from large and flat with rich extracellular matrix to small and convex with little extracellular matrix (Fig. 3c). When the frozen stocks of CmL05 and GmL07 were inoculated to P. stali, the improved adult emergence rate, the greenish body colour and the small and convex colony shape were reproducibly observed (Fig. 3d,e and Extended Data Fig. 4). These results indicated that some evolutionary lines of hypermutating E. coli have evolved mutualistic traits for the host insect and that the phenotypic effects are attributable to genetic changes in the evolutionary E. coli lines.
Microbial traits of mutualistic E. coli. In addition to colony size, shape and extracellular matrix on agar plates (Fig. 3c) Table 1). Interestingly, the gene expression patterns of E. coli at generations 7-14 after the improvement of host phenotypes were separately clustered in contrast to those at generations 1-6 before the improvement (Fig. 5a). In the growth selection line GmL07, similarly, the gene expression patterns of E. coli at generations 2-12 after the improvement were distinct from that at generation 1 before the improvement and also from those of the other growth selection lines GmL02 and GmL04 in which the improvement of host phenotypes did not occur (Fig. 5b). These results suggested that the evolution of the mutualistic E. coli lines entails a specific and global change of gene expression patterns.
In the growth selection line GmL07 and colour selection line CmL05, we surveyed differentially expressed genes before and after the improvement of host phenotypes, which identified 193 commonly downregulated genes and 95 commonly upregulated genes across GmL07 and CmL05 (Extended Data Fig. 6a,b)  The improved lines CmL05 and GmL07 and the non-improved lines GmL02 and GmL04 were subjected to genome sequencing throughout the evolutionary course (Supplementary Table 2), which identified many mutations accumulated in the hypermutating E. coli lines (Extended Data Fig. 7 and Supplementary Table 3). In an attempt to identify candidate mutations that are correlated with the improvement of the host's phenotype, we surveyed the mutations that appeared at generation seven of CmL05 and then fixed, which yielded seven candidate genes, and also the mutations that appeared downregulated genes contained a number of metabolism-related genes, such as transporter genes for sugars and other nutrients like maltose, ribose, galactitol, trehalose, mannose and branched chain amino acids, glyoxylate bypass genes, fatty acid degradation genes and others. Notably, core genes involved in extracellular matrix (= Curli fimbriae) production were significantly downregulated after the improvement (Extended Data Fig. 6c), which likely accounted for the altered colony morphology of E. coli associated with the improvement of host phenotypes (Fig. 3c).  evolutionary E. coli lines, we prepared E.coli strains that carry the mutations under the wild-type (WT) genetic background: the strain ΔcyaA in which the cyaA gene is disrupted; and the strain crp 221T>C whose crp gene was engineered to carry the leucine-proline replacement at the cAMP binding site. Both mutant E. coli strains exhibited small and convex colonies with little extracellular matrix, somewhat slower growth rate, smaller cell size and loss of flagellar motility ( Fig. 6a and Extended Data Fig. 10a-e), which were generally reminiscent of the characteristic traits of the improved evolutionary E. coli lines CmL05 and GmL07 ( Fig. 3c and Fig. 4a-e). When the mutant E. coli strains were inoculated to sterilized newborn nymphs of P. stali, both the ΔcyaAand crp 221T>C -infected insects exhibited remarkably high adult emergence rates, which were comparable to the insects infected with the improved evolutionary E. coli lines and were significantly higher than the insects infected with the control E. coli strains (Fig. 6b). Moreover, the ΔcyaAand crp 221T>C -infected insects were greenish in colour, which were comparable to the greenish insects infected with the improved evolutionary E. coli lines and distinct from the dwarf brown insects infected with the control E. coli strains (Fig. 6c). On the other hand, the infection densities of crp 221T>C and ΔcyaA were not comparable to those of the improved evolutionary E. coli lines (Extended Data Fig. 10f). These results demonstrated that, strikingly, the single mutations that disrupt the CCR global regulator system make E. coli mutualistic to the host insect P. stali.

Discussion
We established an experimental insect-E. coli symbiotic system in which the model bacterium is localized to the host symbiotic organ, transmissible to the host offspring vertically and supportive of host survival, although not comparable to the original symbiont. By infecting and passaging a hypermutating E. coli strain with the host insect trans-generationally, several evolutionary lines rapidly developed improved adult emergence and body colour, realizing recurrent evolution of mutualism in the laboratory. Strikingly, the evolution of E. coli into insect mutualist was ascribed to single mutations that convergently disrupted the bacterial CCR pathway, uncovering unexpected involvement of the nutrient-responsive global transcriptional regulator in the establishment of symbiosis. Our finding sheds light on the evolvability of symbiosis-elaborate mutualistic symbiosis can evolve much more easily and rapidly than conventionally envisaged. We suggest the possibility that the inactivation of the CCR global regulator may represent a pivotal evolutionary step at an early stage of symbiosis. Densely packed in the symbiotic organ, symbiotic bacteria are expected to constantly suffer nutritional shortage and activate the CCR pathway in vain, which may incur substantial metabolic cost and destabilize the symbiotic association. In this context, the disruption of the CCR pathway should benefit and stabilize symbiosis. Our finding may also be relevant to the general evolutionary trend of symbiont genomes towards size reduction 26,27 and lack of transcription factors 28,29 .
at generation two of GmL07 and then fixed, which yielded nine candidate genes (Fig. 5c).
Disrupted carbon catabolite repression pathway in mutualistic E. coli. Of these candidates, we focused on a frameshift mutation that disrupted adenylate cyclase (CyaA) in CmL05 and a non-synonymous mutation that changed a functionally important cAMP binding site of the cAMP receptor protein (Crp) from leucine to proline in GmL07 (Fig. 5d). Despite their independent origins in distinct evolutionary lines, CyaA and Crp are pivotal components of the same global metabolic regulatory system, the carbon catabolite repression (CCR) pathway, operating in diverse bacteria including E. coli 18,19 (Fig. 5e).
With sufficient availability of glucose as the primary carbon source for E. coli, the CCR components are subjected to glucose-mediated suppression, being in an unphosphorylated form incapable of activating CyaA, by which the intracellular cAMP is maintained at a low level (Extended Data Fig. 8a). When glucose is used up, the glucose-mediated suppression is released, by which the CCR components are phosphorylated and activate CyaA, which results in an elevated intracellular cAMP level and promotes allosteric binding of cAMP to Crp. The resultant global transcriptional regulator Crp-cAMP activates and/or represses several hundreds of operons throughout the bacterial genome, referred to as the Crp-cAMP regulon, by which the bacterial metabolic pathways are switched to exploit other carbon sources for adaptation to nutrient-deficient and/or high bacterial density conditions (Extended Data Fig. 8b) 20,21 . According to RegulonDB 22 , the Crp-cAMP regulon of E. coli consists of some 390 upregulated genes and 80 downregulated genes (Extended Data Fig. 8c), which are involved in, for example, upregulation of transporters and catabolic enzymes for non-glucose sugars 23 , quorum sensing induction 24 and production of extracellular matrix 25 .
Both the cyaA mutation in CmL05 and the crp mutation in GmL07 are disruptive of the CCR pathway. Considering that E. coli cells are packed in the host symbiotic organ very densely ( Fig. 1k and Extended Data Fig. 2i,k), it seems likely that the symbiotic E. coli may be under a nutrient-limited condition in the host insect, at least locally. If so, it is expected that, in the evolutionary E. coli lines, while the Crp-cAMP transcriptional regulator was activated before the mutations occurred, the activation was disabled after the mutations occurred. Notably, of 193 genes commonly downregulated after the yaA mutation in CmL05 and the crp mutation in GmL07, 55 genes were reported as being activated by Crp-cAMP (Extended Data Fig. 9a). These genes, which are expected to be silenced on disruption of the CCR system, were significantly downregulated in CmL05 and GmL07, which represented many transporter genes for non-glucose sugars, carbohydrate metabolism genes, quorum sensing genes, extracellular matrix production genes, transcription factor genes and others (Extended Data Fig. 9b-i).

Disrupted CCR genes make E. coli an insect mutualist.
To test whether these mutations are involved in the mutualistic traits of the regulators and genome size reduction might have concurrently proceeded in this way during the symbiont genome evolution.
On the other hand, we found that the original symbiont of P. stali retained the complete CCR pathway genes, although the uncultivable symbiont accumulated hundreds of pseudogenes in the genome 10 . Plausibly, the CCR disruption observed in the evolutionary The disruption of the CCR pathway causes silencing of otherwise activated about 400 genes under the Crp-cAMP regulon 22 , which accounts for about 10% of the whole E. coli genome and provides potential targets for gene disruption, IS amplification and insertion, intragenomic recombination and reductive genome evolution. We propose that, although speculative, inactivation of transcriptional c e d f g h 4.5-5.5 megabase genome encodes over 4,000 genes and around 70% of them carry functional information 31,32 . Laboratory evolution of mutualism using such a model bacterium with ample technological and genetic resources will lead to understanding of previously unapproachable evolutionary aspects of symbiosis. Considering that E. coli represents a universal component of the gut microbiome of human, mouse and other vertebrates 33,34 , the insect-E. coli system in combination with the germ-free mouse-E. coli experimental E. coli lines may represent one of multiple possible evolutionary trajectories towards symbiosis with P. stali and we expect that other mechanisms would be uncovered by larger scale and longer-span evolutionary experiments. The P. stali-E. coli experimental symbiotic system will open a window to directly observe and analyse the evolutionary processes and mechanisms of mutualistic symbiosis in real time. E. coli is among the best understood cellular organisms 30 , whose  Construction of E. coli mutants. The E. coli mutant ∆intS was established by replacing the intS gene of E. coli BW25113 with the nptII gene that confers kanamycin resistance by λ-Red homologous recombination using the pRed/ET plasmid (Gene Bridges GmbH). The E. coli mutant ∆mutS was established by replacing the mutS gene of ∆intS with the FRT-Cm-FRT cassette (Gene Bridges GmbH) by λ-Red homologous recombination; then Cm R was eliminated by Flp-FRT recombination. The E. coli mutant crp 221T>C was established from ∆intS by replacing the 221st nucleotide T of the WT crp gene with C, which changed the 74th amino acid leucine of the Crp protein to proline. This replacement was introduced by the MAGE method 37,38 with a 90-mer DNA oligonucleotide (5′ -taaagaaatg-atcctctcct-atctgaatca-gggtgatttt-attggcgaac-Cgggcctgtt-tgaagagggccaggaacgta-gcgcatgggt-3′) whose 1st to 4th nucleotides were phosphorothioated.
To establish the revertant of crp 221T>C (crp 221C>T ), a 90-mer oligonucleotide (5′ -taaagaaatg-atcctctcct-atctgaatca-gggtgatttt-attggTgaac-Tgggcctgtt-tgaagagggccaggaacgta-gcgcatgggt-3′) was used. This oligonucleotide was designed not only to revert the 221st nucleotide but also replace the 216th nucleotide C to T to introduce a synonymous mutation, which allowed us to discriminate the resultant revertant clone from the unmodified WT.
Preparation of symbiont-free nymphs by surface sterilization of eggs. Egg clutches produced by the stock culture of P. stali were soaked in 4% formaldehyde for 10 min, rinsed with sterilized water several times and kept in sterilized plastic boxes until use. While this treatment does not affect hatchability and survival of the eggs, newborn nymphs fail to acquire the symbiotic bacteria and become symbiont-free 11 . Either diluted E. coli culture (2.5 ml adjusted to OD 600 = 0.1) or homogenate of the symbiotic organ dissected from a selected female of the previous generation (2.5 ml containing 1/2 organ equivalent) was soaked in a cotton pad and orally administered to around 84 symbiont-free hatchlings derived from 6 surface-sterilized egg masses, by making use of the nymphal behaviour that, after egg surface probing for about 30 min and resting for around 1 d, they take water without feeding and moult to second instar in a few days 10,11 . These nymphs were reared on sterilized peanuts, soya beans and ascorbic acid water as described previously 11 . In the evolutionary experiments, two selection schemes, growth and colour selection, were conducted (Fig. 2). In the growth selection lines (GmL for hypermutating ΔmutS lines; GiL for non-mutating ΔintS lines), the first-emerged adult female was subjected to dissection of the symbiotic organ for inoculation to the next generation as well as freeze storing. In the colour selection lines (CmL for the ΔmutS lines; CiL for the ΔintS lines), adult females were collected for 35 d after hatching or until at least 1 adult female emerged. These adult females were anaesthetized on ice and photographed from the ventral side using a digital camera. Their body colour was measured using the image analysing software Natsumushi v.1.10 (ref. 39 ); the adult female that exhibited the highest hue angle (= greenness) was subjected to dissection of the symbiotic organ for inoculation to the next generation as well as freeze-storing.
The symbiotic organ of the selected female was dissected in PBS (0.8% NaCl, 0.02% KCl, 0.115% Na 2 HPO 4 , 0.02% KH 2 PO 4 , pH 7.4), rinsed with 70% ethanol and homogenized in 200 µl sterile water. Of the 200-µl homogenate, 5 µl was used for contamination checking by quantitative PCR (qPCR). The number of E. coli genome copies was evaluated in terms of kanamycin resistance gene copies, which are present in the ΔintS and ΔmutS mutants but absent in WT E. coli and other bacteria. The number of total bacterial genome copies was evaluated based on bacterial 16S ribosomal RNA gene copies. When the former E. coli genome copy number was approximately the same as the latter bacterial genome copy number, the specimen was diagnosed as free of contamination. When the specimen was diagnosed as contaminated, the next best female was used. For qPCR, the primers Tn5-1789F (5′-TGCTCGACGTTGTCACTGAA-3′) and Tn5-1879R (5′ -GCAGGAGCAAGGTGAGATGA-3′) were used for the kanamycin resistance gene, while the primers 16S-967F (5′-CAACGCGAAGAACCTTACC-3′) and 16S-1046R (5′-CGACAGCCATGCANCACCT-3′) were used for the bacterial 16S rRNA gene. The PCR reaction was performed using the Brilliant PCR Mix (Agilent Technologies). The standard curve was drawn using serially diluted ∆intS genomic DNA, which contains one kanamycin gene copy and seven 16S rRNA gene copies per genome. The thermal profile was the initial denaturation at 95 °C for 3 min followed by 40 cycles of incubation at 95 °C for 5 s and at 60 °C for 10 s. To confirm specific amplification, melting curve analysis was also included. The reaction was conducted on Mx3000p (Agilent Technologies). While 100 µl of the homogenate of the female symbiotic organ diagnosed as free of contamination was used as the evolution systems 35,36 would enable us to pursue not only the differences but also the commonality underpinning the mechanisms of gut symbiosis across vertebrates and invertebrates.

Methods
Insect and bacterial strains used in this study. An inbred laboratory strain of the brown-winged green stinkbug P. stali was established from several adult insects collected at Tsukuba, Ibaraki, Japan in September 2012 and has been maintained in the laboratory for years. This strain is associated with an essential and uncultivable gut symbiont Pantoea sp. A 10 in the posterior midgut region specialized as the symbiotic organ ( Fig. 1 and Extended Data Fig. 2). The insects were reared on raw peanuts, soya beans and water containing 0.05% ascorbic acid (Merck) at 25 ± 1 °C and 50 ± 5% relative humidity under a long-day regime of 16 h light and 8 h dark. The E. coli strains and mutants used in this study are listed in Supplementary Table  4. The mutants ∆intS, ∆mutS and crp 221T>C were generated as described later. For time-lapse analyses of growth and morphology of individual E. coli cells, two types of microfluidic devices were used. One type was a microfluidic device where bacterial cells were enclosed in microchambers etched on a glass coverslip. A cellulose membrane was attached to a coverslip via biotin-streptavidin binding, on which the microchambers were created as described elsewhere 44,45 . Another type was a microfluidic device made of polydimethylsiloxane with a channel structure similar to Mother Machine as described by Wang et al. 46 (Fig. 4f). The width of the cell observation channels in this device was 9 µm, which was broader than that of the Mother Machine; thus, each cell observation channel could harbour 30-70 individual E. coli cells depending on cell size. E. coli cells in the exponential phase were introduced into both types of microfluidic devices and observed under a Nikon Ti-E microscope equipped with an ORCA-fusion camera (Hamamatsu Photonics). In the time-lapse measurements, phase-contrast images were acquired with a 100× oil immersion objective lens (plan apochromat, numerical aperture 1.45) at an interval of 3 min, in which 50-100 XY positions were simultaneously observed. The microscope was controlled from a computer using Micro-Manager v.4. In the microchamber device measurements, lysogeny broth was supplemented with 0.1% bovine serum albumin and 0.02% Tween-80 to suppress cell adhesion and was introduced into the devices at a flow rate of 2 ml h −1 .
For measurements of size and flagellar motility, E. coli cells were grown in lysogeny broth medium with shaking at 25 °C to around OD 600 = 2.0, observed under a phase-contrast microscope IX71 (Olympus), recorded by a charge-coupled device camera DMK33UP5000.WG (The Imaging Source) at 30 frames per second and analysed using ImageJ v.1.53 (ref. 40 ) and IGOR Pro 8.02J (WaveMetrics). The cell size data were measured for six individual cultures. The swimming ratio data were obtained as the number of swimming cells in 100 cells from 8 individual cultures.

Statistics and reproducibility.
Statistical analyses were conducted with R v.4.1.2 (ref. 47 ) and RStudio 48 . R was also used to plot the data. No statistical methods were used to predetermine sample sizes, but our sample sizes are similar to those reported in previous publications 10,11,14 . All data points were plotted as long as applicable. Data distribution was assumed to be normal but this was not formally tested. For Reporting summary. Further information on research design is available in the Nature Research Reporting Summary linked to this article.

Data availability
All RNA and DNA sequencing data produced in this study were deposited in the DNA Data Bank of Japan (DDBJ) Sequence Read Archive (Supplementary  Tables 1 and 2). The data have been deposited with links to BioProject accession no. PRJDB5544 in the DDBJ BioProject database. Source data are provided with this paper.
Inoculation of E. coli frozen stocks to P. stali. The frozen glycerol stocks were thawed; 50 μl was taken and diluted with sterile water to 3 ml. Each of 3 replicates of around 84 symbiont-free hatchlings from 6 surface-sterilized egg masses was fed with 1 ml inoculum soaked in a cotton pad as described above. The symbionts A and ΔmutS were included in the evaluation as positive and negative controls, respectively. Adult emergence of the insects was monitored for 50 d after hatching. All the adult insects were photographed from the dorsal side with a digital camera; the hue angle (= greenness) of the scutellum and thorax width were measured with ImageJ v.1.53 40 . For the subsequent RNA sequencing (RNA-seq) analyses and resequencing of E. coli genomes, the symbiotic organs were isolated from the adult insects and homogenized in 100 µl PBS. Of the 100 µl homogenate, 50 µl was subjected to RNA-seq and the remaining 50 µl was used for genome resequencing.
Infection of E. coli mutants and effects on host phenotypes. E. coli mutants were cultured, diluted and orally administrated to symbiont-free newborn nymphs of P. stali as described above. The insects were reared to monitor their adult emergence for 42 d after hatching. The dorsal images of the adults were taken with an image scanner GT-X830 (Epson) and the hue angle of the scutellum and thorax width was measured and analysed using the Natsumushi software v.1.10 39 . P. stali harbouring the original symbiont Pantoea sp. A was also included as a reference. As for the adult females infected with E. coli, bacterial titres in the symbiotic organs were measured by qPCR. The KAPA SYBR FAST qPCR Kit (Roche) and Tn5-1789F and Tn5-1879R primer sets were used for quantification. The standard curves were drawn using serially diluted pT7Blue (Takara Bio) plasmid carrying a kanamycin resistance gene fragment. The qPCR reactions were conducted on the Light Cycler 96 (Roche).

Measurement of E. coli phenotypes.
To inspect colony morphology and extracellular matrix production, E. coli cultures were spread onto lysogeny broth agar plates containing 80 µg ml −1 Congo Red (Merck) and incubated at 25 °C for 3 d. Colonies formed on the plate were photographed by using a scanner GT-X850 and/or dissection microscope S9i (Leica Microsystems).
For growth curve measurements, each glycerol stock of E. coli was inoculated to 2 ml lysogeny broth (Becton Dickinson) and incubated at 25 °C for 16 h with shaking at 200 r.p.m. The cell culture was diluted to OD 600 = 0.005 in 25 ml lysogeny broth and incubated at 25 °C with shaking at 200 r.p.m. From the bacterial culture, 120 µl of cell suspension was sampled every hour and samples were subjected to the measurement of OD 600 using a spectrometer UV-1800 (Shimadzu).  49 . g,h, Magnified images of the end crypts infected with E. coli (g) and Sym A (h). Note that E. coli-infected end crypts are atrophied in comparison with Sym A-infected ones. i,j, Localization of E. coli (i) and Sym A (j) in the crypt cavities of the symbiotic organ. k,l, Magnified images of E. coli cells (k) and Sym A cells (l) packed in the crypt cavity. m,n, Patchy localization patterns of E. coli in the symbiotic organ, which are often found with E. coli but seldom observed with Sym A. Red signals represent the distribution of bacteria, except for red autofluorescence of ovaries in (a) and (b). j is reconstructed by merging five microscopic images. The level adjustment without non-linear change is applied to the images. Corresponding author(s): Takema Fukatsu Last updated by author(s): Jun 6, 2022 Reporting Summary Nature Portfolio wishes to improve the reproducibility of the work that we publish. This form provides structure for consistency and transparency in reporting. For further information on Nature Portfolio policies, see our Editorial Policies and the Editorial Policy Checklist.

Statistics
For all statistical analyses, confirm that the following items are present in the figure legend, table legend, main text, or Methods section.

n/a Confirmed
The exact sample size (n) for each experimental group/condition, given as a discrete number and unit of measurement A statement on whether measurements were taken from distinct samples or whether the same sample was measured repeatedly The statistical test(s) used AND whether they are one-or two-sided Only common tests should be described solely by name; describe more complex techniques in the Methods section.
A description of all covariates tested A description of any assumptions or corrections, such as tests of normality and adjustment for multiple comparisons A full description of the statistical parameters including central tendency (e.g. means) or other basic estimates (e.g. regression coefficient) AND variation (e.g. standard deviation) or associated estimates of uncertainty (e.g. confidence intervals) For null hypothesis testing, the test statistic (e.g. F, t, r) with confidence intervals, effect sizes, degrees of freedom and P value noted For manuscripts utilizing custom algorithms or software that are central to the research but not yet described in published literature, software must be made available to editors and reviewers. We strongly encourage code deposition in a community repository (e.g. GitHub). See the Nature Portfolio guidelines for submitting code & software for further information.

Data
Policy information about availability of data All manuscripts must include a data availability statement. This statement should provide the following information, where applicable: -Accession codes, unique identifiers, or web links for publicly available datasets -A description of any restrictions on data availability -For clinical datasets or third party data, please ensure that the statement adheres to our policy The RNAseq and DNAseq reads generated and analyzed in this study are available in the DDBJ (DRA run acc nos. DRR088471--DRR088509, DRR088509 and DRR330401-DRR330422). All other source data and statistical data are provided with the paper.