Contrary to Lp or Eco, Ecc or Bt bacteria are found exclusively in the anterior part of the gut.

A: Pictures to illustrate the position of the green fluorescence of control (CantonS) L3 stage larvae as a group (upper panel) or individual (lower panel) after having been fed 1h with a media containing yeast and GFP-producing bacteria (Ecc or Bt or Lp). The white asterisk indicates the anterior part of the animal. The white arrow indicates the posterior limit of the area containing the fluorescent bacteria. Below the pictures are schematics representing larvae, their gut, and the relative position of the GFP-producing bacteria in green. Scale bar is 1mm.

B: Graphic representing the blockage ratio for CantonS (ctrl) L3 larvae exposed during 1h to a mixture composed of yeast and fluorescent bacteria: Lp or Escherichia coli (Eco) or Ecc or Bt. The ratio of control larvae with a distinguishable green fluorescence only in the upper part of the intestine, considered as blocked bacteria, is represented. The ratio is calculated as: x larvae with bacteria exclusively in the anterior part of the gut / (x larvae with bacteria exclusively in the anterior part of the gut + y larvae with bacteria all along the gut). Larvae with no distinguishable fluorescence were considered as non-eaters and discarded from the quantifications. The ratio of larvae with no distinguishable fluorescence was not influenced by the different conditions we tested. Shown is the average blockage ratio with a 95% confidence interval from at least 3 independent assays with at least 30 animals per condition and trial. **** indicates p<0,0001, Fisher exact t-test. See the source data file for details.

C: Blockage ratio for L3 larvae of w1, Oregon or w1118 isogenized genotypes fed during various times with a mixture combining yeast with Lp, Ecc or Bt. Shown is the average blockage ratio with a 95% confidence interval from at least 3 independent assays with at least 100 animals in total. The 0 symbol indicates an absence of blockage, **** indicates p<0,0001, Fisher exact t-test. See the source data file for details.

Bacterial blockage is dose-dependent, occurs in less than 30 minutes, and does not involve a group effect.

A: Blockage ratio for control L3 larvae fed 1h with a mixture combining yeast with different concentrations of fluorescent Ecc or Bt, concentrations are in number of bacteria per ml. Shown is the average blockage ratio with a 95% confidence interval from at least 3 independent assays with at least 18 animals per condition and trial. **** indicates p<0,0001, Fisher exact t-test. See the source data file for details.

B: Representative images of control larvae fed during 30 min. with Bt. Scale bar is 1mm.

C: Blockage ratio for control L3 larvae fed during various times with a mixture combining yeast with Ecc or Bt. Shown is the average blockage ratio with a 95% confidence interval from at least 3 independent assays with at least 20 animals per condition and trial. ns indicates values with differences not statistically significant, **** indicates p<0,0001, Fisher exact t-test. See the source data file for details.

D: Blockage ratio for control L3 larvae fed 1h as individual animals or as groups of 10 or >40 with a mixture combining yeast with a constant concentration of Ecc or Bt (4.1010 bacteria per ml). Shown is the average blockage ratio with a 95% confidence interval from at least 3 independent assays with the exact number of animals indicated per condition and trial. ns indicates values with differences not statistically significant, Fischer exact t-test. See the source data file for details.

The bacterial blockage necessitates Duox in enterocytes, the TrpA1 channel and Dh31 in Pros+ cells.

A: Pictures to illustrate the localization of the fluorescent bacteria within the intestine of control (ctrl), TrpA11 or Dh31KG09001 L3 larvae after having been fed 1h with a mixture of yeast and Ecc. Scale bar is 1mm.

B: Blockage ratio for control (ctrl) L3 larvae or mutants for TrpA11or Dh31KG09001 fed 1h with a mixture combining yeast and Lp or Ecc or Bt or fluorescent Dextran with or without hCGRP hormone. Shown is the average blockage ratio with a 95% confidence interval from at least 3 independent assays with at least 30 animals per condition and trial. 0 indicates an absence of blockage. **** indicates p<0,0001, Fisher exact t-test. See the source data file for details.

C: Pictures to illustrate the localization of the fluorescence within the intestine of control L3 larvae after having been fed 1h with a mixture of yeast and fluorescent Dextran with or without hCGRP hormone. Below the pictures are schematics representing larvae, their gut, and the relative position of the fluorescence in green. Scale bar is 1mm.

D: Blockage ratio for animals expressing RNA interference constructions directed against Duox mRNA or Dh31 mRNA, ubiquitously (Da-Gal4), in enterocytes (Mex-Gal4) or in enteroendocrine cells (Pros-Gal4) and then fed 1h with a mixture combining yeast and Ecc or Bt. Shown is the average blockage ratio with a 95% confidence interval from at least 3 independent assays with at least 30 animals per condition and trial. ns indicates values with differences not statistically significant, **** indicates p<0,0001, Fisher exact t-test. See the source data file for details.

Blocking the ROS with DTT prevents the compartmentalization of Bt, and the larvae with bacteria in the posterior part of the intestine die.

A: Pictures to illustrate the localization of the fluorescence within the intestine of control (ctrl) L3 larvae after having been fed 1h with a mixture of yeast and Bt with or without DTT. Below the pictures are schematics representing larvae, their gut, and the relative position of the fluorescent bacteria in green. Scale bar is 1mm.

B: Blockage ratio for control (ctrl) L3 larvae fed 1h with a mixture combining yeast, DTT and fluorescent Dextran or Bt. Shown is the average blockage ratio with a 95% confidence interval from at least 3 independent assays with at least 18 animals per condition and trial. ns indicates values with differences not statistically significant, Fisher exact t-test. See the source data file for details.

In the absence of blockage in TrpA11 or Dh31KG09001 mutants, Bt and Ecc proliferate in the larval intestine and the larvae die.

A, B and C: quantification over time of the amount of Lp, (A), Bt (B) or Ecc (C) live bacteria within the larval intestine of control (ctrl) (A, B and C), Dh31KG09001 (B and C) and TrpA11 (B and C) animals following a 1h feeding period with a solution containing yeast and bacteria. CFU stands for Colony Forming Units. Shown is the average ± SEM of at least 3 independent experiments with at least 7 guts each. After 8h, either all the TrpA11 or Dh31KG09001 larvae were dead or the intestines were severely damaged preventing the CFU counting. * Indicates p<0,05, Mann Whitney, two-tailed test. See the source data file for details.

D: Pictures of control (ctrl) or TrpA11 or Dh31KG09001larvae after 8h in a wet chamber following a 1h feeding with a mixture of yeast and Bt. For control larvae, some animals made pupae that are visible while for TrpA11 and Dh31KG09001 mutants, the dark larvae are dead non-moving melanized animals. Scale bar is 1mm.

E: Ratio of dead control or TrpA11 or Dh31KG09001larvae after 8h in a wet chamber following or not (water) a 1h feeding period with yeast mixed with Lp or Ecc or Bt. Shown is the average with 95% confidence interval of at least 3 independent experiments with at least 21 larvae per trial and condition. The 0 symbol indicates an absence of lethality. **** indicates p<0,0001, Fisher exact t-test. See the source data file for details.

F: Ratio of dead control (ctrl) larvae after 8h in a wet chamber following a 1h feeding period with a mixture combining yeast, DTT and Dextran fluorescent beads or Bt.

Shown is the average with 95% confidence interval of at least 3 independent experiments with at least 18 larvae per trial and condition. The 0 symbol indicates an absence of lethality. **** indicates p<0,0001, Fisher exact t-test. See the source data file for details.

TrpA1+ cells in the gut are enteroendocrine cells concentrated in a portion of the intestine bordering the blocked bacteria.

Confocal fluorescent pictures of the anterior portions of L3 larval intestines to detect; longitudinal and transversal muscles concentrated in actin (F, G, H and H’), TrpA1+ cells producing RFP (A, A’, B, C, C’’ and F), GFP-bacteria (B, G and H), Dh31+ cells (C’, C’’, D and E), Pros+ cells (D and E) and nuclei with DNA staining (A, A’, B, C’’, D, E and G).

In B, D, E, G, H and H’; animals were previously fed for 1h with a mixture containing bacteria and yeast with Bt (B, D and E) or Ecc (G, H and H’). When present, the white star indicates the anterior part of the intestinal portion shown, the arrows point to TARMs and the > symbols point to TrpA1+ cells. The empty squares in A and H with dashed lines correspond to the portion of the image magnified in A’ and H’, respectively. Scale bar in A, B, F, G and H represents 500µm, in A’, C, D, E and H’ represents 100 µm.

IMD pathway is not required for the blockage but essential for larvae survival and Bt or Ecc clearance.

A: Pictures to illustrate the localization of the fluorescence within the intestine of PGRP-LCΔE L3 larvae after having been fed 1h with a mixture of Lp or Ecc or Bt. Scale bar is 1mm.

B: Blockage ratio for control L3 larvae or mutants of the IMD pathway fed 1h with a mixture combining yeast and Lp or Ecc or Bt. Shown is the average with 95% confidence interval of at least 3 independent experiments with at least 20 larvae per trial and condition. ns indicates values with differences not statistically significant, Fisher exact t-test. See the source data file for details.

C: Pictures of PGRP-LCΔE, RelE20 or ΔAMP14 mutant larvae after 18h in a wet chamber following a 1h feeding with a mixture of yeast and Bt. The dark larvae are dead non-moving melanized animals. ΔAMP14 is a mutant deleted for 14 antimicrobial-encoding genes.

D: Ratio of dead control or TrpA11 or Dh31KG09001larvae after 18h in a wet chamber following or not (water) a 1h feeding period with yeast mixed with Lp or Ecc or Bt. Shown is the average with 95% confidence interval of at least 3 independent experiments with at least 20 larvae per trial and condition. The 0 symbol indicates an absence of lethality. **** indicates p<0,0001, Fisher exact t-test. See the source data file for details.

E and F: quantification over time of the amount of Bt (A) and Ecc (B) live bacteria within the larval intestine of control or IMD pathway mutant animals including ΔAMP14 following a 1h feeding period with a solution containing yeast and bacteria. CFU stands for Colony Forming Units. ΔAMP14 is a mutant deleted for 14 antimicrobial-encoding genes. Shown is the average ± SEM of at least 3 independent experiments with at least 7 guts each. After 8h, either all the mutants were dead or the intestines were severely damaged preventing the CFU counting. * Indicates p<0,05, Mann Whitney, two-tailed test. See the source data file for details.

Chronological coordination of ROS/TrpA1/Dh31 and IMD pathways for an efficient microbial elimination.

t0: larvae ingest bacteria from the food mixture (anterior on the left, only bacteria similar to Ecc or Bt are illustrated). This initial phase necessitates a discrimination between commensal and pathogenic bacteria, not elucidated in this study (symbolized by ‘?’). The presence of pathogenic bacteria induces the production of ROS by enterocytes (EC) in a Duox-dependent manner. Then ROS activates TrpA1 in enteroendocrine cells (EEC). t15 minutes: Dh31 secretion by EEC is responsible for the blockage of bacteria likely by promoting visceral muscle contractions leading to a closure of a valve-like structure. This phenomenon concentrates the bacteria in the anterior part of the gut. The bacterial concentration in this part of the intestinal lumen may facilitate the triggering of the IMD signaling cascade that controls the transcription of the genes (AMPs) encoding the antimicrobial peptides (AMPs). t6 hours: the valve-like structure is still closed. The bactericidal activity of AMPs has eliminated most of the bacteria accumulated in the anterior part of the intestine. Importantly, if confinement is prevented, the larvae die; if the response by antimicrobial peptides is hindered, the larvae die.

Ecc and Bt are blocked in the anterior part of the intestine and disappear while Lp transits to the posterior part and remains.

A: Timelapse from the movies of L3 Larvae fed 1h with a mixture of yeast and Ecc then transferred on a glass slide, in a wet chamber, to be imaged overnight. Refers to Movie 1.

B: Timelapse from the movies of L3 Larvae fed 1h with a mixture of yeast and Bt then transferred on a glass slide, in a wet chamber, to be imaged overnight. Refers to Movie 2.

C: Timelapse from the movies of L3 Larvae fed 1h with a mixture of yeast and Lp then transferred on a glass slide, in a wet chamber, to be imaged overnight. Refers to Movie 3.

For A-C, the frames are separated by 5 minutes.

Contrary to Lp, Ecc or Bt bacteria are blocked in the anterior part of the gut.

A: Graphic representing the blockage ratio for dissected intestines of L3 larvae exposed during 1h to a mixture composed of yeast and fluorescent bacteria. Shown is the average blockage ratio with a 95% confidence interval from at least 3 independent assays with at least 8 organs per condition and trial. **** indicates p<0,0001, Fisher exact t-test. See the source data file for details.

B: Picture to illustrate the position of the green fluorescence of control (CantonS) L3 stage larvae as a group after having been fed 20h with a media containing yeast and GFP-Bt. The white asterisk indicates the anterior part of the animals. Scale bar is 1mm.

Ecc is not blocked anteriorly in TrpA11 and Dh31KG09001 mutants, persists in the posterior part of the intestine and disappears while Lp can be blocked following exogenous addition of hCGRP.

A: Timelapse from the movies of TrpA11 L3 Larvae fed 1h with a mixture of yeast and Ecc then transferred on a glass slide, in a wet chamber, to be imaged overnight. Refers to Movie 4.

B: Timelapse from the movies of Dh31KG09001L3 Larvae fed 1h with a mixture of yeast and Ecc then transferred on a glass slide, in a wet chamber, to be imaged overnight. Refers to Movie 5.

C: Timelapse from the movies of w- L3 Larvae fed 1h with a mixture of yeast and Lp + hCGRP then transferred on a glass slide, in a wet chamber, to be imaged overnight. Refers to Movie 6.

For A-C, the frames are separated by 5 minutes.

RNAi interference of Dh31 in a specific subset of enteroendocrinal cells impairs the blockage phenotype.

Blockage ratio for animals expressing RNA interference constructions directed against Dh31 mRNA, in a subset of enteroendocrine cells (DJ752-Gal4) and then fed 1h with a mixture combining yeast and Ecc or Bt. Shown is the average blockage ratio with a 95% confidence interval from at least 3 independent assays with at least 30 animals per condition and trial. ns indicates values with differences not statistically significant, **** indicates p<0,0001, Fisher exact t-test. See the source data file for details.

Uracil supplementation does not trigger the blockage phenotype.

Blockage ratio for control L3 larvae fed 1h with a mixture combining yeast and Lp with or without Uracil supplementation at 20 nM. Shown is the average with 95% confidence interval of at least 3 independent experiments with at least 20 larvae per trial and condition. The 0 symbol indicates an absence of blockage. ns indicates values with differences not statistically significant, Fisher exact t-test. See the source data file for details.

The intestinal immune response of reference animals, TrpA11 and Dh31KG09001 mutants are similar.

RT-qPCR analysis of the expression of IMD/NF-kB target AMP genes Diptericin, Attacin D (AttD) and Toll target genes Drosomycin (Droso) upon enteric intoxication in w1 animals (reference), TrpA11 and Dh31KG09001 mutant backgrounds. For clarity of the graph, all the statistics are not presented, but data from a full comparison between the different conditions are in the source data file (Mann Whitney test). ns Indicates p>0,05, Mann Whitney, two-tailed test. See the source data file for details. The analysis of the activation of the AMP genes was performed 5h after feeding with yeast only (yeast), yeast + Lp (Lp), yeast + Ecc (Ecc) or yeast + Bt (Bt).

TARMsT2 are attached to the longitudinal gut muscles.

Confocal fluorescent pictures of different TARMsT2 in the anterior portions of L3 larval intestines to detect longitudinal and transversal muscles concentrated in actin. The white star indicates the anterior part of the intestinal portion shown. The empty square with dashed lines in A corresponds to the portion of the image magnified in A’. Scale bar represents 500µm.

TARMs T2 structures are still present in TrpA11 and Dh31KG09001 mutant backgrounds.

A: Picture to illustrate the position of the TARMs T2 structures in L3 stage CantonS larval intestine (Ctrl). The white asterisk indicates the anterior part of the intestine. Scale bar represents 500µm.

B: Picture to illustrate the position of the TARMs T2 structures in L3 stage Dh31KG09001 mutant larval intestine. The white asterisk indicates the anterior part of the intestine. Scale bar represents 500µm.

A: Picture to illustrate the position of the TARMs T2 structures in L3 stage TrpA11 mutant larval intestine. The white asterisk indicates the anterior part of the intestine. Scale bar represents 500µm.

Bt and Ecc are blocked anteriorly and persist in PGRP-LCΔE and PGRP-LE112 mutants, respectively.

A: Timelapse from the movies of PGRP-LCΔE L3 Larvae fed 1h with a mixture of yeast and Bt then transferred on a glass slide, in a wet chamber, to be imaged overnight. Refers to Movie 8.

B: Timelapse from the movies of PGRP-LE112 L3 Larvae fed 1h with a mixture of yeast and Ecc then transferred on a glass slide, in a wet chamber, to be imaged overnight. Refers to Movie 9.

For A and B, the frames are separated by 5 minutes.

Bt and Ecc are blocked and persist anteriorly in DreddF64 and RelE20 mutants.

A: Timelapse from the movies of DreddF64 L3 Larvae fed 1h with a mixture of yeast and Ecc then transferred on a glass slide, in a wet chamber, to be imaged overnight. Refers to Movie 10.

B: Timelapse from the movies of RelE20 L3 Larvae fed 1h with a mixture of yeast and Bt then transferred on a glass slide, in a wet chamber, to be imaged overnight. Refers to Movie 11.

C: Timelapse from the movies of RelE20 L3 Larvae fed 1h with a mixture of yeast and Ecc then transferred on a glass slide, in a wet chamber, to be imaged overnight. Refers to Movie 12.

For A-C, the frames are separated by 5 minutes.

Fluorescent pictures of individual L3 transgenic reporter line larvae with cells expressing the Diptericin gene producing mCherry (A’, A’’, B’ and B’’). Larvae were fed 1h with yeast containing Lp (A, A’ and A’’) or Bt (B, B’ and B’’) then transferred on doubled sided tape in a wet chamber to be imaged 3h later. Scale bar is 1mm.