*2.7. Data Analysis*

#### 2.7.1. Olfactory Preference/Avoidance Test

Preference time and avoidance time during the 10-min test were measured from the recorded videos using MATLAB. The test cage was divided into two compartments of equal area. Preference time was defined as the time spent in the compartment with a filter paper scented with peanut butter or food, and avoidance time was defined as the time spent in a compartment without a filter paper scented with 2,4,5-trimethylthiazole or peppermint oil [24].

O ffline spike sorting and statistics of single-cell spiking data: When we did spike sorting, all the files were put together to make sure signals recorded at di fferent stages were from same units. Similar to previous studies, single units were sorted and identified with principal components analysis in O ffline Sorter V4 software [18,19]. In addition, we performed further analysis on all recorded unit to double check that the spikes were from the same units (repeated measures ANOVA on the spike amplitude and half-width). To generate the peristimulus time histogram (PSTH), spikes 2 s before and 4 s after the onset of odor stimulation were extracted for each trial and the spike firing rate was averaged over 100-ms bins (Figure 2E). The spontaneous firing rate (during the 2 s before odor stimulation) and the odor-evoked firing rate (during the 2 s after odor stimulation) were calculated by averaging the frequency of spikes during these 2 s periods. To test whether an odor evoked a significant response, we used a paired *t*-test to compare the baseline firing rate with the odor-evoked firing rate across all the trials for each cell–odor pair. If the *p* value was >0.05, the cell–odor pair was defined as nonresponsive. If the *p* value was <0.05, the cell–odor pair was defined as responsive and was further categorized as excitatory (if the odor-evoked firing rate was higher than the baseline firing rate) or inhibitory (if the odor-evoked firing rate was lower than the baseline firing rate).

**Figure 2.** The firing of M/Ts recorded from the OB changes under different nutritional states. (**A**,**B**) Representative raw spike traces (**A**) and spike waveforms (**B**) recorded from a mouse fasted for 0 h (black), 12 h (orange), and 24 h (red) respectively. (**C**) Cumulative probability and box-and-whisker plot showing the spontaneous firing rate under different fasting states. Each gray circle represents the mean firing rate of a single unit. (Cumulative probability: Two-sample *K-S* test, 0 h vs. 12 h, *p* = 0.31, 0 h vs. 24 h, *p* = 0.0012, 12 h vs. 24 h, *p* = 0.073. Box-and-whisker plot: Friedman's test, χ2 (2,248) = 65.10, *p* < 0.001, 0 h vs. 12 h, *p* = 0.0023, 0 h vs. 24 h, *p* < 0.001, 12 h vs. 24 h, *p* < 0.001). (**D**) Three examples of firing induced by isoamyl acetate when mice were in a satiated state. From left to right: an excitatory response, an inhibitory response, and no response. Top, raster plot. Bottom, peristimulus histograms for the firing rate, smoothed with a Gaussian filter with a standard deviation of 1500 ms. The red dotted lines indicate the period of odor stimulation. Error bars show the standard error of the mean (SEM). (**E**) The changes in the neural responses to odors under different fasting conditions. (**E1**). Stacked bar plots Neutral odorants (0 h, Excitory: 27/250, Inhibitory: 39/250, No response: 184/250; 12 h, Excitatory:

50/250, Inhibitory: 23/250, No response: 177/250; 24 h, Excitatory: 12/250, Inhibitory: 32/250, No response: 206/250). Chi-Square Tests: χ2 (4) = 31.23, *p* = 0.000003, Exci. 0 h vs. Exci. 12 h, *p* < 0.05, Exci. 0 h vs. Exci. 24 h, *p* < 0.05, Exci. 12 h vs. Exci. 24 h, *p* < 0.05. Appetitive odorants (0 h, Excitory: 18/250, Inhibitory: 35/250, No response: 197/250; 12 h, Excitory: 42/250, Inhibitory: 17/250, No response: 191/250; 24 h, Excitory: 16/250, Inhibitory: 36/250, No response: 198/250). Chi-Square Tests: χ2 (4) = 24.47, *p* = 0.000064, Exci. 0 h vs. Exci. 12 h, *p* < 0.05, Exci. 12 h vs. Exci. 24 h, *p* < 0.05. Aversive odorants (0 h, Excitory: 16/250, Inhibitory: 50/250, No response: 184/250; 12 h, Excitory: 42/250, Inhibitory: 24/250, No response: 184/250; 24 h, Excitory: 19/250, Inhibitory: 39/250, No response: 192/250). Chi-Square Tests: χ2 (4) = 25.04, *p* = 0.000049, Exci. 0 h vs. Exci. 12 h, *p* < 0.05, Exci. 12 h vs. Exci. 24 h, *p* < 0.05. (**E2**). Pseudocolor plots represent odor-evoked responses for each unit at di fferent metabolism states, including fasted for 0 h, 12 h, and 24 h. (**E3**). Among the number of unit-odor pairs with excitatory response (Top) or inhibitory response (Bottom) at fasted for 24 h, the percentages for unit-odor pairs showing excitatory (orange), inhibitory (green) or no response (gray) at fasted for 0 h. (**F**) Cumulative probability and box-and-whisker plots of the odor-evoked firing rate. (**F1**). Cumulative probability: Two-sample *K-S* test: 0 h vs. 12 h, *p* < 0.001, 0 h vs. 24 h, *p* = 0.082, 12 h vs. 24 h, *p* < 0.001. Box-and-whisker plot: Friedman's test: χ2 (2,310) = 35.81, *p* < 0.001, 0 h vs. 12 h, *p* < 0.001, 12 h vs. 24 h, *p* < 0.001. (**F2**). Cumulative probability: Two-sample *K-S* test: 0 h vs. 12 h, *p* < 0.001, 0 h vs. 24 h, *p* = 0.24, 12 h vs. 24 h, *p* < 0.001. Box-and-whisker plot: Friedman's test: χ2 (2,310) = 17.78, *p* = 0.00014, 0 h vs. 12 h, *p* = 0.00085, 12 h vs. 24 h, *p* = 0.00068. (**F3**). Cumulative probability: Two-sample *K-S* test: 0 h vs. 12 h, *p* < 0.001, 0 h vs. 24 h, *p* = 0.023, 12 h vs. 24 h, *p* < 0.001. Box-and-whisker plot: Friedman's test: χ2 (2,310) = 30.36, *p* < 0.001, 0 h vs. 12 h, *p* < 0.001, 12 h vs. 24 h, *p* < 0.001. \* *p* < 0.05, \*\* *p* < 0.01, \*\*\* *p* < 0.001.

#### 2.7.2. Analysis of LFP Signals

Programs written in MATLAB were used to analyze the LFP signals. Raw data 2 s prior to the onset of odor stimulation were used to represent the ongoing baseline LFP activity. A time–frequency transformation was performed on this 2-s window. For odor-evoked responses, the data 2 s prior to and 4 s after the onset of odor stimulation were selected for presentation and further analysis. Similar to previous studies [20,21], we divided the LFP signals into four frequency bands: theta (2–12 Hz), beta (15–35 Hz), low gamma (36–65 Hz), and high gamma (66–95 Hz). However, we focused only on the beta and high gamma bands in our analysis since odors usually evoke strong and reliable responses within these two frequency bands. Spectral power was computed using MATLAB's STFT method (The MathWorks). For each trial, the baseline was normalized to 1, and all the trials for each odor were averaged for further analysis.

#### 2.7.3. Receiver Operating Characteristic (ROC) Analysis

Receiver operating characteristics (ROCs) were used to assess the classification of responses evoked by odor pairs, and were estimated using the roc function in MATLAB. Mean firing rate during odor stimuli with a 2-s bin was utilized in ROC analysis. The area under the ROC (auROC) is a nonparametric measure of the discriminability of two distributions. We used the auROC to assess the classification of the two odors within an odor pair. An auROC curve is defined from 0.5 to 1.0. A value of 0.5 indicates completely overlapping distributions, whereas a value of 1 predicts perfect discriminability [19].
