Extended Data Fig. 5: Methods for measuring population- and single-cell-level responses.

a, Top, embedding of neuronal traces into 32-dimensional CEBRA space. For all our latent space analyses, the dimensionality of the latent space is 32. Bottom, binary time series, indicating reward consumption moments with reward frames set to 1 and all other frames set to 0 (the same analysis is applied to the screen and reward approach). b, Latent representation of neuronal activity; blue points represent frames during reward consumption, grey points represent other frames. c, Average of calcium activity across all cells averaged across trials (mean ± s.e.m, averaged across trials). d, Mouse speed prior to the reward and during reward consumption. e, Fivefold cross-validation is used to decode the reward moments from latent representation of neuronal activity. For each fold, a linear classification model is trained on the other four folds to predict the reward in the held-out data. MI between true and predicted reward, averaged across 5 folds, represents the information content of the reward representation for each recording session. f, The shuffle-control procedure is used to identify reward cells. It involves calculating the neuronal activity during reward consumption (averaging the deconvolved trace) for each neuron and comparing it with the distribution of neuronal activity from 1,000 random circular shuffled traces. A neuron is classified as a reward cell if its neuronal activity surpasses the 99th percentile of the distribution of shuffled neuronal activity (bottom left panel). The bottom right panel shows the distribution of neuronal activity for all reward cells (black) and compares them with their corresponding shuffled ones (blue) (n = 6,495) (see ‘Identification of cell types’ in Methods). Right panel shows the percentage of identified reward cells across mice. The numbers above each box show the cross-session average number of reward cells for each mouse. The dashed grey line and the shade around it represent the average number of reward cells ± s.e.m. (8.5 ± 1.5%). Chance level is 1%. g, The same shuffle-control procedure as described in f is used here to identify screen cells. Neuronal activity 150 ms before and after the screen poke is used to assess neuronal activity at the screen. The panel at the bottom right compares shuffle and control neural activity across all screen cells recorded across sessions and mice. The right panel shows the percentage of identified screen cells across mice. Each point represents one session, and the numbers above each box show the cross-session average number of reward cells for each mouse. h, Same analysis as for f,g but for reward-approach cells. Cells are identified as reward-approach cells if their activity from the screen to the reward onset is greater than chance. Box plots in f–h show median (centre line), 25th–75th percentiles (box), and range within 1.5 × IQR (whiskers); points beyond whiskers are outliers. The illustrations in f–h were created using Affinity Designer.