<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD with MathML3 v1.3 20210610//EN"  "JATS-archivearticle1-3-mathml3.dtd"><article xmlns:ali="http://www.niso.org/schemas/ali/1.0/" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" article-type="research-article" dtd-version="1.3"><front><journal-meta><journal-id journal-id-type="nlm-ta">elife</journal-id><journal-id journal-id-type="publisher-id">eLife</journal-id><journal-title-group><journal-title>eLife</journal-title></journal-title-group><issn publication-format="electronic" pub-type="epub">2050-084X</issn><publisher><publisher-name>eLife Sciences Publications, Ltd</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="publisher-id">97340</article-id><article-id pub-id-type="doi">10.7554/eLife.97340</article-id><article-id pub-id-type="doi" specific-use="version">10.7554/eLife.97340.3</article-id><article-version article-version-type="publication-state">version of record</article-version><article-categories><subj-group subj-group-type="display-channel"><subject>Research Article</subject></subj-group><subj-group subj-group-type="heading"><subject>Neuroscience</subject></subj-group></article-categories><title-group><article-title>Compressed sensing-based approach identifies modular neural circuitry driving learned pathogen avoidance</article-title></title-group><contrib-group><contrib contrib-type="author" corresp="yes"><name><surname>Hallacy</surname><given-names>Timothy</given-names></name><contrib-id authenticated="true" contrib-id-type="orcid">https://orcid.org/0000-0002-0069-1409</contrib-id><email>timothyhallacy@gmail.com</email><xref ref-type="aff" rid="aff1">1</xref><xref ref-type="fn" rid="con1"/><xref ref-type="fn" rid="conf1"/></contrib><contrib contrib-type="author"><name><surname>Yonar</surname><given-names>Abdullah</given-names></name><xref ref-type="aff" rid="aff2">2</xref><xref ref-type="fn" rid="con2"/><xref ref-type="fn" rid="conf1"/></contrib><contrib contrib-type="author"><name><surname>Ringstad</surname><given-names>Niels</given-names></name><contrib-id authenticated="true" contrib-id-type="orcid">https://orcid.org/0000-0002-8679-2269</contrib-id><xref ref-type="aff" rid="aff3">3</xref><xref ref-type="fn" rid="con3"/><xref ref-type="fn" rid="conf1"/></contrib><contrib contrib-type="author" corresp="yes"><name><surname>Ramanathan</surname><given-names>Sharad</given-names></name><contrib-id authenticated="true" contrib-id-type="orcid">https://orcid.org/0000-0001-9445-1248</contrib-id><email>sharad@cgr.harvard.edu</email><xref ref-type="aff" rid="aff2">2</xref><xref ref-type="fn" rid="con4"/><xref ref-type="fn" rid="conf1"/></contrib><aff id="aff1"><label>1</label><institution-wrap><institution-id institution-id-type="ror">https://ror.org/03vek6s52</institution-id><institution>Biophysics Program, Harvard University</institution></institution-wrap><addr-line><named-content content-type="city">Cambridge</named-content></addr-line><country>United States</country></aff><aff id="aff2"><label>2</label><institution-wrap><institution-id institution-id-type="ror">https://ror.org/03vek6s52</institution-id><institution>Departments of Molecular and Cellular Biology, and of Stem Cell and Regenerative Biology, John A. Paulson School of Engineering and Applied Sciences, Harvard University</institution></institution-wrap><addr-line><named-content content-type="city">Cambridge</named-content></addr-line><country>United States</country></aff><aff id="aff3"><label>3</label><institution-wrap><institution-id institution-id-type="ror">https://ror.org/0190ak572</institution-id><institution>Department of Cell Biology, Skirball Institute of Biomolecular Medicine, New York University Grossman School of Medicine</institution></institution-wrap><addr-line><named-content content-type="city">New York</named-content></addr-line><country>United States</country></aff></contrib-group><contrib-group content-type="section"><contrib contrib-type="editor"><name><surname>Grunwald Kadow</surname><given-names>Ilona C</given-names></name><role>Reviewing Editor</role><aff><institution-wrap><institution-id institution-id-type="ror">https://ror.org/041nas322</institution-id><institution>University of Bonn</institution></institution-wrap><country>Germany</country></aff></contrib><contrib contrib-type="senior_editor"><name><surname>VijayRaghavan</surname><given-names>K</given-names></name><role>Senior Editor</role><aff><institution-wrap><institution-id institution-id-type="ror">https://ror.org/03gf8rp76</institution-id><institution>National Centre for Biological Sciences, Tata Institute of Fundamental Research</institution></institution-wrap><country>India</country></aff></contrib></contrib-group><pub-date publication-format="electronic" date-type="publication"><day>10</day><month>02</month><year>2026</year></pub-date><volume>13</volume><elocation-id>RP97340</elocation-id><history><date date-type="sent-for-review" iso-8601-date="2024-04-10"><day>10</day><month>04</month><year>2024</year></date></history><pub-history><event><event-desc>This manuscript was published as a preprint.</event-desc><date date-type="preprint" iso-8601-date="2024-04-13"><day>13</day><month>04</month><year>2024</year></date><self-uri content-type="preprint" xlink:href="https://doi.org/10.1101/2024.04.10.588911"/></event><event><event-desc>This manuscript was published as a reviewed preprint.</event-desc><date date-type="reviewed-preprint" iso-8601-date="2024-06-05"><day>05</day><month>06</month><year>2024</year></date><self-uri content-type="reviewed-preprint" xlink:href="https://doi.org/10.7554/eLife.97340.1"/></event><event><event-desc>The reviewed preprint was revised.</event-desc><date date-type="reviewed-preprint" iso-8601-date="2024-12-31"><day>31</day><month>12</month><year>2024</year></date><self-uri content-type="reviewed-preprint" xlink:href="https://doi.org/10.7554/eLife.97340.2"/></event></pub-history><permissions><copyright-statement>© 2024, Hallacy et al</copyright-statement><copyright-year>2024</copyright-year><copyright-holder>Hallacy et al</copyright-holder><ali:free_to_read/><license xlink:href="http://creativecommons.org/licenses/by/4.0/"><ali:license_ref>http://creativecommons.org/licenses/by/4.0/</ali:license_ref><license-p>This article is distributed under the terms of the <ext-link ext-link-type="uri" xlink:href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution License</ext-link>, which permits unrestricted use and redistribution provided that the original author and source are credited.</license-p></license></permissions><self-uri content-type="pdf" xlink:href="elife-97340-v2.pdf"/><self-uri content-type="figures-pdf" xlink:href="elife-97340-figures-v2.pdf"/><abstract><p>An animal’s survival hinges on its ability to integrate past information to modify future behavior. The nematode <italic>Caenorhabditis elegans</italic> adapts its behavior based on prior experiences with pathogen exposure, transitioning from attraction to avoidance of the pathogen. A systematic screen for the neural circuits that integrate the information of previous pathogen exposure to modify behavior has not been feasible because of the lack of tools for neuron type-specific perturbations. We overcame this challenge using methods based on compressed sensing to efficiently determine the roles of individual neuron types in learned avoidance behavior. Our screen revealed that distinct sets of neurons drive exit from lawns of pathogenic bacteria and prevent lawn re-entry. Using calcium imaging of freely behaving animals and optogenetic perturbations, we determined the neural dynamics that regulate one key behavioral transition after infection: stalled re-entry into bacterial lawns. We find that key neuron types govern pathogen lawn-specific stalling but allow the animal to enter nonpathogenic <italic>Escherichia coli</italic> lawns. Our study shows that learned pathogen avoidance requires coordinated transitions in discrete neural circuits and reveals the modular structure of this complex adaptive behavioral response to infection.</p></abstract><kwd-group kwd-group-type="author-keywords"><kwd>neuroscience</kwd><kwd>learning</kwd><kwd>pathogen avoidance</kwd><kwd>memory</kwd><kwd><italic>Pseudomonas aeruginosa</italic></kwd><kwd>compressed sensing</kwd></kwd-group><kwd-group kwd-group-type="research-organism"><title>Research organism</title><kwd><italic>C. elegans</italic></kwd></kwd-group><funding-group><award-group id="fund1"><funding-source><institution-wrap><institution-id institution-id-type="ror">https://ror.org/01cwqze88</institution-id><institution>National Institutes of Health</institution></institution-wrap></funding-source><award-id>5R01NS117908-03</award-id><principal-award-recipient><name><surname>Ringstad</surname><given-names>Niels</given-names></name><name><surname>Ramanathan</surname><given-names>Sharad</given-names></name></principal-award-recipient></award-group><funding-statement>The funders had no role in study design, data collection and interpretation, or the decision to submit the work for publication.</funding-statement></funding-group><custom-meta-group><custom-meta specific-use="meta-only"><meta-name>Author impact statement</meta-name><meta-value>An efficient neural screening approach rapidly identifies circuit modules governing distinct behavioral transitions in response to pathogen exposure.</meta-value></custom-meta><custom-meta specific-use="meta-only"><meta-name>publishing-route</meta-name><meta-value>prc</meta-value></custom-meta></custom-meta-group></article-meta></front><body><sec id="s1" sec-type="intro"><title>Introduction</title><p>Animals use past experiences to modify future behavior, and this behavioral plasticity is essential for an animal’s fitness and survival. Previous studies suggest that sparse sets of neurons, such as those in the mushroom bodies of flies (<xref ref-type="bibr" rid="bib62">Zhao et al., 2021</xref>, <xref ref-type="bibr" rid="bib12">de Belle and Heisenberg, 1994</xref>, <xref ref-type="bibr" rid="bib43">Pascual and Préat, 2001</xref>, <xref ref-type="bibr" rid="bib24">Heisenberg, 2003</xref>) or in the human hippocampus (<xref ref-type="bibr" rid="bib56">Vargha-Khadem et al., 1997</xref>, <xref ref-type="bibr" rid="bib6">Bird and Burgess, 2008</xref>, <xref ref-type="bibr" rid="bib31">Kovács, 2020</xref>, <xref ref-type="bibr" rid="bib14">Duff et al., 2019</xref>, <xref ref-type="bibr" rid="bib16">FeldmanHall et al., 2021</xref>), can play pivotal roles in integrating information from prior experiences and using it to influence subsequent behavior. These critical neurons at bottlenecks of neural networks make up a small fraction of the total size of the nervous system. Identification of these key neurons represents a crucial step towards understanding both the neural and molecular mechanisms responsible for encoding experiences and modulating behavior.</p><p>Despite its small nervous system, the nematode <italic>Caenorhabditis elegans</italic> displays a robust capacity to modify its behavior based on experience (<xref ref-type="bibr" rid="bib18">Gourgou et al., 2021</xref>, <xref ref-type="bibr" rid="bib1">Amano and Maruyama, 2011</xref>, <xref ref-type="bibr" rid="bib15">Eliezer et al., 2019</xref>, <xref ref-type="bibr" rid="bib61">Zhang and Zhang, 2012</xref>, <xref ref-type="bibr" rid="bib2">Ardiel and Rankin, 2010</xref>). One example of this is learned pathogen avoidance. Worms are initially attracted to pathogenic bacteria such as <italic>Pseudomonas aeruginosa</italic> (strain PA14). However, after several hours of exposure, animals associate infection with PA14 specific cues and change their behavior to avoid these bacteria (<xref ref-type="bibr" rid="bib40">Meisel and Kim, 2014</xref>, <xref ref-type="bibr" rid="bib60">Zhang et al., 2005</xref>, <xref ref-type="bibr" rid="bib11">Chen et al., 2013</xref>, <xref ref-type="bibr" rid="bib47">Shivers et al., 2009</xref>, <xref ref-type="bibr" rid="bib48">Singh and Aballay, 2019</xref>, <xref ref-type="bibr" rid="bib28">Kaletsky et al., 2020</xref>). This behavioral transition reduces the chance of infection and thus increases the worm’s odds of survival (<xref ref-type="bibr" rid="bib47">Shivers et al., 2009</xref>, <xref ref-type="bibr" rid="bib29">Kim et al., 2002</xref>, <xref ref-type="bibr" rid="bib51">Tan et al., 1999</xref>, <xref ref-type="bibr" rid="bib44">Reddy et al., 2009</xref>). How does the worm’s nervous system encode this pathogen experience and use this information to change behavior? Previous studies uncovered a range of sensory cues that govern the worm’s behavioral transition, ranging from chemosensory cues (<xref ref-type="bibr" rid="bib41">Meisel et al., 2014</xref>, <xref ref-type="bibr" rid="bib22">Hao et al., 2018</xref>, <xref ref-type="bibr" rid="bib20">Ha et al., 2010</xref>, <xref ref-type="bibr" rid="bib23">Harris et al., 2014</xref>) and the worm’s innate immune response (<xref ref-type="bibr" rid="bib60">Zhang et al., 2005</xref>, <xref ref-type="bibr" rid="bib34">Lee and Mylonakis, 2017</xref>) to mechanosensory inputs arising from the bacteria’s biofilm (<xref ref-type="bibr" rid="bib45">Reddy et al., 2011</xref>, <xref ref-type="bibr" rid="bib9">Chang et al., 2011</xref>, <xref ref-type="bibr" rid="bib5">Bai et al., 2021</xref>). Olfactory stimuli have also been implicated in learned pathogen avoidance through serotonin modulation (<xref ref-type="bibr" rid="bib47">Shivers et al., 2009</xref>, <xref ref-type="bibr" rid="bib60">Zhang et al., 2005</xref>). The underlying neural circuits that encode information about past experiences and their dynamics remain unknown despite this. One strategy to find such neurons would be to carry out a comprehensive screen of the nervous system. However, such a screen is technically challenging due to the lack of neuron subtype-specific promoters and the necessity of systematic timed perturbations of neural activity during pathogen exposure to disrupt the animal’s ability to learn to avoid pathogens in the future.</p><p>To discover neurons whose activity patterns governed experience-dependent pathogen avoidance, we performed a comprehensive screen of the nervous system using a compressed sensing-based approach (<xref ref-type="bibr" rid="bib35">Lee et al., 2019</xref>) that overcomes these technical challenges. Through this screen, we discovered that the behavioral transition from attraction to avoidance of PA14 involves transitions in two subbehaviors - exit from the bacterial lawn and lawn re-entry. We found that distinct sets of neurons regulate each subbehavior. In particular, the aversion to re-entry is controlled by two neuronal types, AIY and SIA, which encode pathogen exposure through sustained downregulation of neural activity. Our data further indicated that AIY regulates PA14-specific aversion and drives stalling at the edge of the pathogenic lawn. Finally, we used the identification of neural substrates of learned pathogen avoidance to explore how long-term changes in neural dynamics might be mediated by neuropeptide signaling between critical neurons that govern transitions in this behavior.</p></sec><sec id="s2" sec-type="results"><title>Results</title><sec id="s2-1"><title>Prior pathogen exposure alters two behavioral modules to generate learned pathogen avoidance</title><p>Infection of the nematode <italic>C. elegans</italic> by pathogenic bacteria elicits learned pathogen avoidance behavior. Naïve animals dwell and feed on lawns of pathogenic <italic>P. aeruginosa</italic> (PA14), but after infection, animals avoid <italic>P. aeruginosa</italic> lawns (<xref ref-type="bibr" rid="bib40">Meisel and Kim, 2014</xref>, <xref ref-type="bibr" rid="bib45">Reddy et al., 2011</xref>). To obtain high-resolution measurements of learned pathogen avoidance behavior, we monitored animals that had been placed on a lawn of pathogenic PA14 for 18 hours. We counted the fraction of animals that remained on the lawn over time (<xref ref-type="fig" rid="fig1">Figure 1A</xref>) at 30-minute intervals. Within 8 hours, half of the animals changed their foraging behavior and left the lawn of pathogenic bacteria. By contrast, nearly all the animals placed on a control lawn of non-pathogenic <italic>Escherichia coli</italic> (OP50) bacteria remained on the lawn during 18 hours of monitoring (<xref ref-type="fig" rid="fig1">Figure 1A</xref>).</p><fig-group><fig id="fig1" position="float"><label>Figure 1.</label><caption><title>Exposure to pathogenic bacteria inhibits the ability of worms to re-enter the bacteria lawn.</title><p>(<bold>A</bold>) <italic>Above</italic>: representative sequence of phase contrast images of <italic>P. aeruginosa</italic> PA14 lawn evacuation at t=1, 9, and 15 hours after deposition of <italic>C. elegans</italic> onto lawn. Evacuated worms are highlighted in red using imaging processing. <italic>Below</italic>: fractional occupancy of <italic>C. elegans</italic> on bacteria lawns plotted against time spent on pathogenic PA14 lawns (red) or non-pathogenic <italic>E. coli</italic> OP50 lawns (blue). Mean occupancy and SEM over n=25 independent experiments with 10 worms each. (<bold>B</bold>) <italic>C. elegans</italic> fractional occupancy (black) and the rate constant of <italic>C. elegans</italic> exit (exits events/hour/animal, red) plotted against time spent on pathogenic PA14 lawns. The exit rate constant increased with time spent on the lawn. Mean and SEM over n=5 samples of 10 worms each. (<bold>C</bold>) Representative phase contrast images of a worm attempting to re-enter PA14 lawn after 5 hours (left column) and 15 hours (right column) of PA14 exposure. Time labels denote time after first contact of worm with bacteria lawn. (<bold>D</bold>) Latency in re-entry (delay in the re-entry of the animal onto the bacteria lawn upon first contact with the lawn, red) and fractional occupancy (black) plotted against duration of exposure for worms on PA14 lawns. Mean and SEM over n=5 samples of 10 worms each. (<bold>E</bold>) Representative sequence of phase contrast images taken from a fresh lawn assay experiment to investigate worm entry dynamics. Worms (highlighted in red) are transferred to a fresh lawn of PA14 and their entry dynamics are measured pre-PA14 exposure (left) and post-15 hours of PA14 exposure (right). Time labels denote time after first contact of worm with bacteria lawn. (<bold>F</bold>) Representative plots of distance of center of mass of each animal from the edge of the PA14 lawn versus time after first contact with lawn, pre (black, n=11) and post 15 hours of PA14 exposure (red, n=9). (<bold>G</bold>) Latency of entry of worms pre (n=35) and 15 hours post (n=29) PA14 exposure. Post-exposed worms increased latency of entry tenfold compared to pre-exposed control. (<bold>H</bold>) Model for lawn evacuation. Pre-exposed worms (left) have high re-entry rates and low exit rates. Exposure to pathogenic bacteria causes a transition in behavior (right), where worms increase exit rate and decrease re-entry rate, leading to net lawn evacuation.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-97340-fig1-v2.tif"/></fig><fig id="fig1s1" position="float" specific-use="child-fig"><label>Figure 1—figure supplement 1.</label><caption><title>Lawn evacuation following neural inhibition.</title><p>(<bold>A</bold>) Evacuation dynamics of all 29 transgenic lines following 2 hours of neural inhibition. (<bold>B</bold>) Exit rate of worms on OP50 with neural inhibition. (<bold>C</bold>) Latency of re-entry with neural inhibition.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-97340-fig1-figsupp1-v2.tif"/></fig></fig-group><p>The fractional occupancy of worms on a bacterial lawn is affected in principle by two processes: lawn exit and lawn re-entry. We determined how PA14 exposure affected each of these processes. After four hours in the presence of pathogen, the rate constant for the lawn exit (exits per animal per hour) increased dramatically from zero and reached a plateau of roughly one exit event per worm-hour after 10 hours (<xref ref-type="fig" rid="fig1">Figure 1B</xref>). We observed that worms that left lawns of pathogen after 10–16 hours of exposure repeatedly attempted to return to the lawn but stalled for long periods upon contact with the lawn edge (<xref ref-type="fig" rid="fig1">Figure 1C</xref>, <xref ref-type="video" rid="video1">Video 1</xref>). We quantified this re-entry defect by measuring the latency to re-entry, that is<italic>,</italic> the delay between first contact with the lawn and re-entry of the animal into the lawn. Animals that had been exposed to a pathogen for short periods rapidly re-entered the lawn after an exit with latencies of only a few seconds (<xref ref-type="fig" rid="fig1">Figure 1D</xref>). After 5 hours of exposure to pathogen, the latency of re-entry began to increase, and after 12 hours of exposure, the mean latency to re-entry was 36.7±3.5 minutes (<xref ref-type="fig" rid="fig1">Figure 1D</xref>, <xref ref-type="video" rid="video2">Videos 2</xref> and <xref ref-type="video" rid="video3">3</xref>). Increases in lawn-leaving rates and latency to re-entry were correlated and coincided with the observed evacuation of the lawn of pathogenic bacteria (<xref ref-type="fig" rid="fig1">Figure 1D</xref>).</p><media mimetype="video" mime-subtype="mp4" xlink:href="elife-97340-video1.mp4" id="video1"><label>Video 1.</label><caption><title>Time-series video of a lawn evacuation assay taken 2 hours into the assay.</title></caption></media><media mimetype="video" mime-subtype="mp4" xlink:href="elife-97340-video2.mp4" id="video2"><label>Video 2.</label><caption><title>Time-series video of a lawn evacuation assay taken 8 hours into the assay.</title></caption></media><media mimetype="video" mime-subtype="mp4" xlink:href="elife-97340-video3.mp4" id="video3"><label>Video 3.</label><caption><title>Time-series video of a lawn evacuation assay taken 14 hours into the assay.</title></caption></media><p>To demonstrate that the experience of pathogen exposure was driving the observed changes in behavior, as opposed to some change in the bacterial lawn caused by foraging animals, we performed an assay to test worm entry dynamics on a fresh lawn of PA14. We exposed animals to pathogenic PA14 for 15 hours, collected those that had left the lawn, and then compared the latency of lawn entry of this cohort to the latencies of a cohort of naive animals that had not experienced pathogen. Naive worms rapidly entered a fresh lawn of pathogen, whereas worms that had experienced 15 hours of pathogen exposure displayed increased latency of entry into such fresh lawns (<xref ref-type="fig" rid="fig1">Figure 1E–G</xref>). The results of this fresh lawn assay indicated that pathogen exposure changed the internal state of the worm to drive the observed behavioral transition from re-entering the lawn rapidly to stalled re-entry (<xref ref-type="fig" rid="fig1">Figure 1H</xref>).</p></sec><sec id="s2-2"><title>A compressed sensing-based optogenetic screen to identify neurons that function in learned pathogen avoidance</title><p>We next sought to identify neurons that regulate interactions of <italic>C. elegans</italic> with lawns of pathogenic <italic>P. aeruginosa</italic>. Conventional approaches to identifying neurons required for a <italic>C. elegans</italic> behavior involve targeting individual neuron types by microablation (<xref ref-type="bibr" rid="bib4">Avery and Horvitz, 1989</xref>, <xref ref-type="bibr" rid="bib19">Gray et al., 2005</xref>, <xref ref-type="bibr" rid="bib30">Kobayashi et al., 2013</xref>) or optogenetics (<xref ref-type="bibr" rid="bib37">Liu et al., 2022a</xref>, <xref ref-type="bibr" rid="bib39">López-Cruz et al., 2019</xref>, <xref ref-type="bibr" rid="bib49">Sordillo and Bargmann, 2021</xref>). These approaches can be time-consuming, and applying them to perform unbiased screens of the entire nervous system can require the generation of large numbers of transgenic lines.</p><p>We previously showed that an optogenetic screen for neurons that drive a behavior can be performed more efficiently using multiplexed optogenetic manipulations of neurons followed by a compressed sensing analysis to infer individual key neuron types (<xref ref-type="bibr" rid="bib35">Lee et al., 2019</xref>, <xref ref-type="bibr" rid="bib7">Candes and Wakin, 2008</xref>, <xref ref-type="bibr" rid="bib13">Donoho, 2006</xref>). We performed a compressed sensing-based screen using a panel of 29 transgenic <italic>C. elegans</italic> lines, each expressing the light-gated ion channel Archaerhodopsin-3 (Arch3) under a different promoter (<xref ref-type="supplementary-material" rid="supp1">Supplementary file 1</xref>). The panel used for this study focused on interneurons, and covered 54 classes of interneuron, 25 classes of sensory neuron, and 8 classes of motor neuron (<xref ref-type="bibr" rid="bib25">Hobert et al., 2016</xref>; <xref ref-type="bibr" rid="bib58">White et al., 1986</xref>; <xref ref-type="bibr" rid="bib59">Xu et al., 2013</xref>). We optically inhibited neurons during the early stages of pathogen exposure when animals presumably associate pathogen-specific cues with sickness. We then monitored the subsequent dynamics of lawn leaving and re-entry. Animals were transferred to pathogenic lawns, given 1 hour to settle, and then illuminated for 2 hours with pulses of 525 nm green light (1 second on/off, 5 mW/mm<sup>2</sup>) to inhibit neurons expressing Arch3 in that line (<xref ref-type="fig" rid="fig2">Figure 2A</xref>). The behavior of these animals was then recorded for a total of 18 hours at 3-minute intervals (<xref ref-type="fig" rid="fig2">Figure 2A</xref>). We performed the same measurements of matched controls that had not been fed the opsin cofactor all-trans retinal and were thus insensitive to photoinhibition (<xref ref-type="fig" rid="fig2">Figure 2A</xref>). To quantify the effect of optogenetic inhibition on behavior, we calculated for each strain a differential retention index—the difference in the area between the temporal lawn occupancy curves of transgenic animals exposed to inhibitory light and a paired no-ATR control (<xref ref-type="fig" rid="fig2">Figure 2B</xref>). Six strains showed significant changes in differential retention index after neural silencing compared to controls (<xref ref-type="fig" rid="fig2">Figure 2B</xref>). Silencing neurons in these strains during the first 2 hours of pathogen exposure augmented lawn-leaving over the next 18 hours (<xref ref-type="fig" rid="fig1s1">Figure 1—figure supplement 1A</xref>).</p><fig-group><fig id="fig2" position="float"><label>Figure 2.</label><caption><title>An optogenetic screen of the <italic>C</italic>. <italic>elegans</italic> nervous system to identify neurons controlling exit and re-entry into pathogenic bacteria lawns.</title><p>(<bold>A</bold>) Experimental protocol used to identify neurons that modulate long-term changes in PA14 lawn evacuation dynamics. In each experiment, animals of one transgenic line expressing archaerhodopsin were placed onto a lawn of PA14 and allowed to settle for 1 hour (blue segment, in schematic). Worms were illuminated with green light (525 nm) to inhibit activity for 2 hours in neurons expressing archaerhodopsin (green segment, in schematic). Worm evacuation was monitored over an additional 15 hours (red time segment, schematic). Worms are illuminated for imaging with a red ring light. (<bold>B</bold>) Differential retention metric for 29 transgenic lines. The differential retention metric for each transgenic line was determined by measuring the difference in the area under lawn evacuation curves with and without neural inhibition (see 'Materials and methods'). Differential retention metrics were compared against the standard deviation in retention metrics from uninhibited control worms (gray) to determine statistical significance (see methods). 6 of the 29 lines (<italic>dop-2</italic>, <italic>flp-4</italic>, <italic>mpz-prom1</italic>, <italic>sams-5</italic>, <italic>ttx-3</italic>, and <italic>npr-4</italic>) showed statistically significant differential retention metrics. Mean and SEM over n=5 samples of 10 worms each. (<bold>C</bold>) Rate constant of exit (exit events/hour/animal) for statistically significant transgenic lines (<bold>B</bold>). Two lines showed statistically significant changes in rate constant (<italic>dop-2</italic> and <italic>flp-4</italic>) between inhibition (red,+ATR) and no inhibition (blue, -ATR) control. Mean and SEM over n=5 samples of 10 worms each. (<bold>D</bold>) Left: fluorescence and phase image of P<italic>dop-2</italic>::ARCH-mCherry. Scale bar 15 µm. Right: fractional lawn occupancy of P<italic>dop-2</italic>::ARCH-mCherry as a function of time (right) with (red,+ATR) and without (blue, -ATR) neural inhibition. (<bold>E</bold>) Trajectories of worms exiting the lawn either with (left) or without (right) inhibition of neurons expressing dop-2. Trajectories are taken during the 2-hour timescale of inhibition, and times are taken from the time of lawn exit. Trajectories are color-coded by time and are over n=2 samples of 10 worms each. (<bold>F</bold>) Latency in re-entry (time of re-entry of the animal onto the bacteria lawn after first contact) of statistically significant transgenic lines (<bold>B</bold>). Four lines show statistically significant differences in latency in re-entry (<italic>dop-2</italic>, <italic>sams-5</italic>, <italic>ttx-3</italic>, and <italic>npr-4</italic>) between inhibition (red, +ATR) and no inhibition (blue, -ATR) control. (<bold>G</bold>) Representative fluorescence and phase image (left) of P<italic>npr-4</italic>::ARCH-mCherry. Scale bar 15 µm. Fractional lawn occupancy of this line as a function of time (right) with (red,+ATR) and without (blue, -ATR) neural inhibition. (<bold>H</bold>) Representative plots of the distance of individual P<italic>npr-4</italic>::ARCH-mCherry worms from the edge of the lawn with (red, n=5) and without (black, n=5) neural inhibition. Inset: representative trajectories (n=5) color coded by time of P<italic>npr-4</italic>::ARCH-mCherry worms attempting to enter bacteria lawn with (left) and without (right) neural inhibition. All trajectories are taken from lawn exit to re-entry.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-97340-fig2-v2.tif"/></fig><fig id="fig2s1" position="float" specific-use="child-fig"><label>Figure 2—figure supplement 1.</label><caption><title>Compressed sensing solutions with sparsity parameters for lawn exit and entry.</title><p>(<bold>A</bold>) Median neuron weights from 10,000 lasso regression solutions over three orders of magnitude of sparsity parameters for lawn exit rate. (<bold>B</bold>) Median neuron weights from 10,000 lasso regression solutions over three orders of magnitude of sparsity parameters for lawn entry timescale.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-97340-fig2-figsupp1-v2.tif"/></fig><fig id="fig2s2" position="float" specific-use="child-fig"><label>Figure 2—figure supplement 2.</label><caption><title>Validation of compressed sensing solutions via Arch expression efficiency through measurement matrix corruption.</title><p>Solutions obtained following perturbing the measurement matrix to mimic differences in expression of Archaerhodopsin (see 'Materials and methods').</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-97340-fig2-figsupp2-v2.tif"/></fig><fig id="fig2s3" position="float" specific-use="child-fig"><label>Figure 2—figure supplement 3.</label><caption><title>Validation of robustness of compressed sensing solutions to choice of measurements through promoter removal.</title><p>To validate that solutions to lawn entry were robust to choice of measurements, 1 (<bold>A</bold>) to 5 (<bold>E</bold>) promoters were removed at random from the measurement matrix (see 'Materials and methods') and solutions were evaluated. Our results showed that our solutions were robust to such removals. (<bold>F</bold>) Aggregated solutions across 1–5 to removals.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-97340-fig2-figsupp3-v2.tif"/></fig><fig id="fig2s4" position="float" specific-use="child-fig"><label>Figure 2—figure supplement 4.</label><caption><title>Recovery and false positive rate for measurement matrix of choice.</title><p>(<bold>A</bold>) False positive and negative rate for recovery of measurement matrix for a randomly simulated set of key neurons (see 'Materials and methods'). False positive and recovery rates for each key neuron identified as being important in lawn entry behavior: AVK (<bold>B</bold>), AIY (<bold>C</bold>), MI (<bold>D</bold>), and SIA (<bold>E</bold>).</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-97340-fig2-figsupp4-v2.tif"/></fig></fig-group><p>We next asked whether the accelerated pathogen avoidance observed upon neural silencing resulted from increased lawn exits, increased latency to re-entry, or both. Two Archaerhodopsin lines (P<italic>dop-2::Arch3</italic> and P<italic>mpz-1::Arch3</italic>) showed increased exit rates, while four lines (P<italic>flp-4::Arch3</italic>, P<italic>sams-5::Arch3</italic>, P<italic>ttx-3::Arch3</italic>, and P<italic>npr-4::Arch3</italic>) did not show changes in exit rates upon inhibition (<xref ref-type="fig" rid="fig2">Figure 2C and D</xref>). Neural inhibition that increased lawn exit rates dramatically increased the number of tracks outside of the lawn (<xref ref-type="fig" rid="fig2">Figure 2E</xref>). We next measured the effects of the early neural silencing on lawn re-entry. We found that four lines (P<italic>dop-2::Arch3</italic>, P<italic>npr-4::Arch3</italic>, P<italic>sams-5::Arch3,</italic> and P<italic>ttx-3::Arch3</italic>) showed significant increases in latency to re-entry in response to activation of Archaerhodopsin (<xref ref-type="fig" rid="fig2">Figure 2F and G</xref>). For example, the inhibition of the P<italic>npr-4::Arch3</italic> line over the first 2 hours of the experiment dramatically decreased lawn re-entry over the entire time course, resulting in worm trajectories stalling at the lawn edge (<xref ref-type="fig" rid="fig2">Figure 2H</xref>). Inhibition of neurons on non-pathogenic OP50 produced dramatically different effects on both exit and entry compared to PA14 (<xref ref-type="fig" rid="fig1">Figure 1B and C</xref>). In particular, none of the optogenetic lines showed changes in latency to re-entry on OP50 (<xref ref-type="fig" rid="fig1">Figure 1C</xref>), suggesting that this effect is specific to PA14 exposure. These results indicated that inhibition of neurons during an early phase of learned pathogen avoidance could cause long-term changes in aversion to pathogenic bacteria through modulating distinct behaviors.</p></sec><sec id="s2-3"><title>A sparse set of neurons influences the encoding of the memory of pathogen exposure</title><p>We next sought to identify specific neurons that influence learned pathogen avoidance. To identify neurons that control specific behaviors (<xref ref-type="fig" rid="fig3">Figure 3A</xref>), one usually thinks of perturbing <inline-formula><alternatives><mml:math id="inf1"><mml:mi>N</mml:mi></mml:math><tex-math id="inft1">\begin{document}$N$\end{document}</tex-math></alternatives></inline-formula> neurons of the nervous system one at a time. These measurements can be visualized as an <inline-formula><alternatives><mml:math id="inf2"><mml:mstyle><mml:mrow><mml:mstyle displaystyle="false"><mml:mi>N</mml:mi><mml:mo>×</mml:mo><mml:mspace width="thinmathspace"/><mml:mi>N</mml:mi></mml:mstyle></mml:mrow></mml:mstyle></mml:math><tex-math id="inft2">\begin{document}$N\times \, N $\end{document}</tex-math></alternatives></inline-formula> set of equations, which can be easily solved to give the relative contribution of each neuron to the phenotype (<xref ref-type="fig" rid="fig3">Figure 3B</xref>). This approach requires as many measurements as the number of neurons being characterized. Utilizing a compressed sensing-based approach, we can instead formulate our optogenetic screen results as an underdetermined set of equations <inline-formula><alternatives><mml:math id="inf3"><mml:mstyle><mml:mrow><mml:mstyle displaystyle="false"><mml:mrow><mml:mi mathvariant="bold">M</mml:mi></mml:mrow><mml:mrow><mml:mover><mml:mi>w</mml:mi><mml:mo stretchy="false">→</mml:mo></mml:mover></mml:mrow><mml:mo>=</mml:mo><mml:mrow><mml:mover><mml:mi>P</mml:mi><mml:mo stretchy="false">→</mml:mo></mml:mover></mml:mrow><mml:mo>.</mml:mo></mml:mstyle></mml:mrow></mml:mstyle></mml:math><tex-math id="inft3">\begin{document}$\mathbf{M}\vec{w}=\vec{P}.$\end{document}</tex-math></alternatives></inline-formula> The matrix, <inline-formula><alternatives><mml:math id="inf4"><mml:mi mathvariant="bold">M</mml:mi></mml:math><tex-math id="inft4">\begin{document}$\mathbf{M}$\end{document}</tex-math></alternatives></inline-formula>, is an incoherent measurement matrix of size 29 by 87 measurement matrix (<xref ref-type="fig" rid="fig3">Figure 3C</xref>), with each row corresponding to each Archaerhodopsin line (experiments were performed on 29 lines) and each column corresponding to neural identity. The matrix element, <inline-formula><alternatives><mml:math id="inf5"><mml:msub><mml:mrow><mml:mi mathvariant="bold">M</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi><mml:mi>j</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft5">\begin{document}$\mathbf{M}_{ij}$\end{document}</tex-math></alternatives></inline-formula> is equal to 1 if the <italic>i</italic>th line drives expression in neuron <inline-formula><alternatives><mml:math id="inf6"><mml:mi>j</mml:mi></mml:math><tex-math id="inft6">\begin{document}$j$\end{document}</tex-math></alternatives></inline-formula> and is 0 otherwise. <inline-formula><alternatives><mml:math id="inf7"><mml:mover accent="true"><mml:mrow><mml:mi>w</mml:mi></mml:mrow><mml:mo>⃑</mml:mo></mml:mover></mml:math><tex-math id="inft7">\begin{document}$\vec{w}$\end{document}</tex-math></alternatives></inline-formula> corresponds to neural weights, that is, how much each neuron contributes to the phenotype, and <inline-formula><alternatives><mml:math id="inf8"><mml:mover accent="true"><mml:mrow><mml:mi>P</mml:mi></mml:mrow><mml:mo>⃑</mml:mo></mml:mover></mml:math><tex-math id="inft8">\begin{document}$\vec{P}$\end{document}</tex-math></alternatives></inline-formula> is the phenotype vector. The relative contributions (weights) of 87 neuron types to a phenotype can be determined using an L1 norm from these 29 measurements.</p><fig id="fig3" position="float"><label>Figure 3.</label><caption><title>Compressed sensing analysis identified a set of neurons controlling worm re-entry and exit.</title><p>(<bold>A</bold>) Example of a neural network where behavior is controlled by a small number of key nodes (highlighted in red) that make up a small fraction of the total number of nodes (gray). (<bold>B</bold>) Single neuron perturbations can be framed as solving a N by N matrix equation to find the neural contributions to phenotypes. Each diagonal entry (white) corresponds to a single perturbation. Interrogating the entire nervous system to determine the contribution (weight, w) of each neuron to the behavior requires as many measurements as the number of neurons in the nervous system (N). (<bold>C</bold>) Using compressed sensing to determine neurons controlling entry and exit from the optogenetic screen by determining their weights (w) from an underdetermined set of equations. These equations can be represented as a 29 × 87 measurement matrix M (left). Rows are promoters and columns are neuron types. Matrix has an entry 1 (white) if the promoter drives expression in that neuron type, else 0 (black). Phenotype vectors P<sub>exit</sub> and P<sub>entry</sub> were obtained by taking the difference between the re-entry timescale or rate constant of exit with and without neural inhibition (see 'Materials and methods'). From measurements of the phenotype of 29 lines (P<sub>exit</sub> and P<sub>entry</sub>), the weights of each of the 87 neurons (w) can be determined using compressed sensing (see 'Materials and methods') (<bold>D</bold>) Median neuron weight contributions to the exit phenotype from 10,000 lasso regression solutions from bootstrapping (see 'Materials and methods'). Neurons with significant weights contributing to the exit phenotype (AVA, CEP, HSN, RIA, RID, SIA) are highlighted. (<bold>E</bold>) Median neuron weight contributions to the re-entry phenotype from 10,000 lasso regression solutions from bootstrapping (see 'Materials and methods'). Neurons with significant weights contributing to the re-entry phenotype (AIY, SIA, AVK, MI) are highlighted.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-97340-fig3-v2.tif"/></fig><p>We evaluated the phenotype vector <inline-formula><alternatives><mml:math id="inf9"><mml:mover accent="true"><mml:mrow><mml:mi>P</mml:mi></mml:mrow><mml:mo>⃑</mml:mo></mml:mover></mml:math><tex-math id="inft9">\begin{document}$\vec{P}$\end{document}</tex-math></alternatives></inline-formula> for the two behaviors of interest by quantifying the changes to the dynamics of re-entry and exit from the lawns of pathogen. For both exit and re-entry, we calculated differences between optogenetically inhibited and non-inhibited worms for each transgenic line that showed statistically significant effects of inhibition. For lawn exit, the phenotype was the increase in the rate constant of exit due to neural inhibition. For re-entry, the phenotype was the difference between the latency in re-entry caused by neural inhibition. Lines that did not show significant behavioral changes in response to inhibition were assigned a phenotype value of zero.</p><p>We inferred neural weights <inline-formula><alternatives><mml:math id="inf10"><mml:mover accent="true"><mml:mrow><mml:mi>w</mml:mi></mml:mrow><mml:mo>⃑</mml:mo></mml:mover></mml:math><tex-math id="inft10">\begin{document}$\vec{w}$\end{document}</tex-math></alternatives></inline-formula> from our matrix equation using Lasso regression (<xref ref-type="bibr" rid="bib55">Tibshirani, 2011</xref>, <xref ref-type="bibr" rid="bib54">Tibshirani, 1996</xref>), which allowed us to solve the underdetermined set of linear equations <inline-formula><alternatives><mml:math id="inf11"><mml:mi mathvariant="bold">M</mml:mi><mml:mover accent="true"><mml:mrow><mml:mi>w</mml:mi></mml:mrow><mml:mo>⃑</mml:mo></mml:mover><mml:mo>=</mml:mo><mml:mover accent="true"><mml:mrow><mml:mi>P</mml:mi></mml:mrow><mml:mo>⃑</mml:mo></mml:mover></mml:math><tex-math id="inft11">\begin{document}$\mathbf{M}\vec{w}=\vec{P}$\end{document}</tex-math></alternatives></inline-formula> while simultaneously imposing sparsity constraints on the weight vector by minimizing the sum of the mean squared error <inline-formula><alternatives><mml:math id="inf12"><mml:mstyle><mml:mrow><mml:mstyle displaystyle="false"><mml:msup><mml:mi>χ</mml:mi><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msup><mml:mo>=</mml:mo><mml:mspace width="thinmathspace"/><mml:msup><mml:mrow><mml:mo>(</mml:mo><mml:mrow><mml:mrow><mml:mi mathvariant="bold">M</mml:mi></mml:mrow><mml:mrow><mml:mover><mml:mi>w</mml:mi><mml:mo stretchy="false">→</mml:mo></mml:mover></mml:mrow><mml:mo>−</mml:mo><mml:mrow><mml:mover><mml:mi>P</mml:mi><mml:mo stretchy="false">→</mml:mo></mml:mover></mml:mrow></mml:mrow><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msup></mml:mstyle></mml:mrow></mml:mstyle></mml:math><tex-math id="inft12">\begin{document}$\chi ^{2}=\, \left (\mathbf{M}\vec{w}-\vec{P}\right)^{2}$\end{document}</tex-math></alternatives></inline-formula> and the L1 norm of the solutions, thus minimizing <inline-formula><alternatives><mml:math id="inf13"><mml:msup><mml:mrow><mml:mfenced separators="|"><mml:mrow><mml:mi mathvariant="bold">M</mml:mi><mml:mover accent="true"><mml:mrow><mml:mi>w</mml:mi></mml:mrow><mml:mo>⃑</mml:mo></mml:mover><mml:mo>-</mml:mo><mml:mover accent="true"><mml:mrow><mml:mi>P</mml:mi></mml:mrow><mml:mo>⃑</mml:mo></mml:mover></mml:mrow></mml:mfenced></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msup><mml:mo>+</mml:mo><mml:mi>λ</mml:mi><mml:msub><mml:mrow><mml:mfenced open="‖" close="‖" separators="|"><mml:mrow><mml:mover accent="true"><mml:mrow><mml:mi>w</mml:mi></mml:mrow><mml:mo>⃑</mml:mo></mml:mover></mml:mrow></mml:mfenced></mml:mrow><mml:mrow><mml:mn>1</mml:mn></mml:mrow></mml:msub></mml:math><tex-math id="inft13">\begin{document}$\left (\mathbf{M}\vec{w}-\vec{P}\right)^{2}+\lambda \left \| \vec{w}\right \| _{1}$\end{document}</tex-math></alternatives></inline-formula> where <inline-formula><alternatives><mml:math id="inf14"><mml:mi>λ</mml:mi></mml:math><tex-math id="inft14">\begin{document}$\lambda $\end{document}</tex-math></alternatives></inline-formula> is the sparsity parameter. Using this approach, we inferred a set of candidate neurons for lawn exit and lawn re-entry (<xref ref-type="fig" rid="fig3">Figure 3D and E</xref>). We focused primarily on neurons governing lawn re-entry (<xref ref-type="fig" rid="fig1">Figure 1F</xref>). For lawn re-entry, four key neurons were inferred over a wide range of sparsity parameters: AVK, SIA, AIY, and MI (<xref ref-type="fig" rid="fig2s1">Figure 2—figure supplement 1</xref>), with one example solution taken at a point where chi-squared error began to increase (<xref ref-type="fig" rid="fig3">Figure 3D</xref>). Some neurons were assigned negative weights by this analysis (suggesting that their inhibition promotes lawn re-entry). However, the contributions of these neurons decreased as the sparsity parameter increased, suggesting that these neurons were less important (<xref ref-type="fig" rid="fig2s1">Figure 2—figure supplement 1</xref>).</p><p>Compressed-sensing analysis of lawn-exit behavior identified contributions from six neuron classes to this behavior: CEPs, HSNs, RIAs, RIDs, and SIAs. Some of these neurons have previously been implicated in lawn retention or dwelling. RIAs are required for learned avoidance of <italic>Pseudomonas</italic> lawns (<xref ref-type="bibr" rid="bib38">Liu et al., 2022b</xref>, <xref ref-type="bibr" rid="bib20">Ha et al., 2010</xref>). CEPs and HSNs are also known to promote dwelling on bacterial lawns through release of dopamine and serotonin, respectively (<xref ref-type="bibr" rid="bib46">Sawin et al., 2000</xref>). Notably, this analysis suggested that the neural circuit governing lawn exits is distinct from the neural circuit governing re-entry.</p><p>We next performed several tests to determine the robustness of our solutions, focusing on lawn re-entry behavior. To determine whether variation in archaerhodopsin expression might affect identification of neurons that govern this behavior, we tested the solutions to corrupted versions of the measurement matrix. The four neurons AVK, SIA, AIY, and MI were robustly identified regardless of matrix corruption (<xref ref-type="fig" rid="fig2s2">Figure 2—figure supplement 2</xref>). We next tested whether random removal of promoters would alter our solutions, <italic>i.e.,</italic> whether a small subset of strains was driving the identification of neurons. Neuron identification was robust to removal of up to 5 of the 29 promoters (<xref ref-type="fig" rid="fig2s3">Figure 2—figure supplement 3</xref>). Finally, we determine false-positive and false-negative rates for compressed sensing-based inference (<xref ref-type="fig" rid="fig2s4">Figure 2—figure supplement 4A</xref>), as well as the recovery rate and true positive rate for each of the four neurons (AVK, SIA, AIY, and MI) (<xref ref-type="fig" rid="fig2s4">Figure 2—figure supplement 4B–E</xref>). While all four neurons identified have high recovery rates, MI, SIA, and AVK can have true recovery rates below 50%. Thus, we would expect at least one of these neurons to be a false positive. To directly test and determine the roles of the neurons implicated by compressed sensing, we next focused on measuring the activities from these neuron types in freely moving animals.</p></sec><sec id="s2-4"><title>Neurons identified by compressed sensing encode the experience of pathogen exposure as a reduction in neural activity</title><p>We measured calcium signals in three neuron subtypes (AVK, SIA, and AIY) in unrestrained worms before and after exposure to pathogenic <italic>Pseudomonas</italic>. We excluded MI from this analysis because of its role as a pharyngeal motor neuron; perturbation of MI might have affected lawn re-entry by modulating bacteria ingestion (<xref ref-type="bibr" rid="bib57">Vidal et al., 2022</xref>).</p><p>To accurately measure calcium dynamics in AVK, SIA, and AIY, we used a custom real-time image-stabilization microscope capable of tracking and measuring neural dynamics in freely moving worms (<xref ref-type="fig" rid="fig4">Figure 4A</xref>). The microscope can track worms with 1 μm precision in all three dimensions while performing rotational stabilization by tracking a marker neuron (AWC<sup>on</sup>, P<italic>str-2::mKO</italic>). We demonstrated the capability of this system by imaging neural activity in freely moving <italic>C. elegans</italic> at high magnification for up to an hour without affecting animal behavior (<xref ref-type="bibr" rid="bib35">Lee et al., 2019</xref>).</p><fig id="fig4" position="float"><label>Figure 4.</label><caption><title>Identified neurons responsible for re-entry show reduction in calcium activity following PA14 exposure.</title><p>(<bold>A</bold>) Schematic of tracking and image stabilization microscope allowing for simultaneous measurement of GCaMP activity and worm position with 1 µm precision (orange: mKO emission, light green: GCaMP emission, blue: GCaMP excitation, dark green: mKO excitation). An mkOrange labeled marker neuron is imaged through Camera 1. This imaging data is transmitted to FPGA 1 for processing. Processed position information is used to control the x, y, z (stage) and rotational optics to stabilize the worm within the field of view. GCaMP imaging data is acquired via Camera 2. A tunable lens being controlled by FPGA 2 scans through the worm to allow for acquisition of GCaMP images at multiple focal planes. A DLP mirror array, controlled by a PC, is used to target light on specific neurons through structured illumination. (<bold>B</bold>) Fluorescent and phase image of P<italic>ttx-3</italic>::GCaMP line used to image AIY neural activity. Scale bar 10 µm. (<bold>C</bold>) Histogram of AIY neural activity pre (blue) and post (red) 24 hours of PA14 exposure normalized to pre-exposure baseline (see 'Materials and methods'). Data taken from n=4 worms over 36 minutes. Inset: histogram of neural activity from a single worm pre (blue) and post (red) 24-hour PA14 exposure. (<bold>D</bold>) AIY neural activity over 36 minutes for a single worm pre (blue) and post (red) 24 hours of PA14 exposure normalized to pre-exposure baseline (see 'Materials and methods'). Inset: zoom in of AIY neural activity between 28–33.5 minutes to illustrate neural activity transition in naïve (pre-exposed) worms. (<bold>E</bold>) Fluorescent and phase image of P<italic>npr-4</italic>::GCaMP line used for AVK imaging. Scale bar 10 µm. (<bold>F</bold>) Histogram of AVK neural activity pre (blue) and post (red) 24 hours of PA14 exposure normalized to pre-exposure baseline (see 'Materials and methods'). Data taken from n=7 worms over 36 min. Inset: histogram of neural activity from a single worm pre (blue) and post (red) 24-hour PA14 exposure. (<bold>G</bold>) AVK neural activity for a single worm pre (blue) and post (red) 24 hours of PA14 exposure as a function of time normalized to pre-exposure baseline (see 'Materials and methods'). (<bold>H</bold>) Fluorescent and phase image of P<italic>npr-4</italic>::GCaMP used to image SIA neural activity. Scale bar 10 µm. (<bold>I</bold>) Histogram of AVK neural activity pre (blue) and post (red) 24 hours of PA14 exposure normalized to pre-exposure baseline (see 'Materials and methods'). Data was taken from n=8 worms over 36 min. Inset: histogram of neural activity from a single worm (blue) and post (red) 24-hour PA14 exposure. (<bold>J</bold>) SIA neural activity for a single worm pre (blue) and post (red) 24 hours of PA14 exposure as a function of time normalized to pre-exposure baseline (see 'Materials and methods').</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-97340-fig4-v2.tif"/></fig><p>We tracked neurons in transgenic animals expressing the calcium sensor GCaMP6s in AVK, SIA, or AIY interneurons. Naive animals (pre-pathogen exposure) were imaged on an empty agar plate for approximately 40 minutes. These worms were then placed onto a PA14 lawn for 24 hours, recovered to an empty assay plate, and imaged for approximately 40 minutes to determine how pathogen exposure affected neural activity. P<italic>npr-4::GCaMP6s</italic> was utilized to measure the activity of AVKs and SIAs, and P<italic>ttx-3::GCaMP6s</italic> was used to measure the activity of AIYs. We found that AIY (<xref ref-type="fig" rid="fig4">Figure 4C and D</xref>), AVK (<xref ref-type="fig" rid="fig4">Figure 4F and G</xref>), and SIA (<xref ref-type="fig" rid="fig4">Figure 4I and J</xref>) all showed reduced neural activity after pathogen exposure. These results were evident both in analyses of populations of animals (<xref ref-type="fig" rid="fig4">Figure 4C, F and I</xref>), but were also clearly observed in individual worms (<xref ref-type="fig" rid="fig4">Figure 4C, F and I</xref> inset and <xref ref-type="fig" rid="fig4">Figure 4D, G and J</xref>). Pathogen exposure had different effects on different interneurons. AIY neurons of naive animals showed a significant increase in calcium approximately 30 minutes after transfer to assay plates (<xref ref-type="fig" rid="fig4">Figure 4D</xref>). By contrast, AIY neurons of animals that had been exposed to pathogens remained quiescent. AVK and SIA neurons of naive animals displayed continuous high-frequency calcium signals. Post-exposure, AVKs and SIAs displayed long periods of quiescence. This data indicated that the activity of neurons that regulate a behavior critical for learned pathogen avoidance is strongly affected by exposure to pathogen. These neurons thus appear to encode the history of exposure to pathogenic bacteria in their neural activity state.</p></sec><sec id="s2-5"><title>Modulation of candidate neurons validates their role in inhibition of pathogen lawn re-entry</title><p>We next tested how manipulating the activity of neurons identified by compressed sensing as regulators of lawn re-entry affects how naïve animals interact with bacterial lawns. We inhibited each of the three candidate neuron types using Archaerhodopsin and measured how acute neuronal inhibitions affected re-entry into a lawn of pathogen. We performed parallel measurements of a control set of worms that had not been treated with the opsin cofactor ATR. To target specific neurons, we used a DLP mirror array to restrict illumination to cells of interest as previously described (<xref ref-type="bibr" rid="bib35">Lee et al., 2019</xref>).</p><p>We found that acute inhibition of AIY in naive animals (no prior PA14 exposure) increased the latency of re-entry onto a fresh lawn of pathogenic <italic>Pseudomonas</italic>, mimicking the effect of prior pathogen exposure (<xref ref-type="fig" rid="fig5">Figure 5B</xref>). This effect was not the result of a general defect in locomotion or lawn-entry behavior; entry into lawns of non-pathogenic <italic>E. coli</italic> was not affected by AIY inhibition (<xref ref-type="fig" rid="fig5">Figure 5B</xref>). Inhibition of AVK failed to produce any effect on re-entry behavior (<xref ref-type="fig" rid="fig5">Figure 5D</xref>). Inhibition of <italic>npr-4</italic>-expressing neurons also increased latency to lawn entry on PA14 (<xref ref-type="fig" rid="fig5">Figure 5E</xref>). To validate that this effect was due to SIA, we projected patterned light onto P<italic>npr-4:Arch3</italic> animals (<xref ref-type="fig" rid="fig5">Figure 5F</xref>) to selectively inhibit SIA/SIB. Inhibition of SIA using this method deterred entry of worms onto PA14 lawns (<xref ref-type="fig" rid="fig5">Figure 5G</xref>), resulting in increased latency in entry (<xref ref-type="fig" rid="fig5">Figure 5H</xref>). Overall, our results show that two out of the three key neurons identified by compressed sensing were able to elicit a change in lawn entry dynamics through inhibition. Together, our neural imaging and selective inhibition suggested that reduced activity of AIY, SIA, and SIB drives the reduction in lawn occupancy triggered by pathogen exposure.</p><fig-group><fig id="fig5" position="float"><label>Figure 5.</label><caption><title>Entry onto pathogenic bacteria can be controlled through modulation of key neurons.</title><p>(<bold>A</bold>) Fluorescent and phase image of P<italic>ttx-3</italic>::ARCH line used for neuron specific AIY inhibition. Scale bar 10 µm. (<bold>B</bold>) Latency in entry (delay in the entry of the animal onto the bacteria lawn upon first contact) of naive worms onto PA14 (n&gt;18) and OP50 (n&gt;17) lawns with (red) and without (blue) AIY neural inhibition. Neural inhibition resulted in significant increases in latency in entry onto PA14, but not OP50. (<bold>C</bold>) Fluorescent and phase image of P<italic>flp-1</italic>::NpHR line used for neuron-specific AVK inhibition. Scale bar 10 µm. (<bold>D</bold>) Latency in entry of worms onto PA14 lawns with (red) and without (blue) AVK neural inhibition (n&gt;27). (<bold>E</bold>) Latency in entry of naive worms onto PA14 (n&gt;11) and OP50 (n&gt;16) with (red) and without (blue) inhibition of <italic>npr-4</italic> expressing neurons. Neural inhibition resulted in significant increases in latency in entry onto both PA14 and OP50. (<bold>F</bold>) Fluorescent images of P<italic>npr-4</italic>::ARCH with (+ATR) and without (-ATR) targeted illumination of SIA/SIB neuron cluster. (<bold>G</bold>) Representative sequence of phase contrast images of a naive worm attempting to enter PA14 bacteria lawn with (+ATR) and without (-ATR) SIA neural inhibition. Time labels denote time after first contact of worm with bacteria lawn. (<bold>H</bold>) Latency in entry of naive worms onto PA14 with (red) and without (blue) SIA neural inhibition. Neural inhibition resulted in a significant increase in latency in entry for PA14. (<bold>I</bold>) Fluorescent and phase image of P<italic>ttx-3</italic>::CHR2 line used for neuron-specific AIY activation. Scale bar corresponds to a length of 10 µm. (<bold>J</bold>) Re-entry rate constant of evacuated worms following 24 hours of exposure (post-exposure) to PA14 lawns with (green) and without (blue) AIY neural activation. Mean and SEM of the rate constant over n=5 samples of 10 worms each (see 'Materials and methods'). (<bold>K</bold>) Fluorescent and phase image of P<italic>npr-4</italic>::CHR2 line used for neural activation. Scale bar corresponds to a length of 10 µm. (<bold>L</bold>) Re-entry rate constant of evacuated worms following 24 hours of exposure to PA14 lawns with (green) and without (blue) <italic>npr-4</italic> neural activation. Mean and SEM of the rate constant over n=5 samples (see 'Materials and methods'). All experiments were performed over a 1-hour time period.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-97340-fig5-v2.tif"/></fig><fig id="fig5s1" position="float" specific-use="child-fig"><label>Figure 5—figure supplement 1.</label><caption><title>Activation of re-entry neurons fails to impact lawn occupancy.</title><p>Activation of AIY (<bold>A</bold>) and Npr-4 expressing neurons (<bold>B</bold>) fails to significantly increase lawn occupancy in evacuated colonies. (<bold>C</bold>) Worms that re-enter lawn after Npr-4 neural activation show very low residency time on PA14 lawns.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-97340-fig5-figsupp1-v2.tif"/></fig><fig id="fig5s2" position="float" specific-use="child-fig"><label>Figure 5—figure supplement 2.</label><caption><title>AIY neural activity controls reversal rates.</title><p>(<bold>A</bold>) Sample time series of AIY neural activity vs reversal rate over a 30-minute period. AIY neural activity increases with a decrease in reversal rate. (<bold>B</bold>). AIY neural activity anticorrelates with reversal rate (n=13 samples). (<bold>C</bold>) Time series of reversal rate with and without neural inhibition of AIY during navigation on an empty agar plate. (<bold>D</bold>) Aggregated reversal data with and without neural inhibition shows an increase in reversal rate with neural inhibition.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-97340-fig5-figsupp2-v2.tif"/></fig><fig id="fig5s3" position="float" specific-use="child-fig"><label>Figure 5—figure supplement 3.</label><caption><title>Candidate neuropeptide identification from re-entry neurons.</title><p>(<bold>A</bold>) Scatterplot of neuropeptides plotted on an axis of maximum relative expression in one of the two candidate neurons (AIY and SIA) versus the specificity of their expression (as measured by calculated participation ratio, see 'Materials and methods'). <italic>pdf-2</italic> is highlighted as a neuropeptide of interest as it showed both high expression and high specificity. (<bold>B</bold>) Plot of worm latency of re-entry onto lawns as a function of time spent on PA14 lawn for loss of function mutant of the neuropeptide <italic>pdf-2</italic> (red) and wild type worms (blue). Mutant worms showed systematic increases in latency of re-entry compared to wild type control. (<bold>C</bold>) Representative center of mass trajectories of worms at the edge of the PA14 lawn taken from 12 to 14 hours of PA14 exposure for wild type worms (left) and PDF-2 mutant worms (right) color coded by time.</p></caption><graphic mimetype="image" mime-subtype="tiff" xlink:href="elife-97340-fig5-figsupp3-v2.tif"/></fig></fig-group><p>We next tested whether activation of these neurons would suffice to reverse this behavioral switch. To test this, we optogenetically activated AIY, SIA, and SIB using transgenes expressing the light-gated ion channel channelrhodopsin-2 driven by the two promoters P<italic>ttx-3::ChR2</italic> and P<italic>npr-4::ChR2</italic>. Transgenic lines were fed ATR and placed on lawns of pathogenic bacteria for 24 hours to induce lawn evacuation. Blue light 467 nm, 1 mW/mm<sup>2</sup> was then used to activate these neurons and the rate of re-entry onto the lawn was quantified. For both P<italic>ttx-3::ChR2</italic> (<xref ref-type="fig" rid="fig5">Figure 5J</xref>) and P<italic>npr-4::ChR2</italic> (<xref ref-type="fig" rid="fig5">Figure 5L</xref>), activation of these neurons dramatically increased the re-entry rate of experienced animals onto the PA14 lawn. Animals that re-entered the lawn also rapidly exited the lawn. Thus, the increased re-entry rate did not result in sustained increases in lawn occupancy (<xref ref-type="fig" rid="fig5s1">Figure 5—figure supplement 1</xref>). These results further illustrate that lawn exit and re-entry are controlled by a distinct set of neurons (<xref ref-type="fig" rid="fig2">Figure 2C and D</xref>) and demonstrate that both behavioral modules must change in order to evacuate the bacterial lawn.</p></sec></sec><sec id="s3" sec-type="discussion"><title>Discussion</title><p>After experiencing pathogenic bacteria, worms switch their foraging behavior and evacuate the bacterial lawn. We found that this learned pathogen avoidance behavior is driven in part by changes to lawn re-entry behavior. Unlike naive animals, which rapidly re-enter a lawn of pathogen after they exit, animals previously exposed to pathogen dramatically delay re-entry upon encountering the pathogenic bacteria lawn. Such contact-dependent pathogen aversion depends in a graded manner on the extent of pathogen exposure; the latency to lawn re-entry increases with increased time of pathogen exposure. Contact-dependent inhibition of lawn re-entry is a previously unappreciated behavioral response to pathogen exposure revealed by our study. This behavior is distinct from associative olfactory learning and modulation of chemotactic behaviors reported by other studies (<xref ref-type="bibr" rid="bib60">Zhang et al., 2005</xref>, <xref ref-type="bibr" rid="bib20">Ha et al., 2010</xref>). In our study, continuous monitoring of worms exposed to pathogen revealed that animals that leave the pathogen lawn are capable of chemotaxis back to the lawn but stall upon contacting the lawn and do not re-enter. We further found that neurons previously identified as being important in aversive olfactory learning, for example, AIB, RIA, AIZ, and RIM (<xref ref-type="bibr" rid="bib20">Ha et al., 2010</xref>) were not essential for control of lawn re-entry. Our study indicated that the transition in pathogen lawn re-entry behavior occurs through modulation of two key neurons, AIY and SIA, which both decrease their neural activity in response to pathogen exposure. These neurons appear to encode information about the previous pathogen exposure in their neural activity, which in turn influences the worm’s behavior when they interact with the pathogenic bacteria. This encoding of experience in neural dynamics is reminiscent of similar processes seen in memory encoding in more complex organisms, such as in the case of the place cells of the hippocampus or the mushroom body.</p><p>The capacity of AIY and SIA to inhibit re-entry raises questions about how these neurons might contribute to this behavior. In our previous work, we demonstrated that SIA’s neural activity controls speed of locomotion (<xref ref-type="bibr" rid="bib35">Lee et al., 2019</xref>). Reduced SIA neural activity levels might therefore act to inhibit worm movement into the lawn, consistent with the edge stalling behavior seen in worms attempting to re-enter the lawn. Likewise, AIY has been linked to control of reversals and forward locomotion (<xref ref-type="bibr" rid="bib36">Li et al., 2014</xref>). Data we have collected on AIY’s neural activity shows a negative correlation with reversal rate (<xref ref-type="fig" rid="fig5s2">Figure 5—figure supplement 2A and B</xref>) and inhibition of AIY during locomotion results in increased reversal rate (<xref ref-type="fig" rid="fig5s2">Figure 5—figure supplement 2C and D</xref>). Reduced AIY activity may thus result in increased reversals and decreased sustained forward locomotion needed for lawn re-entry.</p><p>If contact-dependent lawn aversion represents a modality of pathogen aversion distinct from aversive olfactory learning, what sensory system governs this behavior? While we have yet to establish the signals involved in this process, some hints as to what might be responsible for this aversion can be inferred from looking at synaptic inputs to the neurons that we identified as key for this behavior. SIAs are connected to two sensory neurons that might play a role in driving neural activity changes following pathogen exposure: URX and CEP (<xref ref-type="bibr" rid="bib10">Chen et al., 2006</xref>). URX is a potent regulator of foraging behavior (<xref ref-type="bibr" rid="bib33">Laurent et al., 2015</xref>), is one of the few neurons with contact with the pseudocoelomic fluid of <italic>C. elegans</italic>, and has been previously linked to regulation of metabolic signals and innate immune responses (<xref ref-type="bibr" rid="bib50">Styer et al., 2008</xref>, <xref ref-type="bibr" rid="bib26">Hussey et al., 2018</xref>). CEPs mediate mechanosensory detection of bacteria and potently inhibit locomotion (<xref ref-type="bibr" rid="bib46">Sawin et al., 2000</xref>, <xref ref-type="bibr" rid="bib52">Tanimoto et al., 2016</xref>). By being downstream of these two neurons, SIA might integrate chemosensory and mechanosensory stimuli, two signals known to be important in modulating lawn evacuation from prior studies (<xref ref-type="bibr" rid="bib41">Meisel et al., 2014</xref>, <xref ref-type="bibr" rid="bib9">Chang et al., 2011</xref>). Other neurons that we identified—the AIYs—are part of the olfactory learning circuit and may thus represent a chemotactic component of this contact-dependent pathogen aversion (<xref ref-type="bibr" rid="bib20">Ha et al., 2010</xref>, <xref ref-type="bibr" rid="bib38">Liu et al., 2022b</xref>). In addition, AIY acts as a central hub neuron that is downstream of multiple sensory neurons and may thus also act as an integrator for multiple sensory modalities (<xref ref-type="bibr" rid="bib8">Chalasani et al., 2007</xref>, <xref ref-type="bibr" rid="bib3">Ashida et al., 2019</xref>, <xref ref-type="bibr" rid="bib32">Kuhara et al., 2011</xref>). Interestingly, investigation of molecular modulators of this aversion behavior by looking at neuropeptides that are highly and uniquely expressed in our neurons of interest reveals a candidate neuropeptide PDF-2 which is highly expressed in AIY (<xref ref-type="fig" rid="fig5s3">Figure 5—figure supplement 3A</xref>; <xref ref-type="bibr" rid="bib53">Taylor et al., 2021</xref>). Knocking out PDF-2 increases contact-dependent lawn avoidance (<xref ref-type="fig" rid="fig5s3">Figure 5—figure supplement 3B and C</xref>). PDF-2 has been implicated in gut to neuron signaling through the Rictor/TORC2 pathway (<xref ref-type="bibr" rid="bib42">O’Donnell et al., 2018</xref>), suggesting a potential mechanism through which pathogen infection data could be communicated to AIY to influence PDF-2 signaling to modulate behavior.</p><p>One remarkable aspect of the neurons that control lawn aversion is the fact that early perturbation of these neurons (within the first 1 to 3 hours of the animal’s deposition on the pathogenic lawn) produces long-term changes in pathogen avoidance behavior. Effects of this early neural inhibition could be seen in differences in lawn occupancy 15 hours later, suggesting that early suppression of neural activity patterns has long-term consequences of behavior. How could SIA and AIY produce such long-term effects? One possible explanation is that reduction in AIY and SIA neural activity might serve as an internal cue. The reduction in activity could drive a bistable circuit including AIY and SIA, causing extended suppression of their activity and a long-term change in their neural activity patterns. This bistability could be accomplished through positive autoregulatory feedback. PDF-2, which appears to be involved in bacteria re-entry, might provide such a mechanism to provide this feedback mechanism. Both PDF-2 and its receptor PDFR-1 are expressed in AIY (<xref ref-type="bibr" rid="bib17">Flavell et al., 2013</xref>), providing a potential feedback loop for bistability.</p><p>While contact-dependent re-entry represents a novel form of pathogen aversion, it is not the only behavioral transition driving lawn evacuation. Using our compressed sensing-based approach, we were able to rapidly assay the nervous system to not only discover the key neurons controlling entry, but also exit from the pathogen lawn. We find there is little overlap between the sets of neurons controlling these two subbehaviors. Consistent with this, we were able to modulate subbehaviors independently. With the exception of P<italic>dop-</italic>2, lines that showed increases in exit rate upon inhibition did not show changes in lawn re-entry dynamics, and activation of neurons modulating re-entry failed to suppress the exit of worms off the lawn. Together, these results suggest that neural control of lawn evacuation is highly modular, with different sets of neurons governing the individual behavioral transitions needed for lawn evacuation. This modularity in control over net pathogen aversion is similar to that seen in several forms of aversive olfactory learning of <italic>C. elegans</italic> in response to pathogenic bacteria. For example, imprinting of a memory of pathogenic bacteria in larvae stage worms requires distinct sets of neurons for the establishment of the memory and the expression of that memory (<xref ref-type="bibr" rid="bib27">Jin et al., 2016</xref>), while aversive learning in adult worms carries distinct neural circuits for naïve versus learned olfactory preference (<xref ref-type="bibr" rid="bib20">Ha et al., 2010</xref>).</p></sec><sec id="s4" sec-type="materials|methods"><title>Materials and methods</title><sec id="s4-1"><title>Strains</title><p>All lines used in this work are listed in supplementary tables. Lines used for the measurement matrix are in <xref ref-type="supplementary-material" rid="supp1">Supplementary file 1</xref>. Lines used for neural activation and halorhodopsin can be seen in <xref ref-type="supplementary-material" rid="supp2">Supplementary file 2</xref>. Finally, lines used for neural imaging can be seen in <xref ref-type="supplementary-material" rid="supp3">Supplementary file 3</xref>. PDF-2 mutant used was wSR897: nlp-37(tm4780).</p></sec><sec id="s4-2"><title>Lawn evacuation assays</title><p>PA14 lawn evacuation assay plates were prepared as follows. PA14 was inoculated into LB media and allowed to grow for 15 hours without shaking at 37 °C until the culture reached an OD of 0.1–0.2. 5 uL of this culture was then pipetted onto NGM Agar plates and the colonies were allowed to grow for 18 hours at room temperature. Each colony was surrounded by a ring of filter paper to prevent worms from escaping to the edges of the plate. OP50 lawn evacuation plates were prepared in the same manner as PA14 evacuation plates; however, OP50 bacteria was grown for 18 hours at 37°C with shaking. This longer growth period was used to roughly match the thickness of the PA14 and OP50 colonies.</p><p>To begin lawn evacuation, 10 worms were transferred onto the bacteria lawn and given 1 hour to settle. All worms used for this assay were 1-day-old hermaphroditic adults grown on OP50 bacteria. The assay was then imaged at 3 fps for a total of 18 hours to assay lawn avoidance. Occupancy rate was calculated as (Number of worms on lawn)/(Total number of worms). Worms were counted as being on the lawn if any part of the body was in contact with the lawn.</p></sec><sec id="s4-3"><title>Lawn re-entry assay</title><p>PA14 bacteria colonies were generated as described for the lawn evacuation assay. Assays were initiated by placing 5–10 worms 5 mm away from the lawn edge, and then imaging the worms at 3 fps for 1 hour. Worms were infected prior to the assay by placing them onto a PA14 lawn evacuation colony for 15 hours. Worms that evacuated the colony over this time period were removed from the plate and used in the assay. Control worms were left on an OP50 lawn during this timeframe.</p></sec><sec id="s4-4"><title>Compressed sensing implementation</title><p>Compressed sensing was implemented using Lasso regression in Python using the scikit-learn library. Solutions were evaluated over a range of sparsity parameters over 6 orders of magnitude, and chi-squared error of the difference between behavioral predictions and measured behavior was calculated. Solutions shown in <xref ref-type="fig" rid="fig3">Figure 3</xref> were taken by selecting solutions where chi-squared error began to increase as seen in <xref ref-type="fig" rid="fig2s1">Figure 2—figure supplement 1</xref>.</p></sec><sec id="s4-5"><title>Optogenetic assay for lawn evacuation</title><p>All transgenic lines used for this assay were generated by fusing Archaerhodopsin-3 to the relevant promoters via fusion PCR and then injecting the resulting constructs into worms. Worms used for optogenetic assays were fed on the rhodopsin cofactor all-trans retinal (ATR) for +12 hours before the assay. One-day-old adults were used for all behavioral assays.</p><p>Plates were set up as described for the lawn evacuation assays above. Following this, we performed optogenetic inhibition with pulsed (1 second on, 1 second off) 5 mW/mm<sup>2</sup> green light for 2 hours using a ScopeLED G250 to activate archaerhodopsin. Assays were imaged for a total of 18 hours either at one frame per 3 minutes for the full assay, or 3 fps to assay entry and exit sub-behaviors.</p></sec><sec id="s4-6"><title>Targeted inhibition of neurons during re-entry</title><p>Targeted inhibition of SIA and SIB was carried out as described in previous work. Worms were cultured for 12+hours on ATR. Worms were then placed 5 mm away from the edge of a PA14 lawn generated as described above. SIA and SIB were located at the center of the fluorescent pattern P<italic>npr-4::Arch3</italic> line. A circular pattern of light was projected from the DLP projector to selectively target SIA/SIB. Worms were tracked in the frame of view and imaged until they fully entered the PA14 colony or for a total of 1 hour after the worms first contacted the lawn.</p></sec><sec id="s4-7"><title>Quantification of entry and exit rate for optogenetic screening</title><p>Lawn exit rate was calculated by evaluating the number of exit events during the 2-hour timeframe of neural inhibition. Lawn evacuation movies were analyzed in 1-minute intervals, and any exit events occurring (as defined by a worm completely leaving contact with the bacteria) were noted. The exit events per hour were calculated from this, and statistics were calculated by aggregating exit rates per each experiment replicate (with each replicate consisting of 10 worms on a PA14 lawn). Latency to re-entry was also evaluated by measuring the time from first contact of the worm to the bacteria lawn to time of full entry of the worm onto the lawn. All latency to re-entry analysis was performed by aggregating all works that exited and re-entered the lawn during the measured timeframe. Analysis of statistical significance was performed by carrying out a t-test implemented in Matlab on the phenotype with and without neural inhibition.</p></sec><sec id="s4-8"><title>GCAMP imaging and analysis</title><p>Calcium imaging was performed using a custom-built microscope as previously described in past work at 15.625 frames per second. Worms were first imaged on an empty NGM plate for 40 minutes. Imaged worms were then transferred onto a colony of PA14 bacteria as used for the lawn evacuation assay and allowed to remain there for 24 hours. Following this, infected worms were imaged again for another 40 minutes.</p><p>GCaMP intensity information was extracted using custom software written in MATLAB to extract intensity data given segments encapsulating the neurons of interest. GCaMP imaging data was compiled for all imaged worms. Worm to worm variability in GCAMP expression was normalized by dividing all data by the bottom 5 percentile of fluorescence intensity in healthy worms. GCaMP data was smoothed over a 6-second window.</p></sec><sec id="s4-9"><title>Re-entry with neural activation</title><p>PA14 lawn evacuation plates were prepared as described above, and 10 ATR-treated worms expressing channelrhodopsin-2 under the relevant promoters were seeded onto each colony. Channelrhodopsin was activated using 1 mW/mm<sup>2</sup> blue light for 1 hour. Re-entry rate (defined as the rate at which worms fully entered the lawn) and contact rate were evaluated and quantified over this time.</p></sec><sec id="s4-10"><title>Promoter removal and additions</title><p>The robustness of the solutions to removal of promoters was tested as follows. 1–5 promoters were removed from the measurement matrix at random. The resulting measurement matrix and phenotype vector were used to infer neuronal weights for the re-entry phenotype. This process was repeated 200 times for each of the 1–5 promoters, or 1000 times in total for 1–5 promoters. Our results demonstrated robustness of AIY, AVK, SIA, and MI to these removals.</p></sec><sec id="s4-11"><title>Robustness of solutions to corruption of measurement matrix</title><p>The robustness of the solutions to corruption of the measurement matrix was tested by randomly altering a small fraction of the measurement matrix and re-inferring the neural contributions. 10% of the non-zero entries in the measurement matrix were altered to a value between 0 and 0.5. 1000 such corrupted measurement matrices were generated and solutions to each corrupted matrix were inferred via Lasso regression. Our results demonstrated that corruption generally did not result in alteration of the inferred neurons, with AIY, AVK, MI, and SIA robustly being inferred even with matrix corruption.</p></sec><sec id="s4-12"><title>Calculation of inverse participation ratio and relative expression</title><p>Single-cell RNA seq data from Taylor et al. was used to calculate the average expression of each neuropeptide within each neuron type. The relative expression of each of the neuropeptides in each neuron was calculated by dividing expression in each neuron by the maximum expression over all neurons. Inverse participation ratio (IPR) was calculated as<disp-formula id="equ1"><alternatives><mml:math id="m1"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mrow><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mstyle displaystyle="true" scriptlevel="0"><mml:mi>I</mml:mi><mml:mi>P</mml:mi><mml:mi>R</mml:mi><mml:mo>=</mml:mo><mml:mtext> </mml:mtext><mml:mfrac><mml:mn>1</mml:mn><mml:mrow><mml:munder><mml:mo>∑</mml:mo><mml:mi>i</mml:mi></mml:munder><mml:msup><mml:mrow><mml:mo>(</mml:mo><mml:mfrac><mml:msub><mml:mi>E</mml:mi><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub><mml:mrow><mml:munder><mml:mo>∑</mml:mo><mml:mi>i</mml:mi></mml:munder><mml:msub><mml:mi>E</mml:mi><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:mrow></mml:mfrac><mml:mo>)</mml:mo></mml:mrow><mml:mrow><mml:mn>2</mml:mn></mml:mrow></mml:msup></mml:mrow></mml:mfrac></mml:mstyle></mml:mstyle></mml:mrow></mml:mstyle></mml:math><tex-math id="t1">\begin{document}$$\displaystyle  IPR=\ \frac{1}{\underset{i}{\sum }\left (\frac{E_{i}}{\underset{i}{\sum }E_{i}}\right)^{2}}$$\end{document}</tex-math></alternatives></disp-formula></p><p>where <inline-formula><alternatives><mml:math id="inf15"><mml:msub><mml:mrow><mml:mi>E</mml:mi></mml:mrow><mml:mrow><mml:mi>i</mml:mi></mml:mrow></mml:msub></mml:math><tex-math id="inft15">\begin{document}$E_{i}$\end{document}</tex-math></alternatives></inline-formula> is the expression in the <italic>i</italic>th neuron.</p></sec></sec></body><back><sec sec-type="additional-information" id="s5"><title>Additional information</title><fn-group content-type="competing-interest"><title>Competing interests</title><fn fn-type="COI-statement" id="conf1"><p>No competing interests declared</p></fn></fn-group><fn-group content-type="author-contribution"><title>Author contributions</title><fn fn-type="con" id="con1"><p>Conceptualization, Data curation, Software, Formal analysis, Validation, Investigation, Visualization, Methodology, Writing – original draft</p></fn><fn fn-type="con" id="con2"><p>Conceptualization, Formal analysis, Investigation, Visualization, Methodology</p></fn><fn fn-type="con" id="con3"><p>Supervision, Methodology, Writing – review and editing</p></fn><fn fn-type="con" id="con4"><p>Conceptualization, Supervision, Investigation, Methodology, Writing – original draft, Project administration, Writing – review and editing</p></fn></fn-group></sec><sec sec-type="supplementary-material" id="s6"><title>Additional files</title><supplementary-material id="supp1"><label>Supplementary file 1.</label><caption><title>Archaerhodopsin lines that constitute the measurement matrix.</title></caption><media xlink:href="elife-97340-supp1-v2.docx" mimetype="application" mime-subtype="docx"/></supplementary-material><supplementary-material id="supp2"><label>Supplementary file 2.</label><caption><title>Channelrhodopsin and halorhodopsin lines.</title></caption><media xlink:href="elife-97340-supp2-v2.docx" mimetype="application" mime-subtype="docx"/></supplementary-material><supplementary-material id="supp3"><label>Supplementary file 3.</label><caption><title>GCaMP lines.</title></caption><media xlink:href="elife-97340-supp3-v2.docx" mimetype="application" mime-subtype="docx"/></supplementary-material><supplementary-material id="mdar"><label>MDAR checklist</label><media xlink:href="elife-97340-mdarchecklist1-v2.docx" mimetype="application" mime-subtype="docx"/></supplementary-material></sec><sec sec-type="data-availability" id="s7"><title>Data availability</title><p>Processed behavioral, imaging, and screening data, together with analysis code, are openly available at <ext-link ext-link-type="uri" xlink:href="https://github.com/TimHVAnalytica/C-elegans-pathogen-avoidance-data">https://github.com/TimHVAnalytica/C-elegans-pathogen-avoidance-data</ext-link> (copy archived at <xref ref-type="bibr" rid="bib21">Hallacy, 2025</xref>).</p><p>The following previously published dataset was used:</p><p><element-citation publication-type="data" specific-use="references" id="dataset1"><person-group person-group-type="author"><name><surname>Taylor</surname><given-names>SR</given-names></name><name><surname>Miller</surname><given-names>DM</given-names></name></person-group><year iso-8601-date="2019">2019</year><data-title>Molecular topography of an entire nervous system</data-title><source>NCBI Gene Expression Omnibus</source><pub-id pub-id-type="accession" xlink:href="https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE136049">GSE136049</pub-id></element-citation></p></sec><ack id="ack"><title>Acknowledgements</title><p>We would like to thank members of the Ringstad and Ramathan lab for their feedback and advice on the manuscript. This work is supported by 5R01NS117908-03 (SR, NR).</p></ack><ref-list><title>References</title><ref id="bib1"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Amano</surname><given-names>H</given-names></name><name><surname>Maruyama</surname><given-names>IN</given-names></name></person-group><year iso-8601-date="2011">2011</year><article-title>Aversive olfactory learning and associative long-term memory in <italic>Caenorhabditis elegans</italic></article-title><source>Learning &amp; Memory</source><volume>18</volume><fpage>654</fpage><lpage>665</lpage><pub-id pub-id-type="doi">10.1101/lm.2224411</pub-id><pub-id pub-id-type="pmid">21960709</pub-id></element-citation></ref><ref id="bib2"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Ardiel</surname><given-names>EL</given-names></name><name><surname>Rankin</surname><given-names>CH</given-names></name></person-group><year iso-8601-date="2010">2010</year><article-title>An elegant mind: learning and memory in <italic>Caenorhabditis elegans</italic></article-title><source>Learning &amp; Memory</source><volume>17</volume><fpage>191</fpage><lpage>201</lpage><pub-id pub-id-type="doi">10.1101/lm.960510</pub-id><pub-id pub-id-type="pmid">20335372</pub-id></element-citation></ref><ref id="bib3"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Ashida</surname><given-names>K</given-names></name><name><surname>Hotta</surname><given-names>K</given-names></name><name><surname>Oka</surname><given-names>K</given-names></name></person-group><year iso-8601-date="2019">2019</year><article-title>The input-output relationship of AIY interneurons in <italic>Caenorhabditis elegans</italic> in noisy environment</article-title><source>iScience</source><volume>19</volume><fpage>191</fpage><lpage>203</lpage><pub-id pub-id-type="doi">10.1016/j.isci.2019.07.028</pub-id><pub-id pub-id-type="pmid">31377664</pub-id></element-citation></ref><ref id="bib4"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Avery</surname><given-names>L</given-names></name><name><surname>Horvitz</surname><given-names>HR</given-names></name></person-group><year iso-8601-date="1989">1989</year><article-title>Pharyngeal pumping continues after laser killing of the pharyngeal nervous system of <italic>C. elegans</italic></article-title><source>Neuron</source><volume>3</volume><fpage>473</fpage><lpage>485</lpage><pub-id pub-id-type="doi">10.1016/0896-6273(89)90206-7</pub-id><pub-id pub-id-type="pmid">2642006</pub-id></element-citation></ref><ref id="bib5"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Bai</surname><given-names>H</given-names></name><name><surname>Zou</surname><given-names>W</given-names></name><name><surname>Zhou</surname><given-names>W</given-names></name><name><surname>Zhang</surname><given-names>K</given-names></name><name><surname>Huang</surname><given-names>X</given-names></name></person-group><year iso-8601-date="2021">2021</year><article-title>Deficiency of innate immunity against <italic>Pseudomonas aeruginosa</italic> enhances behavioral avoidance via the HECW-1/NPR-1 module in <italic>Caenorhabditis elegans</italic></article-title><source>Infection and Immunity</source><volume>89</volume><elocation-id>e0006721</elocation-id><pub-id pub-id-type="doi">10.1128/IAI.00067-21</pub-id><pub-id pub-id-type="pmid">34310887</pub-id></element-citation></ref><ref id="bib6"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Bird</surname><given-names>CM</given-names></name><name><surname>Burgess</surname><given-names>N</given-names></name></person-group><year iso-8601-date="2008">2008</year><article-title>The hippocampus and memory: insights from spatial processing</article-title><source>Nature Reviews. Neuroscience</source><volume>9</volume><fpage>182</fpage><lpage>194</lpage><pub-id pub-id-type="doi">10.1038/nrn2335</pub-id><pub-id pub-id-type="pmid">18270514</pub-id></element-citation></ref><ref id="bib7"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Candes</surname><given-names>EJ</given-names></name><name><surname>Wakin</surname><given-names>MB</given-names></name></person-group><year iso-8601-date="2008">2008</year><article-title>An introduction to compressive sampling</article-title><source>IEEE Signal Processing Magazine</source><volume>25</volume><fpage>21</fpage><lpage>30</lpage><pub-id pub-id-type="doi">10.1109/MSP.2007.914731</pub-id></element-citation></ref><ref id="bib8"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Chalasani</surname><given-names>SH</given-names></name><name><surname>Chronis</surname><given-names>N</given-names></name><name><surname>Tsunozaki</surname><given-names>M</given-names></name><name><surname>Gray</surname><given-names>JM</given-names></name><name><surname>Ramot</surname><given-names>D</given-names></name><name><surname>Goodman</surname><given-names>MB</given-names></name><name><surname>Bargmann</surname><given-names>CI</given-names></name></person-group><year iso-8601-date="2007">2007</year><article-title>Dissecting a circuit for olfactory behaviour in <italic>Caenorhabditis elegans</italic></article-title><source>Nature</source><volume>450</volume><fpage>63</fpage><lpage>70</lpage><pub-id pub-id-type="doi">10.1038/nature06292</pub-id><pub-id pub-id-type="pmid">17972877</pub-id></element-citation></ref><ref id="bib9"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Chang</surname><given-names>HC</given-names></name><name><surname>Paek</surname><given-names>J</given-names></name><name><surname>Kim</surname><given-names>DH</given-names></name></person-group><year iso-8601-date="2011">2011</year><article-title>Natural polymorphisms in <italic>C. elegans</italic> HECW-1 E3 ligase affect pathogen avoidance behaviour</article-title><source>Nature</source><volume>480</volume><fpage>525</fpage><lpage>529</lpage><pub-id pub-id-type="doi">10.1038/nature10643</pub-id><pub-id pub-id-type="pmid">22089131</pub-id></element-citation></ref><ref id="bib10"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Chen</surname><given-names>BL</given-names></name><name><surname>Hall</surname><given-names>DH</given-names></name><name><surname>Chklovskii</surname><given-names>DB</given-names></name></person-group><year iso-8601-date="2006">2006</year><article-title>Wiring optimization can relate neuronal structure and function</article-title><source>PNAS</source><volume>103</volume><fpage>4723</fpage><lpage>4728</lpage><pub-id pub-id-type="doi">10.1073/pnas.0506806103</pub-id><pub-id pub-id-type="pmid">16537428</pub-id></element-citation></ref><ref id="bib11"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Chen</surname><given-names>Z</given-names></name><name><surname>Hendricks</surname><given-names>M</given-names></name><name><surname>Cornils</surname><given-names>A</given-names></name><name><surname>Maier</surname><given-names>W</given-names></name><name><surname>Alcedo</surname><given-names>J</given-names></name><name><surname>Zhang</surname><given-names>Y</given-names></name></person-group><year iso-8601-date="2013">2013</year><article-title>Two insulin-like peptides antagonistically regulate aversive olfactory learning in <italic>C. elegans</italic></article-title><source>Neuron</source><volume>77</volume><fpage>572</fpage><lpage>585</lpage><pub-id pub-id-type="doi">10.1016/j.neuron.2012.11.025</pub-id><pub-id pub-id-type="pmid">23395381</pub-id></element-citation></ref><ref id="bib12"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>de Belle</surname><given-names>JS</given-names></name><name><surname>Heisenberg</surname><given-names>M</given-names></name></person-group><year iso-8601-date="1994">1994</year><article-title>Associative odor learning in <italic>Drosophila</italic> abolished by chemical ablation of mushroom bodies</article-title><source>Science</source><volume>263</volume><fpage>692</fpage><lpage>695</lpage><pub-id pub-id-type="doi">10.1126/science.8303280</pub-id><pub-id pub-id-type="pmid">8303280</pub-id></element-citation></ref><ref id="bib13"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Donoho</surname><given-names>DL</given-names></name></person-group><year iso-8601-date="2006">2006</year><article-title>Compressed sensing</article-title><source>IEEE Transactions on Information Theory</source><volume>52</volume><fpage>1289</fpage><lpage>1306</lpage><pub-id pub-id-type="doi">10.1109/TIT.2006.871582</pub-id></element-citation></ref><ref id="bib14"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Duff</surname><given-names>MC</given-names></name><name><surname>Covington</surname><given-names>NV</given-names></name><name><surname>Hilverman</surname><given-names>C</given-names></name><name><surname>Cohen</surname><given-names>NJ</given-names></name></person-group><year iso-8601-date="2019">2019</year><article-title>Semantic memory and the hippocampus: revisiting, reaffirming, and extending the reach of their critical relationship</article-title><source>Frontiers in Human Neuroscience</source><volume>13</volume><elocation-id>471</elocation-id><pub-id pub-id-type="doi">10.3389/fnhum.2019.00471</pub-id><pub-id pub-id-type="pmid">32038203</pub-id></element-citation></ref><ref id="bib15"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Eliezer</surname><given-names>Y</given-names></name><name><surname>Deshe</surname><given-names>N</given-names></name><name><surname>Hoch</surname><given-names>L</given-names></name><name><surname>Iwanir</surname><given-names>S</given-names></name><name><surname>Pritz</surname><given-names>CO</given-names></name><name><surname>Zaslaver</surname><given-names>A</given-names></name></person-group><year iso-8601-date="2019">2019</year><article-title>A memory circuit for coping with impending adversity</article-title><source>Current Biology</source><volume>29</volume><fpage>1573</fpage><lpage>1583</lpage><pub-id pub-id-type="doi">10.1016/j.cub.2019.03.059</pub-id><pub-id pub-id-type="pmid">31056393</pub-id></element-citation></ref><ref id="bib16"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>FeldmanHall</surname><given-names>O</given-names></name><name><surname>Montez</surname><given-names>DF</given-names></name><name><surname>Phelps</surname><given-names>EA</given-names></name><name><surname>Davachi</surname><given-names>L</given-names></name><name><surname>Murty</surname><given-names>VP</given-names></name></person-group><year iso-8601-date="2021">2021</year><article-title>Hippocampus guides adaptive learning during dynamic social interactions</article-title><source>The Journal of Neuroscience</source><volume>41</volume><fpage>1340</fpage><lpage>1348</lpage><pub-id pub-id-type="doi">10.1523/JNEUROSCI.0873-20.2020</pub-id><pub-id pub-id-type="pmid">33361462</pub-id></element-citation></ref><ref id="bib17"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Flavell</surname><given-names>SW</given-names></name><name><surname>Pokala</surname><given-names>N</given-names></name><name><surname>Macosko</surname><given-names>EZ</given-names></name><name><surname>Albrecht</surname><given-names>DR</given-names></name><name><surname>Larsch</surname><given-names>J</given-names></name><name><surname>Bargmann</surname><given-names>CI</given-names></name></person-group><year iso-8601-date="2013">2013</year><article-title>Serotonin and the neuropeptide PDF initiate and extend opposing behavioral states in <italic>C. elegans</italic></article-title><source>Cell</source><volume>154</volume><fpage>1023</fpage><lpage>1035</lpage><pub-id pub-id-type="doi">10.1016/j.cell.2013.08.001</pub-id><pub-id pub-id-type="pmid">23972393</pub-id></element-citation></ref><ref id="bib18"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Gourgou</surname><given-names>E</given-names></name><name><surname>Adiga</surname><given-names>K</given-names></name><name><surname>Goettemoeller</surname><given-names>A</given-names></name><name><surname>Chen</surname><given-names>C</given-names></name><name><surname>Hsu</surname><given-names>AL</given-names></name></person-group><year iso-8601-date="2021">2021</year><article-title><italic>Caenorhabditis elegans</italic> learning in a structured maze is a multisensory behavior</article-title><source>iScience</source><volume>24</volume><elocation-id>102284</elocation-id><pub-id pub-id-type="doi">10.1016/j.isci.2021.102284</pub-id><pub-id pub-id-type="pmid">33889812</pub-id></element-citation></ref><ref id="bib19"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Gray</surname><given-names>JM</given-names></name><name><surname>Hill</surname><given-names>JJ</given-names></name><name><surname>Bargmann</surname><given-names>CI</given-names></name></person-group><year iso-8601-date="2005">2005</year><article-title>A circuit for navigation in <italic>Caenorhabditis elegans</italic></article-title><source>PNAS</source><volume>102</volume><fpage>3184</fpage><lpage>3191</lpage><pub-id pub-id-type="doi">10.1073/pnas.0409009101</pub-id><pub-id pub-id-type="pmid">15689400</pub-id></element-citation></ref><ref id="bib20"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Ha</surname><given-names>H</given-names></name><name><surname>Hendricks</surname><given-names>M</given-names></name><name><surname>Shen</surname><given-names>Y</given-names></name><name><surname>Gabel</surname><given-names>CV</given-names></name><name><surname>Fang-Yen</surname><given-names>C</given-names></name><name><surname>Qin</surname><given-names>Y</given-names></name><name><surname>Colón-Ramos</surname><given-names>D</given-names></name><name><surname>Shen</surname><given-names>K</given-names></name><name><surname>Samuel</surname><given-names>ADT</given-names></name><name><surname>Zhang</surname><given-names>Y</given-names></name></person-group><year iso-8601-date="2010">2010</year><article-title>Functional organization of a neural network for aversive olfactory learning in <italic>Caenorhabditis elegans</italic></article-title><source>Neuron</source><volume>68</volume><fpage>1173</fpage><lpage>1186</lpage><pub-id pub-id-type="doi">10.1016/j.neuron.2010.11.025</pub-id><pub-id pub-id-type="pmid">21172617</pub-id></element-citation></ref><ref id="bib21"><element-citation publication-type="software"><person-group person-group-type="author"><name><surname>Hallacy</surname><given-names>T</given-names></name></person-group><year iso-8601-date="2025">2025</year><data-title>C-elegans-pathogen-avoidance-data</data-title><version designator="swh:1:rev:ae86fac312692b6000c37c66405ff8e5390705c4">swh:1:rev:ae86fac312692b6000c37c66405ff8e5390705c4</version><source>Software Heritage</source><ext-link ext-link-type="uri" xlink:href="https://archive.softwareheritage.org/swh:1:dir:7f01d5ac33d507febdb6f3a3e283a62b831859b5;origin=https://github.com/TimHVAnalytica/C-elegans-pathogen-avoidance-data;visit=swh:1:snp:3147a3f67bb22efb527b1ebb30da80a6006fda50;anchor=swh:1:rev:ae86fac312692b6000c37c66405ff8e5390705c4">https://archive.softwareheritage.org/swh:1:dir:7f01d5ac33d507febdb6f3a3e283a62b831859b5;origin=https://github.com/TimHVAnalytica/C-elegans-pathogen-avoidance-data;visit=swh:1:snp:3147a3f67bb22efb527b1ebb30da80a6006fda50;anchor=swh:1:rev:ae86fac312692b6000c37c66405ff8e5390705c4</ext-link></element-citation></ref><ref id="bib22"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Hao</surname><given-names>Y</given-names></name><name><surname>Yang</surname><given-names>W</given-names></name><name><surname>Ren</surname><given-names>J</given-names></name><name><surname>Hall</surname><given-names>Q</given-names></name><name><surname>Zhang</surname><given-names>Y</given-names></name><name><surname>Kaplan</surname><given-names>JM</given-names></name></person-group><year iso-8601-date="2018">2018</year><article-title>Thioredoxin shapes the <italic>C. elegans</italic> sensory response to <italic>Pseudomonas</italic> produced nitric oxide</article-title><source>eLife</source><volume>7</volume><elocation-id>e36833</elocation-id><pub-id pub-id-type="doi">10.7554/eLife.36833</pub-id></element-citation></ref><ref id="bib23"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Harris</surname><given-names>G</given-names></name><name><surname>Shen</surname><given-names>Y</given-names></name><name><surname>Ha</surname><given-names>H</given-names></name><name><surname>Donato</surname><given-names>A</given-names></name><name><surname>Wallis</surname><given-names>S</given-names></name><name><surname>Zhang</surname><given-names>X</given-names></name><name><surname>Zhang</surname><given-names>Y</given-names></name></person-group><year iso-8601-date="2014">2014</year><article-title>Dissecting the signaling mechanisms underlying recognition and preference of food odors</article-title><source>The Journal of Neuroscience</source><volume>34</volume><fpage>9389</fpage><lpage>9403</lpage><pub-id pub-id-type="doi">10.1523/JNEUROSCI.0012-14.2014</pub-id><pub-id pub-id-type="pmid">25009271</pub-id></element-citation></ref><ref id="bib24"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Heisenberg</surname><given-names>M</given-names></name></person-group><year iso-8601-date="2003">2003</year><article-title>Mushroom body memoir: from maps to models</article-title><source>Nature Reviews. Neuroscience</source><volume>4</volume><fpage>266</fpage><lpage>275</lpage><pub-id pub-id-type="doi">10.1038/nrn1074</pub-id><pub-id pub-id-type="pmid">12671643</pub-id></element-citation></ref><ref id="bib25"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Hobert</surname><given-names>O</given-names></name><name><surname>Glenwinkel</surname><given-names>L</given-names></name><name><surname>White</surname><given-names>J</given-names></name></person-group><year iso-8601-date="2016">2016</year><article-title>Revisiting neuronal cell type classification in <italic>Caenorhabditis elegans</italic></article-title><source>Current Biology</source><volume>26</volume><fpage>R1197</fpage><lpage>R1203</lpage><pub-id pub-id-type="doi">10.1016/j.cub.2016.10.027</pub-id><pub-id pub-id-type="pmid">27875702</pub-id></element-citation></ref><ref id="bib26"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Hussey</surname><given-names>R</given-names></name><name><surname>Littlejohn</surname><given-names>NK</given-names></name><name><surname>Witham</surname><given-names>E</given-names></name><name><surname>Vanstrum</surname><given-names>E</given-names></name><name><surname>Mesgarzadeh</surname><given-names>J</given-names></name><name><surname>Ratanpal</surname><given-names>H</given-names></name><name><surname>Srinivasan</surname><given-names>S</given-names></name></person-group><year iso-8601-date="2018">2018</year><article-title>Oxygen-sensing neurons reciprocally regulate peripheral lipid metabolism via neuropeptide signaling in <italic>Caenorhabditis elegans</italic></article-title><source>PLOS Genetics</source><volume>14</volume><elocation-id>e1007305</elocation-id><pub-id pub-id-type="doi">10.1371/journal.pgen.1007305</pub-id><pub-id pub-id-type="pmid">29579048</pub-id></element-citation></ref><ref id="bib27"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Jin</surname><given-names>X</given-names></name><name><surname>Pokala</surname><given-names>N</given-names></name><name><surname>Bargmann</surname><given-names>CI</given-names></name></person-group><year iso-8601-date="2016">2016</year><article-title>Distinct circuits for the formation and retrieval of an imprinted olfactory memory</article-title><source>Cell</source><volume>164</volume><fpage>632</fpage><lpage>643</lpage><pub-id pub-id-type="doi">10.1016/j.cell.2016.01.007</pub-id><pub-id pub-id-type="pmid">26871629</pub-id></element-citation></ref><ref id="bib28"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Kaletsky</surname><given-names>R</given-names></name><name><surname>Moore</surname><given-names>RS</given-names></name><name><surname>Vrla</surname><given-names>GD</given-names></name><name><surname>Parsons</surname><given-names>LR</given-names></name><name><surname>Gitai</surname><given-names>Z</given-names></name><name><surname>Murphy</surname><given-names>CT</given-names></name></person-group><year iso-8601-date="2020">2020</year><article-title><italic>C. elegans</italic> interprets bacterial non-coding RNAs to learn pathogenic avoidance</article-title><source>Nature</source><volume>586</volume><fpage>445</fpage><lpage>451</lpage><pub-id pub-id-type="doi">10.1038/s41586-020-2699-5</pub-id><pub-id pub-id-type="pmid">32908307</pub-id></element-citation></ref><ref id="bib29"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Kim</surname><given-names>DH</given-names></name><name><surname>Feinbaum</surname><given-names>R</given-names></name><name><surname>Alloing</surname><given-names>G</given-names></name><name><surname>Emerson</surname><given-names>FE</given-names></name><name><surname>Garsin</surname><given-names>DA</given-names></name><name><surname>Inoue</surname><given-names>H</given-names></name><name><surname>Tanaka-Hino</surname><given-names>M</given-names></name><name><surname>Hisamoto</surname><given-names>N</given-names></name><name><surname>Matsumoto</surname><given-names>K</given-names></name><name><surname>Tan</surname><given-names>M-W</given-names></name><name><surname>Ausubel</surname><given-names>FM</given-names></name></person-group><year iso-8601-date="2002">2002</year><article-title>A conserved p38 MAP kinase pathway in <italic>Caenorhabditis elegans</italic> innate immunity</article-title><source>Science</source><volume>297</volume><fpage>623</fpage><lpage>626</lpage><pub-id pub-id-type="doi">10.1126/science.1073759</pub-id><pub-id pub-id-type="pmid">12142542</pub-id></element-citation></ref><ref id="bib30"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Kobayashi</surname><given-names>J</given-names></name><name><surname>Shidara</surname><given-names>H</given-names></name><name><surname>Morisawa</surname><given-names>Y</given-names></name><name><surname>Kawakami</surname><given-names>M</given-names></name><name><surname>Tanahashi</surname><given-names>Y</given-names></name><name><surname>Hotta</surname><given-names>K</given-names></name><name><surname>Oka</surname><given-names>K</given-names></name></person-group><year iso-8601-date="2013">2013</year><article-title>A method for selective ablation of neurons in <italic>C. elegans</italic> using the phototoxic fluorescent protein, KillerRed</article-title><source>Neuroscience Letters</source><volume>548</volume><fpage>261</fpage><lpage>264</lpage><pub-id pub-id-type="doi">10.1016/j.neulet.2013.05.053</pub-id><pub-id pub-id-type="pmid">23748043</pub-id></element-citation></ref><ref id="bib31"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Kovács</surname><given-names>KA</given-names></name></person-group><year iso-8601-date="2020">2020</year><article-title>Episodic memories: how do the hippocampus and the entorhinal ring attractors cooperate to create them?</article-title><source>Frontiers in Systems Neuroscience</source><volume>14</volume><elocation-id>559168</elocation-id><pub-id pub-id-type="doi">10.3389/fnsys.2020.559186</pub-id><pub-id pub-id-type="pmid">33013334</pub-id></element-citation></ref><ref id="bib32"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Kuhara</surname><given-names>A</given-names></name><name><surname>Ohnishi</surname><given-names>N</given-names></name><name><surname>Shimowada</surname><given-names>T</given-names></name><name><surname>Mori</surname><given-names>I</given-names></name></person-group><year iso-8601-date="2011">2011</year><article-title>Neural coding in a single sensory neuron controlling opposite seeking behaviours in <italic>Caenorhabditis elegans</italic></article-title><source>Nature Communications</source><volume>2</volume><elocation-id>355</elocation-id><pub-id pub-id-type="doi">10.1038/ncomms1352</pub-id><pub-id pub-id-type="pmid">21673676</pub-id></element-citation></ref><ref id="bib33"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Laurent</surname><given-names>P</given-names></name><name><surname>Soltesz</surname><given-names>Z</given-names></name><name><surname>Nelson</surname><given-names>GM</given-names></name><name><surname>Chen</surname><given-names>C</given-names></name><name><surname>Arellano-Carbajal</surname><given-names>F</given-names></name><name><surname>Levy</surname><given-names>E</given-names></name><name><surname>de Bono</surname><given-names>M</given-names></name></person-group><year iso-8601-date="2015">2015</year><article-title>Decoding a neural circuit controlling global animal state in <italic>C. elegans</italic></article-title><source>eLife</source><volume>4</volume><elocation-id>e04241</elocation-id><pub-id pub-id-type="doi">10.7554/eLife.04241</pub-id><pub-id pub-id-type="pmid">25760081</pub-id></element-citation></ref><ref id="bib34"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Lee</surname><given-names>K</given-names></name><name><surname>Mylonakis</surname><given-names>E</given-names></name></person-group><year iso-8601-date="2017">2017</year><article-title>An intestine-derived neuropeptide controls avoidance behavior in <italic>Caenorhabditis elegans</italic></article-title><source>Cell Reports</source><volume>20</volume><fpage>2501</fpage><lpage>2512</lpage><pub-id pub-id-type="doi">10.1016/j.celrep.2017.08.053</pub-id><pub-id pub-id-type="pmid">28877481</pub-id></element-citation></ref><ref id="bib35"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Lee</surname><given-names>JB</given-names></name><name><surname>Yonar</surname><given-names>A</given-names></name><name><surname>Hallacy</surname><given-names>T</given-names></name><name><surname>Shen</surname><given-names>CH</given-names></name><name><surname>Milloz</surname><given-names>J</given-names></name><name><surname>Srinivasan</surname><given-names>J</given-names></name><name><surname>Kocabas</surname><given-names>A</given-names></name><name><surname>Ramanathan</surname><given-names>S</given-names></name></person-group><year iso-8601-date="2019">2019</year><article-title>A compressed sensing framework for efficient dissection of neural circuits</article-title><source>Nature Methods</source><volume>16</volume><fpage>126</fpage><lpage>133</lpage><pub-id pub-id-type="doi">10.1038/s41592-018-0233-6</pub-id><pub-id pub-id-type="pmid">30573831</pub-id></element-citation></ref><ref id="bib36"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Li</surname><given-names>Z</given-names></name><name><surname>Liu</surname><given-names>J</given-names></name><name><surname>Zheng</surname><given-names>M</given-names></name><name><surname>Xu</surname><given-names>XZS</given-names></name></person-group><year iso-8601-date="2014">2014</year><article-title>Encoding of both analog- and digital-like behavioral outputs by one <italic>C. elegans</italic> interneuron</article-title><source>Cell</source><volume>159</volume><fpage>751</fpage><lpage>765</lpage><pub-id pub-id-type="doi">10.1016/j.cell.2014.09.056</pub-id><pub-id pub-id-type="pmid">25417153</pub-id></element-citation></ref><ref id="bib37"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Liu</surname><given-names>M</given-names></name><name><surname>Kumar</surname><given-names>S</given-names></name><name><surname>Sharma</surname><given-names>AK</given-names></name><name><surname>Leifer</surname><given-names>AM</given-names></name></person-group><year iso-8601-date="2022">2022a</year><article-title>A high-throughput method to deliver targeted optogenetic stimulation to moving <italic>C. elegans</italic> populations</article-title><source>PLOS Biology</source><volume>20</volume><elocation-id>e3001524</elocation-id><pub-id pub-id-type="doi">10.1371/journal.pbio.3001524</pub-id><pub-id pub-id-type="pmid">35089912</pub-id></element-citation></ref><ref id="bib38"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Liu</surname><given-names>H</given-names></name><name><surname>Wu</surname><given-names>T</given-names></name><name><surname>Canales</surname><given-names>XG</given-names></name><name><surname>Wu</surname><given-names>M</given-names></name><name><surname>Choi</surname><given-names>MK</given-names></name><name><surname>Duan</surname><given-names>F</given-names></name><name><surname>Calarco</surname><given-names>JA</given-names></name><name><surname>Zhang</surname><given-names>Y</given-names></name></person-group><year iso-8601-date="2022">2022b</year><article-title>Forgetting generates a novel state that is reactivatable</article-title><source>Science Advances</source><volume>8</volume><elocation-id>e9071</elocation-id><pub-id pub-id-type="doi">10.1126/sciadv.abi9071</pub-id></element-citation></ref><ref id="bib39"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>López-Cruz</surname><given-names>A</given-names></name><name><surname>Sordillo</surname><given-names>A</given-names></name><name><surname>Pokala</surname><given-names>N</given-names></name><name><surname>Liu</surname><given-names>Q</given-names></name><name><surname>McGrath</surname><given-names>PT</given-names></name><name><surname>Bargmann</surname><given-names>CI</given-names></name></person-group><year iso-8601-date="2019">2019</year><article-title>Parallel multimodal circuits control an innate foraging behavior</article-title><source>Neuron</source><volume>102</volume><fpage>407</fpage><lpage>419</lpage><pub-id pub-id-type="doi">10.1016/j.neuron.2019.01.053</pub-id><pub-id pub-id-type="pmid">30824353</pub-id></element-citation></ref><ref id="bib40"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Meisel</surname><given-names>JD</given-names></name><name><surname>Kim</surname><given-names>DH</given-names></name></person-group><year iso-8601-date="2014">2014</year><article-title>Behavioral avoidance of pathogenic bacteria by <italic>Caenorhabditis elegans</italic></article-title><source>Trends in Immunology</source><volume>35</volume><fpage>465</fpage><lpage>470</lpage><pub-id pub-id-type="doi">10.1016/j.it.2014.08.008</pub-id><pub-id pub-id-type="pmid">25240986</pub-id></element-citation></ref><ref id="bib41"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Meisel</surname><given-names>JD</given-names></name><name><surname>Panda</surname><given-names>O</given-names></name><name><surname>Mahanti</surname><given-names>P</given-names></name><name><surname>Schroeder</surname><given-names>FC</given-names></name><name><surname>Kim</surname><given-names>DH</given-names></name></person-group><year iso-8601-date="2014">2014</year><article-title>Chemosensation of bacterial secondary metabolites modulates neuroendocrine signaling and behavior of <italic>C. elegans</italic></article-title><source>Cell</source><volume>159</volume><fpage>267</fpage><lpage>280</lpage><pub-id pub-id-type="doi">10.1016/j.cell.2014.09.011</pub-id><pub-id pub-id-type="pmid">25303524</pub-id></element-citation></ref><ref id="bib42"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>O’Donnell</surname><given-names>MP</given-names></name><name><surname>Chao</surname><given-names>P-H</given-names></name><name><surname>Kammenga</surname><given-names>JE</given-names></name><name><surname>Sengupta</surname><given-names>P</given-names></name></person-group><year iso-8601-date="2018">2018</year><article-title>Rictor/TORC2 mediates gut-to-brain signaling in the regulation of phenotypic plasticity in <italic>C. elegans</italic></article-title><source>PLOS Genetics</source><volume>14</volume><elocation-id>e1007213</elocation-id><pub-id pub-id-type="doi">10.1371/journal.pgen.1007213</pub-id><pub-id pub-id-type="pmid">29415022</pub-id></element-citation></ref><ref id="bib43"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Pascual</surname><given-names>A</given-names></name><name><surname>Préat</surname><given-names>T</given-names></name></person-group><year iso-8601-date="2001">2001</year><article-title>Localization of long-term memory within the <italic>Drosophila</italic> mushroom body</article-title><source>Science</source><volume>294</volume><fpage>1115</fpage><lpage>1117</lpage><pub-id pub-id-type="doi">10.1126/science.1064200</pub-id><pub-id pub-id-type="pmid">11691997</pub-id></element-citation></ref><ref id="bib44"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Reddy</surname><given-names>KC</given-names></name><name><surname>Andersen</surname><given-names>EC</given-names></name><name><surname>Kruglyak</surname><given-names>L</given-names></name><name><surname>Kim</surname><given-names>DH</given-names></name></person-group><year iso-8601-date="2009">2009</year><article-title>A polymorphism in npr-1 is a behavioral determinant of pathogen susceptibility in <italic>C. elegans</italic></article-title><source>Science</source><volume>323</volume><fpage>382</fpage><lpage>384</lpage><pub-id pub-id-type="doi">10.1126/science.1166527</pub-id><pub-id pub-id-type="pmid">19150845</pub-id></element-citation></ref><ref id="bib45"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Reddy</surname><given-names>KC</given-names></name><name><surname>Hunter</surname><given-names>RC</given-names></name><name><surname>Bhatla</surname><given-names>N</given-names></name><name><surname>Newman</surname><given-names>DK</given-names></name><name><surname>Kim</surname><given-names>DH</given-names></name></person-group><year iso-8601-date="2011">2011</year><article-title><italic>Caenorhabditis elegans</italic> NPR-1-mediated behaviors are suppressed in the presence of mucoid bacteria</article-title><source>PNAS</source><volume>108</volume><fpage>12887</fpage><lpage>12892</lpage><pub-id pub-id-type="doi">10.1073/pnas.1108265108</pub-id><pub-id pub-id-type="pmid">21768378</pub-id></element-citation></ref><ref id="bib46"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Sawin</surname><given-names>ER</given-names></name><name><surname>Ranganathan</surname><given-names>R</given-names></name><name><surname>Horvitz</surname><given-names>HR</given-names></name></person-group><year iso-8601-date="2000">2000</year><article-title><italic>C. elegans</italic> locomotory rate is modulated by the environment through a dopaminergic pathway and by experience through a serotonergic pathway</article-title><source>Neuron</source><volume>26</volume><fpage>619</fpage><lpage>631</lpage><pub-id pub-id-type="doi">10.1016/s0896-6273(00)81199-x</pub-id><pub-id pub-id-type="pmid">10896158</pub-id></element-citation></ref><ref id="bib47"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Shivers</surname><given-names>RP</given-names></name><name><surname>Kooistra</surname><given-names>T</given-names></name><name><surname>Chu</surname><given-names>SW</given-names></name><name><surname>Pagano</surname><given-names>DJ</given-names></name><name><surname>Kim</surname><given-names>DH</given-names></name></person-group><year iso-8601-date="2009">2009</year><article-title>Tissue-specific activities of an immune signaling module regulate physiological responses to pathogenic and nutritional bacteria in <italic>C. elegans</italic></article-title><source>Cell Host &amp; Microbe</source><volume>6</volume><fpage>321</fpage><lpage>330</lpage><pub-id pub-id-type="doi">10.1016/j.chom.2009.09.001</pub-id><pub-id pub-id-type="pmid">19837372</pub-id></element-citation></ref><ref id="bib48"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Singh</surname><given-names>J</given-names></name><name><surname>Aballay</surname><given-names>A</given-names></name></person-group><year iso-8601-date="2019">2019</year><article-title>Microbial colonization activates an immune fight-and-flight response via neuroendocrine signaling</article-title><source>Developmental Cell</source><volume>49</volume><fpage>89</fpage><lpage>99</lpage><pub-id pub-id-type="doi">10.1016/j.devcel.2019.02.001</pub-id><pub-id pub-id-type="pmid">30827896</pub-id></element-citation></ref><ref id="bib49"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Sordillo</surname><given-names>A</given-names></name><name><surname>Bargmann</surname><given-names>CI</given-names></name></person-group><year iso-8601-date="2021">2021</year><article-title>Behavioral control by depolarized and hyperpolarized states of an integrating neuron</article-title><source>eLife</source><volume>10</volume><elocation-id>e67723</elocation-id><pub-id pub-id-type="doi">10.7554/eLife.67723</pub-id><pub-id pub-id-type="pmid">34738904</pub-id></element-citation></ref><ref id="bib50"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Styer</surname><given-names>KL</given-names></name><name><surname>Singh</surname><given-names>V</given-names></name><name><surname>Macosko</surname><given-names>E</given-names></name><name><surname>Steele</surname><given-names>SE</given-names></name><name><surname>Bargmann</surname><given-names>CI</given-names></name><name><surname>Aballay</surname><given-names>A</given-names></name></person-group><year iso-8601-date="2008">2008</year><article-title>Innate immunity in <italic>Caenorhabditis elegans</italic> is regulated by neurons expressing NPR-1/GPCR</article-title><source>Science</source><volume>322</volume><fpage>460</fpage><lpage>464</lpage><pub-id pub-id-type="doi">10.1126/science.1163673</pub-id><pub-id pub-id-type="pmid">18801967</pub-id></element-citation></ref><ref id="bib51"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Tan</surname><given-names>MW</given-names></name><name><surname>Mahajan-Miklos</surname><given-names>S</given-names></name><name><surname>Ausubel</surname><given-names>FM</given-names></name></person-group><year iso-8601-date="1999">1999</year><article-title>Killing of <italic>Caenorhabditis elegans</italic> by <italic>Pseudomonas aeruginosa</italic> used to model mammalian bacterial pathogenesis</article-title><source>PNAS</source><volume>96</volume><fpage>715</fpage><lpage>720</lpage><pub-id pub-id-type="doi">10.1073/pnas.96.2.715</pub-id><pub-id pub-id-type="pmid">9892699</pub-id></element-citation></ref><ref id="bib52"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Tanimoto</surname><given-names>Y</given-names></name><name><surname>Zheng</surname><given-names>YG</given-names></name><name><surname>Fei</surname><given-names>X</given-names></name><name><surname>Fujie</surname><given-names>Y</given-names></name><name><surname>Hashimoto</surname><given-names>K</given-names></name><name><surname>Kimura</surname><given-names>KD</given-names></name></person-group><year iso-8601-date="2016">2016</year><article-title>In actio optophysiological analyses reveal functional diversification of dopaminergic neurons in the nematode <italic>C. elegans</italic></article-title><source>Scientific Reports</source><volume>6</volume><elocation-id>26297</elocation-id><pub-id pub-id-type="doi">10.1038/srep26297</pub-id><pub-id pub-id-type="pmid">27193056</pub-id></element-citation></ref><ref id="bib53"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Taylor</surname><given-names>SR</given-names></name><name><surname>Santpere</surname><given-names>G</given-names></name><name><surname>Weinreb</surname><given-names>A</given-names></name><name><surname>Barrett</surname><given-names>A</given-names></name><name><surname>Reilly</surname><given-names>MB</given-names></name><name><surname>Xu</surname><given-names>C</given-names></name><name><surname>Varol</surname><given-names>E</given-names></name><name><surname>Oikonomou</surname><given-names>P</given-names></name><name><surname>Glenwinkel</surname><given-names>L</given-names></name><name><surname>McWhirter</surname><given-names>R</given-names></name><name><surname>Poff</surname><given-names>A</given-names></name><name><surname>Basavaraju</surname><given-names>M</given-names></name><name><surname>Rafi</surname><given-names>I</given-names></name><name><surname>Yemini</surname><given-names>E</given-names></name><name><surname>Cook</surname><given-names>SJ</given-names></name><name><surname>Abrams</surname><given-names>A</given-names></name><name><surname>Vidal</surname><given-names>B</given-names></name><name><surname>Cros</surname><given-names>C</given-names></name><name><surname>Tavazoie</surname><given-names>S</given-names></name><name><surname>Sestan</surname><given-names>N</given-names></name><name><surname>Hammarlund</surname><given-names>M</given-names></name><name><surname>Hobert</surname><given-names>O</given-names></name></person-group><year iso-8601-date="2021">2021</year><article-title>Molecular topography of an entire nervous system</article-title><source>Cell</source><volume>184</volume><fpage>4329</fpage><lpage>4347</lpage><pub-id pub-id-type="doi">10.1016/j.cell.2021.06.023</pub-id><pub-id pub-id-type="pmid">34237253</pub-id></element-citation></ref><ref id="bib54"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Tibshirani</surname><given-names>R</given-names></name></person-group><year iso-8601-date="1996">1996</year><article-title>Regression shrinkage and selection via the lasso</article-title><source>Journal of the Royal Statistical Society Series B</source><volume>58</volume><fpage>267</fpage><lpage>288</lpage><pub-id pub-id-type="doi">10.1111/j.2517-6161.1996.tb02080.x</pub-id></element-citation></ref><ref id="bib55"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Tibshirani</surname><given-names>R</given-names></name></person-group><year iso-8601-date="2011">2011</year><article-title>Regression shrinkage and selection via the lasso: a retrospective</article-title><source>Journal of the Royal Statistical Society Series B</source><volume>73</volume><fpage>273</fpage><lpage>282</lpage><pub-id pub-id-type="doi">10.1111/j.1467-9868.2011.00771.x</pub-id></element-citation></ref><ref id="bib56"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Vargha-Khadem</surname><given-names>F</given-names></name><name><surname>Gadian</surname><given-names>DG</given-names></name><name><surname>Watkins</surname><given-names>KE</given-names></name><name><surname>Connelly</surname><given-names>A</given-names></name><name><surname>Van Paesschen</surname><given-names>W</given-names></name><name><surname>Mishkin</surname><given-names>M</given-names></name></person-group><year iso-8601-date="1997">1997</year><article-title>Differential effects of early hippocampal pathology on episodic and semantic memory</article-title><source>Science</source><volume>277</volume><fpage>376</fpage><lpage>380</lpage><pub-id pub-id-type="doi">10.1126/science.277.5324.376</pub-id><pub-id pub-id-type="pmid">9219696</pub-id></element-citation></ref><ref id="bib57"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Vidal</surname><given-names>B</given-names></name><name><surname>Gulez</surname><given-names>B</given-names></name><name><surname>Cao</surname><given-names>WX</given-names></name><name><surname>Leyva-Díaz</surname><given-names>E</given-names></name><name><surname>Reilly</surname><given-names>MB</given-names></name><name><surname>Tekieli</surname><given-names>T</given-names></name><name><surname>Hobert</surname><given-names>O</given-names></name></person-group><year iso-8601-date="2022">2022</year><article-title>The enteric nervous system of the <italic>C. elegans</italic> pharynx is specified by the Sine oculis-like homeobox gene <italic>ceh-34</italic></article-title><source>eLife</source><volume>11</volume><elocation-id>e76003</elocation-id><pub-id pub-id-type="doi">10.7554/eLife.76003</pub-id><pub-id pub-id-type="pmid">35324425</pub-id></element-citation></ref><ref id="bib58"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>White</surname><given-names>JG</given-names></name><name><surname>Southgate</surname><given-names>E</given-names></name><name><surname>Thomson</surname><given-names>JN</given-names></name><name><surname>Brenner</surname><given-names>S</given-names></name></person-group><year iso-8601-date="1986">1986</year><article-title>The structure of the nervous system of the nematode <italic>Caenorhabditis elegans</italic></article-title><source>Philosophical Transactions of the Royal Society of London. Series B, Biological Sciences</source><volume>314</volume><fpage>1</fpage><lpage>340</lpage><pub-id pub-id-type="doi">10.1098/rstb.1986.0056</pub-id><pub-id pub-id-type="pmid">22462104</pub-id></element-citation></ref><ref id="bib59"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Xu</surname><given-names>M</given-names></name><name><surname>Jarrell</surname><given-names>TA</given-names></name><name><surname>Wang</surname><given-names>Y</given-names></name><name><surname>Cook</surname><given-names>SJ</given-names></name><name><surname>Hall</surname><given-names>DH</given-names></name><name><surname>Emmons</surname><given-names>SW</given-names></name></person-group><year iso-8601-date="2013">2013</year><article-title>Computer assisted assembly of connectomes from electron micrographs: application to <italic>Caenorhabditis elegans</italic></article-title><source>PLOS ONE</source><volume>8</volume><elocation-id>e54050</elocation-id><pub-id pub-id-type="doi">10.1371/journal.pone.0054050</pub-id></element-citation></ref><ref id="bib60"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Zhang</surname><given-names>Y</given-names></name><name><surname>Lu</surname><given-names>H</given-names></name><name><surname>Bargmann</surname><given-names>CI</given-names></name></person-group><year iso-8601-date="2005">2005</year><article-title>Pathogenic bacteria induce aversive olfactory learning in <italic>Caenorhabditis elegans</italic></article-title><source>Nature</source><volume>438</volume><fpage>179</fpage><lpage>184</lpage><pub-id pub-id-type="doi">10.1038/nature04216</pub-id><pub-id pub-id-type="pmid">16281027</pub-id></element-citation></ref><ref id="bib61"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Zhang</surname><given-names>X</given-names></name><name><surname>Zhang</surname><given-names>Y</given-names></name></person-group><year iso-8601-date="2012">2012</year><article-title>DBL-1, a TGF-β, is essential for <italic>Caenorhabditis elegans</italic> aversive olfactory learning</article-title><source>PNAS</source><volume>109</volume><fpage>17081</fpage><lpage>17086</lpage><pub-id pub-id-type="doi">10.1073/pnas.1205982109</pub-id></element-citation></ref><ref id="bib62"><element-citation publication-type="journal"><person-group person-group-type="author"><name><surname>Zhao</surname><given-names>C</given-names></name><name><surname>Widmer</surname><given-names>YF</given-names></name><name><surname>Diegelmann</surname><given-names>S</given-names></name><name><surname>Petrovici</surname><given-names>MA</given-names></name><name><surname>Sprecher</surname><given-names>SG</given-names></name><name><surname>Senn</surname><given-names>W</given-names></name></person-group><year iso-8601-date="2021">2021</year><article-title>Predictive olfactory learning in <italic>Drosophila</italic></article-title><source>Scientific Reports</source><volume>11</volume><elocation-id>e5841</elocation-id><pub-id pub-id-type="doi">10.1038/s41598-021-85841-y</pub-id></element-citation></ref></ref-list></back><sub-article article-type="editor-report" id="sa0"><front-stub><article-id pub-id-type="doi">10.7554/eLife.97340.3.sa0</article-id><title-group><article-title>eLife Assessment</article-title></title-group><contrib-group><contrib contrib-type="author"><name><surname>Grunwald Kadow</surname><given-names>Ilona C</given-names></name><role specific-use="editor">Reviewing Editor</role><aff><institution>University of Bonn</institution><country>Germany</country></aff></contrib></contrib-group><kwd-group kwd-group-type="claim-importance"><kwd>Important</kwd></kwd-group><kwd-group kwd-group-type="evidence-strength"><kwd>Solid</kwd></kwd-group></front-stub><body><p>This <bold>important</bold> study describes a neural circuit contributing to two behavioral processes affecting pathogen avoidance in the nematode <italic>C. elegans</italic>. The method used to identify specific contributing neurons is innovative, and the experimental evidence supporting the major claims is <bold>solid</bold>. This study will be of interest to neuroscientists studying behavior, in particular in <italic>C. elegans</italic>.</p></body></sub-article><sub-article article-type="referee-report" id="sa1"><front-stub><article-id pub-id-type="doi">10.7554/eLife.97340.3.sa1</article-id><title-group><article-title>Reviewer #1 (Public review):</article-title></title-group><contrib-group><contrib contrib-type="author"><anonymous/><role specific-use="referee">Reviewer</role></contrib></contrib-group></front-stub><body><p>This study identifies two behavioral processes that underlie learned pathogen avoidance behavior in <italic>C. elegans</italic>: exiting and re-entry of pathogenic bacterial lawns. Long-term behavioral tracking indicates that animals increase the prevalence of both behaviors over long-term exposure to the pathogen <italic>Pseudomonas aeruginosa</italic>. Using an optogenetic silencing screen, the authors identify groups of neurons, whose activity regulates lawn occupancy. Surprisingly, they find that optogenetic inhibition of neurons during only the first two hours of pathogen exposure can establish subsequent long-term changes in pathogen aversion. By leveraging a compressed sensing approach, the authors define a set of neurons involved in either lawn exit or lawn re-entry behavior using a constrained set of transgenic lines that drive Arch-3 expression in overlapping groups of neurons. They then measure the calcium activity of the candidate neurons involved in lawn re-entry in freely moving animals using GCaMP, and observe a reduction in their neural activity after exposure to pathogen. Optogenetic inhibition of AIY and SIA neurons during acute pathogen exposure in naïve animals delays lawn entry whereas activating these neurons in animals previously exposed to pathogen enhances lawn entry, albeit transiently.</p><p>This work is missing experiments and analyses that are necessary to substantiate their claims. Although the authors convincingly show that neuronal inhibition experiments during pathogen exposure reveal separable groups of neurons controlling pathogenic lawn exiting and re-entry, their methods to validate these results at single neuron cell-type resolution lack rigor.</p><p>In Figure 4, the authors claim that the reduction in calcium activity in cells of interest following pathogen exposure encodes pathogen experience. However, they make no effort to correlate the observed decreased activity with concomitant shifts in increased immobility (decreased forward locomotion) or the increased age of the worms since pathogen exposure began (24 hours have elapsed), either of which could easily explain these results. A better comparison would be between age-matched naive animals and animals exposed to pathogen. More to the point, we are interested in the involvement of these neurons' activity patterns with the behavioral motifs associated with lawn exits and re-entries, so examining these activity patterns in the absence of any pathogen before or after long-term pathogen exposure yields little insight into their relevant signaling roles. To substantiate the authors' claims, a better experiment would measure these neurons' calcium activity during lawn exits and re-entries in naive and post-exposed age-matched worms.</p><p>In Figure 5, the authors attempt to show that manipulating AIY and SIA/SIB neuronal activity controls pathogenic lawn re-entry behavior. Although they show that inhibiting these neurons in naive animals increases latency to enter pathogenic lawns, they never test the effect of neuronal inhibition in post-exposed animals. Instead they activate these neurons using channelrhodopsin, whereby they observe an increase in lawn entry and exit behavior, indicative of high forward locomotion speed. Although suggestive, neither of these experiments prove these neurons' involvement in pathogenic lawn re-entry behavior following pathogen exposure. To rigorously test the hypothesis that AIY and SIA/SIB neurons are required to sustain higher latency to lawn re-entry following pathogen exposure, the authors should perform neuronal inhibition experiments in post-pathogen-exposed animals as well and compare the results. The interpretation of this figure is further complicated by the fact that Npr-4::ChR2 animals express ChR2 in AIY in addition to SIA/SIB neurons: experiments that calculated lawn re-entry rates in Npr-4::ChR2 activation in post-exposed animals may include the known effect of stimulating AIY alone (Fig. 5J) since no discernible attempt at structured illumination to limit excitation to SIA/SIB neurons was made in these animals (Fig. 5 K, L).</p><p>This work raises the interesting possibility that different sets of neurons control lawn exit and lawn re-entry behaviors following pathogen exposure. However, the authors never directly test this claim. To rigorously show this, the authors would need to show that lawn-exit promoting neurons (CEPs, HSNs, RIAs, RIDs, SIAs) are dispensable for lawn re-entry behavior and that lawn re-entry promoting neurons (AVK, SIA, AIY, MI) are dispensable for lawn exit behavior in pathogen-exposed animals. The authors identify AVK neurons as important for modulating lawn re-entry behavior by brief inhibition at the start of pathogen exposure but fail to find that these neurons are required for increased latency to re-entry in naïve animals (Fig. 5D). Recent work from Marquina-Solis et al (2024) shows that chronic silencing of these neurons delays pathogen lawn leaving, due to impaired release of flp-1 neuropeptide. Authors may wish to connect their work more closely with the existing literature by investigating the behavioral process by which AVK contributes to lawn evacuation.</p></body></sub-article><sub-article article-type="referee-report" id="sa2"><front-stub><article-id pub-id-type="doi">10.7554/eLife.97340.3.sa2</article-id><title-group><article-title>Reviewer #2 (Public review):</article-title></title-group><contrib-group><contrib contrib-type="author"><anonymous/><role specific-use="referee">Reviewer</role></contrib></contrib-group></front-stub><body><p>In this manuscript, Hallacy et al. used a compressed sensing-based optogenetic screening method to investigate the crucial neurons that regulate pathogenic avoidance behavior in <italic>C. elegans</italic>. They further substantiate their findings using complementary optogenetic activation and imaging techniques to confirm the roles of the key neurons identified through extensive screening efforts. Notably, they identified AIY and SIA as pivotal neurons in the dynamic process of pathogenic avoidance. Their significant discovery is the delayed or stalled reentry process, which drives avoidance behavior; to my knowledge, this dynamic has not been previously documented. Additionally, the successful integration of quantitative optogenetic tools and compressed sensing algorithms is noteworthy, demonstrating the potential for obtaining highly quantitative data from the <italic>C. elegans</italic> nervous system. This approach is quite rare in this field, yet it represents a promising direction for studying this simple nervous system.</p><p>However, the paper's main weakness lies in its lack of a detailed mechanism explaining how the delayed reentry process directly influences the actual locomotor output that results in avoidance. The term 'delayed reentry' is used as a dynamic metric for quantifying the screening, yet the causal link between this metric and the mechanistic output remains unclear. Despite this, the study is well-structured, with comprehensive control experiments, and is very well constructed.</p><p>Comments on revisions:</p><p>The authors have addressed all my concerns and suggestions. They particularly further clarified the AIY's role in navigation by providing a new figure. They also provided supplementary videos representing the re-entry process.</p></body></sub-article><sub-article article-type="author-comment" id="sa3"><front-stub><article-id pub-id-type="doi">10.7554/eLife.97340.3.sa3</article-id><title-group><article-title>Author response</article-title></title-group><contrib-group><contrib contrib-type="author"><name><surname>Hallacy</surname><given-names>Timothy</given-names></name><role specific-use="author">Author</role><aff><institution>Harvard University</institution><addr-line><named-content content-type="city">Cambridge</named-content></addr-line><country>United States</country></aff></contrib><contrib contrib-type="author"><name><surname>Yonar</surname><given-names>Abdullah</given-names></name><role specific-use="author">Author</role><aff><institution>Harvard University</institution><addr-line><named-content content-type="city">Cambridge</named-content></addr-line><country>United States</country></aff></contrib><contrib contrib-type="author"><name><surname>Ringstad</surname><given-names>Niels</given-names></name><role specific-use="author">Author</role><aff><institution>New York University Grossman School of Medicine</institution><addr-line><named-content content-type="city">New York</named-content></addr-line><country>United States</country></aff></contrib><contrib contrib-type="author"><name><surname>Ramanathan</surname><given-names>Sharad</given-names></name><role specific-use="author">Author</role><aff><institution>Harvard University</institution><addr-line><named-content content-type="city">Cambridge</named-content></addr-line><country>United States</country></aff></contrib></contrib-group></front-stub><body><p>The following is the authors’ response to the original reviews.</p><disp-quote content-type="editor-comment"><p><bold>Reviewer 1:</bold></p></disp-quote><p>We thank the reviewer for their comments and suggestions. We have made several edits to the paper to address these comments, including the addition of several new control experiments, corrections to mislabeled figures in Fig 2, and other additions to improve the clarity of several figures.</p><disp-quote content-type="editor-comment"><p>This work is missing several controls that are necessary to substantiate their claims. My most important concern is that the optogenetic screen for neurons that alter pathogenic lawn occupancy does not have an accompanying control on non-pathogenic OP50 bacteria. Hence, it remains unclear whether these neuronal inhibition experiments lead to pathogen-specific or generalized lawn-leaving alterations. For strains that show statistical differences between - and + ATR conditions, the authors should perform follow-up validation experiments on non-pathogenic OP50 lawns to ensure that the observed effect is PA14-specific. Similarly, neuronal inhibition experiments in Figures 5E and H are only performed with naïve animals on PA14 - we need to see the latency to re-entry on OP50 as well, to make general conclusions about these neurons' role in pathogen-specific avoidance.</p></disp-quote><p>We have added data from new control experiments to Fig. S1 (subfigures B, C) for both exit and re-entry dynamics on OP50. We find that inhibition of neurons produces different effects on both lawn entry and exit on PA14 compared to OP50. We observed that inhibition of neurons failed to change the re-entry dynamics for any of the lines which showed delayed latency to re-entry on PA14. Our results suggest that the neural control of re-entry dynamics we see are PA14 specific.</p><disp-quote content-type="editor-comment"><p>My second major concern is regarding the calcium imaging experiments of candidate neurons involved in lawn re-entry behavior. Although the data shows that AIY, AVK, and SIA/SIB neurons all show reduced activity following pathogen exposure, the authors do not relate these activity changes to changes in behavior. Given the well-established links between these cells and forward locomotion, it is essential to not only report differences in activity but also in the relationship between this activity and locomotory behavior. If animals are paused outside of the pathogen lawn, these neurons may show low activity simply because the animals are not moving forward. Other forward-modulated neurons may also show this pattern of reduced activity if the animals remain paused. Given that the authors have recorded neural activity before and after contact with pathogenic bacteria in freely moving animals, they should also provide an analysis of the relationship between proximity to the lawn and the activity of these neurons.</p></disp-quote><p>In response, we added an additional supplementary figure S7 to illustrate the role of each neuron in navigational control and added text to the discussion to better explain the role of each neuron type in the regulation of re-entry, in light of our previously published work on SIA in speed control.</p><disp-quote content-type="editor-comment"><p>This work is missing methodological descriptions that are necessary for the correct interpretation of the results shown here. Figure 2 suggests that the determination of statistical significance across the optogenetic inhibition screen will be found in the Methods, but this information is not to be found there. At various points in the text, authors refer to &quot;exit rate&quot;, &quot;rate constant&quot;, and &quot;entry rate&quot;. These metrics seem derived from an averaged measurement across many individual animals in one lawn evacuation assay plate. However &quot;latency to re-entry&quot; is only defined on a per-animal basis in the lawn re-exposure assay. These differences should be clearly stated in the methods section to avoid confusion and to ensure that statistics are computed correctly.</p></disp-quote><p>Additional details have been added to the methods section to provide more in depth information on the statistical analysis performed. In brief, the latency to re-entry is calculated in the same way across all assays – re-entry events across replicate experiments for a given experimental condition are aggregated together and used to calculate relevant statistics.</p><disp-quote content-type="editor-comment"><p>This work also contains mislabeled graphs and incorrect correspondence with the text, which make it difficult to follow the authors 'claims. The text suggests that Pdop-2::Arch3 and Pmpz-1::Arch3 show increased exit rates, whereas Figure 2 shows that Pflp-4::Arch3 but not Pmpz-1::Arch3 has increased exit rate. The authors should also make a greater effort to correctly and clearly label which type of behavioral experiment is used to generate each figure and describe the differences in experimental design in the main text, figure legends, and methods. Figure 2E depicts trajectories of animals leaving a lawn over a 2.5-minute interval but it is unclear when this time window occurs within the 18-hour lawn leaving assay. Likewise, Figure 2H depicts a 30-minute time window which has an unclear relationship to the overall time course of lawn leaving. This figure legend is also mislabeled as &quot;Infected/Healthy&quot;, whereas it should be labeled &quot;-/+ ATR&quot;.</p><p>In Figures 2C and F, the x-axis labels are in a different order, making it difficult to compare between the 2 plots. Promoter names should be italicized. What does the red ring mean in Figure 2A? Figure 2 legend incorrectly states that four lines showed statistically significant changes for the Exist rate constant - only 2 lines are significant according to the figure.</p></disp-quote><p>We thank the reviewer for identifying this embarrassing error. Figure 2C and F were flipped, and we have corrected this, we are sorry for the error. Promoter names have been italicized, and we have added additional text in the captions that the red ring is a ring light for background illumination of the worms. In addition, we have corrected the error in the figure legends from “Infected/Healthy” to “+/- ATR”.</p><p>Lines in figure 2C and 2F are ordered by significance rather than keeping the same order in both. Majority feedback from colleagues suggested that this ordering was preferred.</p><disp-quote content-type="editor-comment"><p>This work raises the interesting possibility that different sets of neurons control lawn exit and lawn re-entry behaviors following pathogen exposure. However, the authors never directly test this claim. To rigorously show this, the authors would need to show that lawn-exit-promoting neurons (CEPs, HSNs, RIAs, RIDs, SIAs) are dispensable for lawn re-entry behavior and that lawn re-entry promoting neurons (AVK, SIA, AIY, MI) are dispensable for lawn exit behavior in pathogen-exposed animals.</p></disp-quote><p>We agree with the reviewer’s comments that there is insufficient evidence to show a complete decoupling of lawn exit and lawn re-entry. However, we note that our screen results show that only 1 line (dop-2) shows changes in both exit and re-entry dynamics upon neural inhibition (Fig. 2). This seems to suggest that at least some degree of neural control of re-entry is decoupled from exit.</p><disp-quote content-type="editor-comment"><p>Please label graph axes with units in Figure 1 - instead of &quot;Exit Rate&quot; make it #exits per worm per hour, and make it more clear that Figures 1C and E have a different kind of assay than Figures 1A, B and D. There should be more consistency between the meaning of &quot;pre/post&quot; and &quot;naive/infected/healthy&quot; - and how many hours constitutes post.</p></disp-quote><p>We have edited Figure 1 and made additions to the captions of figure 1 to make both points clearer. We have also standardized our language for subsequent figures (such as figure 5) to provide less ambiguity in pre/post and naïve/infected/healthy.</p><disp-quote content-type="editor-comment"><p>Figure 5 - it should be made more clear when the stimulation/inhibition occurred in these experiments and how long they were recorded/analyzed.</p></disp-quote><p>We have added additional details to the figure captions to make it clearer when the data was collected.</p><p>Workspaces and code have been added under a data availability section in the manuscript.</p><disp-quote content-type="editor-comment"><p><bold>Reviewer 2:</bold></p><p>However, the paper's main weakness lies in its lack of a detailed mechanism explaining how the delayed reentry process directly influences the actual locomotor output that results in avoidance. The term 'delayed reentry' is used as a dynamic metric for quantifying the screening, yet the causal link between this metric and the mechanistic output remains unclear. Despite this, the study is well-structured, with comprehensive control experiments, and is very well constructed.</p></disp-quote><p>We thank the reviewer for their comments and suggestions. We have added additional data and details to our work to cover these weaknesses, as can be seen in our responses to the suggestions below.</p><disp-quote content-type="editor-comment"><p>(1) A key issue in the manuscript is the mechanistic link between the delayed process and locomotor output. AIY is identified as a crucial neuron in this process, but the specifics of how AIY influences this delay are not clear. For instance, does AIY decrease the reversal rate, causing animals to get into long-range search when they leave the bacterial lawn? Is there any relationship between pdf-2 expression and reversal rates? Given that AIY typically promotes long-range motion when activated, the suppression of this function and its implications on motion warrants further clarification.</p></disp-quote><p>We have included additional data to explain how AIY might be able to regulate lawn entry behaviors and have added more to the discussion to explain how neural suppression might lead to changes in the behavior (new figure S7). Both AIY and SIA dynamics have been linked to worm navigation. In previous work (Lee 2019), we have demonstrated that SIA can control locomotory speed. Inhibition of SIA decreases locomotory speed, and as a result may serve to drive the increased latency of re-entry.</p><p>AIY’s role in navigation has been previously established (Zhaoyu 2014), but we have added an additional supplementary figure and edited our discussion to further illustrate this point. As can be seen in the new figure S7, AIY neural activity undergoes a transition after removal from a bacterial lawn, going from low activity to high activity. This activity increase is correlated with a transition from a high reversal rate local search state to a long range search state characterized by longer runs. Inhibition of AIY during this long range search state increased the reversal rate resulting in a higher rate of re-orientations. This might serve as a part of the mechanistic explanation for AIY’s role in preventing lawn re-entry, as inhibition dramatically increased the rate of re-orientation, preventing worms from making directed runs into the bacterial lawn. However, there is an additional effect of the inhibition of AIY, not seen during food search. Inhibition of AIY in the context of a pathogenic bacterial lawn leads to stalling at the edge. Therefore, re-entry AIY could have an additional role in governing the animals movement, post exposure, upon contact with a pathogenic lawn.</p><disp-quote content-type="editor-comment"><p>(2) I recommend including supplementary videos to visually demonstrate the process. These videos might help others identify aspects of the mechanism that are currently missing or unclear in the text.</p><p>(4) The authors mention that the worms &quot;left the lawn,&quot; but the images suggest that the worms do not stray far and remain around the perimeter. Providing videos could help clarify this observation and strengthen the argument by visually connecting these points</p></disp-quote><p>Additional supplementary videos (1-3) taken at several stages of lawn evacuation have been added to visually demonstrate the process.</p><disp-quote content-type="editor-comment"><p>(3) Regarding the control experiments (Figure 1E-G), the manuscript describes testing animals picked from a PA14-seeded plate and retesting them on different plates. It's crucial to clarify the differences between these plates. Specifically, the region just outside the lawn should be considered, as it is not empty and worms can spread bacteria around. Testing animals on a new plate with a pristine proximity region might introduce variables that affect their behavior.</p></disp-quote><p>We have reworded the paper to make it clearer that these new conditions on a fresh PA14 lawn represent a different type of assay from the lawn evacuation assay. Fresh PA14 plates will indeed have a pristine proximity region compared to plates where the worms have spread the bacteria.</p><p>These experiments were done to test if the evacuation effect is purely due to aversive signals left on the lawn or attractive signals left outside of the lawn. Given that worms are known to be able to leave compounds such as ascarosides to communicate with each other, we wanted to test that this lawn re-entry defect was not simply the result of deposited pheromones. Without any other method to remove such compounds, we relied on using fresh PA14 lawns instead to test this. We have updated the manuscript to clarify this point.</p><disp-quote content-type="editor-comment"><p>(5) The manuscript notes that the PA14 strain was grown without shaking. Typically, growing this strain without agitation leads to biofilm formation. Clarifying whether there is a link between biofilm formation and avoidance behavior would add depth to the understanding of the experimental conditions and their impact on the observed behaviors.</p></disp-quote><p>As the reviewer has noted, growth of PA14 without shaking might indeed lead to biofilm formation. This does represent a legitimate concern, as evidence from previous work has suggested that biofilm formation could be linked to pathogen avoidance as worms make use of mechanosensation to avoid pathogenic bacteria (Chang et al. 2011). However, we do not observe substantial formation of biofilm in our cultured bacteria, likely since our growth time might be insufficient for sufficient biofilm formation to occur. We also note that our evacuation dynamics appear to be of similar timescale to results reported in previous work which used different growth conditions. As such, we believe that our growth conditions thus represent similar conditions as to those historically used in the lawn evacuation literature.</p><disp-quote content-type="editor-comment"><p><bold>Reviewer 3:</bold></p><p>Weaknesses:</p><p>My only concern is that the authors should be more careful about describing their &quot;compressed sensing-based approach&quot;. Authors often cite their previous Nature Methods paper, but should explain more because this method is critical for this manuscript. Also, this analysis is based on the hypothesis that only a small number of neurons are responsible for a given behavior. Authors should explain more about how to determine scarcity parameters, for example.</p></disp-quote><p>We have added more details to our paper outlining some of the details involved in our compressed sensing approach. We go into more detail about how we chose sparsity parameters and note that our discovered neurons for re-entry appear to be robust over choice of sparsity parameters. These additional details can be found in both the paper body and the methods section.</p><disp-quote content-type="editor-comment"><p>Line 45: This paragraph tries to mention that there should be &quot;small sets of neurons&quot; that can play key roles in integrating previous information to influence subsequent behavior. Is it valid as an assumption in the nervous systems?</p></disp-quote><p>We want to clarify that what is important is not that there are ‘small sets of neurons’, but rather that these key neurons make up a small fraction of the total number of neurons in the nervous system. More correctly: the compressed sensing approach identifies information bottlenecks in the neural circuits, and the assumption is that the number of neurons in these bottlenecks are small. This is the underlying sparsity assumption being made here that allows us to utilize a compressed sensing based approach to identify these neurons. We have reworded this section to make it clear that what is important is not that the total number of neurons is small, but that they must be a small fraction of the total number of neurons in the nervous system.</p><disp-quote content-type="editor-comment"><p>Line 125: &quot;These approaches…&quot; Authors repeatedly mentioned this statement to emphasize that their compressed sensing-based approach is the best choice. Are you really sure?</p></disp-quote><p>We agree that there are several approaches that might allow for faster screening of the nervous system. For example, many studies approach the problem by looking at neurons with synapses onto a neuron already known to be implicated in the behavior or find neurons that express a key gene known to regulate the behavior of interest. These approaches utilize prior information to greatly reduce the pool of candidate neurons needed to be screened.</p><p>In the absence of such prior information, we believe that our compressed sensing based approach allows a rapid way to perform an unbiased interrogation of the entire nervous system to identify key neurons at bottlenecks of neural circuits. Once these key neurons are identified, neurons upstream and downstream of these key neurons can be investigated in the future. This approach gives us the added advantage of being able to identify neurons that do not connect to neurons that are already implicated in the behavior, or that don’t have clear genetic signatures in the behavior of interest. Our approach further allows for screening of neurons with no clear single genetic marker without the next to utilize intersectional genetic strategies. We should not use the phrase “best choice” which might not be justified. We have reworded these statements, and we believe that compressed sensing based methods provide a complementary approach to those in the literature.</p><disp-quote content-type="editor-comment"><p>Line 42: If authors refer to mushroom bodies and human hippocampus in relation to the significance of their work, authors should go back to these references in the Discussion and explain how their work is important.</p></disp-quote><p>We thank the reviewer for this feedback, and we have added to our discussion to expand upon these points.</p><disp-quote content-type="editor-comment"><p>Line 151: &quot;the accelerated pathogen avoidance&quot; Accelerated pathogen avoidance does not necessarily indicate the existence of the neural mechanism that inhibits the association of pathogenicity with microbe-specific cues (during early stages: first two hours).</p></disp-quote><p>We agree with the reviewer’s statements that these results alone do not indicate the presence of an early avoidance mechanism. Other evidence for early avoidance mechanisms exists as seen in two choice assay experiments (Zhang 2005), and our results do seem to support this. However, we agree that early neural inhibition is insufficient evidence towards such a mechanism. We have thus removed this statement for accuracy.</p></body></sub-article></article>