Abstract
While navigating their environment, many animals track their angular heading via the activity of heading-sensitive neurons. How internal heading estimates are used to guide navigational behavior, however, remains largely unclear in any species. We found that normal synaptic output from heading neurons in Drosophila is required for flies to stably maintain their trajectory along an arbitrary direction while navigating a simple virtual environment. We further found that if the heading estimate carried by these neurons is experimentally redirected by focal stimulation, the fly typically turns so as to rotate this internal heading estimate back towards the initial angle, while also slowing down until this correction has been made. These experiments argue that flies compare an internal heading estimate with an internal goal angle to guide navigational decisions, highlighting an important computation underlying how a spatial variable in the brain is translated into navigational action.
One Sentence Summary Flies compare an internal heading estimate with an internal goal angle to guide navigation.
Many animals, from insects to mammals, keep track of their two-dimensional position (1, 2) and angular heading (3, 4) as they navigate through an environment. Neurons that track heading were first discovered in rodents (5), and more recently in insects (6, 7), including Drosophila (8). Whereas emphasis has been placed on understanding how the physiological properties of heading neurons are built (8-14), recent experiments have also begun to explore how animals use internal heading signals to guide navigational behavior (15). For example, destabilizing a rat’s head-direction system induces longer, more circuitous routes to a home position (16), suggesting that head direction cell activity is generally important for oriented navigation. Furthermore, electrophysiological recordings in flying bats have revealed not only neurons that track the bat’s head direction, but also neurons that track its goal direction––i.e., the angle of a known landing platform relative to the bat (17)––suggesting that a neural comparison between heading- and goal-direction guides the bat’s navigational behavior. However, whether such a neural comparison takes place and how the output of any such comparison is translated into navigational action remains poorly understood in any species. Here, we describe a behavioral task in which Drosophila maintain a consistent walking direction for minutes in a simple virtual environment. We further provide correlational and perturbational evidence that flies accomplish this task by turning so as to maintain a neural heading estimate at an internal goal angle, which can change direction over time.
To study how Drosophila’s heading system guides navigational behavior, we first developed a simple task that is likely to require a sense of direction. We placed tethered flies walking on an air-supported ball (9,18, 19) at the center of a cylindrical, 270° LED arena (20). We presented the flies with a bright, vertical bar whose position on the LED display rotated in closed-loop with the fly’s yaw (left/right) rotations on the ball, simulating a distant, static landmark (9, 21) (Figure 1A). In this virtual environment, we found that, without training, flies tended to walk forward while maintaining their heading relative to the vertical bar for several meters (Figure 1B, left). The flies sometimes also changed heading either abruptly or gradually over time (Figure 1B, center and right). Although previous studies have noted that Drosophila tend to fixate vertical stripes directly in front (22-25), the arbitrary-angle fixation we observed in our setup better resembles previous reports of flies maintaining an arbitrary heading relative to a visual object (menotaxis) (26) or to the angle of polarized light (27, 28), and is reminiscent of dispersal behaviors observed in the wild (29, 30). We have yet to fully characterize the specific experimental conditions that promote front-fixation vs. arbitrary-angle fixation in walking flies (see Behavioral conditions in Methods), but all genotypes we studied reliably performed arbitrary-angle fixation in our setups, allowing us to examine how this behavior is implemented at the neural level.
To quantify the flies’ headings over time, we treated each heading measurement in a walking fly as a unit vector, computed the mean of unit vectors over 60 s windows (Figure 1C), and visualized the distribution of 60-s mean vectors in a polar plot (Figure 1D, see Methods). As expected from their virtual 2D trajectories (Figure 1B), individual flies tended to walk in a relatively constant direction with respect to the bar over 60 s (data points near the edge of the unit circle, Figure 1C-D, top). On the other hand, the same flies did not walk as straight in the dark (data points near the center of the circle, Figure 1C-D, bottom), even though their first-order walking statistics were similar in the dark and with the bar (Figure S1A), indicating that visual feedback allows the flies to stably maintain their direction. Beyond 60 s, flies maintained a consistent heading relative to a bar in closed-loop for many minutes (Figure S1B, top), but not in the dark (Figure S1B, bottom).
To determine whether flies actively maintain their heading in this simple virtual environment––rather than just walking straight irrespective of the location of the bar––we measured the behavioral responses of flies to experimentally introduced rotations of the visual scene. As the flies walked in closed-loop with a bar, we discontinuously rotated (or “jumped”) the bar ±90° or 180° relative to its current angular position. We operationally defined the fly’s goal heading as its mean heading over 10 s before bar jumps, analyzing trials where the flies’ headings were relatively constant (circular s.d. < 45°) before this experimental perturbation. We found that, following bar jumps, flies typically returned the bar to their goal heading (Figure 2A-B, Figure S2A). Moreover, flies performed similar corrections after 30 s of darkness (Figure 2C), indicating that they remembered their goal heading direction, for at least 30 s. That flies return the bar to a goal angle after 180° rotations (Figure S2A) and after 30 s of darkness, argues against the idea that they were responding solely to the angular velocity of the visual scene (i.e. stabilizing the bar’s yaw movements independent of its position on the arena). Rather, these behavioral data argue that flies actively maintain their heading with respect to a goal heading angle, whose angular position appears to be largely arbitrary, with a slight bias toward the rear-left and rear-right of the LED display (Figure S2B).
If flies navigate with respect to a goal direction, one might expect that both their turning and forward-walking velocities would vary systematically as a function of the difference between their current- and goal-headings. After experimentally induced ±90° rotations of the visual scene, flies tended to turn left or right so as to bring the bar back to its previous position on the arena (Figure 2D-E). Moreover, we observed a quantitatively varying relationship between turning velocity and the difference between the fly’s current- and goal-headings, with the largest mean, directional, responses evident when the bar was ±30-60° off the goal (Figure 2F).
Interestingly, we also observed that flies reduced their forward walking velocity after rotations in the visual scene (Figure 2G-H). Like with turning velocities, there was a systematic relationship between the flies’ forward-walking velocities and the angular difference between their current- and goal-headings (Figure 2I). Specifically, flies walked forward fastest when aligned with the goal, consistent with the flies attempting to effectively travel along their goal heading while reducing displacements away from it. The fact that flies slowed down after 180° rotations even when they turned very little (and therefore returned the bar very slowly) (Figure S3) argues that slowing down reflects a separable behavioral response from turning. Thus, two motor actions appear quantitatively tied to a comparison of the fly’s current- and goal-heading during navigation.
How might navigational signals in the brain allow flies to perform arbitrary-angle fixation? Recent work has identified several neuron classes in the fly central complex (Figure 3A-B) that carry heading signals. For example, E-PG (ellipsoid body-protocerebral bridge-gall) neurons (Figure 3B) (31) show a single calcium activity peak that rotates around the donut-shaped ellipsoid body (Figure 3C) (8), and 2-3 peaks that move left and right across the linear protocerebral bridge (9, 10), with the position of these peaks correlating with the fly’s virtual heading. To date, studies have focused on understanding how E-PG heading signals are updated by sensory and motor-related signals (8-10), but how E-PG activity guides navigational behavior remains unknown (Figure 3D). Given the behavioral evidence presented above, one possibility is that the E-PG heading signal is compared with an internal goal heading signal, and the angular difference, or error, between these two signals drives the fly to turn toward the goal direction and walk faster when aligned with it (Figure 3D-E).
To test this model, we first verified that E-PG neurons indeed track the fly’s heading, rather than its goal heading, in our task. We reasoned that during experimental rotations of the bar, a goal signal would stay unchanged in the brain since the fly reacts to this perturbation by turning so as to bring the rotated bar back to its original position (Figure 2), arguing that the goal position was not altered by the bar jump. A heading signal, on the other hand, should update with the bar’s new location on the arena since the repositioned visual cue provides evidence to the fly that its heading has changed. We imaged E-PG activity in the protocerebral bridge under two-photon excitation (9, 18) with GCaMP6f (32) during experimentally induced, discontinuous rotations of the visual scene while the fly walked in closed-loop (Figure S4A-B). We found that the position of the periodic E-PG calcium activity peaks in the bridge, i.e. the E-PG phase, consistently updated with the repositioned bar, as reported in previous studies (8), and inconsistent with the E-PG phase representing the fly’s goal. Another possibility we ruled out is that the E-PG phase tracks the difference between the fly’s current- and goal-headings. We imaged E-PG activity in flies that changed their goal heading at least once during the course of the imaging session and found that the E-PG phase consistently followed the position of the bar on the arena, independently of where on the arena the goal was positioned, as expected from a straightforward heading signal that is ignorant of the goal position (Figure S4C-D).
If the E-PG phase represents an internal heading signal that flies compare with a goal signal to guide oriented navigation, then inhibiting E-PG neuron output should impair the ability of flies to perform this task (Figure 4A). To test this prediction, we expressed in E-PG neurons shibirets, a dominant mutant of dynamin that impairs synaptic transmission at high temperatures (> 29°C) (33). We verified that shibirets impaired E-PG physiology by imaging calcium activity in shibirets-expressing E-PGs (Figure S5A). Because E-PGs show persistent activity in flies standing still in complete darkness (8, 9), it is likely that they participate in recurrent circuits that help to maintain their activity; in this case, inhibiting E-PG synaptic output should impair their own activity. Indeed, although E-PG neurons remained active when E-PG synaptic release was inhibited at 34°C, the E-PG phase was highly unstable, and poorly tracked the fly’s heading, both with a closed-loop bar (Figure S5B-D) and in the dark (Figure S5E). (We note that the E-PG phase velocity tracked the bar velocity reasonably well even in E-PG>shibirets flies, but not well enough to prevent the heading signal from drifting wildly, see Figure S5D.) These observations show that the heading signal in E-PGs is at least partially degraded when E-PG synaptic output is impaired, and thus a behavioral feedback loop with E-PGs, if present, should also be impaired.
We measured the effect of impairing E-PG synaptic output on the flies’ walking behavior (Fig. 4). The first obvious effect was that E-PG-impaired flies dispersed less far than controls (Figure 4B). Shorter 2D dispersals would be expected if E-PG-impaired flies are worse at maintaining a consistent heading in continuous closed-loop with a bar, which indeed is what we observed (Figure 4C, Figure S6). Intriguingly, further analysis of our continuous closed-loop (Figure 4C) and bar rotation (Figure S7) experiments revealed that E-PG-impaired flies retain a residual ability to maintain the bar in front, albeit with more angular variance than the arbitrary-angle fixation seen in control flies (i.e. data points closer to the center in Figure 4C). Thus, E-PG-impaired flies show a residual form of front-bar fixation, but cannot effectively maintain their heading at an arbitrary angle relative to a visual landmark for extended periods.
E-PG-impaired flies walked more slowly than controls (Figure 4G), which also contributed to shorter dispersal distances. Indeed, the model in Figure 3 predicts slow walking in E-PG>shibirets flies because the E-PG phase and goal are expected to be poorly matched and thus rarely drive fast forward walking in these flies (see also Discussion). Beyond the observation of generally slow walking, E-PG-impaired flies also showed no obvious decrease in forward walking speed following bar rotations (Figure 4G-H, Figure S8B), and a very weak (or no) relationship between forward walking speed and angular distance to goal (Figure 4I). Control flies walking at similar speeds as E-PG-impaired flies still slowed down following 180° rotations (Figure S9C-D), arguing that the lack-of-slowing-down seen in E-PG>shibirets flies was not simply due to them walking slowly before the bar jump. E-PG-impaired flies also turned weakly in response to bar jumps (Figure 4D-E, Figure S8A), and as a function of angular distance to goal (Figure 4F). We note, however, that control flies walking at similar forward speeds as E-PG-impaired flies exhibited a similar dampening of their turning responses (Figure S9A-B), arguing that the weak turning responses of E-PG>shibirets flies is, at least in part, due to their slow forward walking speeds. Near-wildtype turning velocities in EPG>shibirets flies (for their walking speed) may be expected given that these flies were still able to actively, if unstably, orient toward bars in front (Figure S7), a behavior that may employ neural pathways that bypass E-PGs. These residual behavioral capacities notwithstanding, E-PG impaired flies could not stably maintain a bar on the side or in the rear, demonstrating a fundamental impairment in their ability to perform arbitrary-angle fixation. These behavioral effects were consistent across all three E-PG-expressing Gal4 lines (Figure 4B-C, Figure S5-8). Anatomical evidence argues that the only cells consistently inhibited across the three Gal4 lines are E-PGs (Figure S10 and Supplemental Table 1).
We sought to further test the model in Figure 3 via neural stimulation experiments (Figure 5A). We performed these experiments in flies walking in darkness, to assess the effects of stimulating the fly’s internal heading system independently of any impact visual inputs might have on the system. Earlier, we showed that flies do not maintain a consistent virtual heading on the ball in the dark (Figure 1D, bottom row); however, intriguingly, we observed that flies walking in darkness maintained the E-PG activity peaks in nearly as stable a position in the brain as when they walked with a closed-loop bar (Figure S11), suggesting that, under these conditions, flies walking in darkness are attempting to maintain a straight trajectory with respect to their E-PG heading signal, even if their actual trajectories on the ball drift. We experimentally rotated the E-PG phase in flies walking in darkness by activating P-ENs (protocerebral bridge-ellipsoid body-noduli) (31), cells that are known to excite E-PGs (9, 10). (See Methods for why we did not stimulate E-PGs directly.) We expressed in P-ENs the ATP-gated cation channel P2X2, and locally released ATP on 1-2 glomeruli in the bridge (Figure 5A-C). This stimulation repositions the E-PG phase in the bridge by both activating E-PGs just medial to the stimulated location and by suppressing E-PGs (via as-of-yet uncharacterized circuitry) where they were originally active (9, 34). We measured the effect of this stimulation both on E-PG activity with GCaMP6f, and on the fly’s behavior, as it walked in the dark.
After stimulating the E-PG phase to a new angle, we observed that flies turned on the ball in a manner that was consistent with the model in Figure 3 (Figure 5D-I). That is, they turned so as to bring the E-PG phase signal back to its location in the bridge prior to stimulation (Movie S1 and S2). The side of the bridge in which we stimulated P-ENs (left vs. right) could not explain the direction in which the flies turned (Figure S12A), and we observed no consistent behavioral turns in flies lacking a Gal4 driver (Figure S12B), arguing that these behavioral responses were caused by the rotation of the E-PG/P-EN phases (which are yoked to each other (9, 10)), specifically. In these stimulation experiments, we observed the standard relationship between the flies’ behavioral turning velocity and the angular distance to goal (of their E-PG phase) (Figure 5I), like in visual bar jump experiments (Figure 2), though the relationship seen here, during stimulation in the dark, was somewhat weaker. We also observed a decrease in forward velocity upon stimulation, which depended on the distance between stimulated- and goal-phases (Figure 5J-K). We observed the standard bell-shaped relationship between forward velocity and angular distance to goal in these experiments as well (Figure 5L). Overall, these stimulation results argue that flies turn to compensate for an experimentally-induced E-PG-phase shift in the dark, consistent with a model in which the E-PG phase interacts with a wholly internal goal angle to guide the fly’s navigational behavior, and mirroring the behavioral effects observed with rotations of visual cues on the LED arena.
Discussion
We show that flies walking in a simple virtual environment maintain their heading at an arbitrary, goal angle (Figure 1), and actively turn back toward this angle when provided with visual evidence that they have been rotated (Figure 2). Moreover, flies tend to slow down after such rotations, and speed back up once they have corrected their heading.
Inhibiting E-PG synaptic output impaired the flies’ ability to maintain an arbitrary heading (Figure 4); however, the flies expressed a residual bias towards keeping the bar in front. This residual frontward bias may rely on visual motion- (35) or visual object- (36-39) sensitive neurons whose signals can perhaps bypass E-PGs to impact the leg motor system.
E-PG-inhibited flies walked more slowly than controls (Figure 4G). This slowing down is consistent with our model (Figure 3) because the alignment between the E-PG heading- and goal-signals is likely poor in E-PG-inhibited flies (Figure S5) and it is this alignment that we hypothesize drives fast forward walking. Alternatively, it is possible that E-PG-inhibited flies walk slowly due to some sort of general lethargy independent of any alignment between the E-PG phase and a putative goal signal. While we cannot definitively differentiate these interpretations, we note that P2X2-mediated stimulation of E-PGs reliably increased the overall level of E-PG activity in the protocerebral bridge (Figure S13), while also causing the fly to slow down specifically when the E-PG phase was stimulated off the goal (Figure 5J-K). This observation argues against the interpretation that E-PG-inhibited flies walk slower due to a general loss of walking drive, though more work will be needed to fully distinguish among these hypotheses.
Our data support the following working model for oriented navigation in Drosophila. The E-PG phase tracks the fly’s heading and is compared with an internal goal angle (Figure 3D). If the E-PG phase is positioned counterclockwise relative to the goal (when viewing the ellipsoid body from the rear), the fly tends to turn left, which in turn causes its E-PG phase to rotate clockwise, back towards the goal heading angle (Figure 3E). Conversely, if the E-PG phase is positioned clockwise relative to the goal, the fly tends to turn right. This closed-loop feedback model between a heading signal and an angular goal signal would allow the fly to maintain a steady heading, as estimated by its E-PG neurons. When the internal goal angle changes (via unknown mechanisms), the fly reorients accordingly. The fly also walks faster when its current- and goal-headings are matched, enabling the fly to travel for hundreds of body lengths along the goal direction.
The model proposed here posits the existence of angular goal signals in the fly brain; future work aimed at identifying these signals will help to further probe this model, and determine how it operates at the level of interacting neurons.
Our results focused on walking flies navigating in the context of a single, distant, vertical visual landmark. A parallel study discovered that tethered, flying Drosophila orient at arbitrary angles relative to a small, sun-like, dot stimulus, and that this orienting behavior is also dependent on E-PG activity (40). Future work with richer 3D visual environments will be needed to determine how the E-PG system operates with respect to local objects and the fly’s 2D or 3D location in an environment. For example, behavioral experiments have shown that fruit flies can navigate to specific locations in two-dimensional arenas (41, 42), suggesting that flies use positional, as well as angular goals, to guide behavior. Even in these tasks, however, the fly must ultimately choose a specific heading and speed at which to walk in order to reach its 2D goal. Thus, the results presented here may reflect a core interface between internal goals and motor actions, upon which other, more complex, navigational capacities in flies are built.
Author Contributions
J.G., V.V., and G.M. conceived of the project. J.G. performed all two-photon imaging and stimulation experiments, P. M.-P. performed all purely behavioral experiments in wildtype and shibire-impaired flies. J.G., V.V., P.M.-P. and G.M. analyzed and interpreted all experiments. V.V. developed the bar jump perturbation approach for studying goal-directed walking. A.A. performed and analyzed all multi-color-flip-out anatomical experiments. J.G. and G.M. wrote the paper.
Materials and Methods
Fly stocks
Flies were raised with a 12 hour light, 12 hour dark cycle. All experiments, except immunohistochemistry experiments, were performed with 1-3 day old females with at least one wild-type white allele. Flies were selected randomly for all experiments. We were not blind to the flies’ genotypes. Genotypes and their origins are listed in Supplemental Tables 2, 3.
Immunohistochemistry
Dissection of fly brains, fixation, and staining for neuropil and multicolor flip-out antigens were performed as previously described (9, 45).
Behavioral setup
Tethered walking, behavioral imaging, ball tracking, and closed-loop visual feedback were setup as previously described (9). We used different rigs for our behavioral and imaging experiments. For the behavioral rig, we recorded data on a National Instruments BNC-2090A A/D converter. For the imaging rig, we recorded data on an Axon Instruments Digidata 1440 A/D converter. Otherwise the two rigs were as identical as possible, including matching the fly’s position relative to the LED display (arena) and the angle of the LED display (see Behavioral task below). We recorded behavioral data at 50 Hz. The temperature of the fly’s head and upper thorax were controlled by the temperature of water (or physiological saline in the case of imaging experiments) flowing over these body regions.
Behavioral conditions
Flies were starved for 8-16 hours prior to testing, and were heated via the water or saline bath to at least 30°C (measured in the bath), except for E-PG>shibirets control imaging experiments, where we kept the bath at 26°C (Figure S5). We originally used these conditions to promote walking; however, we also found that the flies tended to maintain their heading at a consistent, but arbitrary angle with respect to the bar under these conditions. We note that these experimental parameters likely reflect an uncomfortable situation for the fly, and that the fly is likely reacting by attempting to disperse, or search a large area in search of food or cooler temperatures. In addition, the flies’ heads were glued to our fly plates with a downward pitch (antennae angled down, toward the ball), since this posture facilitated protocerebral bridge imaging and ATP stimulation with a pipette. We kept this posture consistent across all imaging and behavioral experiments (always using physiology plates (19), not pins, for experiments). To partially account for this pitch, we tilted the arena 30° forward with respect to the horizontal (angled arena in Figure 1A), to better match the angle of the fly’s head. However, it is likely that the flies still viewed the bright bar with their dorsal visual field, which might lead them to interpret our bright visual landmark (see below) as a celestial cue, useful for orienting their dispersal.
Visual stimuli
We used a cylindrical LED arena (20), spanning 270° in azimuth, and 81° in height. However, we note that the ball below the fly and the physiology plate above the fly’s head acted as visual occluders, allowing the flies to see only ~45-50° of the full height of the bar. For closed-loop bar experiments, we presented the fly with a 6 pixel-wide (11.25°), 81° high bright bar. The bar rotated with the ball with a gain of 1. For discontinuous rotations of the visual stimulus, the fly was presented with a closed-loop bar, except for one frame every trial where the bar jumped −90°, +90° or 180° from its current position. Immediately after the bar jump, it resumed rotating in closed-loop with the fly from its new position. For the 30 s dark stimulus, the fly was presented with a closed-loop bar for 3 minutes, then 30 s of constant darkness, after which the bar reappeared with a random offset with respect to the ball. For all experiments with a closed-loop bar, we let the fly walk in closed-loop with the bar for at least 5 minutes before beginning each experiment. Trial orders were randomly permuted for all experiments. See Supplemental Table 2 for trial structure for each experiment.
Imaging setup
Calcium imaging, two photon data acquisition and alignment with behavioral data were performed as previously described (9). We excited GCaMP6f with a Chameleon Ultra II Ti:Sapphire tuned to 925 nm, with 20-50 mW at the back aperture. We recorded all imaging data using 3-6 z-slices at a volumetric rate of 4-6 Hz. In all figures, the left protocerebral bridge is shown on the left, and the right bridge on the right. In Movie S1 and S2, this orientation is flipped, since the fly is viewed from the front. We perfused the brain with extracellular saline composed of, in mM: 103 NaCl, 3 KCl, 5 N-Tris(hydroxymethyl) methyl-2-aminoethanesulfonic acid (TES), 10 trehalose, 10 glucose, 2 sucrose, 26 NaHCO3, 1 NaH2PO4, 1.5 CaCl2, 4 MgCl2, and bubbled with 95% O2 / 5% CO2. The saline had a pH of 7.3-7.4, and an osmolarity of 280±5 mOsm.
P2X2-based stimulation
The most straightforward way to reposition the phase of the E-PG signal in the protocerebral bridge would be to stimulate E-PGs directly. Although we could reliably stimulate E-PGs by expressing P2X2 in them directly (data not shown), we were not able to induce bilateral changes in E-PG activity in the bridge by stimulating one position on one side of the bridge with stimulation strengths that elicited E-PG responses within their physiological range. However, we could regularly achieve a naturalistic, bilateral, re-positioning of the E-PG activity peaks via stimulation of a different cell class in the central complex, called P-ENs, at one location in the bridge (Figure 5). P-EN neurons from one glomerulus on one side of the bridge project to a tile in the ellipsoid body that contains E-PG neurons that project to the left bridge as well as E-PG neurons that project to the right bridge (31), which may explain why P-EN stimulation in the bridge is more effective at repositioning E-PG activity bilaterally. We note that others were able to relocate the E-PG activity peak by directly activating E-PGs (via optogenetic stimulation) in the ellipsoid body (34), which is innervated by E-PGs from both sides of the bridge. We preferred to chemogenetically activate E-PGs (via P-ENs), since we found that optogenetic light stimulation tended to cause the fly’s behavior to change (including turning), irrespective of whether we expressed a light-activated channel in any neuron. Thus, we stimulated E-PGs by chemogenetically exciting P-ENs. Specifically, we expressed in P-ENs the ATP-gated cation channel P2X2, and focally released ATP from a pipette via pressure pulses, as described previously (9). Unlike previous experiments, however, here we analyzed the fly’s behavioral responses to stimulations and provided ATP pulses with longer inter-pulse intervals (2 min.) to ensure that flies had ample time to behaviorally correct for each perturbation. We used 0.5 mM ATP in extracellular saline delivered with 20-50 ms pressure pulses. To compute the stimulated E-PG phase, we computed the mean E-PG phase over 0.5 to 1 s after stimulations for each recording. We collected data from 17 experimental and 15 control flies.
Data analysis
Two photon images over time were first registered along the x-y plane using python 2.7, as described previously (9). Regions of interest highlighting the 18 glomeruli in the bridge were then manually parsed in Fiji (9, 46) and all subsequent analyses of these signals were performed in python 2.7 as described previously (9). Some flies, which seemed excessively starved and appeared quite unhealthy as a result, were not analyzed; otherwise, no flies were excluded. No statistical method was used to choose the sample size. When plotting turning or forward velocity over time (e.g. Figure 2, 4, 5), these signals were smoothed with a 200 ms Gaussian filter.
Computation of mean heading vectors
We treated each heading measurement as a unit vector, and computed the mean of these heading vectors over a given window length of the fly walking (e.g. 60 s in Figure 1D). Heading measurements associated with time points in the analysis window where the fly was standing still (forward velocity < 0.5 mm/s) were omitted from contributing to the mean heading vector calculated in that window because when the fly stands still, its heading is constant for trivial reasons. We slid the analysis window over the heading time series within each trial (e.g. 60 s closed-loop bar in Figure 1), by 1 s increments, and calculated the mean-heading vector at each position, ultimately plotting the distribution of all mean heading vectors for a given trial type in a 2-dimensional polar histogram. Data near the periphery of such a histogram indicate walking along a consistent bearing whereas data near the middle indicate many changes in heading over the analyzed time window (23). We additionally calculated the mean vector length in each polar plot and then plotted the distribution of mean heading vector magnitudes of polar plots generated with analysis windows of different lengths (Figure S1B, Figure S6, Figure S11). Such a plot acts as a measure of how well flies maintain their heading over different timescales because if the mean vector of polar plots remains high with, for example, 400 s analysis windows, this indicates that flies must be maintaining consistent walking angles over 6+ minutes.
Computing turning and forward walking as a function of distance to goal
Analyzing data from before and after bar jumps (−20 to 40 s), we computed 2D histograms of turning or forward walking velocity, as a function of distance to goal heading (Figures 2F, 2I, 4F, 4I, 5I and 5L). Like in all plots analyzing bar jump data, we operationally defined the goal heading as the mean heading 10 s before bar jumps. We also computed the mean turning signal as a function of distance to goal (black trace). One can plot these data with different delays between the turning velocity signal and the distance to goal signal. In all figures, we plot the data using the delay between the motor signal (e.g. turning or forward velocity) and the distance to goal signal at which the fly turned strongest as a function of distance to goal. This optimal delay was 350 ms for Figures 2, 4, and is consistent with the idea that the fly first processes information about the position of the bar, as well as other sensory and internal inputs, to compute its heading, and then translates this heading signal through further processing (for example, via the model in Figure 3) into a turning command. For Figure 5, we found that the turning response was strongest at 100 ms after the distance-to-goal E-PG phase signal, consistent with the E-PG phase signal (which is derived from the fly’s internal heading estimate) being closer to the fly’s motor command to turn than is a visual stimulus. We used 300 ms-Gaussian-filtered turning and forward walking signals for these analyses to smooth the turning and forward walking signals. The delays reported here are therefore expected to be approximate.
Statistics
Statistical tests are indicated in the relevant figures. 95% confidence intervals were computed by bootstrapping.
Movie S1. Example fly turning to bring its E-PG heading signal back to its position in the protocerebral bridge prior to neural stimulation.
Movie of a fly walking in constant darkness (bottom). Two-photon imaging in the protocerebral bridge of E-PG neurons expressing GCaMP6f (top). The left bridge is shown on the right, and the right bridge on the left, since the fly is viewed from the front. We stimulated E-PGs via P-ENs (see Methods) by expressing in P-ENs the ATP-gated cation channel P2X2 and releasing ATP locally via a pipette (shown in red) on 1-2 glomeruli in the protocerebral bridge. Stimulating P-ENs reliably relocates the E-PG activity peaks approximately 1 glomerulus medial to the stimulated position (9), consistent with P-ENs functionally exciting E-PGs and their known projection anatomy (31). We added a red dot to the movie to appear at approximately the time when a pressure pulse releases ATP from the pipette. The red dot lasts 2 seconds in the movie, to ensure it is salient and visible to the viewer; the actual pressure pulse lasted only 20-50 ms. All other movie components aside from the red dot (e.g., brain activity and fly behavior) were aligned using timestamps from the behavioral camera and the two photon frame triggers in python 2.7.
Movie S2. Same as Movie S1 but at 2x speed.
Acknowledgements
We thank the Ruta and Rubin laboratories for fly stocks, Lisa Fenk for comments on the manuscript, and members of the Maimon laboratory for helpful discussions. Stocks obtained from the Bloomington Drosophila Stock Center (NIH P40OD018537) were used in this study. This work was supported by the McKnight Foundation (G.M.), the National Institutes of Health (DP2DA035148 and R01NS104934) (G.M.) and the Leon Levy Foundation (V.V.).
Footnotes
↵* Gaby Maimon (maimon{at}rockefeller.edu)