Natalia Barrios1, Matheus Farias2, Marta A Moita3. 1. Champalimaud Research, Champalimaud Centre for the Unknown, 1400-038 Lisbon, Portugal. Electronic address: natalia.barrios@neuro.fchampalimaud.org. 2. Champalimaud Research, Champalimaud Centre for the Unknown, 1400-038 Lisbon, Portugal. 3. Champalimaud Research, Champalimaud Centre for the Unknown, 1400-038 Lisbon, Portugal. Electronic address: marta.moita@neuro.fchampalimaud.org.
Abstract
Adjusting to a dynamic environment involves fast changes in the body's internal state, characterized by coordinated alterations in brain activity and physiological and motor responses. Threat-induced defensive states are a classic case of coordinated adjustment of bodily responses, cardiac regulation being one of the best characterized examples in vertebrates. A great deal is known regarding the neural basis of invertebrate defensive behaviors, mainly in Drosophila melanogaster. However, whether physiological changes accompany these remains unknown. Here, we set out to describe the internal bodily state of fruit flies upon an inescapable threat and found cardiac acceleration during running and deceleration during freezing. In addition, we found that freezing leads to increased cardiac pumping from the abdomen toward the head-thorax, suggesting mobilization of energy resources. Concordantly, threat-triggered freezing reduces sugar levels in the hemolymph and renders flies less resistant to starvation. The cardiac responses observed during freezing were absent during spontaneous immobility, underscoring the active nature of freezing response. Finally, we show that baseline cardiac activity predicts the amount of freezing upon threat. This work reveals a remarkable similarity with the cardiac responses of vertebrates, suggesting an evolutionarily convergent defensive state in flies. Our findings are at odds with the widespread view that cardiac deceleration while freezing has first evolved in vertebrates and that it is energy sparing. Investigating the physiological changes coupled to defensive behaviors in the fruit fly has revealed that freezing is costly yet accompanied by cardiac deceleration and points to heart activity as a key modulator of defensive behaviors.
Adjusting to a dynamic environment involves fast changes in the body's internal state, characterized by coordinated alterations in brain activity and physiological and motor responses. Threat-induced defensive states are a classic case of coordinated adjustment of bodily responses, cardiac regulation being one of the best characterized examples in vertebrates. A great deal is known regarding the neural basis of invertebrate defensive behaviors, mainly in Drosophila melanogaster. However, whether physiological changes accompany these remains unknown. Here, we set out to describe the internal bodily state of fruit flies upon an inescapable threat and found cardiac acceleration during running and deceleration during freezing. In addition, we found that freezing leads to increased cardiac pumping from the abdomen toward the head-thorax, suggesting mobilization of energy resources. Concordantly, threat-triggered freezing reduces sugar levels in the hemolymph and renders flies less resistant to starvation. The cardiac responses observed during freezing were absent during spontaneous immobility, underscoring the active nature of freezing response. Finally, we show that baseline cardiac activity predicts the amount of freezing upon threat. This work reveals a remarkable similarity with the cardiac responses of vertebrates, suggesting an evolutionarily convergent defensive state in flies. Our findings are at odds with the widespread view that cardiac deceleration while freezing has first evolved in vertebrates and that it is energy sparing. Investigating the physiological changes coupled to defensive behaviors in the fruit fly has revealed that freezing is costly yet accompanied by cardiac deceleration and points to heart activity as a key modulator of defensive behaviors.
Internal states accompanying behaviors, emotions, and cognitive processes include all bodily adjustments that facilitate short-term deviations from homeostasis to better cope with environmental challenges. A classic example is the tight coupling between heart rate and defensive behaviors.1, 2, 3 In vertebrates, including humans, escapable or imminent threats induce flight-or-fight responses associated with increased heart rate, tachycardia.4, 5, 6 In contrast, more distant or inescapable threats lead to freezing responses with decreased heart rate, bradycardia.,, Cardiac activity changes upon threat are thought to relate to metabolic needs, as the circulatory system distributes oxygen throughout the body. In addition to sustained changes in cardiac activity, threat induces transient cardiac arrest (TCA) as part of the startle reflex. This tight regulation of cardiac function during threat is mediated by the autonomic nervous system (ANS), first evolved in vertebrates. However, highly evolved invertebrates show cardiac arrest and transient bradycardia and tachycardia when threatened., Still, the sustained physiological processes accompanying long-lasting defensive behaviors in invertebrates remain largely unexplored.Insects show a large repertoire of defensive behaviors, including freezing and fleeing.13, 14, 15, 16 It was recently proposed that threat induces a sustained change in internal state, akin to a primitive emotional state, in the fruit fly. However, the physiological changes that comprise this altered state have not been described. Here, we aimed to test whether defensive behaviors are paralleled by physiological changes in Drosophila melanogaster, focusing on cardiac activity during freezing and fleeing as well as during spontaneous locomotion and immobility.Drosophila has an open circulatory system with a dorsal vessel, which extends the body’s entire anterior-posterior axis. Its abdominal part functions as a tubular contractile heart that periodically reverses the direction of beating, thus pumping the hemolymph toward the head-thorax or toward the abdomen. As the circulatory system in vertebrates, the flow of the hemolymph serves to transport immune cells, nutrients, and other metabolites between the thoracic and abdominal cavities.We develop a new technique to image the heart in semi-restrained behaving flies and found an astounding coupling between defensive behaviors and cardiac activity analogous to that found in vertebrates, i.e., running with heart acceleration and freezing with heart deceleration. Moreover, freezing flies biased cardiac pumping toward the head and thorax, suggesting mobilization of resources from the abdomen. Concordantly, sustained freezing led to decreased sugar levels and starvation resistance. Finally, we show that cardiac reversal rate and variability are partial predictors of the level of threat-induced freezing, establishing a link between cardiac function and the selection of defensive behaviors upon threat.
Results
Semi-restrained flies freeze or flee to repeated looming
Unrestrained flies respond to an inescapable threat with freezing or flight attempts.,, To image cardiac activity during defensive responses, we tethered flies dorsally to a coverslip and placed on a ball while a computer monitor showed 20 repetitions of a looming black disc, perceived as a threat by various species, including fruit flies,, or a control visual stimulus (randomly appearing black dots; STAR Methods; Figures 1A and 1B). The flies’ behavior was recorded through an IR camera. We first tested the behavioral response to threat of tethered flies. We found that semi-restrained flies freeze and flee upon looms (Videos S1 and S2). Jumps were also observed, but not quantified, in this work. To estimate the fly’s walking speed, we analyzed the rotational movement of the ball using custom written software in Bonsai. Locomotor behavior included only periods classified as walking (speed > 30 pixels/s). Flies’ walking speed increased during exposure to looming stimuli relative to baseline, during which walking speed remained constant (Wilcoxon test; p < 0.0001; Figures 1C–1F). Control flies also showed constant walking speed during baseline and an increase in walking speed during stimulation (Wilcoxon test; p = 0.004; Figures 1E and 1F), albeit lower than that observed in loom-exposed flies (Mann-Whitney U test; p < 0.0001).
Figure 1
Semi-restrained flies flee or freeze upon looming presentation
(A) Schematic of the behavioral setup.
(B) Schematic of visual stimuli and protocol. After the baseline, twenty stimuli were delivered every 10–20 s, indicated by vertical black lines.
(C and D) Walking speed (color scale on the right) and freezing and immobility (gray) for control (C; n = 27) and loom-exposed flies (D; n = 63). Each row corresponds to one fly, rank-ordered by maximum time freezing during stimulation.
(E) Average walking speed (±SEM) over the course of the experiment. Only periods of walking were included.
(F) Change in walking speed per individual fly (average speed during stimulation − average speed during baseline).
(G) Fraction of flies freezing throughout the experiment (∗p < 0.0001).
(H) Percent time spent freezing per individual fly.
In (E)–(H), gray corresponds to control flies and red and orange to loom-exposed flies. Dashed vertical lines in (C)–(E) and (G) represent stimulus presentations. In (F) and (H) and all figures hereafter, green horizontal lines represent medians, box represents interquartile range, and whiskers minimum and maximum values. See also Figure S1 and Video S1.
Semi-restrained flies flee or freeze upon looming presentation(A) Schematic of the behavioral setup.(B) Schematic of visual stimuli and protocol. After the baseline, twenty stimuli were delivered every 10–20 s, indicated by vertical black lines.(C and D) Walking speed (color scale on the right) and freezing and immobility (gray) for control (C; n = 27) and loom-exposed flies (D; n = 63). Each row corresponds to one fly, rank-ordered by maximum time freezing during stimulation.(E) Average walking speed (±SEM) over the course of the experiment. Only periods of walking were included.(F) Change in walking speed per individual fly (average speed during stimulation − average speed during baseline).(G) Fraction of flies freezing throughout the experiment (∗p < 0.0001).(H) Percent time spent freezing per individual fly.In (E)–(H), gray corresponds to control flies and red and orange to loom-exposed flies. Dashed vertical lines in (C)–(E) and (G) represent stimulus presentations. In (F) and (H) and all figures hereafter, green horizontal lines represent medians, box represents interquartile range, and whiskers minimum and maximum values. See also Figure S1 and Video S1.To identify periods of immobility, we quantified pixel change in a region of interest surrounding the fly (STAR Methods; Figure S1A). Before stimulation, flies were rarely immobile; they mostly walked or groomed. In contrast, loom-exposed animals, but not control ones, sustained long periods of immobility during the stimulation period (Figures 1C, 1D, 1G, and 1H). 1 s after the last stimulus presentation, 76% of loom-exposed flies (48/63) were freezing compared to 4% (1/27) of control-exposed flies (χ2 test; p < 0.0001; Figure 1G). Although, in enclosed arenas, the fraction of flies freezing increases gradually with each loom presentation, the fraction of tethered flies immobile stayed constant during the stimulation period; 69% (44/63) of flies were freezing 1 s after first loom and 76% (48/63) 1 s after last loom (χ2 test; p = 0.677; Figure 1G). Further, the total amount of time spent freezing by loom-exposed animals was higher than that of control flies (Mann-Whitney U test; p < 0.0001; Figure 1H). As shown for flies in enclosed arenas, we observed a bimodal distribution of the time spent freezing during looming stimulation (Figure S1B), and flies that did not freeze ran instead (Figure S1C).These data show that semi-restrained flies also display threat-induced fleeing and freezing, allowing the search for possible coupling of cardiac function and defensive behaviors.
Flies show cardiac startle upon looming
Fruit fly’s heart is composed of two rows of cardiomyocytes that contract rhythmically as a peristaltic wave, pumping the hemolymph alternatively in opposite directions: retrograde or backward, toward the abdomen, and anterograde or forward, toward the head and thorax (Figure 2A). This alternation is known as cardiac reversal.
Figure 2
Looms trigger transient cardiac arrest in semi-restrained intact flies
(A) Illustration showing the fly’s dorsal vessel (top left) and a schematic of the cardiomyocytes (top right) showing the average distance between tracked nuclei (mean ± SEM; n = 38). Representative raw traces of the displacement of two cardiomyocytes, one anterior (black) and another posterior (gray; middle row), are shown. Directional change of heartbeat analyzed by metachrony of contractions (bottom row) is shown. The point arrow indicates a TCA associated with cardiac reversal.
(B) Average power spectral density of backward and forward beating rates (±SEM) during baseline.
(C and D) Backward and forward peak heart rate and heart rate variability per individual fly (n = 90) during baseline.
(E) Representative cardiac trace showing a TCA during a looming stimulus (top). Average peak heart rate (±SEM), aligned to visual stimulus (bottom) for control and loom-stimulated flies. Dashed vertical lines represent stimulus onset and offset.
(F) Frequency of TCAs at random time points during the stimulation period outside stimulus presentations (20,000 time points per fly) and during the looms (20 per fly).
(G) Frequency of TCA over the course of loom presentations (n = 63 flies; for each fly, we took the proportion of TCAs within sets of 4 trials; looms 1–4, 9–12, and 17–20).
In (A)–(D) and hereafter, blue and green correspond to backward and forward pumping, respectively. In (F) and (G) and hereafter, purple, orange, and brown correspond to freezer (n = 30), runner (n = 17), and mixed-response flies (n = 16), respectively. See also Figure S2 and Videos S2, S3, and S4.
Looms trigger transient cardiac arrest in semi-restrained intact flies(A) Illustration showing the fly’s dorsal vessel (top left) and a schematic of the cardiomyocytes (top right) showing the average distance between tracked nuclei (mean ± SEM; n = 38). Representative raw traces of the displacement of two cardiomyocytes, one anterior (black) and another posterior (gray; middle row), are shown. Directional change of heartbeat analyzed by metachrony of contractions (bottom row) is shown. The point arrow indicates a TCA associated with cardiac reversal.(B) Average power spectral density of backward and forward beating rates (±SEM) during baseline.(C and D) Backward and forward peak heart rate and heart rate variability per individual fly (n = 90) during baseline.(E) Representative cardiac trace showing a TCA during a looming stimulus (top). Average peak heart rate (±SEM), aligned to visual stimulus (bottom) for control and loom-stimulated flies. Dashed vertical lines represent stimulus onset and offset.(F) Frequency of TCAs at random time points during the stimulation period outside stimulus presentations (20,000 time points per fly) and during the looms (20 per fly).(G) Frequency of TCA over the course of loom presentations (n = 63 flies; for each fly, we took the proportion of TCAs within sets of 4 trials; looms 1–4, 9–12, and 17–20).In (A)–(D) and hereafter, blue and green correspond to backward and forward pumping, respectively. In (F) and (G) and hereafter, purple, orange, and brown correspond to freezer (n = 30), runner (n = 17), and mixed-response flies (n = 16), respectively. See also Figure S2 and Videos S2, S3, and S4.Cardiac activity has been analyzed mainly in semi-intact preparations or anesthetized flies, and only a few studies have investigated its function in intact animals., However, so far, there are no studies measuring heart activity in behaving fruit flies. Here, we imaged the nuclei of cardiomyocytes expressing nls-dsRed through the cuticle of intact awake tethered flies (Figure 2). To analyze the rhythmic contractions of the heart, the heart rate, we tracked the displacement, perpendicular to the longitudinal axis of the heart tube, of one cardiomyocyte. By tracking two distant cardiomyocytes (Figure 2A; Video S3), we determined the asynchrony in their contractions, from which cardiac pumping direction and cardiac reversal could be extracted (see example raw traces and code in STAR Methods).We first analyzed the baseline heart rate. To compute the power of the various frequencies present in this rhythmic signal, we performed short-time fast Fourier (SFF) on the displacement trace from the most anterior cell. Concordant with Klassen et al., we found the peak heart rate to be 6.33 ± 0.37 Hz (mode ± SEM). It has been reported that the heart rate is different during backward and forward pumping., Thus, we determined backward or forward bouts (STAR Methods) and concatenated all baseline backward or forward bouts for each animal. We performed SFF on each concatenated signal. As reported previously, backward heart rate was faster (Wilcoxon test; p = 0.0004) and more regular than forward heart rate during baseline (Wilcoxon test; p < 0.0001; Figures 2B–2D).To determine cardiac reversal rate, we created for each fly a square wave trace, where a high and a low value corresponded to time points during forward and backward bouts, respectively (Figure S2A). We performed fast Fourier transform (FFT) on the square waves and found the average cardiac reversal rate to be 0.23 ± 0.02 Hz (mode ± SEM; Figure S2B) during baseline. The mean length of backward and forward bouts was 1.90 ± 0.04 (mean ± SEM) and 1.54 ± 0.05 s (mean ± SEM), respectively.Next, we asked whether flies modulate their heart activity when exposed to a visual threat. Because time spent freezing upon looms follows a bimodal distribution (Figure S1B), we analyzed cardiac activity separately for freezers (n = 30) that froze more than 3.5 min, runners (n = 17) that froze less than 1.5 min, and mixed-response flies (n = 16) with bouts of freezing and running interspersed.During the startle response, TCA has been described across phyla.,, Hence, we hypothesized that a sudden decrease in heart rate should be also detectable in D. melanogaster upon a sudden visual threat. We performed a time-frequency analysis of the cardiomyocyte’s displacement in a window of 6 s around each 500-ms visual stimulus. We found that the heart skipped on average one beat during the looming stimulus, but not during control stimulation, reflected in the sudden average decrease of 1.35 ± 0.11 Hz (mean ± SEM) in heart rate (Figure 2E; Video S4).
Video S4. Fly’s behavior and heart activity during looming stimulation, related to Figure 2
A letter ‘A’ appears indicating a transient cardiac arrest during the looming stimulus (indicated at the upper right corner as an expanding white circle on a black background).Next, we examined the relationship between cardiac arrest and defensive behaviors displayed by analyzing the occurrence of TCA upon stimulation for control, freezer, runner, and mixed-response flies. To detect a TCA, we identified moments of sudden decrease in heart rate larger than 0.7 Hz between two consecutive frames (STAR Methods; Figure S2C). No differences were found between groups in the frequency of TCAs at random points during baseline (Figure S2E) or upon control stimulation compared to that found at random points during baseline (Mann-Whitney U test; p = 0.35; Figure S2D). However, in line with prior studies,, upon looms, the frequency of TCAs was similarly increased relative to random time points in between stimuli in freezer, runner, and mixed-response flies (Mann-Whitney U test; p < 0.0001 for all groups; Figure 2F). Furthermore, it is known that the startle reflex is reduced by repetition or anticipation. Indeed, we found that TCAs frequency upon looms decreased over the course of stimulus presentations (55.15% first 4 loom presentations; 28.17% last 4 loom presentations; Wilcoxon test; p < 0.0001; Figure 2G), suggesting that, in our paradigm, the cardiac startle reflex habituates.Because TCAs are also observed during cardiac reversal (Figures 2A, point arrow, and S2F),, we asked whether these events were associated during looms. We found that the frequency of TCAs associated with cardiac reversal (see example in Figure 2E, top) were higher than that without cardiac reversal (see example in Figure S2G; Mann-Whitney U test; p = 0.0001; Figure S2H). Still, in both cases, the frequency of TCAs was higher during than in between looms (Mann-Whitney U test; p < 0.0001 both groups; Figure S2H), indicating that looms trigger TCA independently of its coupling with cardiac reversal.Altogether, these results demonstrate that threat leads to an instantaneous cardiac response in the fruit fly, a TCA, consistent with a startle response, supporting the existence of an autonomic-like reflexive central control of cardiac activity in Drosophila that enables quick adaptation to external stimuli.
Heart rate decelerates during freezing and accelerates during running
We have shown that looms trigger TCAs. However, whether threat exposure leads to long-lasting, behavior-specific, cardiac modulation in invertebrates remains unanswered. Thus, we investigated whether the heart rate is modulated during long-lasting freezing and fleeing defensive responses.As mentioned above, backward and forward pumping bouts have different beating rates (Figures 2B and 2C)., Thus, we concatenated all backward or forward bouts separately and performed SFF during baseline and stimulation periods for each freezer and runner fly. The distribution of backward beating frequencies revealed small, not statistically significant differences between baseline and stimulation periods for both freezer and runner flies (Figures 3A–3C). These small differences were, however, in opposite directions. Therefore, we compared the change, relative to baseline, in the distribution of backward beating frequencies (stimulation − baseline) across freezers, runners, and control flies (Figure 3D). We found that, relative to control flies, freezers increased the prevalence of lower frequencies (around 4 Hz; Kolmogórov-Smirnov test [K-S]; p = 0.0002). Conversely, runners increased the prevalence of higher frequencies (around 7.5 Hz; K-S test; p < 0.0001). Furthermore, a within-animal comparison revealed a decrease in the peak backward heart rate during stimulation in freezers and an increase in runner, mixed-response, and control flies (Wilcoxon test; p < 0.0001, p = 0.002, p = 0.002, and p = 0.0006, respectively; Figure 3F). No differences between freezer, runner, mixed-response, and control animals in the peak rate of backward beating before stimulation were found (one-way ANOVA; p = 0.72; Figure 3E). Unfortunately, the peak heart rate during forward bouts was too variable within individuals (Figure 2D) to allow the observation of reliable changes in heart rate during forward pumping mode (Figure S3A).
Figure 3
Backward heart rate is regulated in opposite directions while freezing and fleeing
(A–C) Average power spectral density of backward heart rate (±SEM) of control flies (A), freezers (B), and runners (C).
(D) Change in the average power spectral density of backward heart rate (±SEM; stimulation − baseline).
(E) Baseline peak backward heart rate per individual fly.
(F) Change in the peak backward heart rate per fly (stimulation − baseline).
See also Figure S3.
Backward heart rate is regulated in opposite directions while freezing and fleeing(A–C) Average power spectral density of backward heart rate (±SEM) of control flies (A), freezers (B), and runners (C).(D) Change in the average power spectral density of backward heart rate (±SEM; stimulation − baseline).(E) Baseline peak backward heart rate per individual fly.(F) Change in the peak backward heart rate per fly (stimulation − baseline).See also Figure S3.These results show that flies adjust their heart rate during defensive behaviors. While pumping in the backward direction, flies showed bradycardia when freezing and tachycardia when fleeing. The increase in backward rate in control flies may reflect the weak but reliable increase in walking speed of these flies upon stimulation (Figures 1E and 1F).
Cardiac reversal rate decelerates during freezing and accelerates during running
The effects of diverse external and internal stimuli on cardiac reversal have been studied in insects., However, its modulation upon threat remains untested. Next, we examined the effect of looms on cardiac reversal of freezer and runner flies, which show long bouts of freezing and running, respectively. We performed FFT on cardiac reversal signals (Figures 4A and 4B; see also Figure S2A) during the baseline and stimulation periods focusing on bouts of freezing or running longer than 10 s. To detect habituation or sensitization, we analyzed reversal rate at early or late phases of the stimulation period. Noticeably, freezing was accompanied by a decrease in cardiac reversal rate that was more evident for late freezing bouts when compared to baseline (K-S test; p < 0.0001; Figure 4C). In contrast, the reversal rate increased during fleeing bouts compared to baseline (K-S test; p < 0.0001; Figure 4E). In this case the increase was equivalent for early and late running bouts (K-S test; p = 0.91; Figure 4E). Interestingly, even before loom presentations, freezers and runners showed a different distribution of cardiac reversal rate (K-S test; p = 0.038; Figure S4A). Freezers showed slower and more variable peak reversal rates (Mann-Whitney U test; p = 0.009 and p = 0.0009; Figures S4B and S4C).
Figure 4
Reversal rate is downregulated during freezing and upregulated during fleeing
(A and B) Representative traces showing walking speed (above) aligned to cardiac reversal (square wave, below) during baseline (A) and stimulation (B). Vertical dashed lines in (B) represent stimulus onset and offset.
(C) Power spectral density of cardiac reversal rate during baseline, early, and late bouts of freezing for freezers flies.
(D) Density distribution of the length of backward (left) and forward bouts (right) of freezers during spontaneous immobility during the baseline, early, and late periods of freezing during stimulation.
(E and F) Same as (C) and (D) for runners for spontaneous walking during the baseline, early, and late bouts of running during stimulation.
See also Figures S4 and S5.
Reversal rate is downregulated during freezing and upregulated during fleeing(A and B) Representative traces showing walking speed (above) aligned to cardiac reversal (square wave, below) during baseline (A) and stimulation (B). Vertical dashed lines in (B) represent stimulus onset and offset.(C) Power spectral density of cardiac reversal rate during baseline, early, and late bouts of freezing for freezers flies.(D) Density distribution of the length of backward (left) and forward bouts (right) of freezers during spontaneous immobility during the baseline, early, and late periods of freezing during stimulation.(E and F) Same as (C) and (D) for runners for spontaneous walking during the baseline, early, and late bouts of running during stimulation.See also Figures S4 and S5.Because reversal rate directly depends on the length of the forward and backward pumping bouts, we assessed whether the observed changes resulted from a modulation of the length of backward and/or forward bouts. We examined the distribution of bout length for backward and forward pumping during loom-triggered freezing or running in early and late phases of stimulation and compared to those of spontaneous immobility or walking periods in the baseline. In freezers, we observed an increase in the length of forward bouts during early and late freezing responses compared to spontaneous immobility bouts during the baseline, and only during late freezing did they also increase the backward bout length (K-S test; p < 0.0001, all cases; Figure 4D). Such pattern can explain the initial and late decrease in reversal rate observed in the stimulation period (Figure 4C). In contrast, runners showed shorter backward, but not forward, bouts, both for early and late running periods compared to spontaneous walking during the baseline, (K-S test; p < 0.01, all cases; Figure 4F). This may explain the smaller change in reversal rate observed in these animals (Figure 4E). In agreement with the Fourier analysis of reversal rate, we observed differences in the distribution of both backward and forward bout lengths between freezers and runners during baseline (K-S test; p < 0.0001, both cases; Figures S4D and S4E), variability in the length of backward and forward bouts being higher for freezers than runners (Mann-Whitney U test; p < 0.0001 and p = 0.0003; Figure S4F).For a within-animal analysis, we took the median bout length of backward and forward pumping modes during either freezing, by freezers, or running, by runners, and compared it to the median bout length during spontaneous immobility or walking during baseline period. Again, we found that freezers increase the length of both backward and forward bouts during freezing (Mann-Whitney U test; p = 0.006 and p < 0.0001, respectively; Figure S5A) while runners specifically decreased median backward bout length during running (Mann-Whitney U test; p = 0.01 and p = 0.66; Figure S5B). Importantly, no changes were observed in the length of bouts in control flies (K-S test; p = 0.949 and p = 0.152, respectively; Figures S5C and S5D). These results show that freezing and running are paralleled by the regulation of cardiac reversal in opposite directions: a deceleration of cardiac reversal reflected in increased length of both backward and forward bouts for freezers, and an acceleration of cardiac reversal reflected in decreased length of backward bouts for runners.The observed differences in cardiac modulation between freezers and runners may either reflect a trait or instead relate to the behavior expressed. To disambiguate between the two possibilities, we asked whether an individual could flexibly change its cardiac reversal during freezing and fleeing responses. We focused on mixed-response flies that both run and freeze in response to looms and freezers that mostly freeze but showed enough periods of running to perform this analysis. Individuals from both groups increased the length of bouts while freezing and decreased it while fleeing (Figures 5A–5D). This effect was more pronounced in freezers than mixed-response flies, possibly because freezers showed longer freezing bouts, which is when more pronounced changes are observed.
Figure 5
Reversal rate is flexibly modulated during freezing and fleeing
(A) Density distribution of the length of backward (left) and forward bouts (right) of freezers during baseline and freezing and running bouts during stimulation.
(B) Change in the median length of backward and forward bouts per animal (freezing or running − baseline) for freezer flies.
(C and D) Same as (A) and (B) for mixed-response flies.
Reversal rate is flexibly modulated during freezing and fleeing(A) Density distribution of the length of backward (left) and forward bouts (right) of freezers during baseline and freezing and running bouts during stimulation.(B) Change in the median length of backward and forward bouts per animal (freezing or running − baseline) for freezer flies.(C and D) Same as (A) and (B) for mixed-response flies.In sum, fruit flies flexibly regulate reversal rate upon threat in a behavior-specific manner, because a single fly is bradycardic while freezing and tachycardic while running. Although, in vertebrates, it is well known that threat-induced freezing is accompanied by bradycardia, whether it constitutes a generic feature of cardiac activity accompanying any form of immobility remained unanswered. Our findings clearly demonstrate that freezing is a different physiological state from spontaneous immobility.
Freezing leads to a forward pumping prevalence and sugar mobilization
We have shown that flies independently modulate backward and forward bout length during threat stimulation. During freezing, the increase in forward bout length is higher than that for backward bouts (mean increase in forward bout length was 1.03 ± 0.09 versus 0.27 ± 0.07 s for backward bouts; Wilcoxon test; p < 0.0001; Figures 5B and 5D), while during running, flies only decreased the length of backward bouts (Figures 4F, 5A, and 5C). Hence, the total time in backward mode seems to decrease upon threat. Indeed, before stimulation, the heart pumped on average 55.60% ± 0.93% of the time in backward mode, while during exposure to looms, the backward mode corresponded to 46.77% ± 2.01% of the time in freezers, 51.59% ± 1.49% in runners, and 48.73% ± 2.76% in mixed response. During stimulation, control flies pumped in backward mode 56.84% ± 1.62% (mean ± SEM). All freezers, runners, and mixed-response animals, but not control flies, decreased the total time in backward mode (Wilcoxon test; p < 0.0001, p = 0.02, p = 0.005, and p = 0.09, respectively; Figure 6A) upon threat. No differences in the proportion of time pumping in backward mode during baseline were observed between groups (one-way ANOVA; p = 0.57; Figure S6A).
Figure 6
Favored forward mode and energy mobilization during freezing
(A) Change in total time in backward mode (stimulation − baseline) for control, freezer, runner, and mixed-response flies.
(B) Percent time in backward mode per period of immobility during baseline (gray) or stimulation in controls (black), freezers (purple), runners (orange), and mixed-response flies (brown).
(C and D) Glucose (C) and trehalose (D) concentration in the hemolymph (thorax or abdomen) from control (gray; n = 7 replicates, 10 flies each) and loomed flies (red; n = 8, 10 flies each).
(E) Schematic of the starvation setup.
(F) Resistance to starvation of flies after 15 min of stimulation (98 control flies and 98 loom-exposed flies).
See also Figure S6.
Favored forward mode and energy mobilization during freezing(A) Change in total time in backward mode (stimulation − baseline) for control, freezer, runner, and mixed-response flies.(B) Percent time in backward mode per period of immobility during baseline (gray) or stimulation in controls (black), freezers (purple), runners (orange), and mixed-response flies (brown).(C and D) Glucose (C) and trehalose (D) concentration in the hemolymph (thorax or abdomen) from control (gray; n = 7 replicates, 10 flies each) and loomed flies (red; n = 8, 10 flies each).(E) Schematic of the starvation setup.(F) Resistance to starvation of flies after 15 min of stimulation (98 control flies and 98 loom-exposed flies).See also Figure S6.We observed a stronger decrease in the percent time in backward mode in freezers, which could arise from a bigger behavioral change from mostly walking during the baseline to mostly freezing during the stimulation period. Alternatively, this reflects a trait of freezers that generally show a stronger modulation of cardiac function. To address this issue, we determined the percent time in backward mode exclusively during bouts of immobility and walking during baseline or during stimulation. We found that both freezers and runners, while freezing, decreased the total time in backward mode even when compared with spontaneous immobility during baseline (Mann-Whitney U test; p < 0.0001 and p = 0.03; Figure 6B). In mixed-response flies, the small decrease in total time pumping backward (53.90% ± 2.95%, mean ± SEM, of the time during spontaneous immobility and 48.14% ± 1.11%, mean ± SEM, during freezing) was not significant, possibly a result of higher variability in the time pumping backward during spontaneous immobility and/or a weaker modulation of cardiac activity upon threat in these flies. Control flies showed no decrease during immobility bouts in the stimulation period (Mann-Whitney U test; p = 0.49; Figure 6B). Similarly, while running, all loom-exposed flies, but not control ones, decreased the proportion of time in backward mode, compared with walking bouts during the baseline (Figure S6B). These findings show that flies reduce backward pumping, thus favoring forward mode, during both freezing and running and underscore that freezing corresponds to a different internal state from that found during spontaneous immobility.We hypothesized that an increase in forward mode might reflect an increased flux of nutrients from the fat body, the fly’s main energy store located in the abdomen, to the head and thorax. Because energy mobilization while running is widely accepted, we studied metabolic changes during freezing, which, to our knowledge, has not been addressed before in any species.We focused on circulating carbohydrates, namely glucose and trehalose, crucial metabolites of insects. We measured these sugars in the hemolymph from abdomens and thorax-head of flies, separately, after prolonged freezing and compared to control flies. To maximize loom-triggered freezing behavior, we used CS flies, which are more sensitive to looms (STAR Methods), and tested them in small arenas (unpublished experiments in the lab showed that flies freeze more in small arenas). We exposed flies to 60 looms or control stimuli for 15 min. Loom-exposed animals froze 96.53% ± 3.53% (mean ± SEM) of the time during the stimulation period while control flies showed 36.6% ± 0.78% of freezing (Figures S6C–S6F). We found that glucose and trehalose levels were decreased in thorax-head in loom-exposed flies compared to control flies (Mann-Whitney U test; p = 0.0007 and p = 0.02; Figures 6C and 6D). In abdomens, we found no significant difference in glucose levels between groups (Mann-Whitney U test; p = 0.21) and a trend decrease in trehalose levels in loom-exposed flies (Mann-Whitney U test; p = 0.07; Figures 6C and 6D).These findings show that loom-exposed flies reduce circulating sugar levels. Although a decrease in trehalose suggests an increase in energy consumption, a decrease in glucose could result from either an increase in energy consumption or an increase in energy stores through glycogen biosynthesis that uses glucose. Because energy consumption directly impacts starvation resistance, next, we tested whether this was altered in flies after prolonged freezing. We exposed flies in enclosed small arenas to 60 looms or control stimuli over 15 min (loom-exposed flies froze the entire time; Figures S6C–S6F) and then recorded their activity during the next 4 days. To ensure access to water, agar 1%, covering the arenas’ bottom, was maintained moist (STAR Methods; Figure 6E). We analyzed the fly’s movement and annotated their death when no pixel change was observed for 1 h and until the end of the experiment. Loom-exposed flies were less resistant to starvation than control exposed flies (log rank test, p = 0.02; hazard ratio = 1.47; 95% confidence interval [CI] = 1.054–2.04; Figure 6F). Next, we tested the impact of a shorter period of stimulation, exposing flies to 20 looms or control stimuli, over 5 min. We found that flies freezing for 5 min were also less resistant to starvation (Figure S2F).Together, these results show that both an increase in forward pumping and energy expenditure accompany freezing, demonstrating that freezing is costly, as it renders flies less resistant to subsequent starvation, likely due to an increase in sugar mobilization and consumption. Future experiments are required to establish whether these physiological changes are causally linked. Our data, although consistent with the view of freezing behavior as a form of preparatory state that ensures detection avoidance, do not support the view of freezing as an energy-sparing state.
Reversal rate and reversal rate variability predict threat-induced freezing
Having shown that cardiac reversal regulation is a physiological feature of defensive behaviors in Drosophila and that the pattern of reversal is different even in resting conditions for freezers and runners, we asked whether cardiac activity predicts the behavioral response to threat. Cardiac reversal during baseline is slower and more variable in freezers than runners (Mann-Whitney U test; p = 0.009 and p = 0.0009; Figures S4B and S4C). Because these are independent variables (Pearson = 0.01; p = 0.92; Figure S7A), we used them to model the time flies spent freezing using ordinary least squares (OLS). We found that our model explained 29.2% of the variance in time spent freezing (F-stat < 0.0001; Figure 7A).
Figure 7
Cardiac reversal rate and variability predict freezing response
(A) 3D scatterplot showing the total time freezing, peak cardiac reversal rate, and variability for the 63 loom-exposed flies.
(B–D) Scatterplot showing baseline average walking speed and total time freezing (B), reversal rate (C), and reversal rate variability (D) for each loom-exposed fly. Least-squares regression lines are shown in gray. Pcoef shows Pearson coefficient.
See also Figure S7.
Cardiac reversal rate and variability predict freezing response(A) 3D scatterplot showing the total time freezing, peak cardiac reversal rate, and variability for the 63 loom-exposed flies.(B–D) Scatterplot showing baseline average walking speed and total time freezing (B), reversal rate (C), and reversal rate variability (D) for each loom-exposed fly. Least-squares regression lines are shown in gray. Pcoef shows Pearson coefficient.See also Figure S7.These results demonstrate that cardiac activity in flies partially predicts the defensive response upon looms. However, baseline differences in cardiac reversal between freezers and runners might reflect differences in behavior before stimulation. In our experimental conditions, both walking speed and total time spent walking during the baseline period correlated with total time freezing upon loom stimulation (Pcoef = −0.41, p = 0.0005 and Pcoef = −0.37, p = 0.02, respectively; Figures 7B and S7B). Because walking speed and time spent walking were correlated (Pcoef = 0.46; p < 0.0001; Figure S7C), henceforth, we will use walking speed as a variable to measure locomotor activity of the fly during baseline. We found that walking speed is correlated with baseline peak cardiac reversal rate (Pearson = 0.39; p = 0.001; Figure 7C), but not with reversal rate variability (Pearson = −0.12; p = 0.33; Figure 7D), suggesting that cardiac reversal rate is dependent on ongoing behavior. Whether the relevant predictor of time spent freezing is cardiac reversal rate or walking speed during the baseline remains unclear. Indeed, when we tested walking speed, instead of cardiac reversal rate, together with cardiac reversal variability as predictors of time spent freezing using OLS, we found that, once more, they explained 32.4% of the variance between animals (F-stat < 0.0001; Figure S7D).These results reveal two independent features of cardiac reversal, rate and rate variability, as predictors of future levels of loom-triggered freezing. We show that reversal variability is independent of ongoing locomotor activity, possibly reflecting a trait of the animal that will impact the defensive response.
Discussion
Functional role of freezing-coupled bradycardia
This study demonstrates that D. melanogaster regulates its cardiac activity upon threat. Although homologous human and fly genes are implicated in cardiomyocyte specification, the functional architecture and neuronal control of the fly’s heart is likely analogous to the chambered heart of humans. Still, the fruit fly downregulates cardiac output (heart rate and cardiac reversal rate) when freezing and upregulates it when fleeing, just like vertebrates do. Further, it has been demonstrated in other insects32, 33, 34 that cardiac reversal leads to changes in tracheal ventilation; the latter might also accelerate during fleeing and decelerate during freezing.Several hypotheses attempt to explain the characteristic bradycardia accompanying freezing. The motivational approach proposes that cardiac deceleration during freezing meets the need for decreased energy consumption as part of the preparation for future action. Indeed, in frugivorous bats, bradycardia while resting allows the reduction of daily energy used. The cognitive model proposes that cardiac deceleration helps the brain increase sensory processing. A third hypothesis proposes that bradycardia was inherited from our vertebrate aquatic ancestors that show bradycardia in the context of threat-induced diving responses, where lowering oxygen consumption is crucial. Concordantly, all terrestrial vertebrates show a diving bradycardic response, protective against hypoxia. Our findings demonstrate that sustained cardiac deceleration during freezing is already present in invertebrates and suggests that its adaptive value is not necessarily related to a decrease in metabolic requirements. We show that, despite the observed bradycardia during freezing, it is a costly behavioral state. Whether freezing is energetically costly in vertebrates remains to be tested. It is possible that bradycardia upon threat is energy sparing in vertebrates, serving a different function in invertebrates. Alternatively, bradycardia may serve different purposes in different contexts, e.g., during rest, it may contribute to energy sparing, as seen in the fruit bats, but upon threat contribute to sensory processing as the cognitive theory proposes.
Flexible control of cardiac activity
In vertebrates, the ANS mediates the coupling between cardiac activity and defensive behaviors. Flight-or-fight responses are associated with stronger sympathetic activity leading to tachycardia4, 5, 6 and freezing to parasympathetically mediated bradycardia.,, It has been argued that the basic functions of the ANS, absent in invertebrates, may have emerged very early in metazoan evolution, and that a similar cardiac regulation is also present in highly evolved invertebrates. The fruit fly’s heart is innervated at least by two neuronal populations: the transverse nerves and the bipolar neurons that may act as two independent pacemakers, regulating heart rate and cardiac reversal., In line with this, our findings reveal independent regulation of backward and forward bout length during defensive responses. Furthermore, we show that, upon threat, flies quickly regulate their cardiac activity, supporting the idea of an autonomic-like control of cardiac activity. Further studies are needed to assess the existence of neuronal control of cardiac activity during defensive behaviors. An interesting possibility to be explored is that the same descending neurons involved in triggering freezing, DNp9 neurons, control cardiac responses to threat. These neurons project throughout the ventral nerve chord, including the abdominal segment, which contains neurons that innervate the fly’s viscera.
Cardiac activity as modulator of freezing
This study adds to the wealth of external and internal factors regulating freezing,,,44, 45, 46, 47, 48 by showing that two features of cardiac activity measured before threat, reversal rate and reversal rate variability, partially predict the amount of threat-induced freezing. Furthermore, reversal rate correlated with ongoing locomotor activity, widely used as a proxy for arousal in all taxa, including flies, suggesting that it might be an additional measure of physiological arousal. Further studies on the relationship between reversal rate, locomotion, and arousing stimuli will be instrumental for our understanding of insect physiological arousal and its relevance to behavior.In contrast, we found no correlation between reversal rate variability and the ongoing locomotor behavior before stimulation. Whether cardiac variability reflects a transient internal state of the animal or a persistent individual trait remains to be established. Interestingly, heart rate and heart rate variability are used in humans as proxies for the status of the parasympathetic and sympathetic nervous system and as predictors of health and emotional responses., To definitively establish cardiac activity as a modulator of defensive behaviors, a mechanistic understanding of cardiac regulation is required.
Resume
This study reveals fast, flexible, and behavior-dependent changes in cardiac activity in the fruit fly. It shows that threat-induced freezing corresponds to a costly internal state distinct from spontaneous immobility, establishing that energy sparing and inheritance from aquatic vertebrates are unlikely explanations for bradycardia during freezing, favoring a role in sensory processing. Indeed, recent studies show that the human brain processes information regarding cardiac function, which affects sensory information processing and memory.52, 53, 54 This work establishes the fruit fly as a model well suited to mechanistic, functional, and comparative studies on the regulation of cardiac physiology and its contribution to behavior.
STAR★Methods
Key resources table
Resource availability
Lead contact
Further information and requests should be directed to the Lead Contact, Marta Moita (m.moita@neuro.fchampalimaud.org).
Materials availability
This study did not generate new unique reagents.
Experimental model and subject details
Fly lines and husbandry
To image cardiac activity, we used 1-2 days old mated females fruit flies (Drosophila melanogaster). The following stock was used: yw-; tinCGal4, UAS-nls-dsRed/CyO. tinCGal4 gift from Manfred Frasch, UAS-nls-dsRed (Bloomington Drosophila Stock Center, #8546). The partial rescue of white gene in these flies make them less sensitive to looming so they showed both fleeing and freezing defensive behaviors when tethered. Flies were reared on standard food at 25°C and 70% humidity in a 12 h-12 h dark:light cycle. For aging, 20 females and 5 males were transferred to a fresh vial for 24 h. In total, 32 flies were dots (control) exposed and 84 were exposed to looming. At least 20% flies were discarded without being exposed to visual stimulation due to a low fluorescence signal from cardiomyocytes.For starvation resistance and sugar measurements experiments 10 to 11 days-old mated CantonS males were raised at 25°C and 70% humidity in a 12 h-12 h dark:light cycle. For aging, 15 females and 15 males were transferred to a fresh vial every 72 h. In total, we used 98 control flies and 98 looming exposed flies for starvation resistance experiments and 20 control flies and 30 looming exposed for sugar measurements.
Method details
Handling of flies
Tethering procedure
Flies were briefly cold anesthetized and glued to a coverslip using Norland Optical adhesive #61 cured with a 365 nm UV lamp (UVP) for 30 s. Each fly was given 10 min to recover before starting an experiment. In total, 35 flies were dots (control) exposed and 80 were loomed. From those only 27 and 63 flies respectively were analyzed All behavioral experiments were performed in the 8 hours period after light onset.
Testing arenas
Flies were cold anesthetized for 10 min before being placed into the arenas. Before starting the experiment, flies were given 15 min to recover. In total, 49 control and 49 looming exposed flies were used per starvation resistance experiment. All experiments were performed in the 8 hours period after light onset.
Visual stimulation
After a 5 minutes baseline period, experimental and control animals received 20 (heart imaging set-up) or 60 (testing arenas) stimuli presentations with an ISI ± 20 s.All visual stimuli in the heart imaging set-up were generated as described in Zacarias et al. in custom python scripts using PsychoPy. To generate a looming effect, a black circle increased in size on a blue background. The visual angle of the expanding circle was determined by the equation: θ(t) = 2tan−1 (l / vt) (Equation 1), where l is half of the length of the object and v the speed of the object toward the fly. The virtual object length was 1 cm and the speed was 25 cm s−1 (l / v value of 40 ms). Each looming presentation lasted for 500 ms. The object expanded for 450 ms until it reached maximum size of 78° where it remained for 50 ms before disappearing. Synchronous with expansion, the looming stimulus produced a considerable decrease in luminance within the behavioral apparatus. We measured luminance using a digital lux meter (DX-100, INS instrumentation). When no stimulus was being presented (blue screen) the luminance at the stage was 260 lux. Just before looming offset, when the disk reached its maximum size, luminance was 32 lux, representing an 88% decrease. To control for these changes, we created a stimulus where an array of approximately 5° dots was added each frame in random positions as not to create an expanding pattern. The size and number of dots was determined empirically to generate a similar decrease in luminance as the looming stimulus (35 lux, 86.5% decrease).For stimulation in enclosed arenas, similar visual stimuli were generated using a custom Bonsai workflow.
Behavioral apparatus
Semi-restrained flies
Cardiac activity was imaged from semi-restrained flies using a Hamamatsu C11440 camera (ORCA-flash4.0LT) and a 10X/0.30w objective (Olympus). Excitation light was provided by a 530 nm mounted LED from Thorlabs and a T-cube LED drive from Thorlabs was set at 0.5 A to keep constant illumination intensity. A small porexpam ball (4.3 mm diameter) was held by a custom-made holder (the funnel section of a glass Pasteur pipette) underneath the fly at a distance that allowed the fly to catch the ball. The ball could be freely moved by the fly and if released, the fly could catch the ball again. Visual stimuli were presented on a 24-inch monitor (ASUS VG248QE) with a 144 Hz refresh rate and tilted at 45 degrees over the imaging stage. To visualize the presentation of stimuli in the recorded video, we used a programmable microcontroller (Arduino Mega 2000) to trigger the illumination of a custom-made red LED synchronized with the stimulus presentation. To image the fly’s movement, an infrared (850 nm) LED was placed laterally to illuminate the fly. Fly behavior and ball movement was recorded using a USB3 video camera (Flea3 1.3 MP Mono USB3 Vision, Point Grey, Richmond, Canada) with a 700 nm long pass filter placed 40 cm away from the imaging stage. The entire rig was placed inside a light-tight black enclosure.Two identical behavioral apparatus were used in parallel for looming and control stimulation of flies. Each setup had a stimulation monitor (Asus ROG Strix XG258Q, 24.5”) tilted at 45° over the stage running at 240 Hz refresh rate. Testing arenas were composed of 50 small circular arenas (16 mm in diameter) that were cut in white acrylic 4 mm thick plates. For the starvation resistance assay, the small arenas were filled with agar 1%, leaving 4 mm for the fly to move. To prevent flies from escaping and allow air exchange and video acquisition the plates were covered with nylon socks. For sugar measurement experiments and scoring of freezing behavior, the arenas were made of one acrylic plate (such that each arena was 4 mm high) on top of a 3 mm thick, white opalino sheet that allowed diffuse light through. The plate was covered with a transparent acrylic sheet for maximum resolution of the fly movement throughout the stimulation session. To increase the resolution of the image for subsequent behavior quantification only 15 flies were recorded. We used a USB3 camera (FLIR Blackfly S, Mono, 1.3MP) at 60 Hz with a 730 nm long pass filter (Lee Filters, Polyester 87 Infrared). The stage plates were backlit by an infrared (940 nm) LED array developed by the Scientific Hardware Platform at the Champalimaud Centre for the Unknown. The entire rig was kept at 25°C and 70% humidity.
Starvation resistance
Immediately after stimulation (20 or 60 looming or control stimuli, over the course of 5 or 15 min, respectively) the two stage plates were placed in a transparent container with water, ensuring that the agar is moist until the end of the experiment. The container was backlit by a custom-built infrared (940 nm) LED array, and a camera (the same as in the stimulation setup) recorded both stage plates at 6 Hz. The entire rig was kept at 25°C and 70% humidity in a 12 h-12 h dark-light cycle until the last fly died.
Video acquisition
Heart videos of the second and third abdominal segments, width 180 x height 556 pixels, were recorded using HC Image Live Software at 30 Hz obtaining a standard 8bit RGB tiff file as the signal.Fly videos were acquired using Bonsai at 60 Hz and width 1104 x height 1040 resolution. In starvation resistance experiments we used a custom-built Bonsai workflow for video acquisition at 1 Hz.
Glucose and trehalose assays
Immediately after visual stimulation, plates with 50 flies in independent small arenas were placed on dry ice. After 1 hour, flies were cut under the stereoscope using a pair of micro-scissors. We collected 10 thorax-heads or abdomens per sample. Samples were rinsed twice with cold PBS and 10 thorax-heads or abdomens were homogenized in 100 μl of cold PBS. We spun down samples for 1 min at 5000 rpm at 4°C. After keeping aside 15 μl for the protein assay (Pierce BCA protein Assay Kit, #10678484, Fisher Scientific), the supernatant was heated for 5 min at 70°C. Next, we spun down for 3 min at 13.000 rpm at 4°C and the supernatants were frozen at −80°C. The next day, we performed glucose assays on the supernatant using a Glucose (GO) assay kit from Sigma (GAGO-20). Samples were diluted 1/3 in PBS and absorbance was measured in a plate reader (BMG Labtech, SpectroStar Nano) at 540 nm. For the trehalose assays we diluted samples 1/10 in Trehalase buffer (5mM Tris, 137mM NaCl, 2.7mM KCl – pH corrected to pH 6.6) and incubated overnight at 37°C with trehalase (#T0167, Sigma). Samples were spun down for 3 min at maximum speed and absorbance measured a plate reader (BMG Labtech, SpectroStar Nano) at 540 nm. In addition, we measure protein levels in each sample to normalize the amount of glucose and trehalose. For protein assays samples were diluted ½ in PBS and absorbance measure a plate reader (BMG Labtech, SpectroStar Nano) at 562 nm. 7 and 8 samples were measured for control and looming exposed animals, respectively, in each assay.
Quantification and statistical analysis
Video tracking
We extracted two main features from the fly videos using Bonsai: ball movement and fly motion. Walking speed was extracted from the displacement in 3 dimensions of feature points in the surface of the ball. Fly motion was quantified by the number of pixels active in a 162x117 pixel region of interest surrounding the fly (ROI, see supplementary 1). A minimum change of 18 intensity levels from one frame to the next was required for a single pixel to be considered active.From the heart videos we tracked the nuclei of two cardiomyocytes using Bonsai. The distance between nuclei was measured using Fiji/ImageJ, resulting to be in average 490.04 μm ± 7.51 (mean ± s.e.m.; n = 38). The displacement (in pixels) perpendicular to the heart axis was represented by the x coordinate in a ROI surrounding the nucleus.We used a custom-built Bonsai workflow to extract to main features of the fly: centroid position and pixel change in a 72 × 72 pixels ROI around the fly.We used a custom-built Bonsai workflow to quantify pixel change inside each arena. A pixel was scored to be active if it recorded a change higher than 5 values of intensity from the previous frame.
Data analysis from semi-restrained flies
Data were analyzed using custom scripts in Python 2.
Behavioral classifiers
To classify behavioral states, walking speed and fly movement data were averaged over a 83.3 ms (5 frames) moving window to smooth out short-term fluctuations. Walking speed was determined from data extracted from the ball movement, using the following formula: . The threshold for classifying not walking periods was determined by manual annotation. Non-walking periods were classified as periods longer than 2.5 s with a walking speed lower than 0.5 pixels/frame. Fly activity was extracted from pixel change data. The threshold for classifying not moving periods was determined by manual annotation. Immobility/freezing was classified as periods longer than 2.5 s periods with a pixel change lower than 5 pixels/frame within the ROI.
Backward/Forward modes
We regularized datasets of the displacement of the nuclei of cardiomyocytes by subtracting the mean and dividing by the standard deviation. The heart signal was up-sampled to 60 Hz using linear interpolation to reach the same sampling that we had from fly videos. We determined backward bouts by peak to peak and valley to valley comparison between the anterior and posterior nucleus traces. A contraction was classified as backward pumping only if an anterior cell peak/valley happened either at the same time or followed by a posterior cell peak in the next 7 frames. If two backward contractions were separated by more than 18 frames we treated them as two different bouts, and we classified as a forward bout the contractions in between. Only bouts of more than 3 backward contractions were included. We assumed that the intervals between two backward bouts were forward bouts. We selected 90 flies from 116 flies recorded to perform the analysis. 26 flies were discarded because distance between nuclei was either too big or too little and comparison of peaks from anterior and posterior cell did not give a good differentiation of backward and forward bouts.
Cardiac arrest
A transient cardiac arrest was classified as a sudden decrease in cardiac rate between two consecutive frames above 0.7 Hz. Transient cardiac arrest was associated with looming when it was found in a 666.6 ms window including each looming. To determine the frequency of transient cardiac arrests outside looming presentation, we performed a randomization test (with 1000 shuffles with 20 random points per animal) during baseline or stimulation period excluding looming windows.
Cardiac reversal
Cardiac reversal frequency was determined by performing a Fast Fourier Transform on the square waves obtained from the analysis of backward and forward bouts. The minimum value was assigned to backward pumping and the maximum value to forward pumping. For analysis of cardiac reversal frequency during different behaviors, we concatenated the square waves for periods longer than 10 s in which the animal was showing a specific behavior. Fast Fourier Transform was performed on the square trace resulting from each behavior including all animals. To analyze early and late phases of freezing, we included the first and last third of freezing bouts, respectively.For analysis of length of backward and forward bouts during immobility/freezing, only bouts in which the average pixel change was less or equal to 5 were included. Backward and forward bouts in which the average pixel change was above 5 were included as moving periods (walking/running).
Data analysis from testing arenas
Data were analyzed using custom scripts on Python 3. Using the centroid position, a fly was considered to be walking if its speed was higher than 4 mm/s and lower than 75 mm/s. Freezing was classified as the absence of pixel change for periods longer than half a second.
Data analysis of starvation resistance
Data were analyzed using custom scripts on Python 3. Using an hour length step, a fly was considered to be dead if during the last hour less than 3 minutes of motion was recorded. Survival curves were analyzed using Graphpad Prism 8.4.0.
Data analysis from glucose/trehalose assays
Data were analyzed using custom scripts on Python 2.
Statistics
Prior to statistical testing, the data were tested for normality with a Shapiro-Wilk test and the appropriate non-parametric test was chosen if the data were not normally distributed. All statistical tests are specified in the results section of the text or figure captions and are two-sided. To test whether two samples are drawn from the same distribution we computed a Kolmogorov-Smirnov statistic. Probabilities were compared using the χ2 contingency test. Linear regression algorithm was calculated using a simple ordinary least-squares model in Python. Survival curves were compared using Log-rank (Mantel-Cox) test. We use sequential Bonferroni correction when multiple comparisons were done to control the familywise error rate.
Authors: Jaime Vila; Pedro Guerra; Miguel Angel Muñoz; Cynthia Vico; Maria Isabel Viedma-del Jesús; Luís Carlos Delgado; Pandelis Perakakis; Elisabeth Kley; José Luís Mata; Sonia Rodríguez Journal: Int J Psychophysiol Date: 2007-07-14 Impact factor: 2.997
Authors: William T Gibson; Carlos R Gonzalez; Conchi Fernandez; Lakshminarayanan Ramasamy; Tanya Tabachnik; Rebecca R Du; Panna D Felsen; Michael R Maire; Pietro Perona; David J Anderson Journal: Curr Biol Date: 2015-05-14 Impact factor: 10.834
Authors: Dilip Verma; James Wood; Gilliard Lach; Herbert Herzog; Guenther Sperk; Ramon Tasan Journal: Neuropsychopharmacology Date: 2015-06-11 Impact factor: 7.853
Authors: Tim Lebestky; Jung-Sook C Chang; Heiko Dankert; Lihi Zelnik; Young-Cho Kim; Kyung-An Han; Fred W Wolf; Pietro Perona; David J Anderson Journal: Neuron Date: 2009-11-25 Impact factor: 17.173