We thank H. Chu, G. Sharon, W.-L. Wu, J. K. Scarpa, E. D. Hoopfer and the Mazmanian laboratory for critiques; A. A. Aravin and K. Fejes Tόth for use of their laboratory space; D. J. Anderson, H. A. Lester, V. Gradinaru and M.-F. Chesselet for discussions; A. R. Sandoval, M. Meyerowitz and M. Smalley for technical support; Y. Garcia-Flores for administrative support; D. C. Hall for creating custom Python scripts; W.-J. Lee for the L. brevisEW, L. plantarumWJL and Acetobacter pomorum bacterial strains; the Yale Coli Genetic Stock Center for wild-type and mutant E. coli strains; M. H. Dickinson, D. J. Anderson, A. A. Aravin, and K. Fejes Tόth for fly lines; the GlycoAnalytics Core for help with carbohydrate analysis; and M. Fischbach and M. Funabashi for the pGID023 vector and advice. Imaging was performed in the Biological Imaging Facility, with the support of the Caltech Beckman Institute and the Arnold and Mabel Beckman Foundation. C.E.S. was partially supported by the Center for Environmental Microbial Interactions at Caltech. This project was funded by grants from the NIH (NS085910) and the Heritage Medical Research Institute to S.K.M.

Reviewer information

Nature thanks P. Bercik, C.-F. Wu and the other anonymous reviewer(s) for their contribution to the peer review of this work.