Main

Behavioural plasticity is critical for adaptation in varying environments. For instance, Drosophila typically display robust cycles of sleep and wake, but with prolonged starvation, they increase foraging activity at the expense of sleep4. Sleep is typically thought to be required for the consolidation of long-term memory, but surprisingly, starved flies can still consolidate memory related to food5. From an evolutionary standpoint, this facilitates survival, as the increased arousal promotes foraging for food and the preserved capability for memory is relevant for obtaining food. However, it raises the question of whether sleep is dispensable for long-term memory under conditions of starvation; and, conversely, how memory is consolidated when food is available. Here we show that a feeding/hunger-dependent adaptive switch drives the recruitment of distinct neural circuit mechanisms to promote appetitive long-term memory formation.

To test whether sleep is coupled to appetitive memory formation, starved flies were first trained in an olfactory conditioning paradigm and then sleep was assessed in individual flies kept on either agar or sucrose tubes. Training/conditioning occurred at zeitgeber time (ZT)6 and then sleep was assessed from ZT8 to ZT12. We saw no difference in sleep between trained and untrained groups of flies starved post-conditioning (Fig. 1a). By contrast, trained flies kept in sucrose tubes slept significantly more than untrained controls (Fig. 1a). This was also evident in flies starved for only 6 h pre-training, as opposed to the standard 18 h. (Extended Data Fig. 1a). Sleep bout length, a measure of sleep quality, was also significantly longer in trained flies kept on sucrose but not in flies on agar tubes (Extended Data Fig. 1b, c). The sleep increase after conditioning was variable across trained groups but was consistently higher in trained flies that exhibited robust memory.

Fig. 1: Flies fed post-training require sleep for memory consolidation.
figure 1

a, Flies trained at ZT6, and thereafter kept in agar tubes, show sleep comparable to that of untrained flies. By contrast, feeding post-training increases sleep in trained flies compared to controls. Sleep amount was quantified for the ZT8–12 interval (0- to 4-h time points on the curve) (two-sided t-tests were performed for each condition to compare trained and untrained groups, followed by Bonferroni correction, n = 32). b, Exposure to 6 h of sleep disruption (SD) affects long-term memory in flies fed post-training (two-sided t-test; n ≥ 8). Sleep post-training was comparable to that of the flies depicted in a. c, Exposure to 6 h of sleep deprivation does not affect long-term memory in flies starved post-training (two-sided t-test; n = 8). Sleep post-training was comparable to that of the flies depicted in a. d, Long-term memory is sensitive to sleep deprivation in flies kept on arabinose post-training (two-sided t-test; n = 8). e, Exposure to 6 h of sleep disruption affects long-term memory in npfr mutant flies kept starved post-training. npfr/+ was used as a control (two-sided t-tests were performed for each genotype to compare undisturbed and sleep-deprived groups, followed by Bonferroni correction; n ≥ 6). The data are represented as mean ± s.e.m. Each data point in a memory experiment represents a group of flies, and in a sleep experiment it depicts a single fly. Precise n and P values are provided in the Source Data. ***P < 0.001; **P < 0.01; *P < 0.05.

Source data

We next evaluated whether sleep is required for long-term memory. Flies were starved or fed for 24 h after training, after which starved flies were tested immediately while fed flies were re-starved for 30 h for robust memory retrieval5. Long-term memory in fed flies was dependent on protein synthesis (Extended Data Fig. 2a), as shown previously in starved flies5. To assess the need for sleep, groups of trained flies were sleep deprived via mechanical stimulation. We verified that fed and starved flies display sleep rebound following group deprivation (Extended Data Fig. 2b), and given that sleep deprivation is typically conducted with fed flies, we ensured effective sleep deprivation of trained starved flies by monitoring them individually (Extended Data Fig. 2c). Subjecting fed flies to 6 h of sleep deprivation immediately post-training resulted in significant impairment in long-term memory (Fig. 1b). By contrast, flies starved post-training showed no effect of sleep deprivation on long-term memory (Fig. 1c). Sleep deprivation had a comparable feeding-dependent effect on memory in flies starved for only 6 h before training (Extended Data Fig. 2d, e). These results indicate that the role of sleep in memory might not be universal but instead is dependent on feeding. Sleep deprivation initiated 6 h post-training had no effect on memory, demonstrating that sleep in a specific time window is relevant for memory formation (Extended Data Fig. 2f).

To determine whether the duration before testing influences the need for sleep, flies were starved post-training for 6 h, and then fed and re-starved so they could be tested at the same time as flies fed post-training (that is, 54 h). These flies displayed long-term memory, which was unimpaired by sleep deprivation during the initial 6-h starvation, indicating that post-training duration does not confer sleep dependence and that feeding immediately post-training is essential for switching to sleep-dependent memory (Extended Data Fig. 2g).

Aversive 24-h memory consolidation is not sensitive to sleep deprivation in flies kept in constant-light settings1. By contrast, we found that flies maintained in constant light demonstrated impaired long-term memory when sleep deprived and fed, but not if sleep deprived and starved (Extended Data Fig. 2h, i). Thus, the effect of sleep on appetitive memory formation is independent of environmental light cues. The need for sleep in fed flies was supported by the analysis of a short-sleeping mutant. As some short-sleeping mutants were impaired in learning or unable to survive starvation, we focused on the redeye (rye) mutant6 and found that rye flies demonstrated impaired long-term memory only if they were fed after conditioning (Extended Data Fig. 3a, b). Correspondingly, sleep in these mutants did not increase post-training (Extended Data Fig. 3c). Therefore, feeding acts as an adaptive switch such that it induces sleep-dependent memory formation. Conversely, starvation triggers a distinct consolidation mechanism that is sleep independent.

A feeding-based adaptive switch may require caloric intake. Alternatively, the sweet taste associated with sucrose might be sufficient to induce sleep-dependent memory consolidation. Starved flies kept on arabinose, a non-metabolizable sugar7,8, post-training formed robust long-term memory, which was sensitive to sleep deprivation (Fig. 1d). Accordingly, post-training sleep was higher and better consolidated in trained flies kept on arabinose than in untrained flies (Extended Data Fig. 4). Thus, the sensation of food is sufficient to trigger the formation of sleep-dependent memory.

Starved animals have a high drive for food, raising the possibility that hunger signals, such as Neuropeptide F (NPF)9,10, contribute to the adaptation to sleep-independent memory. Indeed, starved flies lacking the NPF receptor (which is encoded by npfr) demonstrated a substantial increase in sleep quantity and quality post-training (Extended Data Fig. 5a, b) and required sleep for long-term memory (Fig. 1e). Furthermore, knockdown of npf in all NPF-positive cells or npfr pan-neuronally with RNA interference resulted in sleep-dependent memory in flies starved post-training (Extended Data Fig. 5c, d), supporting the idea that loss of NPF renders flies dependent on sleep for memory consolidation. A switch to sleep-dependent memory may account for the reported memory impairment at 3 h post-training in flies with disrupted npf signalling11, as sleep-dependent memory may not be stable at this time point.

Circuits underlying appetitive memory in flies starved post-training have been identified, so we sought to determine whether the same circuits mediate memory in fed flies. The mushroom bodies (MBs), a major centre of olfactory learning and memory, are assembled into distinct lobes: α/β, α′/β′ and γ (refs. 12,13), of which α′/β′ lobes are particularly important for appetitive memory5. We expressed a dominant-negative and temperature-sensitive allele of dynamin (UAS-shibirets1) in α′/β′ neurons using a split-GAL4 driver, MB461B (ref. 14), trained flies at 25 °C and then moved them for 4 h to 32 °C, the temperature at which shibirets1 blocks synaptic transmission. We found that activity in α′/β′ lobes in the first 4 h, but not 8–12 h, post-training is required for long-term memory in both starved and fed settings (Extended Data Fig. 6).

During development, specific projection patterns further divide α′/β′ neurons into two subtypes: α′/β′m (medial) and α′/β′ap (anterior–posterior)14. To delineate the role of α′/β′ subsets in long-term memory, we used R35B12 and VT50658 Gal4 lines to target α′/β′ap neurons while R26E01 and MB370B were used to target the α′/β′m subset14,15,16. Blocking neurotransmission in α′/β′m neurons reduced long-term memory performance in starved flies, but not in those that were fed (Fig. 2a and Extended Data Fig. 7a). Conversely, the activity of α′/β′ap cells was needed for long-term memory formation only in fed flies but was dispensable in flies starved post-training (Fig. 2b and Extended Data Fig. 7c).

Fig. 2: Distinct α′/β′ subsets mediate sleep-dependent and sleep-independent memory.
figure 2

a, Silencing α′/β′m neurons (UAS-shibirets1/R26E01 and UAS-shibirets1/MB370B) affects long-term memory in starved flies (one-factor analysis of variance (ANOVA) with a Tukey post hoc test; n = 6). b, In fed flies, long-term memory is reduced by the silencing of α′/β′ap neurons (UAS-shibirets1/R35B12 and UAS-shibirets1/VT50658) post-training (one-factor ANOVA with a Tukey post hoc test; n ≥ 6). c, The GFP signal in α′/β′ap neurons was substantially reduced in trained starved flies compared to both trained fed flies and untrained controls (two-sided Mann–Whitney U-tests; n ≥ 19). d, Trained starved flies demonstrated an increase in α′/β′m activity compared to both fed flies and untrained controls. A significant decrease in calcium/GFP was also observed in trained fed flies compared to untrained fed flies (two-sided Mann–Whitney U-tests; n ≥ 14). e, Thermogenetic activation of α′/β′ap neurons (UAS-TrpA1/R35B12) resulted in a substantial gain in sleep while sleep was reduced significantly when α′/β′m neurons (UAS-TrpA1/R26E01) were activated (one-factor ANOVA with a Tukey post hoc test; n = 32). f, UAS-shibirets1/R35B12 flies showed an enhancement in sleep post-training at permissive but not at restrictive settings. g, Sleep measurements at restrictive settings (two-sided t-tests were performed for each genotype to compare trained and untrained groups, followed by Bonferroni correction; n ≥ 32). h, In trained fed flies, CaLexA-based neuronal activity in α′/β′ap neurons was substantially reduced in sleep-deprived flies compared to controls (two-sided Mann–Whitney U-test; n ≥ 11). In c, d and h, representative images are shown; two independent experiments; scale bars, 50 μm. The data are represented as mean ± s.e.m. Each data point in a memory experiment represents a group of flies, and in a CaLexA imaging and sleep experiment it depicts a single fly. Precise n and P values are provided in the Source Data. ***P < 0.001; **P < 0.01; *P < 0.05. The asterisks in a, b and e indicate a significant difference between experimental flies and genetic controls.

Source data

To determine how the activity of α′/β′ subsets is affected by training under fed or starved conditions, we measured calcium using CaLexA17. Trained or untrained flies were kept on either a food or agar vial for 4 h and then individual fly brains were prepared for imaging. Following training, the green fluorescent protein (GFP)/calcium signal in α′/β′ap neurons was reduced in trained starved flies relative to trained fed and untrained starved flies (Fig. 2c). Nevertheless, this decrease in α′/β′ap activity may not be relevant for memory in starved flies as hyperactivating α′/β′ap neurons post-training had no effect on memory performance (Extended Data Fig. 7g, h). By contrast, α′/β′m neurons showed an increase in calcium after training in starved flies and a training-dependent decrease in fed flies (Fig. 2d). Together, our results indicate that food availability influences the selection of neural circuits for the consolidation of appetitive memories.

We next asked whether the circuitry for memory in fed flies also affects sleep. Previous work showed that α′/β′ neurons drive wakefulness18,19. This effect may be mediated by α′/β′m neurons as we found that transient activation of this subset with temperature-induced TrpA1 substantially reduced sleep in flies (Fig. 2e and Extended Data Fig. 8a). Surprisingly, stimulating α′/β′ap neurons resulted in a considerable increase in sleep (Fig. 2e and Extended Data Fig. 8a). We infer that α′/β′m neurons and α′/β′ap neurons have opposing effects on sleep. Disrupting neurotransmission with UAS-shibirets1 in α′/β′ap or α′/β′m neurons had no effect on sleep, perhaps because these neurons influence sleep only in specific contexts such as appetitive conditioning (Extended Data Fig. 8b, c).

To determine whether the activity of α′/β′ap neurons is required for the sleep increase with appetitive conditioning, we blocked the activity of these neurons post-training. Experimental and control flies showed a significant increase in sleep post-training when kept at 25 °C (Fig. 2f and Extended Data Fig. 9a). Blocking α′/β′ap neurotransmission eliminated the increase in sleep as well as in sleep bout length (Fig. 2f, g and Extended Data Fig. 9b), indicating that α′/β′ap activity is required for the post-training sleep increase. By contrast, α′/β′m activity is dispensable for this change in sleep (Extended Data Fig. 9d–g). Given that sleep deprivation affects memory mediated by α′/β′ap neurons, we asked whether it also affects activity by sleep-depriving trained flies for 6 h and imaging fly brains for calcium using CaLexA. Sleep loss significantly reduced calcium in α′/β′ap neurons of flies fed post-training (Fig. 2h), but it had no effect in α′/β′m neurons of flies kept starved after training (Extended Data Fig. 9h). The effect of sleep deprivation on the activity of α′/β′ap neurons may account for its effect on impaired long-term memory in fed flies.

The consolidation of appetitive memory requires the activity of dopaminergic neurons (DANs), in particular PPL1 DANs20. To identify the relevant DANs in our experimental paradigms, we first tested a split-GAL4 driver line, MB504B, which labels multiple PPL1 DANs14,21. UAS-shibirets1/MB504B-Gal4 flies showed impaired long-term memory at the restrictive temperature in both fed and starved settings (Extended Data Fig. 10a–d).

To functionally restrict neurons in the PPL1 cluster, we first used the MB320C line that labels the MB-MP1 DANs14,21. The activity of MB-MP1 neurons was required for reward memory consolidation in starved flies, as previously reported20, but was dispensable for long-term memory in fed flies (Fig. 3a, b and Extended Data Fig. 10g). On the other hand, silencing MB-MV1 (also known as PPL1-γ2α′1) neurons with MB296B impaired memory consolidation in fed but not starved flies (Fig. 3a, b). Thus, as in the case of the α′/β′ lobes, different PPL1 DANs are recruited for sleep-dependent and sleep-independent memory.

Fig. 3: Feeding drives recruitment of different DANs and MBONs for appetitive memory formation.
figure 3

a, Silencing MB-MP1 (UAS-shibirets1/MB320C), but not MB-MV1 (UAS-shibirets1/MB296B), neurons affects long-term memory in starved flies (one-factor ANOVA with a Tukey post hoc test; n ≥ 6). b, Neuronal activity in MB-MV1, but not in MB-MP1, DANs is required for long-term memory in flies fed post-training (one-factor ANOVA with a Tukey post hoc test; n ≥ 7). c, Trained and starved flies show impaired memory when MBON-γ1pedc (UAS-shibirets1/MB112C) neurons are blocked for 4 h post-training but remain unaffected if MBON-γ2α′1 (UAS-shibirets1/MB077B) neurons are silenced (one-factor ANOVA with a Tukey post hoc test; n ≥ 6). d, Long-term memory was lower in fed flies in which MBON-γ2α′1 neurons were silenced post-training (one-factor ANOVA with a Tukey post hoc test; n ≥ 6). The data are represented as mean ± s.e.m. Each data point represents a group of flies. Precise n and P values are provided in the Source Data. The asterisks in ad indicate a significant difference between experimental flies and genetic controls. e, Fed flies form sleep-dependent memory that requires activity in α′/β′ap neurons in association with a circuit comprised of MB-MV1 DANs and MBON-γ2α′1. By contrast, α′/β′m neurons with MB-MP1 DANs and MBON-γ1pedc mediate sleep-independent long-term memory in starved flies.

Source data

MB neurons are tiled by individual DANs and corresponding MB output neurons (MBONs) to form 15 distinct compartments14,22. MBON-γ2α′1 neurons form functional connections with MB-MV123,24, so we asked whether these are required for memory under fed conditions. Blocking the activity of the MBON-γ2α′1 resulted in a substantial decrease in long-term memory in fed but not starved flies (Fig. 3c, d). Conversely, as previously reported25, memory under starved conditions requires MBON-γ1pedc neurons, which are connected to MB-MP1 DANs (Fig. 3c, d). MBON-γ2α′1 are sleep-promoting neurons that project back to MB-MV1 DANs to form a recurrent circuit22,23,24 and are also functionally connected to α′/β′ap neurons19. We propose that the MV1–MBON-γ2α′1–MV1 recurrent circuit acts in conjunction with α′/β′ap neurons to drive sleep-dependent memory formation (Fig. 3e).

Discussion

In a typical appetitive conditioning paradigm, flies are starved after training for memory retrieval, and we show here that when they are fed, they require sleep and use different circuits to form memory. In mammals, the need for sleep varies on the basis of the type of memory assayed. For instance, in rats and humans, sleep is specifically required for hippocampus-dependent memory26,27,28,29. Here we show that appetitive memory has differential requirements for sleep, and recruits different circuits based on post-training metabolic conditions. The role we report for NPF indicates that circuit selection is driven by the animal’s hunger level, which might be mediated through NPF receptors on MB-MP1 DANs11. We speculate that feeding results in the accumulation of catabolic waste products that impose energy demands and thereby trigger a need for sleep and sleep-dependent memory consolidation. However, the switch to such memory does not require actual nutrient intake, as sweet taste is sufficient. Importantly, the circuit required for sleep-dependent memory also promotes sleep after training, thereby coupling sleep and memory. This would be the pathway used under standard conditions, but to survive a food-depleted environment, flies have clearly evolved mechanisms to memorize cues related to food without curtailing wake/foraging activities. Thus, they can form ethologically relevant memories in distinct environmental settings.

Methods

Fly stocks and maintenance

Flies were raised at 25 °C and 60% relative humidity on standard cornmeal fly food under a 12:12-h light:dark cycle. Four- to seven-day-old flies were used for experiments and were transferred to fresh food vials 48 h before behavioural tests. The fly population was randomized but was kept age matched in each trial. For food deprivation, flies were kept in empty bottles with a wet cotton plug to prevent desiccation. The following fly lines were from Bloomington stock centre: Npf-Gal4 (25681), npfr mutants (10747), 20XUAS-TTS-shi[ts1]-p10 (66600; referred to as UAS-shibirets1 in the text), UAS-TrpA1 (26263), MB461B (68327), MB370B (68319), MB504B (68329), MB296B (68308), MB320C (68253), MB077B (68283) and MB112C (68263). UAS-npf-RNAi (108772), UAS-npfr-RNAi (107663) and VT50658 (200166) were from the Vienna Drosophila Resource Center. Other fly lines were described previously: redeye (ref. 6), R26E01 (ref. 15), R35B12 (ref. 16) and UAS-CaLexA (ref. 17). The background control line was the Canton-S (Heisenberg) strain.

Behaviour

Appetitive conditioning was performed as described previously5,30. In brief, a 4- to 7-day-old mixed-sex population of ~100 flies were starved for either 6 h or 18 h and then trained at 25 °C and 70% relative humidity to associate sucrose (unconditioned stimulus (US)) with odour A (conditioned stimulus (CS)+), presented in an air stream, for 2 min. A filter paper soaked in 1.5 M sucrose solution and then dried with a blow dryer was used as a US reward. A 30-s stream of clean air was followed by the presentation of a water-soaked filter paper (blank) plus odour B (CS) for 2 min, followed by another 30-s stream of clean air. In reciprocal experiments, odour B and odour A were presented with sucrose and the blank, respectively. The odours used in these experiments were: 4-methylcyclohexanol and 3-octanol. All odours were diluted in paraffin oil at 1:10 concentration. Odours were presented in 5-mm-diameter (4-methylcyclohexanol) and 3-mm-diameter (3-octanol) cups in the air stream. To block protein synthesis, flies were kept in vials with a filter paper soaked in 35 mM cycloheximide in water for 17 h and then given 1 h to recover before training as described previously5,30. After conditioning, flies were either moved to standard fly food or maintained starved for 24 h. In experiments assessing the role of sweet taste, flies were kept on 300 mM arabinose in 1% agar after conditioning. Fed flies were re-starved for 30 h before memory tests. This duration was determined on the basis of the robustness of memory expression in tests, as 24-h re-starvation was not sufficient but more than 30-h re-starvation led to a significant number of flies dying. To prolong the testing interval in starved flies, we first kept these flies on agar for 6 h after training, the interval in which memory is sensitive to sleep deprivation, and then fed them overnight for 18 h followed by 30-h re-starvation before memory tests. Memory was tested by presenting flies in a T-maze with odour A and odour B for 2 min. The performance index was calculated as the number of flies selecting CS+ odour minus the number of flies selecting CS odour divided by the total number of flies. Each performance index is the average of the performance indices from reciprocal experiments with two odours swapped to minimize non-associative effects.

For appetitive conditioning involving UAS-shibirets1 or UAS-TrpA1, flies were raised at 21 °C. UAS-shibirets1 flies were trained at 25 °C and 70% relative humidity and then moved to 32 °C (restrictive temperature) for 4 h to block neuronal activity. UAS-TrpA1 flies were kept at 21 °C throughout experiments and moved to 29 °C only for 4 h post-training for temperature-based induction.

For sleep assessment, a mixed population of 4- to 7-day-old male and female flies was introduced into 65-mm glass tubes containing 2% agar and 5% sucrose through an aspirator without anaesthesia and loaded into Drosophila activity monitors (DAMs, Trikinetics system). Locomotor data were collected using DAMsystem3 software and raw data files were analysed with DAMfilescan111. A 5-min period of inactivity, defined as no beam breaks in the DAM, was classified as sleep31,32. Sleep data were analysed using Insomniac 3.0 (ref. 33). Experiments to monitor sleep after training involved training a group of starved flies in an appetitive training paradigm and then transferring them individually into locomotor tubes with either sucrose or only agar. Control untrained flies were introduced into the training apparatus and then presented with only sucrose with no odour for 2.5 min followed by 2.5 min of water-soaked filter paper. Training was carried out at ZT6 and sleep was assessed from ZT8 onwards in the DAM system owing to the time spent in introducing flies into individual tubes and, also, to minimize the effects of handling on sleep. A vortexer mounting plate (Trikinetics) was used for mechanical sleep deprivation experiments, which involved horizontal shaking of fly vials for 2 s within every 20 s time interval.

For measuring sleep changes in flies with UAS-shibirets1 or UAS-TrpA1, flies were raised at 21 °C. First, baseline sleep was assessed at 21 °C, which was then compared to changes in sleep after TrpA1-based induction at 29 °C or shibirets1-based inhibition at 32 °C. Change in sleep was calculated as the amount of sleep in the first 24 h at the restrictive temperature minus baseline sleep at 21 °C the previous day. UAS-shibirets1 flies were kept at 32 °C for 4 h after training and then moved to 25 °C to assess the role of α′/β′ subsets in sleep post-training.

Immunohistochemistry

A standard protocol was used for fixation and staining. Briefly, adult fly brains were dissected in cold phosphate-buffered saline (PBS) and then fixed in 4% paraformaldehyde (v/v) for 20–30 min at room temperature. Brains were then rinsed in PBS–0.3% Triton-X (PBST) three times, 15 min each. Samples were then incubated with a mixture of 5% normal goat and normal donkey serum in 10% bovine serum albumin (m/v) and PBST (NGS/NDS) for 1 h, and then incubated overnight with primary antibodies in NGS/NDS at 4 °C. The samples then underwent seven 15-min washes with PBST before incubation with secondary antibodies for 2 h at room temperature in NGS/NDS buffer. Subsequently, another seven repetitions of 15-min PBST washes and a single 15-min PBS wash were performed, and then brains were moved into 50% glycerol. Brains were mounted on slides with anti-fade medium (Vectashield: H1000) and visualized in a Leica TCS SP5 confocal microscope. Primary antibodies used were: mouse anti-GFP (1:200; Roche Applied Biosciences; 11814460001) and rabbit anti-RFP (1:200; Takara Bio; 632475). The following secondary antibodies were used: Alexa Fluor 488 donkey anti-mouse (1:200; ThermoFisher; A-21202) and Cy5 donkey anti-rabbit (1:200; Jackson ImmunoResearch; 711-175-152). Mouse anti-GFP primary with secondary Alexa Fluor 488 donkey anti-mouse antibodies were used to detect GFP signal from the CaLexA (calcium-dependent nuclear import of LexA) reporter system. Fiji 2.0 was used for analysing images.

Statistical treatment

Data are mean ± s.e.m. The sample size is indicated in the respective figure legends and precise n values are provided in the Source Data. The sample size was not determined by any statistical test. Group means are displayed in figures depicting sleep trends. In behavioural experiments, owing to the unambiguous nature of measurements, blinding was not used. In imaging experiments, investigators were blinded to group allocation during data collection and analysis. GraphPad Prism 8.0 was used to plot graphs and compare independent groups of data. All groups of data were tested for normality using the D’Agostino and Pearson omnibus test. For normally distributed data, a two-sided Student’s t-test for two groups and one-factor ANOVA followed by a Tukey post hoc test in the case of multiple groups were used for analysis. In addition, differences between multiple undisturbed and sleep-deprived groups or trained and untrained groups were assessed using multiple t-tests, followed by Bonferroni correction. For the examination of data with a non-Gaussian distribution, a Mann–Whitney U-test was performed. Statistical significance is demonstrated as ***P < 0.001; **P < 0.01; *P < 0.05.

Reporting summary

Further information on research design is available in the Nature Research Reporting Summary linked to this paper.