Speed dependent descending control of innate freezing behavior in Drosophila melanogaster

Summary The most fundamental choice an animal has to make when it detects a predator, or other threats, is whether to freeze, reducing its chances of being noticed, or to flee to safety. Here we show that Drosophila melanogaster exposed to looming stimuli in a confined arena either froze or fled. The probability of freezing versus fleeing was modulated by the fly’s walking speed at the time of threat, demonstrating that freeze/flee decisions were context dependent. We describe a pair of descending neurons crucially implicated in freezing. Genetic silencing of P9 descending neurons disrupted freezing yet did not prevent fleeing. Optogenetic activation of both P9 neurons induced running and freezing in a state-dependent manner. Our findings establish walking speed as a key factor in defensive response choices and reveal a pair of descending neurons as a critical component in the circuitry mediating selection and execution of freezing or fleeing behaviors.


Introduction 25
Animals rely on similar kinds of cues to detect a predator's rapid approach such as visual 26 looming stimuli (Card, 2012;Carr, 2015;Pereira and Moita, 2016). Although great progress has been made in the study of threat detection mechanisms, much less is known regarding when and how different 28 defensive behaviors are performed. Animals deploy several defensive strategies, grossly categorized 29 into flight, freeze and fight, the display of which is modulated by external factors, such as the presence 30 of offspring or existence of escape, and the animal's internal state (Blanchard et al., 1986;Giaquinto 31 and Volpato, 2001;Llaneza and Frye, 2009;Montgomerie and Weatherhead, 1988;de OCA et al., 32 2007a;Rickenbacher et al., 2017;Vale et al., 2017;Verma et al., 2016). How each specific defensive 33 response is selected and executed remains unclear. 34 In mammals, mostly from studies using rodents, multiple brain regions have been implicated 35 in the expression of freezing and escape responses including amygdala, hypothalamus and peri-36 aqueductal grey (Amorapanth et al., 2000;Gross and Canteras, 2012;Kim et al., 2013Kim et al., , 1993Kunwar 37 et al., 2015;Silva et al., 2013). More recently, microcircuits within these brain regions regulating the 38 expression of flight or freeze behaviors have been characterized (Fadok et al., 2017;Tovote et al., 2016). 39 Much less is known about the mechanisms of expression of defensive behaviors in other vertebrates. In 40 fish, Mauthner cells, a pair of large neurons in the hindbrain, have been implicated in fast escape 41 responses (review in (Korn and Faber, 2005), whereas other spinal chord projecting neurons are 42 involved in slower escapes (Bhattacharyya et al., 2017). Even though the zebrafish habenula has been 43 shown to down regulate freezing, favoring escape responses, how freezing behavior is produced remains 44 unknown. In invertebrates the mechanisms of escape responses have received more attention. In striking 45 similarity with the zebrafish, fruit flies can exhibit either fast or slower escape responses, the first 46 relying on the giant fibers, a pair large descending neurons and the later on other descending neurons 47 to use large sample sizes allowing for detailed quantitation of behavior. We developed a visual assay to 56 track responses of flies to an expanding shadow mimicking a large object on a collision course -looming 57 stimulus -that triggers defensive behaviors in virtually all visual animals tested, including fruit flies 58 (Card, 2012;Carr, 2015;Pereira and Moita, 2016). Flies were exposed to multiple looming stimuli in 59 an enclosed arena to increase the chances of seeing both escape and freezing responses. In our 60 experimental set-up sustained freezing was the predominant defensive response. When flies did not 61 freeze they displayed escape responses directed away from the looming stimulus. Taking advantage of 62 a close-loop system, which allows the presentation of stimuli dependent on the behavior of flies, we 63 found that the decision to freeze or flee was modulated by the flies' walking speed at the time of threat. 64 Through genetic manipulation of neuronal activity we identified a pair of descending neurons whose 65 activity is required for freezing. Moreover, their ability to drive freezing, through optogenetic activation, 66 depended on the walking speed of flies at the time of stimulation. These results reveal that innate 67 responses to threats can be modulated by the flies' internal state, while identifying an element of the 68 freezing circuit that is modulated by this state. 69 70

71
Flies jumped rarely in response to repeated inescapable looming 72 Figure 1 shows a schematic representation of the experimental setup. We placed single flies in a 73 covered walking arena and gave them 5 minutes to explore. A computer monitor angled above the arena 74 showed a looming stimulus (black circle expanding on a white background) repeated 20 times over a 75 subsequent 5-min period. As a control, we showed a separate group of flies a sequence of randomly 76 appearing black pixels resulting in a similar change in luminance but with no pattern of expansion 77 ( Figure 1B). Notably, flies cannot escape from the arenas. 78 We found that looming stimuli only occasionally triggered escape jumps, or takeoffs (6.4% of 79 looming stimuli, 384/6000), the most studied defensive response in insects (Card andDickinson, 2008a, 80 2008b;Fotowat et al., 2009;Hammond and O'Shea, 2007;Heitler and Burrows, 1977;McKenna et al., 81 1989;von Reyn et al., 2014;Tauber and Camhi, 1995;De Vries and Clandinin, 2012). The number of 82 jumps per fly was significantly higher for looming than control condition (Wilcoxon Rank Sum test Z= 83 14.15, p < 0.0001, Figure 1C) and the large majority of these events occurred within the window of 84 stimulation, before the circle reached its maximum size ( Figure 1D). Still, the efficacy of looming 85 stimuli to elicit jumps was lower in our experimental conditions than that reported previously (Fotowat 86 et al., 2009;De Vries and Clandinin, 2012), where flies were exposed to a single escapable looming 87 stimulus. Furthermore, the probability of jumping decreased over the course of the 20 stimulus 88 presentations ( Figure 1E), suggesting that with multiple presentations flies may have habituated to 89 looming. Alternatively, flies could be adopting other defensive strategies.  Figure 2A). Visual inspection of the videos led to the observation that flies were not just walking 95 slower, they were completely immobile, i.e. freezing, many times sustaining unbalanced postures for 96 long periods of time (movies S1 and S2). In order to quantify freezing, we created an automated 97 classifier based on pixel changes recorded in a region of interest surrounding the fly ( Figure S1). 98 The fraction of flies freezing increased gradually with each looming presentation, arguing 99 against habituation to the looming stimulus ( Figure 2B). By the end of the experiment, 70% of flies 100 were freezing compared to 12% for the control stimulus (Chi-squared test, X 2 =208.599, p<0.0001, 101 Figure 2B). Interestingly, there was a sharp decrease in freezing during stimulus presentation. Further 102 examination showed that freezing flies displayed startle responses during looms, but quickly returned one minute with many flies freezing up to 5 minutes ( Figure 2F). These long periods of time spent 112 freezing are in sharp contrast with previous studies, which have only reported short-lived, occasional 113 freezing in Drosophila (Card and Dickinson, 2008b;Gibson et al., 2015;Zabala et al., 2012). 114 115 Flies that did not freeze, fled instead 116 Although a large fraction of flies froze in response to looming, not all flies did so. To determine 117 whether flies displayed an alternate response to the looming stimuli, we next analyzed the flies' 118 behavior excluding all freezing and grooming bouts, hence only periods classified as walking (> 4 119 mm/s) were analyzed. During the baseline period walking speed gradually decreased, reflecting a 120 common process of habituation to the test arena. However, during the stimulation period, their walking 121 speed increased (one sample Wilcoxon Signed-Rank test, W=16435, p<0.0001). This was not observed 122 for flies exposed to control stimuli, which further decreased their speed (one sample Wilcoxon Signed-123 Rank test, W=-15623, p<0.0001) (see Figure 3A and B). The average difference in walking speed 124 between stimulation and baseline periods was significantly higher for flies exposed to looming relative 125 to control (Wilcoxon Rank-Sum test, Z =16.33, p<0.0001 Figure 3B). In addition, we observed sharp 126 increases in speed at the time of each looming stimulus ( Figure 3A). To examine changes in speed 127 around looming we plotted the average speed of walking flies aligned on looming onset ( Figure 3C). 128 Walking speed was relatively constant before the stimulus. Upon looming onset, flies initially paused 129 for about 300ms followed by a rapid burst of locomotion ( Figure 3C, marker #2, movie S3). These 130 W=178808, p<0.0001). Flies heading towards the screen changed direction, while flies heading away 140 from the screen increased their walking speed and kept the same orientation. These findings indicate 141 that running bouts triggered by looming stimuli, are not just a simple increase in locomotion, but 142 constitute directed escape responses. Our data suggest that flies select between two distinct behavioral strategies, freezing or fleeing. 146 A possible factor modulating this selection became apparent when we analyzed the relationship between 147 the flies' movement speed and their response to looming. We sorted looming trials by the speed of flies 148 before looming onset and calculated the probability of freezing at different movement speeds. We 149 observed a sharp decay in freezing probability with increasing speed, such that flies moving slowly or 150 grooming were more likely to freeze upon looming stimulation than flies moving faster ( Figure 4A). 151 To further explore the relationship between movement speed at the time of looming and freezing 152 probability, we designed a closed-loop experiment where the speed of the tested fly was tracked online 153 and looming stimuli were delivered at specific speed thresholds. One group of flies received looming 154 at low movement speeds and another at high movement speeds (<1mm/s and >15mm/s respectively. 155 Figure S2). Importantly, there was no difference in the average baseline speed between the two groups, 156 indicating that their overall level of arousal was similar (Student's T-test, t=0.058, p=0.95, Figure 4B). 157 We found that flies walking at low speed when exposed to looming were more likely to freeze than flies 158 exposed to the same stimulus while walking faster (Wilcoxon Rank-Sum test, Z =-6.786, p<0.0001, 159 Figure 4C), thus confirming a modulation of freezing probability by the flies' movement speed. It is 160 possible that the faster the flies walk the more difficult is to come to a fast halt, explaining the sharp 161 decrease of freezing with increased speeds. However, we found that the probability of pausing upon 162 looming was not significantly modulated by the flies walking speed ( Figure S2). Indeed at all walking 163 speeds, including the highest, flies paused in response to ~40% of the looming stimuli. Hence, the 164 modulation of freezing probability is unlikely to result from a simple inability to become immobile at 165 higher walking speed. 166

Activity of P9 descending neurons is required for freezing but not fleeing in response to looming 168
Next, we searched for the neural mechanisms underlying the defensive behaviors observed. We 169 focused on freezing, as it is conserved across the animal kingdom (Blanchard and Blanchard, 1969;170 Eilam, 2005a;Speedie and Gerlai, 2008) and corresponds to the dominant behavior adopted by flies in 171 our experimental conditions. Given the lack of knowledge regarding the neural mechanisms of freezing 172 in insects, we performed an unbiased screen, testing for looming triggered freezing of fly lines P9>Kir2.1 vs. UASKir2.1/+, Z=-8.94, p<0.0001. In addition the two parental controls showed a small 183 but significant difference: P9/+ vs UASKir2.1, Z=3.96, p=0.0002. Figure 5B and C). This effect was 184 not due to an overall decrease in sensitivity to looming since running was intact ( Figure 5D and Figure  185 S4A). Furthermore, the frequency of jumps was increased, raising the possibility that in control flies 186 freezing behavior directly or indirectly inhibits jumps ( Figure S4B). 187

P9-silenced flies still paused in response to looming 189
The effect of silencing P9 neurons on freezing behavior could reflect a general impairment in the ability 190 to stop. However, P9-silenced flies that ran in response to looming still exhibited a pause upon looming 191 onset, which can be seen in the walking speed profiles around looming stimulation ( Figure 5E). Indeed, 192 these flies paused in 30% of the looming stimuli (looming stimuli that occurred while flies were already 193 freezing were excluded from this analysis). This finding indicates that pausing and sustained freezing 194 are mediated by different mechanisms. Interestingly this dissociation is also present in rodents that possess distinct descending neurons for freezing and stopping, and where freezing involves sustained 196 muscle tension whereas stopping does not (Bouvier et al., 2015;Koutsikou et al., 2014;Tovote et al., 197 2016). 198 199

Disruption of freezing was independent of walking speed 200
Given the negative relationship between speed and freezing probability mentioned above, we 201 investigated whether silencing P9 neurons affected the walking speed of the flies. We found that indeed 202 the average baseline speed was increased in silenced flies relative to controls (One-way ANOVA, 203 F=16.37, p<0.0001. Post-hoc Tukey revealed a significant difference between P9>Kir2.1 and the 204 parental controls: P9>Kir2.1 vs. P9/+, p<0.0001; P9>Kir2.1 vs. UASKir2.1/+, p<0.0001. No difference 205 between parental controls was found, p=0.6. Figure 5F). This raises the possibility that the impairment 206 seen in freezing results from the increased walking speed and hence a shift in the probability of freezing 207 behavior. Therefore, we calculated the probability of freezing for looming stimuli occurring at different 208 speeds. We found that despite the upward shift in speed of P9-silenced flies relative to controls, freezing 209 probability of these flies was lower for the entire range of speeds ( Figure S4C). In addition, we tested 210 P9-silenced and control flies in closed loop such that looming stimuli were only presented when flies 211 were at very low speeds (1mm/s) and found that even at these speeds P9-silenced flies froze less than 212 controls (Kruskal-Wallis test, X 2 =33.55, p<0.0001. Post-hoc Dunn tests revealed a significant 213 difference between P9>Kir2.1 and the parental controls: P9>Kir2.1 vs. P9/+, Z=-5.64, p<0.0001; 214 P9>Kir2.1 vs. UASKir2.1/+, Z=-4.16, p<0.0001. No difference between parental controls was found, 215 p=0.36. Figure 5G). Together these findings indicate that silencing P9 neurons directly disrupts 216 freezing, rather than indirectly affecting freezing behavior by increasing the speed of locomotion. 217 218

Activation of P9 neurons induced freezing 219
If indeed P9 neurons are involved in the execution of freezing behavior, activating them 220 artificially, in the absence of looming stimuli, should induce freezing. We expressed the red-shifted 221 channelrhodopsin, CsChrimson (Klapoetke et al., 2014), in P9 neurons and exposed single flies to red function, thus experimental flies were raised in food containing retinal whereas control animals were 224 raised in standard food. Flies were allowed to acclimate to the arena for 2 minutes. We then presented 225 10 trials of continuous light for 2 seconds, separated by 20-second intervals. We found that CsChrimson 226 activation of P9 neurons was sufficient to trigger freezing in ~ 60% of trials ( Figure 6B and movie S4). 227 Closer inspection of the time course of freezing induction showed that the probability of freezing 228 increased gradually over the course of the 2-second light stimulation ( Figure 6C). The lag in freezing 229 correlated with an initial increase in walking speed, induced by P9 activation ( Figure 6D). This running 230 bout was much reduced in control flies, showing that running was mostly caused by P9 activity (Figure  231 S5). The finding that flies first ran in response to P9 activation contrasts with the observation that, upon 232 looming, flies often first paused and then ran, jumped or froze. Given that looming triggered pauses 233 were independent of P9 neurons, it is possible that, with looming, neurons upstream of P9 inhibit the 234 initial running bout seen with artificial P9 activation. Finally, we observed jumps at light offset in test 235 flies, but not control flies (Chi-squared test, X 2 =219.76, p<0.0001, Figure 6E). Moreover, jumps 236 were more likely after stimulations that led to freezing than after stimulations that failed to elicit freezing 237 (Chi-squared test, X 2 =72.51, p<0.0001, Figure 6E). One possible explanation for this could be that Given that the probability of freezing in response to looming stimuli was found to depend on 244 the walking speed of flies at the time of threat, we asked whether the ability of P9 neurons in driving 245 freezing was also modulated by the flies' walking speed. We found that the probability of freezing upon 246 light activation of P9 neurons was negatively correlated with the movement speed of flies ( Figure 6F, 247 linear regression, r 2 =0.71 p=0.001). To confirm that P9-driven freezing is modulated by the movement 248 speed of flies at the time of stimulation, we again tested flies in close loop, such that P9 activation would 249 occur when flies were at low, high or very high speeds (1mm/s, 15mm/s and 20mm/s, respectively).  Figure 6G). Together, these findings show that 253 P9 neurons are a key element in the circuit mediating the speed modulation of freezing expression, and 254 suggest that this modulation is not a result of locomotion induced changes in visual perception (Chiappe 255 et al., 2010;Maimon et al., 2010). 256 257

Discussion 258
Freezing is a defensive response characterized by complete immobility, allowing preys to avoid 259 being detected while remaining attentive to changes in the environment (Eilam, 2005b;Fanselow, 260 1994). This response has been reported across vertebrates (Blanchard and Blanchard, 1969;Eilam, 261 2005b;Speedie and Gerlai, 2008). Here we show long lasting freezing in fruit flies similar to that 262 observed in vertebrates and distinct from the brief freezing periods reported for flies (Card and 263 Dickinson, 2008b;Gibson et al., 2015;von Reyn et al., 2014). The pervasiveness of freezing across 264 distant taxa strongly suggests its independent evolution and supports its adaptive value (Schultz and 265 Endler, 1987). 266 Given the prevalence of freezing behavior, it is crucially important to understand whether there 267 are general principles that govern it. For instance, the display of freezing is plastic. Rodents tend to 268 freeze only if there is no escape, and the presence of conspecifics decreases this behavior (Blanchard et 269 al., 1986;Kiyokawa et al., 2007Kiyokawa et al., , 2009de OCA et al., 2007b;Rickenbacher et al., 2017;Vale et al., 270 2017). Furthermore, it has been previously shown that estrous cycle or feeding state modulate freezing 271 freezing, is the finding that in other vertebrates, such as fish, the expression of innate defensive 274 behaviors is also plastic (Agetsuma et al., 2010;Bass and Gerlai, 2008;Giaquinto and Volpato, 2001). 275 In this study, we extend this to invertebrate animals by demonstrating the plastic nature of freezing in 276 flies. Flies either ran or froze in response to inescapable looming.
The choice between escaping and freezing was strongly modulated by the flies' speed at the 278 time of threat. This effect could be explained by an impact of speed on motor output, sensory processing 279 and/or arousal. An effect on motor output could be simply a consequence of increased difficulty in 280 stopping when walking fast. The findings that pausing in response to looming was independent of the 281 walking speed, and that P9 induced freezing was always preceded by running, argues against this addition a recent study identified in mice a set of descending neurons that drive stopping behavior that 299 is distinct from those identified for freezing (Bouvier et al., 2015;Tovote et al., 2016). The finding that 300 looming triggered-freezing and pausing could be dissociated supports the idea that freezing is an active 301 defense module pointing to the conserved nature of the distinction between freezing and stopping. 302 Moreover, freezing may require active inhibition of alternate behaviors. An indication that active 303 inhibition of alternate behavior happens in flies comes from our observation that P9 silenced flies jump 304 more and that flies jump at the offset of P9 neuron activation, presumably resulting from rebound excitation after inhibition of jump. Consistent with an inhibitory effect of freezing on jumping is the 306 observation that jumping steeply decreased with increase number of flies freezing over the course of 307 the repeated looming stimuli. The identification of P9 descending neurons as central to freezing opens 308 the path to further explore how the active state of freezing is implemented. Activation of P9 neurons 309 drove both running and freezing. However, silencing P9 neurons left looming triggered escape 310 responses intact suggesting that P9 triggered running may correspond to a different behavior. Still, it 311 will be very interesting to unravel how a single pair of neurons drives distinct behaviors. 312 Finally, since the flies' speed modulates their response to looming stimuli, we examined 313 whether the ability of P9 neurons to drive freezing was also modulated by the flies' speed. We found 314 that the probability of freezing upon P9 stimulation was negatively correlated with the flies' movement Shiraki, T., Kawakami, K., et al. (2010). The habenula is crucial for experience-dependent 323 modification of fear responses in zebrafish. Nat. Neurosci. 13, 1354-1356 the control of defensive behavior. Neurosci. Biobehav. Rev. 29, 1181-1191 Fadok, J.P., Krabbe, S., Markovic, M., Courtin, J., Xu, C., Massi, L., Botta, P., Bylund, K., Müller, 363 C., Kovacevic, A., et al. (2017). A competitive inhibitory circuit for selection of active and passive 364 fear responses. Nature 542, 96-100. 365 Fanselow, M.S. (1994). Neural organization of the defensive behavior system responsible for fear. 366 Psychon. Bull. Rev. 1, 429-438. 367 Fotowat, H., Fayyazuddin, A., Bellen, H.J., and Gabbiani, F. (2009) Brain Res. 188, 168-177. 435 Tauber, and Camhi (1995). The wind-evoked escape behavior of the cricket Gryllus bimaculatus: 436 integration of behavioral elements. J. Exp. Biol. 198, 1895-1907 Tovote, P., Esposito, M.S., Botta, P., Chaudun, F., Fadok, J.P., Markovic, M., Wolff, S.B.E., Behavioral arenas were custom built from opaque white and transparent acrylic sheets. Chambers were 486 30 mm in diameter and 4 mm in height. 487

Apparatus 488
We recorded behavior of unrestrained flies while presenting visual stimulation (Figure 1a). A monitor 489 tilted at 45 degrees over the stage delivered visual stimulation. To image fly locomotion, a custom-built 490 infrared (850 nm) LED array was placed under the stage (backlight). A diffuser (2 mm white opaque 491 acrylic sheet) was placed on top of the LED array to produce homogeneous illumination. Fly behavior 492 was recorded using a USB3 camera (PointGrey Flea3) with a 850 nm long pass filter. 493 Each fly was aspirated into a chamber and placed on the stage. Flies were observed for 20 seconds to 494 ensure that no gross motor defects were present before video acquisition started.

Visual stimulation 501
Visual stimuli were presented on a 24-inch monitor running at 144 Hz (ASUS VG248QE). All stimuli 502 were generated in a custom python script using PsychoPy 30 . 503 Looming: The visual angle of the expanding circle was determined by the equation 504 where l is half of the length of the object and v the speed of the object towards the fly. Virtual object 506 length was 1 cm and speed 25 cm/s (l/v value of 40 ms). Each looming presentation lasted for 500 ms. 507 Object expanded during 450 ms until it reached maximum size of 78 degrees where it stayed for 50 ms 508 before disappearing. 509 Random dots: an array of approximately 3 degree dots was added each frame in random positions to 510 generate similar change in luminance as the looming but without any expanding pattern. 511

Behavioral classifiers 512
Jumping: a fly was classified as having jumped if frame by frame speed exceeded a threshold (75 mm/s) 513 identified by a discontinuity in the speed distribution. 514 Freezing: a fly was considered to be freezing when average pixel change in a region of interest around 515 the fly was lower than 25 pixels (approx.< 5% of fly area) over 500 ms. 516 Walking: a fly was considered to be walking if its average speed over a 500 ms period exceeded 4 mm/s. 517

Closed-loop looming stimulation 518
Fly positions were tracked in real time and used to trigger looming stimuli using Bonsai 29 . Threshold 519 for looming stimuli were defined based on the path length in 500 ms windows. Low speed loomings 520 were triggered when path length was < 1 mm in 500 ms. High speed loomings were triggered when 521 path length was > 7.5 mm in 500 ms. A refractory period of 15 seconds was imposed after each triggered 522 stimulation. 523

Optogenetic activation 524
Responses of freely moving flies to CsChrimson 23 activation were captured using a modified version 525 the behavioral apparatus described in figure 6a. High-powered 627 nm LEDs were interspersed between 526 the infrared LEDs on the backlight board. Each arena was irradiated with four LEDs for total radiance 527 of 0.025mW.mm -2 . Experimental flies were raised on standard fly food with 0.2 mM all trans-retinal (Sigma, R2500) and control flies were raised on standard fly food without retinal. Flies were allowed 529 to explore for 2 minutes and then were stimulated with 10 repetitions of 2 seconds light on, 20 seconds 530 light off. 531

Closed-loop optogenetic activation 532
Fly positions were tracked in real time and used to trigger red light activation using Bonsai 29 . Speed 533 thresholds used were the same as in the looming stimulation. Threshold for looming stimuli were 534 defined based on the path length in 500 ms windows. Low speed loomings were triggered when path 535 length was < 1 mm in 500 ms. High speed loomings were triggered when path length was > 7.5 mm in 536 500 ms. A refractory period of 15 seconds was imposed after each triggered stimulation. 537

Staining and imaging 538
Imaging of DN morphology was performed as part of the Janelia Descending Interneuron project. 539 The P9DN split-GAL4 driver line, SS1540, was crossed to 5XUAS-IVS-Syt::smGFP-HA and -540 5xUAS-IVS-myr::smGFP-FLAG and the central nervous systems of the progeny were dissected and 541 stained for anti-GFP according to the standard Janelia FlyLight protocol. Brains were subsequently 542 mounted in DPX and imaged with a confocal microscope. Detailed immunohistochemistry staining 543 and DPX mounting protocols are avilable online at https://www.janelia.org/project-544 team/flylight/protocols. To best illustrate P9 morphology, off-target expression was removed from 545 the image using Photoshop. 546

Data analysis and statistics 547
Data analysis was performed using custom Python scripts. All data, except those from animals excluded 548 due to tracking errors, were analyzed. Prior to statistical testing, data were tested for normality with a 549 Shapiro-Wilk test and the appropriate non-parametric test was chosen if data were not normally 550 Orange corresponds to flies exposed to control stimulus and blue to flies exposed to looming stimulus. Dotted lines represent stimulus presentations. In e-g n=800 stimulation events with retinal, and n=720 stimulation events without. (D) Average speed (mean ± s.e.m.) aligned on light presentation for events that induced freezing (dark blue) and events that did not (light blue). (E) Probability of jumping at light offset for control and test flies (black and red bars). Probability of jumping at light offset for stimulation events of test flies that induced freezing and events that did not (dark, n=492, and light blue, n=308, bars). (F) Linear regression of probability of freezing by test flies upon red light stimulation at different pre-looming speeds. (G) Probability of freezing for P9>CsChrimson tested at different speeds (number of stimulation events for very high, high and low n=403, 674 and 593, respectively). *** denotes p<0.0001