Feeding state functionally reconfigures a sensory circuit to drive thermosensory behavioral plasticity

Internal state alters sensory behaviors to optimize survival strategies. The neuronal mechanisms underlying hunger-dependent behavioral plasticity are not fully characterized. Here we show that feeding state alters C. elegans thermotaxis behavior by engaging a modulatory circuit whose activity gates the output of the core thermotaxis network. Feeding state does not alter the activity of the core thermotaxis circuit comprised of AFD thermosensory and AIY interneurons. Instead, prolonged food deprivation potentiates temperature responses in the AWC sensory neurons, which inhibit the postsynaptic AIA interneurons to override and disrupt AFD-driven thermotaxis behavior. Acute inhibition and activation of AWC and AIA, respectively, restores negative thermotaxis in starved animals. We find that state-dependent modulation of AWC-AIA temperature responses requires INS-1 insulin-like peptide signaling from the gut and DAF-16/FOXO function in AWC. Our results describe a mechanism by which functional reconfiguration of a sensory network via gut-brain signaling drives state-dependent behavioral flexibility.


Introduction
Responses of animals to sensory stimuli are extensively modulated by their internal state Kim et al., 2017;Li and Dulac, 2018;Stowers and Liberles, 2016). The sex and hormonal conditions of an animal determine its responses to pheromones (Li and Dulac, 2018;Martín-Sánchez et al., 2015;McGrath and Ruvinsky, 2019;Stowers and Liberles, 2016), and behavioral arousal thresholds are regulated by sleep-wake cycles (Allada et al., 2017;Lee and Dan, 2012). A particularly well-studied internal state is that of satiety. Well-fed animals exhibit distinct responses to environmental cues compared to animals that have been food-deprived (Augustine et al., 2020;Kim et al., 2017). Starvation not only modulates responses to food-related chemical cues, but also generally and broadly regulates animal behaviors (Dietrich et al., 2015;Rengarajan et al., 2019;Sayin et al., 2019;Trent et al., 1983;Yang et al., 2015). These behavioral changes may allow animals to prioritize food seeking over other behavioral drives. How starvation signals are integrated to alter neuron and circuit properties are not fully understood.
Thermotaxis navigation behaviors in C. elegans are particularly susceptible to feeding state. When placed on a spatial thermal gradient, well-fed but not food-deprived C. elegans navigates toward temperatures at which they were cultivated (T c ) for 3-4 hr prior to the behavioral assay ( Figure 1A; Hedgecock and Russell, 1975). Thermosensation is mediated primarily by the AFD sensory neurons, and their major postsynaptic partners, the AIY interneurons in the head of C. elegans (Mori and Ohshima, 1995). Additional sensory neurons including the AWC olfactory neurons also exhibit temperature responses but play relatively minor roles in regulating thermotaxis behaviors under standard assay conditions (Biron et al., 2008;Ikeda et al., 2020;Kuhara et al., 2008). Temperature responses in AFD appear to be indifferent to feeding state Ramot et al., 2008a;Tsukada et al., 2016), leaving open the question of which circuit mechanisms integrate internal state information into the thermotaxis circuit to disrupt thermotaxis.
A previous study implicated insulin signaling in the regulation of feeding state-dependent thermotaxis behavioral plasticity in C. elegans (Kodama et al., 2006). The INS-1 insulin-like peptide (ILP) gene was suggested to antagonize the DAF-2 insulin receptor and the DAF-16/FOXO transcription factor to disrupt thermotaxis behavior upon food deprivation, such that starved ins-1 mutants continue to perform thermotaxis (Kodama et al., 2006). However, neither the source of INS-1 production, nor its site of action, was definitively identified. Behavioral experiments suggested that INS-1 expression from subsets of neurons targets the AIY, AIZ and RIA interneurons implicated in the thermotaxis circuit (Kodama et al., 2006), and temperature responses in AIZ were shown to be regulated as a function of satiety state (Kodama et al., 2006). However, given conflicting reports on the roles of AIZ and RIA in driving thermotaxis behaviors (Luo et al., 2014a;Mori and Ohshima, 1995;Ohnishi et al., 2011), how internal feeding state and ILP signaling modulate the thermotaxis circuit to alter navigation behaviors remains unclear.
Here we show that internal feeding state regulates thermotaxis behavioral plasticity via INS-1mediated neuromodulation of the AWC sensory neurons and postsynaptic AIA interneurons. AWC and AIA act in parallel to the core AFD-AIY thermosensory circuit to regulate behavioral output. We find that although temperature responses in neither AFD nor AIY are altered upon prolonged food deprivation, the probability and duration of temperature responses in AWC are increased under these conditions. AWC inhibits the AIA interneurons via glutamatergic signaling to alter locomotory strategies and disrupt AFD-driven thermotactic navigation in starved animals. We show that expression of ins-1 specifically in the gut is necessary for internal state-dependent thermotaxis behavioral plasticity, and establish that gut-derived INS-1 signaling targets DAF-16/FOXO in AWC to regulate temperature responses and circuit activity in response to feeding state. Our results indicate that internal state drives thermosensory behavioral plasticity by tuning the activity state of a modulatory circuit via gut-to-brain signaling. This circuit acts in parallel to, and gates the ability of, the core thermotaxis network to regulate navigational strategies as a function of environmental temperature changes and internal conditions.

Prolonged food deprivation disrupts thermotaxis navigation behavior
When placed at temperatures (T) warmer than the T c , C. elegans moves toward cooler temperatures (negative thermotaxis) (Hedgecock and Russell, 1975; Figure 1A). Conversely, when placed at T < T c , animals move toward warmer temperatures (positive thermotaxis) ( Figure 1A). To characterize the effects of prolonged starvation on thermotaxis at high resolution, we examined animal movement under assay conditions that permitted both negative and positive thermotaxis (Luo et al., 2014a). Well-fed young adult hermaphrodites grown at 15˚C, and placed at 20˚C at the center of a   (Hedgecock and Russell, 1975). T: starting temperature on gradient; T c = cultivation temperature 3-4 hr prior to assay. Warm and cool temperatures are indicated in red and green, respectively. (B) Tracks of individual worms on a long linear thermal gradient from a single representative assay of~15 animals each. Worms were cultivated at 15˚C or 25˚C for negative (green tracks) or positive (red tracks) thermotaxis assays, respectively, with (fed) or without (starved) bacterial food for 3 hr prior to assay. Dashed lines indicate the temperature (20˚C) at which animals were placed at the start of the assay. Tracks were superimposed post analysis for presentation. (C) Mean thermotaxis bias of animals subjected to the indicated feeding conditions on a short thermal gradient. Thermotaxis bias was calculated as (run duration toward colder side -run duration toward warmer side)/total run duration. Each dot represents the thermotaxis bias of a biologically independent assay comprised of 15 animals. Errors are SEM. * and ** indicates different from fed at p<0.05 and p<0.01, respectively (ANOVA with Tukey's multiple comparisons test). (D) (Left) Schematic of track orientation on a linear thermal gradient. Orientation parallel to the gradient toward warm temperatures is 0˚, orientation orthogonal to the gradient is 90˚or À90˚, and orientation parallel to the gradient toward cold temperatures is 180˚or-180˚. (Right) Histograms of movement orientation following a turn. Tracks from 8 assays of 15 animals each were categorized into bins of 45˚. Red and green bars indicate orientation toward the warmer/orthogonal or cooler side, respectively. The p-value was derived using the Mardia-Watson-Wheeler non-parametric test for circular data. (E) (Left) Intracellular calcium dynamics in AFD expressing GCaMP6s in response to a linear rising temperature stimulus (black lines) at 0.05˚C/s. Red dashed line indicates cultivation temperature of 20˚C. Each row in the heatmaps displays responses from a single AFD neuron from different animals ordered by the time of the first response; n = 25 (fed) and 24 (starved). (Right) Mean T* AFD of fed and starved animals calculated from data shown in heatmaps at left. Each dot is the T* AFD of a single neuron. Errors are SEM. * indicates different from fed at p<0.05 (Student's t-test). (F) (Top) Intracellular calcium dynamics in AIY expressing GCaMP6s in response to a linear rising temperature stimulus (black lines) at 0.05˚C/s. Red dashed line indicates cultivation temperature of 20˚C. Each row in the heatmaps displays responses from a single neuron from different animals ordered by the time of the first response; n = 44 (fed) and 43 (starved). (Bottom) Each bar in the histograms represents the proportion of neurons responding during 15 s bins. The behavioral temperature range of 23-28˚C is indicated by vertical solid lines. (G) Cumulative distribution fraction plots of total duration of calcium responses per AIY neuron shallow linear thermal gradient (long thermal gradient; see Materials and methods), moved robustly down the gradient toward cooler temperatures ( Figure 1B). Conversely, animals grown at 25˚C and placed at 20˚C on this gradient moved toward warmer temperatures ( Figure 1B). Food deprivation for 3 hr disrupted both navigation behaviors ( Figure 1B; Chi et al., 2007;Ramot et al., 2008b). In particular, examination of individual animal trajectories showed that food-deprived animals grown at 15˚C exhibited more sharp turns and reversals than their fed counterparts, resulting in prolonged residence at the starting temperature. While a subset of food-deprived 15˚C-grown animals eventually moved down the gradient, starved 25˚C-grown animals essentially remained at their starting temperature throughout the assay ( Figure 1B). Starvation-dependent modulation of navigation behaviors was observed only on thermal gradients; fed and starved animals exhibited similar velocities and dispersed throughout an isothermal plate held at 20˚C (Figure 1-figure supplement 1A).
While negative thermotaxis is exhibited across a range of assay parameters, positive thermotaxis is typically consistently observed only under a relatively restricted set of assay conditions (Jurado et al., 2010;Ramot et al., 2008b). We chose to further pursue the effects of food deprivation on negative thermotaxis which in addition to being robust, can also be performed at higher throughput Ryu and Samuel, 2002). On spatial thermal gradients, negative thermotaxis is mediated primarily via klinokinesis Luo et al., 2014a;Ryu and Samuel, 2002;Zariwala et al., 2003). In this behavioral strategy, worms moving toward cooler temperatures suppress reorientations (turns) and consequently, extend the duration of forward movement (runs). Conversely, when moving toward the non-preferred warmer temperatures, worms increase turn frequency and decrease run duration. In parallel, following a turn, worms preferentially bias the direction of a new run toward cooler temperatures (Luo et al., 2014a). These strategies result in net migration of animals down the gradient. We asked whether either or both strategies are disrupted upon starvation.
To quantify klinokinesis, we calculated thermotaxis bias [(run duration toward cold -run duration toward warm)/total run duration] of adult C. elegans hermaphrodites grown at T c = 20˚C and navigating a steeper linear thermal gradient (short thermal gradient; see Materials and methods) (Chi et al., 2007;Clark et al., 2007). While well-fed animals exhibited robust negative thermotaxis bias under these conditions, animals starved for >2 hr were essentially athermotactic, indicating that these animals were unable to modulate turning frequency as a function of experienced temperature changes ( Figure 1C; Chi et al., 2007;Hedgecock and Russell, 1975;Kodama et al., 2006). We established that starved animals also failed to orient run direction toward cooler temperatures following a turn, and instead oriented their runs near-randomly on the gradient ( Figure 1D). Average velocities of fed and starved animals were indistinguishable on these gradients (average velocity: fed -117 mm/s, starved for 3 hr -106 mm/s; n = 10 animals each). Together, these observations indicate that prolonged starvation abolishes both klinokinesis and biased run direction to disrupt negative thermotaxis. All subsequent experiments using starved animals were performed following food removal for 3 hr (referred to interchangeably as starvation or food deprivation).
We tested whether starvation-mediated alteration of negative thermotaxis is reversible. Refeeding starved animals for an hour was sufficient to restore robust negative thermotaxis bias ( Figure 1C; Chi et al., 2007;Mohri et al., 2005), indicating that prolonged starvation does not irreversibly alter the function of the underlying circuit. Since starvation deprives animals of chemosensory inputs from bacteria and alters internal metabolic state, we asked whether exposure to bacterial odors was sufficient to mimic the fed state. However, the presence of bacteria on the lids    of agar plates did not override the effect of starvation on negative thermotaxis (Figure 1-figure supplement 1B). Moreover, feeding animals either live or antibiotic-killed bacteria was sufficient to mimic the well-fed condition for negative thermotaxis (Figure 1-figure supplement 1C). We infer that prolonged starvation alters internal state to disrupt negative thermotaxis.

Starvation does not alter AFD or AIY temperature responses
The bilateral pair of AFD sensory neurons are the primary thermoreceptors driving thermotaxis navigation behaviors (Goodman and Sengupta, 2018;Mori and Ohshima, 1995). To assess whether AFD temperature responses are modulated by food, we examined calcium dynamics in fed and starved animals grown at 20˚C expressing GCaMP6s specifically in AFD and subjected to a rising temperature stimulus. To more closely mimic the temperature changes that animals experience when they are navigating the linear thermal gradient used in our assays, we performed all measurements using a shallow (0.05˚C/s) linear rising temperature ramp from 16-28˚C (see Materials and methods). AFD responds to temperature changes above a T c -determined threshold referred to as T* AFD Kimura et al., 2004). Confirming and extending previous observations using different temperature stimulus paradigms Matsuyama and Mori, 2020;Ramot et al., 2008a;Tsukada et al., 2016), we found that temperature-driven calcium dynamics in AFD were largely indifferent to feeding state, although we noted a small but statistically significant decrease in T* AFD upon starvation ( Figure 1E). Since manipulations resulting in effects of a similar magnitude on T* AFD do not disrupt negative thermotaxis (Inada et al., 2006;Takeishi et al., 2016;Wasserman et al., 2011), we infer that the observed change in T* AFD is unlikely to drive starvationinduced loss of negative thermotaxis behavior.
Since internal state can modulate downstream circuit components without altering responses in the primary sensory neurons themselves (Datta et al., 2008;Haga et al., 2010;Inagaki et al., 2012;Marella et al., 2012;Rengarajan et al., 2019;Root et al., 2011), we next tested whether temperature responses in AIY, the primary postsynaptic partners of AFD, are altered upon starvation. In a recent study, food deprivation has been suggested to alter the phase relationship between AFD and AIY temperature responses in a restricted temperature range and may mediate plasticity in positive thermotaxis (Matsuyama and Mori, 2020). In contrast to the robust and deterministic temperature responses observed in AFD, we observed stochastic calcium transients in AIY neurons expressing GCaMP6s in immobilized animals in response to the shallow linear temperature ramp ( Figure 1F) (also see Hawk et al., 2018). We observed no significant differences in total response duration per neuron or the average duration of individual response bouts in AIY between fed and starved animals ( Figure 1G, Figure 1-figure supplement 2A). Moreover, the proportion of AIY neurons responding to the rising temperature stimulus in the temperature range of the behavioral assay (23-28˚C) was similar under fed and starved conditions, although we noted that responses were initiated at a lower temperature in a subset of AIY neurons upon starvation ( Figure 1F). Temperature responses in AIY can be driven by thermal inputs from sensory neurons other than AFD (Biron et al., 2008;Hawk et al., 2018;Kuhara et al., 2008). To specifically assess AFD-driven responses in AIY, we examined AIY responses to warming near T c (peri-T c ); AIY temperature responses in this range have been shown to be AFD-dependent Hawk et al., 2018). We found that the frequency of responses in this temperature range in AIY was also similar in fed and starved animals ( Figure 1-figure supplement 2B). We conclude that AFD thermosensory responses, and likely AFD synaptic output as measured by responses in AIY, are largely unaffected by starvation, and that alternate pathways incorporate internal state information elsewhere in the thermotaxis circuit.

The AWC olfactory neurons integrate feeding state information into the thermotaxis circuit
We and others previously showed that in addition to AFD, the AWC sensory neurons respond to temperature, albeit in a manner distinct from responses in AFD (Biron et al., 2008;Kuhara et al., 2008). However, the contribution of AWC to thermotaxis behaviors is relatively minor under standard assay conditions Biron et al., 2008;Kuhara et al., 2008;Luo et al., 2014a), raising the question of the role of this neuron type in these behaviors. AWC responds robustly to food-related volatile odors (Bargmann et al., 1993;Chalasani et al., 2007), and AWC olfactory responses and AWC-driven behaviors are modulated by the presence or absence of bacterial food Cho et al., 2016;Colbert and Bargmann, 1995;Lin et al., 2010;Neal et al., 2015;Torayama et al., 2007). We hypothesized that AWC may integrate internal feeding state information into the thermotaxis circuit to modulate negative thermotaxis.
To test this notion, we acutely silenced AWC in adult animals via cell-specific expression of the Drosophila histamine-gated chloride channel (HisCl1) and exposure to exogenous histamine (Pokala et al., 2014). Exposing animals expressing HisCl1 in AWC to histamine during the 3 hr starvation period, but not during the thermotaxis assay, had no effect on the expected negative thermotaxis bias in fed and starved animals ( Figure 2A). However, silencing AWC during the assay alone was sufficient to restore negative thermotaxis bias in starved animals ( Figure 2A). Moreover, HisCl1mediated silencing of AWC restored the ability of starved animals to bias the direction of runs following turns toward cooler temperatures ( Figure 2-figure supplement 1A). We confirmed that AWC activity is inhibited by these manipulations by examining AWC-driven olfactory behaviors of animals expressing AWCp::HisCl1. In the presence of histamine, these animals were no longer attracted toward a point source of the AWC-sensed volatile chemical isoamyl alcohol, although they continued to respond to a point source of the odorant diacetyl sensed by the AWA olfactory neuron type (Figure 2-figure supplement 1B; Bargmann et al., 1993). Similar HisCl1-mediated silencing of the ASI bacteria-sensing neurons (Gallagher et al., 2013) had no effect on the expected negative thermotaxis behaviors (Figure 2-figure supplement 1C). As an independent verification, we silenced AWC via cell-specific expression of the light-gated anion channelrhodopsin GtACR2 (Govorunova et al., 2015;Ló pez-Cruz et al., 2019). Optogenetic silencing of AWC during the assay was again sufficient to restore negative thermotaxis bias in starved animals ( Figure 2B). These results indicate that acute silencing of AWC in adult animals is sufficient to abolish starvation-dependent thermotaxis behavioral plasticity. Moreover, we infer that AWC activity is necessary during the execution of thermotaxis behavior to disrupt negative thermotaxis.
We next asked whether responses to temperature in AWC are modulated as a function of feeding state. AWC neurons in fed animals grown overnight at 20˚C exhibited relatively infrequent and stochastic calcium transients in response to a shallow rising temperature stimulus from 23-28˚C, the temperature range in which animals exhibit negative thermotaxis in our behavioral assays (see Materials and methods; Figure 2C; Biron et al., 2008). These neurons responded similarly in fed animals subjected to a constant temperature of 20˚C ( Figure 2D; Biron et al., 2008). However, we found that the total response duration per neuron as well as the average duration of individual events was significantly increased in response to a rising temperature ramp upon starvation for 3 hr ( Figure  . The bilateral pair of AWC neurons is functionally asymmetric (AWC ON and AWC OFF neurons) and expresses distinct sets of signaling genes (Troemel et al., 1999). We did not detect obvious asymmetry in the responses of these neurons to a rising temperature ramp in starved animals (Figure 2-figure supplement 1E); these neurons are thus considered together in all subsequent experiments. Together, these results indicate that starvation increases responses to rising temperatures in AWC, and that this increased activity is necessary to disrupt negative thermotaxis.

AWC-mediated inhibition of the AIA interneurons is necessary and sufficient to mediate starvation-dependent thermotaxis plasticity
How might enhanced temperature responses in AWC in starved animals disrupt negative thermotaxis? Increasing AWC activity either via genetic or optogenetic means has previously been shown to promote reversals and turns via inhibition and activation of the postsynaptic primary layer interneurons AIY and AIA, and AIB, respectively ( Figure 3A; Albrecht and Bargmann, 2011;Chalasani et al., 2007;Chalasani et al., 2010;Gordus et al., 2015;Gray et al., 2005;White et al., 1986). Consequently, AIY and AIA inhibit, and AIB promotes, reversals and/or turns ( Figure 3A; Chalasani et al., 2007;Gordus et al., 2015;Gray et al., 2005;Kocabas et al., 2012;Li et al., 2014;Ló pez-Cruz et al., 2019;Tsalik and Hobert, 2003;Wakabayashi et al., 2004). Enhanced AWC activity in starved animals is consistent with our observation that animals exhibit increased reversals and turns at the starting temperature upon food deprivation ( Figure 1B), thereby failing to correctly navigate  Figure 2. AWC activity is necessary for starvation-dependent suppression of negative thermotaxis. (A) Mean thermotaxis bias of fed and starved wildtype and transgenic animals expressing HisCl1 in AWC under the odr-1 promoter in the presence or absence of 10 mM histamine (His). Histamine was present during starvation but not on the assay plate, or only on the assay plate as indicated. Each dot represents the thermotaxis bias of a biologically independent assay comprised of 15 animals. Errors are SEM. *** indicates different from fed at each condition at p<0.001 (Student's t-test). n.s. -not significant. P-values in red indicate Wald F-statistic from linear regression analysis for the effect of the indicated genotype on the magnitude of the feeding state effect in the indicated conditions. Wild-type data were interleaved with experimental data in Figure 3F-G, and the spatial thermal gradient. We asked whether AWC acts via one or more of these first layer interneurons to regulate negative thermotaxis.
Since temperature-driven calcium dynamics in AIY were largely indifferent to feeding state ( Figure 1F), we examined temperature responses in AIA and AIB in immobilized fed and starved animals. Similar to AIY, both AIA and AIB exhibited stochastic calcium transients in response to a shallow rising temperature stimulus in the T > T c regime ( Figure 3B . AIB activity is tightly coupled to the motor state of animals (Gordus et al., 2015;Kato et al., 2015). The observation that AIB activity is unaltered in starved animals despite changes in locomotory output raises the possibility that under these conditions, AIB may be partly disassociated from network activity state. However, responses to a rising temperature ramp in AIA were markedly altered upon starvation ( Figure 3B Temperature responses in the AIZ interneurons have also previously been reported to be modulated by feeding state (Kodama et al., 2006). Although not directly postsynaptic to AWC ( Figure 3A), AIZ is a major postsynaptic partner of AIY, receives inputs from both AIA and AIB and multiple sensory neuron types, and is presynaptic to RIA (Cook et al., 2019;White et al., 1986; Figure 3A). Under our imaging conditions, temperature responses in AIZ, like those in AIA, exhibited tonic stochastic activity in fed animals subjected to a rising temperature stimulus, and these responses were decreased upon starvation ( Figure 3D We next asked whether suppression of AIA and/or AIZ activity in fed animals is sufficient to disrupt negative thermotaxis. To inhibit AIA, we expressed HisCl1 under the gcy-28d promoter which drives expression strongly in AIA and less consistently in AVF and a subset of additional neurons (the 'AIA circuit') (Cho et al., 2016). Fed and starved animals expressing HisCl1 in the AIA circuit continued to exhibit the expected negative thermotaxis bias in the absence of histamine ( Figure 3F). However, acute inhibition of the AIA circuit via addition of histamine to the assay plate resulted in animals exhibiting extensive reversals and turns at the starting temperature regardless of feeding state, and consequent inability of these animals to navigate the gradient ( Figure 3F). We observed similar effects on animal locomotion upon inhibition of AIA via expression of an activated UNC-103 potassium channel [unc-103(gf)] in AIA (Cho et al., 2016;Lin et al., 2010;Reiner et al., 2006  . Thermotaxis index was calculated as (number of animals at 23-24˚C on gradient)-(number of animals at 27-28˚C on gradient)/(total number of animals). Animals were grown overnight and assayed with or without 50 mM all-trans retinal (ATR) in the plates as indicated. Assays were performed in the presence of blue light (see Materials and methods). Each dot represents the thermotaxis index of a biologically independent assay comprised of 15 animals. Errors are SEM. *** indicates different from fed at each condition at p<0.001 (Student's t-test). n.s. -not significant. P-values in red indicate Wald F-statistic from linear regression analysis for the effect of the indicated genotype on the magnitude of the feeding state effect. Wild-type data were interleaved with experimental data in Figure 3H, and are repeated. (C-D) (Top) Intracellular calcium dynamics in AWC expressing GCaMP3 in response to a linear rising temperature stimulus at 0.05˚C/s (C) or at a constant temperature of 20˚C (D) (black lines). Each row in the heatmaps displays responses from a single neuron from different animals ordered by the time of the first response; n = 21 (rising ramp, fed), 22 (rising ramp, starved), and 20 each (constant temperature, fed and starved). Each bar in the histograms represents the percentage of neurons responding during 15 s bins. (Bottom) Cumulative distribution fraction plots of total duration of calcium responses per AWC neuron calculated from data shown in the corresponding heatmaps and histograms. Distributions were compared using the Kolmogorov-Smirnov test. Also see   Color codes indicate neurons whose activity is associated with promotion or inhibition of reversals and Figure 3 continued on next page (see Materials and methods) and addition of histamine decreased spontaneous reversals on an isothermal plate as reported previously (Gray et al., 2005;Li et al., 2014;Tsalik and Hobert, 2003; Figure 3-figure supplement 1F), AIZ inhibition had no effect on the expected thermotaxis behavior of either fed or starved animals ( Figure 3G). We conclude that while starvation inhibits activity in both AIA and AIZ, complete suppression of these responses in AIA but not AIZ disrupts negative thermotaxis regardless of feeding state. We next asked whether acute activation of AIA is sufficient to restore negative thermotaxis in starved animals. We optogenetically activated AIA via expression of the light-activated ion channel Chrimson under the ins-1(s) promoter (Dobosiewicz et al., 2019;Klapoetke et al., 2014) as animals performed thermotaxis on a spatial thermal gradient. Activation of AIA was sufficient to restore the ability of starved animals to perform negative thermotaxis ( Figure 3H). AWC inhibits AIA via glutamatergic signaling . If AWC-mediated glutamatergic transmission inhibits temperature responses in AIA in starved animals, we would predict that blocking glutamatergic signaling from AWC would also be sufficient to restore negative thermotaxis upon starvation. Indeed, we found that knocking out the glutamate transporter eat-4 cell-specifically in AWC (Ló pez-Cruz et al., 2019) resulted in robust negative thermotaxis behavior by starved animals ( Figure 3I). These experiments suggest that upon prolonged starvation, increased AWC temperature responses inhibit AIA via glutamatergic signaling to disrupt negative thermotaxis via warming-uncorrelated regulation of reversals and turns. These observations also provide a mechanistic explanation for the previously reported decorrelation between AFD activity and turns in starved as compared to fed animals navigating a thermal gradient (Tsukada et al., 2016). Moreover, these observations indicate that suppression or activation of AIA in fed or starved animals is sufficient to permit or inhibit negative thermotaxis, respectively.   INS-1 signaling from the intestine regulates thermotaxis behavioral plasticity in response to starvation INS-1 ILP signaling has previously been implicated in feeding state-dependent modulation of both negative and positive thermotaxis (Kodama et al., 2006), although the source and target of this signaling are unclear. ins-1 has previously been shown to be expressed in multiple neuron types, including AIA as well as in the intestine, as assessed via GFP reporter expression under ins-1 regulatory sequences (Kodama et al., 2006;Pierce et al., 2001;Tomioka et al., 2006). We investigated the required source of INS-1 production for the modulation of negative thermotaxis in starved animals.
To address this issue, we knocked out ins-1 cell-specifically using Cre-Lox-mediated recombination. We generated strains carrying loxP sites flanking the endogenous ins-1 locus as well as extrachromosomal arrays driving expression of Cre tagged with GFP under the ins-1 endogenous or cellspecific promoters (Figure 4-figure supplement 1A). We then selected animals expressing Cre:: SL2::GFP in the cells of interest and examined their thermotaxis behaviors under fed and starved conditions. Knocking out ins-1 in all or a majority of ins-1-expressing cells by driving Cre::SL2::GFP under endogenous ins-1 regulatory sequences restored negative thermotaxis in starved animals, similar to the behavior of ins-1 null mutants ( Figure 4A and D). However, animals in which ins-1 was deleted only in AIA or AIZ/AIB via Cre::SL2::GFP expression under the gcy-28d or odr-2b(3a) promoters, respectively failed to perform negative thermotaxis upon starvation. In contrast, knocking out ins-1 specifically in the intestine via Cre::SL2::GFP driven under the ifb-2 promoter was again sufficient to rescue the negative thermotaxis behavioral defect in starved animals ( Figure 4A; Kodama et al., 2006). We verified the cell-specificity of these drivers using a characterized recombination reporter that expresses mCherry ubiquitously but drives GFP expression only upon Cre-mediated excision (Ruijtenberg and van den Heuvel, 2015; Figure 4-figure supplement 1B). These results indicate that ins-1 production from the intestine is necessary for starvation-mediated plasticity in negative thermotaxis.
We asked whether prolonged starvation alters ins-1 expression in the intestine by examining expression of destabilized GFP (GFP::PEST) reporter driven under the ins-1 promoter. As reported previously, we observed expression of this reporter in head neurons including in AIA as well as in the intestine ( Figure 4B). However, levels of ins-1p::GFP::PEST expression in the gut were not altered upon food deprivation for 3 hr (Figure 4-figure supplement 1C), suggesting that mechanisms other than changes in intestinal ins-1 expression account for the effects of prolonged food deprivation on negative thermotaxis.

INS-1 targets AWC to alter temperature responses as function of food deprivation
ILPs act via a highly conserved signaling pathway to regulate the phosphorylation state and subcellular localization of the DAF-16 FOXO transcription factor ( Figure 4C; Murphy, 2013;Tissenbaum, 2018). We found that animals mutant for the age-1 and akt-1 kinases in this pathway exhibited phenotypes similar to those of wild-type animals, such that they failed to perform negative thermotaxis upon starvation ( Figure 4D, Figure 4-figure supplement 2A). We could not examine the effects of mutations in the pdk-1 kinase on thermotaxis since these mutants were athermotactic regardless of feeding state (Figure 4-figure supplement 2A). In contrast, loss of function of the daf-18 PTEN phosphatase and daf-16 FOXO restored the ability of starved animals to perform negative thermotaxis, similar to the phenotype of ins-1 mutants ( Figure 4D). These observations imply that starvation inhibits the ILP signaling pathway and phosphorylation of DAF-16 to disrupt negative thermotaxis ( Figure 4C). INS-1 and other ILPs can inhibit the signaling pathway by antagonizing the DAF-2 insulin receptor (Cornils et al., 2011;Hung et al., 2014;Kodama et al., 2006;Pierce et al., 2001). Consistent with the notion that DAF-2-mediated signaling is inhibited upon starvation, loss of daf-2 function did not further affect starvation-mediated loss of negative thermotaxis ( Figure 4D). We infer that upon starvation, INS-1 directly or indirectly antagonizes DAF-2 and disrupts negative thermotaxis via DAF-16.
We asked whether DAF-16 acts cell autonomously in AWC to alter thermotaxis behavior in starved animals by cell-specifically depleting DAF-16 protein in AWC using the auxin-inducible degron system . We expressed the TIR1 F-box protein specifically in AWC in animals in which the daf-16 locus is genome-engineered with auxin-inducible degron sequences   . Promoters used to drive Cre::SL2::GFP expression were ins-1 (ins-1-expressing cells), gcy-28d (AIA), odr-2b(3a) (AIB and AIZ), and ifb-2 (intestine). Alleles used in (D) were ins-1(nr2091), daf-18(ok480), daf-16(m26), and daf-2(e1368). DAF-16 was depleted in AWC via auxin-induced degradation of a degron-tagged daf-16 allele and AWC-specific expression of TIR1 under the ceh-36prom2_del1ASE promoter (E) (Figure 4-figure supplement 2B). Auxin was added during starvation and to the assay plate, or to the assay plate alone, as indicated in (E). Each dot represents the thermotaxis bias of a biologically independent assay comprised of 15 animals. Errors are SEM. *** and ** indicate different from fed p<0.001 and p<0.01, respectively (Student's t-test). n.s. -not significant. P-values in red indicate t-statistic from posthoc effect size comparisons (Dunnett's test) between the indicated genotypes (A) or the conditions (E), respectively, on the magnitude of the feeding state effect. Wild-type data in (E) were interleaved with experimental data in  Aghayeva et al., 2020). We found that addition of auxin during the 3 hr starvation period and the assay but not during the assay alone resulted in significant rescue of negative thermotaxis behavior ( Figure 4E). Although it is possible that DAF-16 is not sufficiently degraded upon addition of auxin only during the assay period, 4 mM auxin was previously shown to reduce degron-tagged protein abundance to <5% within 30 mins . We did not observe any effects on expected negative thermotaxis behavior upon auxin-mediated DAF-16 degradation specifically in ASI (Figure 4-figure supplement 2C). Moreover, we observed no changes in the expected negative thermotaxis behaviors of animals mutant for additional genes previously implicated in feeding state-dependent modulation of AWC-driven olfactory behaviors (Figure 4figure supplement 2D; Chalasani et al., 2010;Neal et al., 2015;Tsunozaki et al., 2008). We infer that INS-1 targets DAF-16 in AWC to modulate negative thermotaxis bias as a function of feeding state, and that DAF-16 function is necessary during prolonged starvation for this modulation.
We next asked whether starvation-regulated plasticity in temperature responses in AWC and AIA was affected in ins-1 mutants. Indeed, we found that in contrast to the increased activity in AWC observed in starved wild-type animals, temperature responses in this neuron type were no longer modulated by feeding state in ins-1 mutants ( Figure 4F and H, Figure 4-figure supplement 2E). Specifically, AWC neurons in both fed and starved ins-1 mutants exhibited infrequent responses similar to the response profiles of fed wild-type animals ( Figure 4F and H, Figure 4-figure supplement 2E). Similarly, the proportion of responding animals, the total response duration per neuron, as well as the average duration of individual events in AIA in fed and starved ins-1 mutants resembled the activity profiles of AIA neurons in fed wild-type animals ( Figure 4G-H, Figure 4-figure supplement 2F). We conclude that INS-1 signaling in starved animals alters AWC and AIA temperature responses to disrupt negative thermotaxis.

Discussion
We show here that prolonged starvation disrupts negative thermotaxis by altering the activity of the modulatory AWC-AIA, but not that of the core thermosensory AFD-AIY, circuit. In fed animals, warming fails to evoke responses in AWC. Under these conditions, AIA exhibits tonic activity and inhibits reversals and turns, thereby enabling AFD-driven regulation of klinokinesis and turning bias as a function of temperature changes and the animal's T c ( Figure 4I). However, during prolonged food deprivation, INS-1 signaling from the gut acts via DAF-16 in AWC neurons to alter their response properties. The altered state of AWC in starved animals results in enhanced temperature responses in AWC, and consequent disruption of AFD-driven thermotactic navigation via suppression of AIA activity ( Figure 4I). Our results indicate that the activity state of AWC-AIA is permissive for AFD-dependent negative thermotaxis in fed animals, and that food deprivation modulates AWC-AIA via gut-to-brain signaling to disrupt this behavior. Starvation has previously been shown to enhance odorant responses in AWC (Neal et al., 2015). We speculate that starvation-dependent changes in sensory responses in AWC allow C. elegans to prioritize responses to bacterial foodrelated odorants over optimal thermoregulation. We find that INS-1 signaling from the gut is necessary to modulate AWC responses upon prolonged starvation possibly via altered processing and/or release. In contrast, ins-1 expression in AIA has been shown to be sufficient for modulation of chemosensory responses in AWC as well as in the     ASER sensory neurons upon pairing starvation with AWC-or ASE-sensed chemical cues Cho et al., 2016;Lin et al., 2010;Tomioka et al., 2006). Similarly, expression of ins-1 from multiple neuron types rescues the ins-1 thermotaxis behavioral phenotype in starved animals (Kodama et al., 2006). These observations suggest that while ins-1 overexpression from multiple neuronal sources including AIA is sufficient, expression and/or production from specific cells and tissues, potentially at different levels, and in response to changing internal states over time, may be necessary for neuromodulation in AWC. The expression of multiple ILP genes as well as neuropeptides is regulated by diverse environmental and internal conditions in different cell types in C. elegans (Cornils et al., 2011;Fernandes de Abreu et al., 2014;Kim and Li, 2004;Pierce et al., 2001;Ritter et al., 2013). Given reports of ILP-to-ILP signaling mechanisms (Chen et al., 2013), we cannot exclude the possibility that intestinal INS-1 targets AWC indirectly via other ILPs expressed from neuronal or non-neuronal tissues. It is likely that regulated transcription and/or release of ILPs and other peptides from defined cell and tissue types is critical for modulation of specific neuron types as a function of temporally varying internal states.
As we reported previously Biron et al., 2008), AWC responses to a shallow rising temperature stimulus are stochastic, although their duration is stimulus-regulated. However, AWC responses to a steeply rising temperature stimulus are time-locked (Kuhara et al., 2008). Similarly, while the ASER salt-sensing neurons exhibit stochastic activity in response to a shallow linear salt gradient, they exhibit time-locked responses when subjected to large step changes in salt concentrations (Luo et al., 2014b). Large stimulus changes may saturate intracellular calcium levels and mask physiologically relevant underlying neuronal dynamics. While AFD exhibits extraordinary thermosensitivity, temperature responses in AWC appear to be far less sensitive (Ramot et al., 2008a). We suggest that a shallow thermal ramp may not be sufficient to elicit sustained temperature responses in AWC, resulting in the observed stochastic activity pattern. Upon prolonged starvation, DAF-16-regulated expression changes in as yet unidentified thermosensory signaling molecules in AWC may lead to the observed increased frequency and duration of temperature response. Molecules such as the CMK-1 calcium/calmodulin-dependent protein kinase I and the EGL-4 cGMPdependent protein kinase have previously been implicated in regulating AWC olfactory responses as a function of starvation in distinct contexts (Cho et al., 2016;Lee et al., 2010;Neal et al., 2015), suggesting that distinct pathways may translate internal state information into changes in AWC responses under different conditions. An important next step will be to identify targets of these pathways in AWC in animals subjected to defined experiences.
Interestingly, although temperature responses in AIZ resemble those in AIA in fed and starved animals, inhibition of AIZ has no effect on negative thermotaxis under either fed or starved conditions. The circuit underlying thermotaxis behaviors in C. elegans is remarkably degenerate, and alternate neuronal pathways can compensate for the absence of the core AFD and AIY components in distinct contexts for different aspects of thermotaxis behaviors Matsuyama and Mori, 2020). AIZ may be a component of a degenerate circuit that modulates negative thermotaxis under specific environmental or genetic conditions. Although this hypothesis remains to be verified, the presence of degenerate circuits driving specific behaviors in a contextdependent manner is a conserved feature of nervous systems, and contributes to both robustness and flexibility in behavioral outputs (Cropper et al., 2016;Edelman and Gally, 2001;Prinz et al., 2004;Saideman et al., 2007;Trojanowski et al., 2014;Wang et al., 2019).
Acute inhibition of AWC and activation of AIA is sufficient to restore negative thermotaxis in starved animals, indicating that the functions of the core thermotaxis circuit are maintained, but are masked by the activity state of the AWC-AIA circuit. Recently, it has been shown that the activity state of the ASG sensory neurons is similarly permissive for avoidance of starvation-associated low salt concentrations by the ASER salt-sensing neurons in C. elegans (Jang et al., 2019). What might be the advantage of driving behavioral plasticity via this gating mechanism as compared to direct regulation of the core circuit? We suggest that incorporating distinct modulatory pathways as a function of different experiences and conditions allows for a greater degree of behavioral flexibility and more efficient behavioral reprioritization, as compared to direct modulation of the core circuit itself, particularly in small circuits. Food deprivation for different periods of time has been shown to result in distinct behavioral changes that may be physiologically relevant in terms of driving specific foodseeking behaviors (Churgin et al., 2017;Farhadian et al., 2012;Ghosh et al., 2016;Gray et al., 2005;Inagaki et al., 2014;Lee and Park, 2004;Ló pez-Cruz et al., 2019;Neal et al., 2015;Root et al., 2011;Tsalik and Hobert, 2003). These changes may be driven via temporally regulated recruitment of different neuronal pathways to functionally reconfigure the core sensorimotor circuit and reprioritize behaviors (Churgin et al., 2017;Ghosh et al., 2016;Gray et al., 2005;Inagaki et al., 2012;Saeki et al., 2001). Although modulatory pathways may target different nodes in the underlying circuits, sensory neurons and first layer interneurons are the primary targets in C. elegans presumably due to the relatively shallow network architecture of the nematode nervous system.
Functional reconfiguration of circuits via neuromodulation expands the repertoire of circuit outputs (Bargmann, 2012;Griffith, 2013;Kim et al., 2017;Marder, 2012). The mechanisms by which neuromodulators effect plasticity in circuit and behavioral output are diverse. Neuromodulation can alter sensory or synaptic gain in specific pathways, enable integration of neurons and pathways into defined functional circuits, selectively activate or inhibit a subset of available hardwired synaptic connections, and broadly regulate circuit state to affect excitability [eg. (Baldridge et al., 1998;Cho et al., 2016;Cohn et al., 2015;Ha et al., 2010;Hill et al., 2015;Jing et al., 2007;Komuniecki et al., 2014;Macosko et al., 2009;Marder and Hooper, 1985)]. Identification of the pathway by which internal state regulates thermotaxis behavioral plasticity in C. elegans adds to our understanding of the mechanistic richness of neuromodulator functions, and suggests that related principles may operate across diverse sensory circuits.

C. elegans strains
The wild-type strain used was C. elegans variety Bristol strain N2 grown on E. coli OP50. Transgenic animals were generated using experimental plasmids at 2-50 ng/ml and the unc-122p::gfp or unc-122p::dsRed coinjection markers at 30-40 ng/ml unless noted otherwise. Expression patterns and behavioral phenotypes were confirmed in initial experiments using multiple independent transgenic lines, and typically, a single line was selected for additional analysis. The presence of specific mutations and genome edits were confirmed by sequencing. A complete list of all strains used in this work is provided in Supplementary file 1.
To express TIR1::mTurquoise2 in individual neurons, 15 ng/ml of TiR1 sequences under cell-specific promoters were injected together with 100 ng/ml of linearized N2 genomic DNA, and 30 ng/ml of co-injection marker. To stably integrate ins-1p::gfp::PEST sequences into the genome, young transgenic adults carrying extrachromosomal arrays were irradiated with 300 mJ UV light (UVP Imaging System). Animals homozygous for the integrated array were backcrossed three times prior to use.
Sequences of crRNAs and donor oligonucleotides used were: crRNA ( Thermotaxis behavioral assays C. elegans was grown for at least 3 generations at 20˚C with ample OP50 bacterial food prior to being examined in behavioral assays. To obtain starved animals, 3 hr prior to the start of the assay, young adult worms were transferred twice sequentially to unseeded NGM plates and allowed to move freely for a few minutes to remove associated bacteria. Animals were then transferred to fresh unseeded NGM plates and re-cultivated at the appropriate temperature. To expose animals to bacterial odors, unseeded NGM plates containing worms were covered with a seeded agar plate for 3 hr. To test the necessity of live bacteria, animals were fed with gentamycin-treated OP50 spread on NGM plates for 3 hr prior to the behavioral assay (200 mg/ml gentamycin was added to concentrated OP50 and incubated for 2 hr). For re-feeding, animals starved for 3 hr were transferred to OP50seeded NGM plates for 1 hr prior to the assay. Just prior to behavioral assays, 25 animals were transferred to unseeded NGM plates briefly, picked into M9 buffer pre-incubated at the cultivation temperature, and subsequently transferred to the thermal gradients. Transfer from the cultivation plate to the thermal gradient was typically accomplished within five mins.

Long thermal gradient
To examine negative and positive thermotaxis on the long gradient (Luo et al., 2014a), worms grown at 20˚C were transferred to 15˚C or 25˚C, respectively, for 4 hr prior to the assay. The temperature on the aluminum plate (ranging from 18-22˚C at 0.2˚C/cm) was controlled by a Peltier system [colder side; H-bridge amplifier (Accuthermo FTX700D), PID controller (Accuthermo FTC100D), Peltier (DigiKey)] and heater system [warmer side; PID controller (Omega CNi3244), solid-state relay (Omega SSRL240DC25), and cartridge heaters (McMaster-Carr 3618K403)]. A 22.5 cm square NGM agar pad for the assay was placed directly on the aluminum plate, and the temperature of agar edges and center were confirmed with a two-probe digital thermometer (Fluke Electronics) prior to each assay. Worms in M9 buffer were placed on the 20˚C isotherm at the center of the gradient. Animal movement was imaged at 2 fps for 30 min using a Mightex camera (BTE-5050-U). Animal trajectories were detected and analyzed using custom LabView and MATLAB scripts (Gershow et al., 2012) (https://github.com/samuellab/MAGATAnalyzer).

Short thermal gradient
A 'short' thermal gradient was established on an unseeded 10 cm plate containing 25 ml NGM agar placed on an aluminum sheet. The thermal gradient (ranging from 23-28˚C at 0.5˚C/cm) was established and maintained on the aluminum sheet using Peltier thermoelectric temperature controllers (Oven Industries). The temperature of the edges of NGM agar was measured with a two-probe digital thermometer (Fluke Electronics). Worms in M9 buffer cultivated at 20˚C were placed at the center of the gradient at 25.5˚C. Animal movement was recorded at a rate of 1 Hz using a PixeLink CCD camera controlled by custom written scripts in MATLAB for 35 mins. 30 min videos excluding the first five mins were analyzed using WormLab (MBF Bioscience) and custom written scripts in MAT-LAB as described previously Yu et al., 2014).

Histamine-mediated acute inhibition
10 mM histamine-containing plates were generated essentially as described previously (Pokala et al., 2014). 1 M histamine dihydrochloride (Sigma-Aldrich H7250) was added to NGM agar at 60˚C prior to pouring into Petri plates. Animals were grown on bacteria-seeded or unseeded NGM agar plates containing histamine for 3 hr prior to the assay as indicated. For histamine-mediated inhibition during the assay, 10 mM histamine was added to the NGM agar plate on which the thermal gradient was established.

Optogenetic activation/inhibition
L4 larval animals were fed 50 mM ATR-OP50 overnight. 3 hr prior to the assay, animals were transferred to seeded or unseeded 50 mM ATR containing NGM plates. Animals were placed on short thermal gradients as described but were also exposed to blue LED light (approximately wavelength 455-470) at 1.9 mW/mm 2 intensity for 25 mins during the assay. At the completion of the assay, the number of animals at the cold and warm ends of the plate were counted to calculate the thermotaxis index [(number of animals at the temperature range 23-24˚C)-(number of animals at 27-28˚C)/(total number of animals in assay)].

Auxin-induced degradation
400 mM Auxin in EtOH (indole-3-acetic acid, Alfa Aesar) was used to make 4 mM auxin-containing seeded, unseeded or assay plates. Plates were kept wrapped in aluminum foil to prevent light exposure.

Analysis of thermotaxis bias and reorientation direction following turns
Identification of worm tracks, direction and duration of worm runs, and run orientation following turns were analyzed with custom written scripts in MATLAB Yu et al., 2014). Each track was defined as a continuous worm trajectory between turns. Track orientation following turns was calculated as the angle of a line connecting the initial and last points of the location of the worm in successive tracks. Thermotaxis bias was calculated as (run duration toward colder side -run duration toward warmer side)/total run duration Chi et al., 2007;Clark et al., 2007). A minimum of seven biologically independent trials with at least 15 animals each were conducted for each experimental condition. Behaviors of mutant and transgenic animals were assessed in parallel with wild-type controls on the same day. Wild-type data were interleaved with data from experimental strains collected over a similar time period and are repeated as indicated in the Figure  Legends.

Olfactory behavioral assays
Chemotaxis assays were performed as previously described (Bargmann et al., 1993). In brief, wellfed animals washed twice with S-Basal and once with water were placed at the center of a 10 cm NGM agar plate with or without 10 mM histamine. 1 ml of isoamyl alcohol (Fisher A393-500) and diacetyl (Sigma B85307) diluted 1:1000 with ethanol were placed at one end with 1 ml of ethanol as the diluent control placed at the other end, together with 1 ml of 1 M sodium azide. Animals at either end were counted after 60 mins. The chemotaxis index was defined as (number of animals at the odorant) -(number of animals at the diluent)/total number of animals. For transgenic strains, only transgenic animals as assessed by expression of the coinjection marker were counted. Prior assessment indicated that 98% of animals (n = 50) expressing the coinjection marker in the PY12205 strain also expressed HisCl1::SL2::mCherry in both AWC neurons.

Quantification of spontaneous reversal frequency
Young adult animals were transferred onto NGM plates at 20˚C containing a thin layer of OP50 bacteria. Reversal frequencies were quantified following 1 min after transfer for 20 mins. Backward movement with two or more head swings were scored manually as reversals (Gray et al., 2005).

in vivo calcium imaging
Calcium imaging experiments were performed essentially as described previously (Takeishi et al., 2016). AWC ON and AWC OFF neurons were identified via expression of mScarlet driven under srsx-3 regulatory sequences. Growth-synchronized L4 larval animals were cultivated overnight with ample OP50 at 20˚C. Young adult animals were starved by placing them on unseeded NGM agar plates and re-cultivating at 20˚C for 3 hr prior to imaging.
Individual animals were glued (WormGlu, GluStitch Inc) to an NGM agar pad on a cover glass, bathed in M9, and mounted under a second cover glass for imaging. For imaging of AFD and AIY, 5-10 fed or starved young adult worms were picked into 10 mM levamisole diluted in M9 on a 5% agarose pad and immobilized between two coverslips. The edges of the cover glass sandwich were sealed with a mixture of paraffin wax (Fisher Scientific), and Vaseline, and the sandwich was transferred to a slide placed on a Peltier device on the microscope stage. Animals were imaged within 3 min of being removed from their cultivation temperature.
Animals were subjected to linear temperature ramps rising at 0.05˚C/s unless noted otherwise, via temperature-regulated feedback using LabView (National Instruments) and a T-type thermocouple (McShane Inc). The slope of the temperature stimulus was selected to align with the temperature changes experienced by animals navigating the short thermal gradient. Based on average worm forward velocity of~0.15 mm/s, animals are expected to experience temperature differences of 0.01C /s on the short thermal gradient. Since we observed few if any temperature responses when using a linear temperature ramp of 0.01˚C/s, we elected to use ramps rising at the rate of 0.05˚C/s to enable higher throughput analyses of responses. Individual animals were imaged for four mins at a rate of 2 Hz. Images were captured using a Zeiss 40X air objective (NA 0.9) or a Zeiss 10X air objective (NA 0.3) (for AFD and AIY imaging) on a Zeiss Axioskop2 Plus microscope, using a Hamamatsu Orca digital camera (Hamamatsu), and MetaMorph software (Molecular Devices). Data were analyzed using custom scripts in MATLAB (Mathworks) (Takeishi et al., 2016).
Each calcium trace was defined as the percent change in the relative fluorescence of the neuron from its baseline fluorescence level (average fluorescence of first 10 frames of each image) following background subtraction for all neurons with the exception of AFD. A fluorescence change of >10% in each neuron was considered a response, and the duration of calcium events was calculated as the sum of all events in each animal. Baseline fluorescence was set to zero to offset fluorescence change caused by photobleaching or movement artifacts. Calcium transients were imaged in the soma of AFD, AWC, AIB, and in the neurites of AIY, AIA and AIZ. T* AFD was calculated as described previously (Takeishi et al., 2016).
Quantification of ins-1p::GFP::PEST fluorescence Young adult animals cultivated overnight at 20˚C were well-fed throughout, or starved by placing them on unseeded NGM agar plates and re-cultivating at 20˚C for 3 hr prior to imaging. Animals were moved onto 2% agarose pads on a glass slide, anesthetized with 1.5 ml of 25 mM azide, and were covered with a cover glass prior to imaging. Images were taken using an AX70 fluorescence microscope (Olympus) with an Olympus 20X UPlanSApo lens (NA 0.75). The ROI in the anterior intestine was outlined within 48 mm (75 pixels) from the posterior end of the pharynx and mean pixel intensity was calculated following background subtraction using ImageJ (NIH). Confocal microscope images were obtained using a FV3000 microscope (Olympus) with an Olympus 40X UPFLN lens (NA 0.75), and were exported as hyperstack. tif files.

Statistical analyses
Excel (Microsoft) and GraphPad Prism version 8.0.0 (www.graphpad.com) were used to generate all histograms, bar graphs, and line-plots of cumulative distribution fractions. For statistical analysis of thermotaxis bias and chemotaxis, Student's t-test was performed between fed and starved of each genotype and/or treatment. One-way ANOVA followed by Tukey's multiple comparison was performed for Figure 1C and Figure 1-figure supplement 1B using GraphPad Prism version 8.0.0. Wald F-and t-statistic analyses were performed using R (https://www.R-project.org/) and RStudio (www.rstudio.com) using the 'emmeans' package. To compare the distributions of reorientation direction following turns, the Mardia-Watson-Wheeler non-parametric test for circular data was performed using R and RStudio. All statistical analyses of imaging data were performed in MATLAB. The Kolmogorov-Smirnov test was performed to compare cumulative distribution fractions. The Mann-Whitney U test was used to compare the average duration of responses per neuron.

Data availability
All data generated or analyzed during this study are included in the manuscript and supporting files. Source data for all behavioral and imaging data have been provided in Excel spreadsheets.