Reconstruction of Spatial Thermal Gradient Encoded in Thermosensory Neuron AFD in Caenorhabditis elegans

During navigation, animals process temporal sequences of sensory inputs to evaluate the surrounding environment. Thermotaxis of Caenorhabditis elegans is a favorable sensory behavior to elucidate how navigating animals process sensory signals from the environment. Sensation and storage of temperature information by a bilaterally symmetric pair of thermosensory neurons, AFD, is essential for the animals to migrate toward the memorized temperature on a thermal gradient. However, the encoding mechanisms of the spatial environment with the temporal AFD activity during navigation remain to be elucidated. Here, we show how the AFD neuron encodes sequences of sensory inputs to perceive spatial thermal environment. We used simultaneous calcium imaging and tracking system for a freely moving animal and characterized the response property of AFD to the thermal stimulus during thermotaxis. We show that AFD neurons respond to shallow temperature increases with intermittent calcium pulses and detect temperature differences with a critical time window of 20 s, which is similar to the timescale of behavioral elements of C. elegans, such as turning. Convolution of a thermal stimulus and the identified response property successfully reconstructs AFD activity. Conversely, deconvolution of the identified response kernel and AFD activity reconstructs the shallow thermal gradient with migration trajectory, indicating that AFD activity and the migration trajectory are sufficient as the encoded signals for thermal environment. Our study demonstrates bidirectional transformation between environmental thermal information and encoded neural activity. SIGNIFICANCE STATEMENT Deciphering how information is encoded in the nervous system is an important challenge for understanding the principles of information processing in neural circuits. During navigation behavior, animals transform spatial information to temporal patterns of neural activity. To elucidate how a sensory system achieves this transformation, we focused on a thermosensory neuron in Caenorhabditis elegans called AFD, which plays a major role in a sensory behavior. Using tracking and calcium imaging system for freely moving animals, we identified the response property of the AFD. The identified response property enabled us to reconstruct both neural activity from a temperature stimulus and a spatial thermal environment from neural activity. These results shed light on how a sensory system encodes the environment.


Introduction
Evaluation of the surrounding environment is a vital ability for living organisms. When animals migrate through their environ-ment, sensory systems convert external information into neural activities as temporally encoded signals. Depending on the encoded signals, animals organize sequences of movement with proper timing to migrate to preferred environments. Elucidating the neuronal mechanisms by which temporal activities of sensory neurons generated a response to environmental input is crucial for understanding the neural code to express and convey the information of external world (Rieke et al., 1999). Sensory signals and motor regulation often interact with each other (Gomez-Marin et al., 2011). Therefore, assessing the sensory encoding of a spatial field during navigation behavior is best conducted in freely behaving animals, in which any sensorimotor feedback is maintained.
Thermotaxis of Caenorhabditis elegans provides a useful model to elucidate how a natural environment is encoded in a sensory system during navigation behavior, because the environmental stimulus can be measured quantitatively and the circuit controlling the behavior is identified and is compact (Hedgecock and Russell, 1975;Mori and Ohshima, 1995). Laser ablation and genetic perturbation of a pair of sensory neurons, AFD, severely disrupts thermotaxis, suggesting that AFD plays a critical role in thermotaxis (Mori and Ohshima, 1995;Satterlee et al., 2001). Calcium imaging shows that AFD responds to a thermal ramp around the cultivation temperature, and this response range of AFD can be changed on shifting the cultivation temperature, suggesting that AFD stores the acclimation temperature (Kimura et al., 2004;Clark et al., 2006). Electrophysiology shows that AFD neurons respond to both increases and decreases of temperature around their responding range with short-term adaptation (Ramot et al., 2008). At the behavioral level, temperature increases modulate the frequency of turning, which is assumed to control thermotaxis with a strategy called biased random walk (Ryu and Samuel, 2002;Zariwala et al., 2003;Luo et al., 2014); additional behavioral strategies, such as weather-vaning strategy (Iino and Yoshida, 2009), could also contribute to thermotaxis.
In this study, we estimated the response function of AFD from data acquired with our tracking and calcium imaging system. The estimated response functions indicated the differential detection mechanism of the AFD neurons, which includes a fast positive response to temperature change, followed by slow adaptation. By estimating the response functions for several cultivation conditions, we showed that the AFD response property was independent of cultivation conditions except at the operating range that is defined by cultivation temperature as a modifiable responsive range to thermal stimuli. We added a nonlinear character to our AFD response model to incorporate the response dependency on the operating range. The constructed response model enabled us to reconstruct AFD activity from the observed temperature input and, conversely, the thermal environment from the observed AFD activity and the migration trajectory. Given the reconstructed activities and thermal environments are highly correlated to actual neuronal activities and the thermal environment, we verified that our model captured the mechanism by which AFD decodes the thermal environment during navigation. These results provide a systems-level understanding of how the nervous system recognizes and processes environmental information during navigation.

Calcium imaging of freely moving animals
We used the lite-1(xu7) background to minimize photo avoidance during free migration. The FRET-based calcium probe yellow cameleon 3.60 was driven by the gcy-8 or gcy-5 promoters to express in AFD, or ASER, respectively. For well fed conditions, L4 animals cultivated at 20°C on nematode growth media with a thin layer of bacteria OP50 were single picked on the day before the experiment and stored at the conditioning temperature on a fresh plate with plenty of food (OP50). For starved conditions, the animals were moved into the fresh plate without food 2-4 h before the experiments at the conditioning temperature.

Making a thermal gradient
We used a thermal gradient device for the tracking experiment as described previously (Kuhara et al., 2011). Cooled water (5-11°C) was maintained at a constant temperature using a bath recirculator AC150 (Thermo Fisher Scientific) and circulated through our custom thermal gradient device using a custom-built liquid pump (Tokai Hit). The thermal gradient device consisted of glass plates with indium tin oxide (ITO) connected to the liquid pump and a power supply, slidetrans RSA-5 (Rikosha). The ITO heats the glass plate according to the supplied electric current. A stable thermal gradient was established on a thermotaxis (TTX) assay plate containing 18 ml of TTX medium with 2% agar in a 14 ϫ 10 ϫ 1.45 cm plastic dish (Eiken Chemical) within Ͼ5 min of being placed on the thermal device. The thermal gradient was measured at the beginning of every trial using both thermography with a TS9230W-A01 (NEC Avio) and a thermometer AM-8000K with a thermocouple probe (Anritsu). The agar medium on the plastic dish was cut into a 9 ϫ 6 cm rectangle, and 8 M glycerol was put on every edge of the cut agar to prevent the worms running away from the agar field.

Tracking freely moving animals
An ordinal analog video camera (CS230B; Olympus) captured freely moving animals at 30 frames per second (fps) with continuous halogen illumination using a 600 nm long-pass filter (R-66; Tokina). A motorized stage BioPrecision (Ludl) was controlled by the microscope-controlling software package Manager (Edelstein et al., 2010) with MATLAB (MathWorks). The MATLAB program identifies the head of the tracking worm in an acquired image based on the curvature of the tracking worm edge. Then, the program moves the stage according to the position of the identified head to keep the head in the center of the microscopic field and send trigger signals to the fluorescence imaging software described below (see Calcium imaging during tracking). The procedures of image acquisition to stage movement are executed every 0.5 s. x-y coordinates are recorded with time stamps in each tracking trial. The time course of temperature experienced by the freely moving animal is calculated according to the recorded x-y coordinates and the thermography, which taken at the beginning of each trial. We confirmed that the thermal gradient with our device kept a stable thermal gradient during the tracking trial.

Calcium imaging during tracking
We used a custom-built galvano-shutter system (Olympus Engineering) with a mercury lamp or SPECTRA light engine (Lumencor) for highspeed control of illumination. A 425 nm bandpass filter and 505 nm dichroic mirror (Olympus) were used for the galvano-shutter system; SPECTRA light engine included a bandpass filter Semrock). A frost filter (Olympus) was used to evenly illuminate the field of view. We used a high fluorescence efficiency macro microscope (MVX10; Olympus) with 0.5 numerical aperture (NA) of 2ϫ objective lens equipped with the thermal device and the motorized stage described above. A Dual-View equipped with 505 nm cube (Molecular Devices) and EMCCD C9100-13 ImagEM (Hamamatsu Photonics) were used for acquiring yellow fluorescence protein (YFP) and cyan fluorescent protein (CFP) fluorescence images. Images were taken with 80 ms exposure time at 1 s intervals with 1 ϫ 1 camera binning. Calcium imaging was regulated using MetaMorph (Universal Imaging).
The time course of YFP and CFP intensities showed a clear reciprocal relationship (Fig. 1 F, G), indicating that the YFP/CFP represented the Ca 2ϩ concentration change. Although unfocused blur sometimes caused synchronized intensity changes of YFP and CFP during the behavioral tracking, such unfavorable effects were cancelled out in YFP/CFP changes (Figs. 1 F, G). We confirmed that the synchronized intensity changes were independent of temperature increases. In the case of a moving object, fluorescent emission signal is affected by the position in a microscopic field mainly because of inhomogeneous excitation light field. To prevent such positional artifacts, we monitored distribution of light intensity over the microscopic field for every experiment and calibrated the YFP and CFP signals.

Calcium imaging of fixed animals
The 20°C cultivated well fed animals were prepared as for the tracking experiments described above. Animals were fixed to an agar pad with polystyrene nanobeads and cover glass (Kim et al., 2013). The coverslip was placed on a Peltier-based thermo-controller (Tokai Hit) attached on an upright microscope (BX61WI; Olympus) with 0.9 NA of 40ϫ objective lens. As in the tracking system, fluorescence was collected into a Dual-View with a 505 nm cube (Molecular Devices) and captured using an EMCCD C9100-13 ImagEM (Hamamatsu Photonics). Images were taken with 400 ms exposure at 1 s intervals with 1 ϫ 1 binning. The temperature on the agar pad was monitored by using a thermometer system (DCM-20; Tokai Hit and Hamamatsu Photonics).

Image analysis
Background correction of non-uniform illumination. Fluorescence intensities of a moving object are likely to be inconsistent as a result of its position because illumination power is nonuniform over the microscopic field. As a consequence, the movement of a tracking animal may cause pseudo-activity during tracking. To correct the positional effect of illumination on neuronal fluorescence intensity, we monitored the positional profile of neuronal fluorescence intensity in a resting state (with constant temperature) and subtracted the estimated illumination effect from the tracking data. To estimate the illumination effect, we first imaged only the agar plate used for the tracking experiments. We then imaged neuronal intensities at the different positions of the microscopic field in a resting state after each tracking experiment: the worm used in a tracking experiment was glued onto an agar plate, and fluorescence images were taken by moving the stage to monitor neuronal intensities from various positions in the microscopic field. The plots of background intensity and resting neuronal intensity revealed an apparent linearity between the background intensity and neuronal intensity at a resting state (data not shown). Based on this relationship and the background intensity image, we estimated baseline neuronal intensity in any position and used this to cancel out the positional illumination effect in the tracking data. When we plotted the relationship between the YFP/CFP of the background agar intensity and YFP/CFP of the neuronal region, the plot showed that neuronal YFP/CFP linearly increased with the increase of background YFP/CFP. The steepness of the correlation slope was found to be dependent on the illumination/camera setting, whereas the relationship between the intensity of background and neuronal region showed positive correlation in any settings.
Analysis of calcium imaging for tracking animals. A neuronal region was defined according to the peak intensity and size (9 pixels) in a YFP image; a neuronal region for a CFP image was defined according to the corresponding YFP image because of the dimmer CFP images. Then, the average fluorescence intensities of the neuronal regions were calculated for each image. Intercellular calcium concentration change was estimated by taking the acceptor/donor (YFP/CFP) fluorescence ratio. A median filter was applied to the time course ratio to eliminate the noise independent from calcium signal. For the analysis of temperature dynamics evoking AFD intermittent activities (see Figs The gray line denotes average AFD regional intensity (or ratio) in a frame (described in detail in Materials and Methods), and the blue line denotes the median for the time series of the average intensities (or ratio). Note that synchronized intensity changes of YFP and CFP were cancelled out in ratio (ϳ420 s). In contrast, reciprocal intensity changes in YFP and CFP fluorescence were reflected into high (or low) signals in ratio (after 600 s). I, Mapped AFD activity of H onto the migratory coordinates. ϩ marks the starting point. Scale bar, 5 mm.
YFP/CFP that was larger than a 50% threshold of maximum delta YFP/ CFP in a trial as an AFD phasic activity. The image processing program for the tracking data was written in MATLAB (MathWorks). Analysis of calcium imaging for fixed animals. We analyzed the calcium imaging data of fixed animals using MetaMorph (Molecular Devices). Background subtraction was executed using the built-in function called statistical correction. A neuronal region was defined with a threshold in a YFP image determined by an observer. To prevent unexpected motion artifacts, positional correction of the defined neuron was executed with the center of mass of the neuronal region. Then, average fluorescence intensities in the neuronal region were calculated for each image. Intercellular calcium concentration change was estimated by taking the change of acceptor/donor (YFP/CFP) fluorescence ratio (⌬ratio).

Estimation for fully sampled response functions
The response of AFD neuron at time t, y(t), was modeled by linear convolution of input x(t) with the response function w(t): , and indicate basal activity of the AFD neuron, the response function, temperature input, and noise, respectively. The response function w(t) represents the impulse response, which corresponds to evoked activity of AFD in response to impulse inputs of x: To estimate the response function, we performed the ridge regression, in which the parameter set W ϭ {w o , w 1 , w 2 , …, w r } was in total called a response function and determined by minimizing the objective function consisting of the sum-of-squares error and a regularization term: where N and indicate the total number of sampling points in observed time series data and regularization parameter, respectively. r denotes the maximum delay time, or time window. u and v are temperature input and calcium activity, respectively. Note that the introduction of regularization avoids overfitting and improves generalization.

Reduced parameter estimation of the response function
In terms of Laguerre orthogonal polynomials, generally, the response function K(t) can be written in the following form: ). According to the fully sampled response functions of the AFD neuron, three parameters {, ␣ 0 , ␣ 1 } of impulse response K(t) ϭ e Ϫ t (␣ 0 Ϫ ␣ 1 t) are sufficient to describe the AFD response in our experimental conditions, similar to the study of bacterial chemotactic response (Celani and Vergassola, 2010;Masson et al., 2012). The Nelder-Mead simplex method was used to determine these parameters (Lagarias et al., 1998).

Nonlinear transformation
The Hill function, H(t), was incorporated into the response model to represent the operating range of AFD to temperature. Based on the observation of AFD activity related to the operating range, we defined the Hill function as follows: H͑t͒ ϭ ͑t Ϫ Ts͒ n Kd ϩ ͑t Ϫ Ts͒ n when t Ͼ Ts, H͑t͒ ϭ 0 when t Ͻ Ts where t, Ts, Kd, and n denotes temperature, cultivated temperature, dissociation constant, and Hill coefficient, respectively. We used the parameters Kd ϭ 8 and n ϭ 2 according to the observed responding range of AFD of 20°C cultivated animals.

Estimation for thermal environment
The thermal environment, T͑x, y͒, was modeled as a second-order linear polynomial: a ij x i y j with the assumption that temperature smoothly changes along the x-y plane in our experimental condition. Each parameter a ij was determined by least-squares fitting with minimizing the following objective function: where temperature change deconv (v, w(t)) was calculated by the deconvolution of the time course of AFD activity v with the estimated response function w(t). We used the Wiener filter for deconvolution algorithm without noise term.

Evaluation for the reconstruction
The reconstructed AFD activity from temperature input and the identified response function was evaluated by variance accounted for (VAF), defined as follows: Figure 2. Temperature dynamics that evoke AFD intermittent activities. A, An example of the extracted temperature experience related to AFD activity. An intermittent activity is defined by a peak and threshold (left side, 50%, at the bottom). Temperature time courses corresponding to peaks were extracted inside time windows. An example is shown in the black square in the top. The gray line in the bottom denotes raw signal, and black denotes the median filtered signal. A threshold for a flat region (30%) is shown at the right side of the bottom. B, Extracted temperature time courses are drawn relative to the AFD activity peak (horizontal, the peak is time ϭ 0) and the temperature relative to the temperature at the peak (vertical; 0°C at time 0). Note that time 0 of the average shows clear increase of temperature. C, The differential of B. For B and C, 98 AFD activity peaks were extracted from 10 fed worms cultivated in 20°C. D, Extracted temperature associated with flat regions plotted over time. A flat region was defined as a sequence of activity under 30% threshold longer than 15 s. Forty-two periods were extracted from the same dataset used in B and C. E, The differential of D. B-E, Gray shows each extracted time course, and black shows the average.
in which y denotes monitored AFD activity and ŷ denotes estimated AFD activity by the response function and temperature input. VAF indicates the percentage of predictive power from the model (Kato et al., 2014). To evaluate similarity for the reconstructed thermal environment, we used the structural similarity (SSIM) index (Wang et al., 2004): where x and y are the local sample means of x and y, respectively, x and y are the local sample SDs of x and y, respectively, and xy is the local sample cross-correlations of x and y. C 1 , C 2 , and C 3 are all regularization constants to stabilize each terms (we used C 1 ϭ 0.01 2 , C 2 ϭ 0.03 2 , and C 3 ϭ C 2 /2). In short, the SSIM index compares three elements (luminance, contrast, and correlation) between two images. ␣, ␤, and ␥ are exponents for balancing each element. We used ␣ ϭ 0, ␤ ϭ 1, and ␥ ϭ 1 because the reconstruction of temperature from fluorescence signal does not ensure absolute value and luminance highly depends on the expression level of the fluorescence probe. We used the MATLAB built-in function of the SSIM index.

Calcium imaging of AFD activity in freely moving C. elegans
To address how AFD neurons encode the thermal environment, we developed an automated system that allows simultaneous monitoring of Ca 2ϩ signal from neurons as fluorescence images and the behavioral trajectory of freely moving animals as x-y coordinates. We used the ratiometric calcium probe yellow cameleon (YC3.60) to avoid movement artifacts and expressed it specifically in AFD neurons using the gcy-8 promoter (see Materials and Methods). A tracking system with a visual feedback controller (Fig. 1A) allowed us to track the head of the moving animal using images acquired by transillumination with red light (Fig. 1B), while simultaneously acquiring fluorescence images (Fig. 1C), the two-dimensional migration trajectory (Fig. 1D), and thermography of the animal's environmental field (Fig. 1D). The fluorescence images were acquired independently from the frequently acquired transparent red light images (30 fps) to reduce photobleaching of the fluorescence probe. By combining these data, we could capture both the temperature and the AFD activity of a freely moving animal on a thermal gradient over time (Figs. 1 E, H ). We found that the AFD neuron showed an intermittent phasic increase of calcium in response to slight increases in temperature ( Fig. 1 E, H ). Although previous studies reported that the AFD neurons show short-term adaptation in response to step-like temperature increases (Kimura et al., 2004) and sinusoidal temperature input induced the phase-locked activity of AFD around cultivation temperature (Clark et al., 2006), our present results showed that adaptation of AFD gave rise to intermittent Ca 2ϩ activity in response to a shallow temperature ramp (0.1°C/min) in animals moving freely on a thermal gradient (Fig. 1 E, H ). Furthermore, we found that the duration of the spike-like activities of AFD was ϳ20 s, and this was insensitive to the quicker (timescale of seconds) increase of temperature. These intermittent neural activities suggest that the representation of the continuous shallow temperature gradient in the dynamics of AFD activity is in the form of discrete stereotypical peaks.

Temperature increases trigger phasic AFD activity
To reveal the environmental stimuli that triggered the intermittent phasic activity of AFD neurons, we analyzed the detail of the relationship between the thermal stimulus and the activity of AFD neurons in freely behaving animals. We extracted the temperature profile in a time window of 80 s around the defined AFD phasic activity ( Fig. 2A; see Materials and Methods). Then, averaging of the temperature profile was triggered on peaks in AFD activity. These profiles showed clear correlation between the de- fined AFD phasic activity and temperature increase (Fig. 2B, time 0). Calculation of the temperature differential further revealed that the timing of phasic activity was associated with an increase and a subsequent slight decrease of temperature (Fig. 2C). The duration of the temperature increase before the appearance of the phasic AFD activity was ϳ20 s. The increase continued for 10 s after the peak of AFD phasic activity, and then a small temperature decrease appeared 10 s after the AFD phasic activity and reached the lowest value within 20 s after the peak phasic activity. These results suggested that most of the intermittent activities of AFD were followed by the decrease of temperature. To examine this further, we defined silent periods as intervals longer than 15 s under 30% of threshold and extracted their respective temperature to compare with the AFDpeak-triggered average of the temperature. The average of the corresponding temperature sequences and its differentials (Figs. 2 D, E) showed no increase of temperature. Mapping of AFD activity onto the navigation trajectory revealed that the turning frequency was increased around peak AFD activities (Fig. 1I, right bottom region). Because the increase in temperature evokes frequent turnings of worms (Ryu and Samuel, 2002), we hypothesized that temperature increases evoke the phasic AFD activity, which is associated with turning behaviors; after the phasic AFD activity, the evoked turnings result in the animals experiencing a decrease in temperature if the animals are on a thermal gradient.

Estimation of an AFD response function and reconstruction of AFD activity
To elucidate how the temperature stimulus is processed by AFD neurons of freely moving animals, we estimated the response function of AFD, which enables to characterize the relationship between the input and output of the AFD neuron as a temporal filter. A fully sampled linear function was estimated by least-square regression (Fig. 3A). The estimated response functions of freely moving animals on a thermal gradient showed a typical shape of sensory impulse response, which corresponds to the observed phasic activities. Then, we modeled the impulse response as an exponential function with three parameters, similar to the bacterial chemotactic response ( Fig. 3B; Celani and Vergassola, 2010). The shape of the response functions suggested that AFD detects the differential of temperatures during continuous temperature input: a fast positive response followed by a slow negative response is indicative of detection of temperature increase and adaptation to the stimulus. We propose that this response property of AFD neurons contributes to the behavioral responses of animals to temperature change, in particular in controlling turning frequency change, extending previous work (Ryu and Samuel, 2002;Zariwala et al., 2003). We think the identified temporal AFD response represents a key component for constructing the behavioral regulatory signal.
To explore this further, we simulated AFD activity on a computer from a recorded temperature input (Fig. 3D) using the estimated average response function (Fig. 3B). Simulated AFD activity reproduced a similar time course as experimentally obtained AFD activity (Fig. 3 E, F ). As a control experiment, we estimated the response function of ASER for temperature input. ASER is a salt-sensing gustatory neuron (Suzuki et al., 2008), not known to have any thermosensory properties. We constructed a strain expressing cameleon (YC3.60) in ASER by using the gcy-5 ASER-specific promoter and confirmed clear responses to NaCl concentration change. The estimated response function of this gustatory neuron did not show any characteristic response property to temperature input (Fig. 3C). Comparison of VAF, which is a performance index for reconstructed neural activities, demonstrated superior fitness of the estimated AFD response function to that of ASER (Fig. 3H ). Also, there was no clear relationship between temperature input and the ASER activity (data not shown); the reconstructed activity of ASER represented a noninformational property (Fig. 3G). These results control for the possible artifacts that could have arisen during the acquisition or the analysis of calcium imaging data from freely moving animals.
The operating range of AFD responses and nonlinear transformation Animals exposed to sinusoidal temperature oscillations showed clear phase-locked responses around the cultivation temperature (Fig. 4A) as reported previously (Clark et al., 2006), which is likely attributable to the cultivation temperature-dependent operating range of AFD responses. Because freely behaving animals tended to migrate toward their cultivation temperature on a thermal gradient, our sampling of freely moving animals while estimating AFD response properties were probably biased in favor of the operating range. Therefore, we incorporated the mechanism of the operating range into our AFD response model, by deriving a linear-nonlinear (L-N) model that consists of the obtained response function and a nonlinear transformation representing the operating range. Based on the experimental considerations and assumptions of allosteric molecular signaling (Hogg et al., 2005), we used the Hill equation to express the nonlinear transformation (Fig. 4B). According to the L-N model, the external stimulus was filtered by the response function, which was estimated from freely moving animals, and then transformed by the nonlinear Hill equation (Fig. 4C). Computer-simulated AFD activity for a defined sinusoidal temperature stimulus matched the real AFD activity (Fig. 4D). The reconstruction without the Hill transformation lacked the proper operating range, although it kept the phase-locked oscillation in response to the sinusoidal thermal stimulus (Fig. 4E). Thus, we confirmed that our L-N model separately implements the response property of AFD by the estimated response function and the operating range of AFD by the nonlinear transformation, respectively.

The response function of AFD is independent of different conditions of food and cultivation temperature
Because thermotaxis behavior is known to be modulated by cultivation temperature and feeding state (Hedgecock and Russell, 1975;Mohri et al., 2005;Kodama et al., 2006), we investigated the response patterns of AFD when we changed the animal's cultivation temperature or food condition. The shapes of response functions kept an initial positive response and a delayed negative response, regardless of cultivation temperatures (Fig. 5A-C). Although our estimation was derived mostly from the animals behaving within the operating ranges, because of the animals' tendency to migrate around their cultivation temperature, the deduced response functions suggest that the response property of AFD is consistent over several cultivation temperature conditions. Similarly, we found that starved animals also kept the initial positive and delayed negative response properties of AFD ( Fig.  5D-F ). Given that food condition is known to affect thermotaxis, the invariable AFD responses implicate that the relationship between AFD activity and behavioral components is different between different food conditions. As we have shown with the Ca 2ϩ imaging data during thermotaxis, the phasic activities of AFD are correlated imperfectly with the turning behaviors during migration on the thermal gradient in a fed condition (Figs. 1I, 6F ). Although the timing of calcium peaks in AFD neurons was not correlated to turns by a one-to-one correlation, peak AFD activ-   19). B, A 20°C cultivated well fed worm; same data as Figure 3B (n ϭ 27). C, A 23°C cultivated well fed worm (n ϭ 14). D, A 17°C cultivated starved worm (n ϭ 5). E, A 20°C cultivated starved worm (n ϭ 9). F, A 23°C cultivated starved worm (n ϭ 7). G, Validation of the reconstruction with different combinations of experimental conditions. The heat map shows cross-correlation coefficients between the reconstructed activity with the response function estimated with labeled condition (raw) and the observed activity in the labeled condition (column). Except for the ASER experiments, most of the combination shows high correlation (Fed 17C, n ϭ 19; Fed 20C, n ϭ 27; Fed 23C, n ϭ 16; Stv 17C, n ϭ 5; Stv 20C, n ϭ 9; Stv 23C, n ϭ 7; Fed ASER 20C, n ϭ 9).
ities were accompanied frequently by turns. Such loose coupling between AFD activity and a turn collapsed under starved conditions (Figs. 6A-E, G). These data suggested that the sensory signal of AFD is conveyed to a behavioral regulatory signal in fed conditions but not in starved conditions. To evaluate the compatibility of the estimated response functions in different conditions, we calculated the cross-correlation between the experimentally observed AFD activity and the reconstructed AFD activity by the response functions derived from animals cultivated under different conditions. The cross-correlations of the different combinations of conditions are summarized in Figure 5G. The high cross-correlation coefficients in most of combinations in Figure  5G suggested compatibility of each estimated response function, which is in accordance with an invariant shape of the estimated response functions. In contrast to AFD, ASER showed no correlations in any combinations. Thus, our response model well explained the AFD neuronal activity in response to thermal stimulus during thermotaxis, and invariable response property of AFD was compatible within different conditions.

Reconstruction of the temperature environment
We found that the response functions of AFD to thermal input were unvarying among different individuals. Moreover, reconstructed AFD activities by convoluting the response functions and temperature inputs were similar to the observed corresponding AFD activities. These results suggest that, once we have identified the response function, temperature inputs can be estimated by deconvolving AFD activities over time. In addition, migration coordinates and the estimated temperature at each point should have the information needed to establish the thermal environment without direct measurement of temperatures. Based on this hypothesis, we tried to estimate the temperature environment using AFD activity, trajectories, and the response function of the freely behaving animals. First, the AFD activity of a well fed animal on a thermal gradient (Fig. 7A) was deconvolved with the identified response function to estimate temperature input along the migration trajectory. Then, we reconstructed the relative thermal landscape of a moving animal based on the deconvolved temperature and observed migration trajectory, by fitting to a polynomial model of the thermal plane ( Fig. 7B; see Materials and Methods). The reconstructed temperature environment was almost identical to the observed temperature environment (Fig. 7B,C). We eliminated possible artifacts caused by data acquisition or the modeling procedure itself: the reconstructed thermal environment from ASER activity (Fig. 7D) collapsed the environmental linear thermal gradient (Fig. 7E,F). The distribution of the cross-correlations between reconstructed thermal environments and corresponding observed thermal landscapes showed high reproducibility of the reconstructed thermal environments from AFD activity (Fig. 7G). This correlation is kept in the AFD activity-based reconstruction with different cultivation temperatures or food conditions but is not kept in the ASER activity-based reconstruction or the random activity-based reconstruction. Similar to crosscorrelation, the SSIM index (Wang et al., 2004) showed a high performance of the thermal environmental reconstruction based on the AFD response function (Fig. 7H). These results showed that the identified response function and a series of AFD activity along the migration trajectory include the information required to predict (or "decode") the temperature environment.

Discussion
Quantitative analysis and mathematical description of functional components provide frameworks to understand the dynamic nature of neural circuits. To understand the encoding mechanisms G F e d S t a r v e d # of AFD peak dependent turns Figure 6. AFD activity of a starved animal during thermotaxis. A, Thermography and migration trajectory of 20°C cultivated worm conditioned in 2.5 h starvation. B, The temperature time course extracted from the thermography along the trajectory shown in A. C, AFD activity of the starved animal mapped onto the migration trajectory. We found that AFD activity has no correlation to directional turning different from fed animals. D, The time course of AFD activity in the starved conditioned animal shown in A-C. Note that AFD starts to respond to temperature increases at ϳ800 s, similar to the fed condition. E, F, Correlation between the timings of AFD activity peaks and turns. Red circles denote activity peaks defined in Figure 2. Black circles denote turns defined by the appearance of backward movement and directional change of tracking coordinates. E, Starved animal shows no coincidence between the activity peaks and turns. The original data are same as in A-D. F, A fed animal shows imperfect correlation between the activity peaks and turns. Spontaneous turns appear at the beginning of the experiment. Conversely, turns are accompanied with the activity peaks in the later term around operating range (bottom right). The original data are the same as Figure 1D-I. ϩ denotes the starting points in A, C, E, and F. G, Frequency of activity peak-dependent turn in fed and starved animals cultivated in 20°C. The turns within 30 s of an AFD peak were counted, and the frequency was calculated by (the number of turns)/(the number of AFD peaks) (total of 67 peaks and 142 turns of five animals for fed, 44 peaks and 25 turns of five animals for starved). of environmental temperature by sensory neurons, we investigated freely moving animals on a thermal gradient and quantified the response property of the thermosensory neuron AFD. The estimated response functions were invariant among different cultivation conditions, and the shape of the response function indicates adaptation and differential detection of input signal based on a time window of 20 s, a timescale comparable with that of behavioral components used by the animal to navigate, such as turning. We incorporated a nonlinear function into the AFD response model to reflect the dependence of the AFD operating range on cultivation temperature (Kimura et al., 2004;Clark et al., 2006). Reconstruction of AFD activity using the estimated response function and the nonlinear property of the operating range recapitulated the real AFD activity in response to temperature input. Conversely, we were able to reconstruct the thermal environment from AFD activities over the course of navigation. Thus, AFD activities of the behaving animals contain enough information to reproduce the thermal environment.
Encoding of thermal environment by AFD neuron AFD neurons of freely moving well fed animals on a shallow thermal gradient showed intermittent calcium responses. This observation suggests a discrete encoding system of AFD neurons even on a continuous thermal gradient. Although the response property of AFD contributes to the generation of pulse-like activities, regulation of changes in input pattern seems to influence the generation of these intermittent pulses. In fact, directional turnings of a fed animal seemed to correlate with intermittent pulse-like activities (Figs. 1I, 6F ), whereas a starved animal showed straightforward movements with gradual AFD activities, which seem to be caused by summations of pulse-like activities (Fig. 6A-D). We assume that directional turning on a thermal gradient causes a change in the temperature input experienced by the animal, and, consequently, the perturbation contributes to generate pulse-like AFD activities of freely moving animals. The differential of the phase response curve of the AFD neuron showed a temperature decrease at 20 s after the timing of phasic activities (Fig. 2C), implying that turnings evoked by the AFD pulse might cause this temperature decrease. Together, the behavioral feedback on the thermosensory input may play a role to recognize environmental information in a freely moving condition. The discrete encoding system of an AFD thermosensory neuron, as a consequence of the behavioral feedback, would help animals navigate a continuous thermal environment. Put differently, the behavioral feedback may amplify the thermosensory  Figure 3C, ASER activity, and the wandering trajectory shown in D. F, The observed migration trajectory and thermography image of the plate corresponding to D and E. G, Cross-correlation between acquired thermography and thermal environmental reconstruction from AFD in different conditions, ASER, and random activity with wandering trajectory. H, The SSIM index (see Materials and Methods) between acquired thermography and thermal environmental reconstruction from AFD in different conditions, ASER, and random activity with wandering trajectory. Sample numbers for G and H are AFD Fed20C, n ϭ 27; ASER Fed20C, n ϭ 9; Random, n ϭ 9; AFD Fed17C, n ϭ 19; AFD Fed 23C, n ϭ 16; AFD Stv17C, n ϭ 5; AFD Stv20C, n ϭ 9; AFD Stv23C, n ϭ 7.