Introduction

Most animals live in social contexts. In our modern human society, the feeling of loneliness is increasing despite the technological advances in social media and communication1. The prolonged absence of social interaction has detrimental effects on quality of life, lifespan and several health problems2,3. In Drosophila melanogaster, social interaction strongly modulates several behaviors, diminishing male-to-male aggression, decreasing food consumption and, depending on the context, increasing or decreasing sleep, among others4. Socialization impacts several parallel modulatory systems5. In particular, activity-regulated genes in dopaminergic neurons modulate aggression and sleep in response to social enrichment6,7,8. Key clusters of dopaminergic neurons are also essential components of learning and memory circuits9, since they innervate the main Drosophila memory structure, the mushroom body (MB)10.

At the molecular level, long-term memory (LTM) formation in the MB requires rutabaga (rut- adenylate cyclase) and dunce (dnc- cAMP phosphodiesterase) gene functions, in order to adequately regulate cAMP levels and ensure neuronal plasticity11. cAMP signaling mediates CREB (cAMP response binding element) phosphorylation, a conserved transcription factor that is key to form long-term memory and synaptic plasticity, among many other processes11,12. Social interaction causes structural changes in the MB, an effect that is abolished in mutant flies for memory-related genes like rut and dnc13,14. Furthermore, the function of such genes is necessary for immediate sleep changes triggered by social interaction15,16.

In this work, we inquired if socialization was able to generate long-lasting changes on behavior, and addressed how these changes were associated with synaptic plasticity. We showed that socialization altered behaviors for more than 8 hours after exposure, up to 72 h. Moreover, the underlying mechanisms have similarities with LTM. Indeed, they depended on cAMP levels and was blocked by anesthesia, and ultimately, it correlated with changes in number of CREB-responsive neurons and synapses. In summary, we propose that socialization awareness modifies long-term behavior sharing some underlying mechanisms that are characteristic of long-term memory processes.

Results

Long-term socialization-induced behavioral impact require cAMP signaling

Flies that experienced social interaction show reduced food consumption when compared with flies that were socially reared and posteriorly isolated17. We used single-fly CApillary FEeding -sCAFE- assay (modified from18) to extend these findings. We compared grouped flies with animals singly reared since eclosion, meaning that they were socially naive. As expected, there was a significant decrease in food uptake of 5-day socialized flies when compared to individual flies in the immediate 24 h (0–24 h time window) (Fig. 1A-B). Next, to determine if such feeding effect is maintained even in the absence of social interaction, we slightly modified the socially-enriched paradigm: flies were group- or single-reared for 5 days and then animals from both experimental groups were kept isolated for additional 24 h previous to assessing feeding (Fig. 1C). Using this protocol, we also detected a decreased food consumption of grouped flies in the 24–48 h time window, confirming a long-lasting effect of social interaction on feeding behavior (Fig. 1D). We reasoned that the most plausible candidate genes to play a role for such long-lasting effect would be memory-related genes, such as rutabaga (rut)19. Despite their past experience, isolated rut mutant flies in the 24–48 h period after socialization showed no differences in food intake with solitaire animals since eclosion (Fig. 1D). Besides, rut mutant flies do not change their feeding behavior during the first 24 h (0–24 h), suggesting a requirement of cAMP for this response (Fig. 1B). To confirm the involvement of cAMP signaling we repeated the sCAFE assay in animals mutant for dunce (dnc). Results were comparable to the rut mutant experiment: dnc mutant flies failed to modify their food consumption not only during the first 24 h after socialization (0–24 h) but also according to previous experience, in the 24–48 h period (Fig. 1B-D). Strikingly, feeding behavior of memory-related mutant animals laid in an intermediate state between socialized and isolated flies, maybe suggesting that their basal food consumption is different from wild-type (wt) strain (see below).

Fig. 1
figure 1

Long-lasting behavioral changes induced by socialization depends on memory-related genes. (A) Scheme of the socialization protocol: recently eclosed animals were either grouped or isolated for five days, and subsequently tested. (B) Quantification of food consumption of wt, rut and dnc mutant flies in socialized and isolated conditions (single fly CAFE assay) in the 0–24 h time window (Kruskal-Wallis chi-squared = 75.905, df = 5, p-value = 6.022e-15; post hoc Dunn comparisons: wtsocial|wtisolatedp = 6.24e-13, rutsocial|rutisolatedp = 1.00, dncsocial|dncisolated = 1.00). (C) Scheme of the modified socialization protocol: 5-day grouped or isolated animals were isolated for 24 h before testes. (D) Quantification of food consumption of wt, rut and dnc mutant flies in socialized and isolated conditions (sCAFE) in the 24–48 h h time window (Kruskal-Wallis chi-squared = 32.698, df = 5, p-value = 4.32e-06; post hoc Dunn comparisons: wtsocial|wtisolatedp = 1.04e-03, rutsocial|rutisolatedp = 1.00, and, in fig S1, dncsocial|dncisolated = 1.00). (E) Sleep profile and (F) sleep quantification of the 24–28 h time window for wt and rut mutant background (Kruskal-Wallis chi-squared = 94.165, df = 3, p < 2.2e-16; post hoc Dunn comparisons: wtsocial|wtisolatedp = 1.07e-02, rutsocial|rutisolatedp = 0.438). (G) Sleep quantification of the 24–28 h time window for wt and dnc mutant background (Kruskal-Wallis chi-squared = 36.476, df = 3, p-value = 5.94e-08; post hoc Dunn comparisons: wtsocial|wtisolatedp = 3.43e-02, dncsocial|dncisolatedp = 3.48e-03).

In isolated flies that previously experienced social interaction, isolation signals starvation and, as a consequence, increases feeding and decreases sleep (particularly daytime sleep), meaning that both behavioral changes are reciprocally related17. However, courtship experience inhibits sleep in male flies20,21, which lasts for several hours, proving a complex regulation of sleep by social cues and experiences. Most published sleep studies employ Drosophila Activity Monitors (DAMs), which only detect movement when the fly crosses a midpoint sensor in the housing tube22, overestimating actual sleep time17. The ethoscope was developed to unequivocally identify immobility periods and assess sleep23. We confirmed that social interaction also induced animals to sleep more15 (Fig. 1E). To ensure consistency with previous works17, we focused on the first four hours after lights ON, where the effect is unambiguous and reproducible (i.e. 24–28 h time window, ZT0-ZT4, Fig. 1E). Sleep quantification showed a significant difference between social-enriched and single-reared animals in this 24–28 h period (Fig. 1F), in line with previous publications15,17. Furthermore, rut mutant animals showed no significant difference in 24–28 h sleep time (Fig. 1E-F), although socialized dnc mutants did exhibit a significant sleep difference in the 24–28 h, (Fig. 1G). Intriguingly, memory-related mutant flies slept considerably more than their wt counterparts, suggesting additional levels of sleep regulation related to cAMP signaling (Fig. 1F-G). The ethoscope platform allows to distinguish walking activity from static movements globally described as micro-movements, therefore we analyzed how these two types of activity are regulated by socialization (fig S1). We found that socialized wt behavior is characterized by a marked decrease in walking, while micro-movements are kept constants (fig S1). The rut mutant animals also showed a modest but significant decrease in walking despite they did not sleep more after socialization (fig S1 B, 1F), highlighting the need of a detail description of behavior to assess sleep. Accordingly, dnc mutant flies decreased both micro-movements and walking activity (Fig. 1S C-D), resulting in an overall significant increase in sleep (Fig. 1G).

Our results with dnc and rut mutant flies were apparently contradictory with those previously described using DAMs15. However, the ethoscope also offers the possibility of analyzing data as they were extracted from DAMs, thus depicting comparable results to published DAM data. This virtual DAM analysis did render a significant difference between rut mutant grouped and single-reared flies, whereas no sleep changes were apparent in dnc mutant animals, in agreement with previous studies (fig S2)15. The differing results obtained depending on the type of analysis (regular or virtual DAM) stem from the higher sensitivity of ethoscopes to movement. It also explains why the increased sleep behavior of memory-mutant flies remained unnoticed until now, given that DAMs cannot detect such changes24 and fig S2). Nevertheless, in either case, our data and previous work support the idea that cAMP regulation, necessary for synaptic plasticity, is needed to sustain long-lasting changes in feeding and sleep even after social interaction has ceased.

Time course of socialization-induced behaviors in isolation

We wondered if socialization awareness was also evident in a different social behavior. Previous data showed that 5-day grouped male flies since eclosion were less aggressive than their single-reared counterparts when tested immediately after the treatment25. We wondered if this modified aggression behavior could be detected after a period of isolation. If so, the short test employed by this paradigm would also allow us to determine very precisely the time progression of socialization effects. Thus, we evaluated aggression after different isolation periods in a well-established behavioral paradigm26 (Fig. 2A). Socially-experienced flies showed reduced aggression (i.e. measured as the proportion of time lunging) at 1, 4, 8 and 24 h after isolation when compared with single-reared animals (Fig. 2B), evidencing a behavioral change at short- and long-term. Despite social interaction had ceased up to 24 h before, grouped flies still spent considerably less time fighting than single flies (Fig. 2B), confirming that socialization awareness is a general feature of socialization. In contrast, rut mutant flies showed decreased levels of aggression, with a much lower baseline when compared to wt animals. This indicates that rut mutant animals are less aggressive, as previously noticed27. rut mutant animals also displayed differences in aggressiveness between grouped and single-reared conditions, but exclusively at short-term (one hour). At intermediate- or long-term (4 and 8–24 h, respectively), we did not detect any significant difference. Our data suggest that socialization effects on aggression in rut mutant flies are still present but disappear after one hour, in contrast to long-lasting effects in wt animals.

Fig. 2
figure 2

Time course of socialization effects after isolation. (A) Scheme for the time course of the aggression protocol: either isolated or grouped animals were isolated for 1,4, 8–24 h, then grouped with other male and their aggression quantified. (B) Quantification of proportion of time expended lunging after different times of re-isolation. Flies either wt or in a rut mutant background were grouped or isolated for 5 days and then socialized flies were tested after 1, 4, 8–24 h after isolation (Kruskal-Wallis chi-squared = 139.99, df = 9, p-value < 2.2e-16, post hoc Dunn comparisons: wt24h_after_social|wtisolatedp = 1.08e-07, wt8h_after_social|wtisolatedp = 1.61e-10, wt4h_after_social|wtisolatedp = 1.88e-05, wt1h_after_social|wtisolatedp = 2.24e-09, rut24h_after_social|rutisolatedp = 1.00, rut8h_after_social|rutisolatedp = 0.815, rut4h_after_social|rutisolatedp = 0.598, rut1h_after_social|rutisolatedp = 7.52e-10).(C) Scheme for the time course of the sleep protocol: flies were either isolated or grouped after eclosion for 7, 6 or 4 days and subsequently isolated for 0, 1 or 3 days (named as socialized, 6 + 1, 4 + 3 and constant isolation); after introducing them in ethoscopes, sleep behavior was recorded for 3 days. (D) Sleep profile of animals isolated for 1 to 4 days, using isolated flies as control. Total number of days in isolation for E-I is depicted in the panel. (E) Quantification of sleep from ZT0 to ZT4 for day 1–4 and flies under constant isolation (CI); Kruskal-Wallis chi-squared = 44.32, df = 7, p-value = 1.85e-07; post hoc Dunn comparisons: wt1d_isolation|wtCIp = 4.20e-05, wt2d_isolation|wtCIp = 5.51e-04, wt3d_isolation|wtCIp = 5.65e-03, wt4d_isolation|wtCIp = 0.399. (F-H) Analysis of bout length (H), total number of bouts (G) and latency to first bout (H) from ZT0 to ZT12 for day 1–4 and animals under CI. (F) Kruskal-Wallis chi-squared = 18.47, df = 7, p-value = 0.01, post hoc Dunn comparisons: wt1d_isolation|wtCIp = 0.409, wt2d_isolation|wtCIp = 0.084, wt3d_isolation|wtCIp = 0.443, wt4d_isolation|wtCIp = 0.414. (G) Kruskal-Wallis chi-squared = 35.44, df = 7, p-value = 9.23e-06, post hoc Dunn comparisons: wt1d_isolation|wtCIp = 2.63e-05, wt2d_isolation|wtCIp = 8.37e-04, wt3d_isolation|wtCIp = 2.50e-02, wt4d_isolation|wtCIp = 0.164. (H) Kruskal-Wallis chi-squared = 36.16, df = 7, p-value = 6.75e-06, post hoc Dunn comparisons: wt1d_isolation|wtCIp = 1.93e-04, wt2d_isolation|wtCIp = 3.88-03, wt3d_isolation|wtCIp = 0.70e-04, wt4d_isolation|wtCIp = 0.207.

In order to determine the decay of socialization awareness effects, we decided to use the sleep paradigm, given that the ethoscope allowed to quantify several parameters. We wanted to compare animals of the same age, so we socialized flies for 7, 6 or 4 days (which is enough socialization time in order to generate a sleep effect15) and subsequently isolated them for 0, 1 or 3 additional days (named as socialized, 6 + 1 or 4 + 3, respectively) (Fig. 2C). Continuously isolated animals were used as control. Then, their sleep behavior was recorded for the following 3 days (i.e. depicted in Fig. 2C). In the framework of this experimental approach, we could compare continuously isolated flies with animals isolated for 1 to 4 days after socialization (Fig. 2D). We could observe a progressive reduction of sleep time in the ZT0- ZT4 after isolation, with significant decrease after 4 days of isolation that was comparable to continuous isolation (Fig. 2E). Thus, 4 days of isolation are enough to modify sleep reaching similarly sleep levels than socially naive flies, in contrast to the need of 5 days described previously using DAMs17. The ethoscope also allows a detailed sleep analysis regarding bout length, the total number of bouts and the latency to first bout in a 12-h analysis (ZT0-ZT12). There were no differences in the sleep bout length amongst experimental groups (Fig. 2F). In contrast, isolated flies for 4 days reduced the number of sleep bouts to similar levels than the ones from socially naive animals, despite we noticed a progressive reduction but still statistically significative (Fig. 2G). Intriguingly, the latency to the first bout in grouped flies remained similar up to day 3, where it raised sharply, similar to the latency of isolated flies (Fig. 2H). Thus, socialization impacts sleep organization altering the number and distribution of episodes, but not the temporal dynamics of a given sleep episode. Moreover, we conclude that the effect of socialization lasts at least for 3 days, and indeed, it can be considered as long-term.

Anesthesia abolishes socialization effects

Anesthesia blocks long-term memory consolidation in most species28,29. In Drosophila, a 2-min cold shock acts as anesthetics and is able to impede long-term memory in the classical aversive olfactory conditioning assay30. We wondered if anesthesia was also able to block socialization awareness. We exposed adult flies to 3-min cold shock two times per day to single and grouped flies for five days, previous to 24 h of isolation and the subsequent testing (Fig. 3A). Both experimental “cold-shocked” groups did not show any significant differences in food consumption in the 24–48 h time window after isolation, in contrast to non-shocked control animals (Fig. 3B). Given the reciprocal relationship between feeding and sleep behavior regarding social interaction17, we confirmed that sleep between isolated and socialized animals in the 24–28 h time window also remained similar after cold shock (Fig. 3C-D). As expected, in non-shocked animals the difference was statistically significant (Fig. 3C-D). In summary, we found that socialization awareness relies on cAMP signaling and is blocked by anesthesia, as it occurs in long-term memory.

Fig. 3
figure 3

Anesthesia abolishes socialization effects on sleep and food consumption. (A) Scheme of the cold-shock protocol (twice per day). (B) Quantification of food consumption using sCAFE (Kruskal-Wallis chi-squared = 15.954, df = 3, p-value = 1.16e-3; post hoc Dunn comparisons: non-shockedsocial|non-shockedisolatedp = 5.26e-3, shockedsocial|shockedisolatedp = 1.00). (C) sleep profile and (D) sleep quantification of the 24–28 h time window (Kruskal-Wallis chi-squared = 31.184, df = 3, p-value = 7.78e-07; post hoc Dunn comparisons: non-shockedsocial|non-shockedisolatedp = 3.05e-06, shockedsocial|shockedisolatedp = 0.116) of cold-shocked socialized and isolated wt flies, together with non-shocked control wt flies.

Socialization correlates with increased neuronal activity and synaptic plasticity

In Drosophila, LTM increased the number of CREB-activated neurons in the MB10,31. To evaluate whether or not socialization also correlates with higher levels of CREB activity in the MB, we used the CAMEL reporter tool after 5 days of socialization directly after eclosion. This tool bears a MB-specific transgenic construct that responds to phosphorylated CREB (and therefore, to activated CREB signaling) with the production of GFP31. We quantified the number of GFP positive soma (Fig. 4A) in adult brains, observing an increase in the number of CREB-positive cells in grouped vs. single-reared animals (Fig. 4B). In contrast, this CREB response was lost in rut mutant brains (Fig. 4B).

Fig. 4
figure 4

Socialization correlates with cellular and synaptic plasticity. (A) Representative confocal images of CAMEL tool for wt and rut mutant MB, either socialized or isolated. Only one representative MB is shown. (B) Number of CREB GFP-positive cells in the MB of socialized or isolated wt and rut mutant animals after 5 days of socialization. Kruskal-Wallis chi-squared = 33.735, df = 3 p-value = 1.93e-05; post hoc Dunn key comparisons: 5 days: wtsocial|wtisolatedp = 6.01e-05, rutsocial|rutisolatedp = 1.00. (C) Example of CAMEL tool (MB cells marked by GFP) combined with the pre-sinaptic marker brp-cherry after 5 days of socialization for wt and rut mutant animals, either socialized of isolated. (D) Quantification of the number of synapses after either isolation or socialization in both wt and rut mutant flies (see fig S4 for a detail on the quantification). Kruskal-Wallis chi-squared = 9.7691, df = 3, p-value = 0.021; post hoc Dunn key comparisons: wtsocial|wtisolatedp = 2.51 e-02, rutsocial|rutisolatedp = 1.00.

LTM formation using an appetitive conditioning paradigm increased the number of MB-input synapses32. Thus, to determine if CREB-activated neurons after socialization also showed signals of increased synaptic plasticity, we included in the CAMEL tool a second reporter, the presynaptic marker BRP, fused with the RFP-variant cherry. This reporter combination allowed the visualization of the presynaptic densities without altering the number of active zones33 (Fig. 4C). We quantified the number of synapses per cell volume in brains of 5-day grouped and single-reared animals (fig S3 shows an example of this quantification technique, see M&M). There was a significant increase in the relative number of pre-synapses in the MB of grouped flies compared to single-reared animals (Fig. 4D), similar to the synaptic plasticity described in mammals after an experience34. In contrast, in a rut mutant background we could not detect any difference in the number of MB pre-synapses, which was in agreement with the reduced pre-synapse number in rut MB-input neurons after appetitive conditioning32(Fig. 4D). Given that intensity of fluorescence varies greatly depending on the region, for analytical purposes we divided the MB in three areas, alpha, beta and the tip of beta. Interestingly, the former two showed only a marginal increase that did not reach statistical significance, however the tip of the MB concentrated most of the increase (fig S4). In summary, our results show a clear correlation of CREB-activated neurons and increased synaptic plasticity with effective social interaction that is abolished in memory impaired mutants, thus supporting a resemblance between socialization awareness and LTM.

Discussion

Socialization induces several changes in animal behavior and here we show that such changes are long-lasting, as a result of social interaction experience. Not surprisingly, socialization awareness shows similarities with a long-term memory process: involvement of cAMP signaling and processes of neuronal and synaptic plasticity. However, it presents differences with LTM. A striking peculiarity is its temporal dynamics since it would be hard to distinguish putative learning and consolidation stages during socialization, while in long-term memory paradigms both phases are clearly distinguishable (as, for example, in appetitive or aversive olfactory conditioning).

The classic view on sleep regulation indicates that this behavioral state is regulated by the circadian clock and the internal sleep homeostat35, but recent work in many species including Drosophila show that sleep regulation goes beyond these two processes and includes temperature, starvation, sexual arousal, and social context, among others36. Our data suggest that a past social experience may also regulate sleep in flies (Fig. 1), similar to what happens with psychophysiological insomnia in humans37.

In mammals, social isolation has profound effects on behavior and cognition, which is accompanied by detectable alterations in brain structure and function at several levels38. For instance, the hippocampus shows reduced dendritic spine density after either postnatal or juvenile social isolation39,40. The hippocampus is the main structure related to long-term memory, analog to the insect Mushroom Body41. In fact, it was previously described that socialization increased the fiber number in the MB, an increase that is impeded by classic learning mutations such as rutabaga42,43. In addition, our results reveal that socialization also induces rut-dependent changes in synaptic plasticity of the previously activated MB neurons. The increased synaptic densities in CREB-positive neurons might be explained by the socialization-induced enhanced sleep, given that sleep loss diminishes pre-synaptic densities in cholinergic neurons, including the MB neurons44,45. This is unlikely because despite rut mutant animals did sleep much more (Fig. 2B), rut mutant flies did not reach enough sleep levels as to restore behavioral plasticity (as it happens under artifically-induced sleep24), thus suggesting that rut increased number of active zones might be due to the excess of sleep but it is unable to rescue the effect of social interaction (Figs. 1 and 2). This reinforces the idea that socialization awareness may induce behavioral plasticity by similar mechanisms to long-term memory.

An apparent contradictory result was that memory-mutant animals did not behave as expected, i.e., as wt isolated flies, resembling more to wt socialized flies (Figs. 1 and 2). There are several reasons to explain this presumed inconsistency. The most obvious one is that the basal behavior of rut and dnc mutant flies are different due to the lack of cAMP signaling, as previously described for aggression27.

Why do isolated flies that were previously socialized behave similar to single-reared flies since eclosion15? Actually, chronic isolation displays starvation-like phenotypes in Drosophila17 and starvation disables aversive long-term memory46, probably because increased metabolism in the MB and glia is necessary47,48. It might well be that socialization awareness was prevented as a consequence of the starvation signaling, and this would explain the similar phenotypes achieved by isolation after socialization and isolation since eclosion, despite mechanistically they should be different. Indeed, one might hypothesize that rescuing such starvation-like phenotype would reveal differences between both experimental conditions.

Notably, socialization-induced behavioral changes are sexually dimorphic, since grouped and single-reared females behave similarly49. In fact, male-specific P1 interneurons act as an internal state regulatory hub for sleep, aggression, sleep and spontaneous locomotion50. Together with Diuretic hormone 44- (DH44) and Tachykinin- (TK) expressing interneurons, P1 neurons form a male-specific neural circuit that regulates spontaneous locomotion in response to social interaction, thus suggesting a possible common mechanism for socially-induced behavioral changes49. Interestingly, P1 neurons directly activate a specific subset of dopaminergic neurons that innervate the MB and it drives LTM appetitive olfactory memory formation51. The MB is not only a memory regulatory center but also acts as a sleep and feeding regulatory center52,53. In this work we have shown that social interaction correlates with increased synaptic plasticity in the MB itself (Fig. 4). Thus, it is tempting to postulate that socialization awareness may use a general neural circuit connecting P1 neurons, dopaminergic neurons and the MB in order to modify several behaviors with long-lasting effects.

Materials

Stocks and fly husbandry

Flies were raised and experiment performed using standard food at 25ºC on a 12/12 h light/dark cycle. rutabaga2080 (#9405), dunce11 (#6020) and Wwild type (Canton S #64349) stocks were obtained from Bloomington Drosophila Stock Center. The CAMEL tool is composed by 6xCRE-splitGal4AD, UAS-eGFP and R21B06-splitGal4DBD, gently donated by Dr Jan Pielage31. rut2080; 6xCRE-splitGal4AD and UAS-cherry-Brutchpilot; R21B06-splitGal4DBD stocks were combined in our laboratory and are available under request.

Isolation/socialization protocol

Male virgin flies were collected under CO2 anesthesia within 4 h post-eclosion and isolated in individual glass vials or socialized (25:25 male: female) in a plastic bottle. After 5 days of socialization or isolation, all flies were isolated without using anesthesia for 24 h (except where indicated) and then, behavioral experiments or dissections were performed.

In the case of cold shock, flies were ice-cold shocked twice a day (Zeitgeber Time 1 -ZT01- and ZT9) during the five days of isolation/socialization protocol for 2–3 min (i.e. until flies fainted). Glass vials were used to allow good cold transfer from ice. Afterwards vials were placed horizontally in a RT surface to let flies recover.

Single fly capillary feeding (sCAFE)

The protocol from18 was used with slight modifications. Males were placed in individual vials with a wet filter paper at the bottom and a 5 µl capillary (Blaubrand, 708707) with 5% sucrose water food. The capillary was introduced through a 5 mm cut 200 µl pipet tip that goes through a wet plug and sustained with an additional tip. After 24 h food intake is measured (0–24 h time window), the capillary substituted by a new one and plugs are wet again to preserve moisture. 24 h later food intake is measured again. Once the experiment has finished flies are weighted. Additional 3 individual tubes without flies were measured to control the evaporation rate.

Sleep

For all experiments, flies were sorted into glass tubes [70 mm × 5 mm × 3 mm (length × external diameter × internal diameter)] containing the same food used for rearing under a regime of 12:12 Light: Dark (LD) condition in incubators set at 25 °C. Activity recordings were performed using ethoscopes23. Behavioral data analysis was performed in RStudio (RStudio Team. RStudio: Integrated Development for r. RSudio, Inc. Boston, MA; 2015. http://www.rstudio.com/) employing the Rethomics suite of packages54. All sleep assays were repeated at least twice with 20–40 flies/treatment/experiment.

Aggression

The protocol from26 with slight modifications was used. Briefly, two flies were placed into each chamber of the arena (4 × 3 mm grid) with food. One-to-one socialization was achieved by allowing both flies to interact, whereas isolation was caused by a black divider that allowed physical separation of flies. After 5 days, socialized flies were also separated by the divider for 1, 4, 8–24 h. After removing the divider, reunited flies were recorded for 20 min and aggression analyzed by means of the FlyTracker (MATLAB) software and the platform JAABA (Janelia Automatic Animal Behavior Annotator), that identifies when the animal is lunging. The proportion of time fighting is the number of frames in which a particular animal lunges divided by the total number of frames.

Immunolabeling, imaging and image analysis

Adult brain preparations were stained following the same protocol as in55. Dissections were always performed at ZT4-5 to avoid possible circadian-induced changes.

For CREB + cells experiment, primary antibodies used were anti-GFP rabbit (1/200; Invitrogen ref. A11122) and anti-Fasciclin II mouse (1/50; DSHB AB_528235). To quantify synapse number, primary antibodies used were anti-GFP goat (1/200; Abcam Cat# ab6673, RRID:AB_305643), anti-RFP rabbit (1/200; MBL International Cat# PM005, RRID:AB_591279) and anti-Fasciclin II mouse (1/50; DSHB). Secondary antibodies used were Alexia 488, 568 or 680 (1/500; Life Technologies).

Images were taken by a Leica SP5 confocal microscopy re-using the same experimental conditions, avoiding saturation. CREB + cell images were taken using a 40X objective, with slices of 3 μm. Synapse quantification confocal images were taken the same day using a 63X objective, slices of 0,8 μm. Posteriorly images were treated using Imaris 6.3.1 software. Axon volume was rebuilt using the Volume tool and brutchpilot signal was quantified using the Spots tool. To adjust brightness parameters accurately the MB was divided in three parts (alfa, beta and beta tip) (Fig. Supp. 2). Synaptic density for each Mushroom Body is the summatory of spots/volume from each part.

Statistical analysis

For the behavioral and morphological experiments (Figs. 1, 2, 3, 4 and 5, S1 and S3), the data was analyzed in R (version 3.6.3) through Rstudio (Version 1.0.153), employing the Kruskal-Wallis non-parametric test (library stats). When appropriate, we performed post hoc Dunn analyses (library FSA) to identify specific differences between treatments. All assays were repeated at least twice with sample sizes as indicated within the figure.

The datasets used and/or analysed during the current study available from the corresponding author on reasonable request.