Fly stocks
Female flies were reared on standard cornmeal and agar medium at 25°C under a 12 h light cycle. For optogenetic experiments, the food was supplemented with 50 μl of all-35 mM solution.trans retinal (Sigma, R2500, dissolved in ethanol) mixed with approximately 1 teaspoon of hydrated potato flakes. Experimental flies were 1–3 days old for electrophysiology experiments or 9–14 days old for imaging experiments. A list of fly genotypes is shown in Supplementary Table 2 and a list of fly reagents is shown in Supplementary Table 3.
Two-photon calcium imaging
Calcium imaging was performed as described in our previous study26. Briefly, we anesthetized flies on ice and a refrigerated aluminum sarcophagus (4–10 °C), then adhered them to custom 3D-printed mounts. We minimized brain movement by stabilizing the proboscis and head, and gluing the eyes, head, and anterior end of the thorax to the support. To access the FB for imaging, we removed a small piece of the superficial cuticle, trachea, and air sacs from the back of the brain using sharp forceps. We positioned the flies above an air ball (9 mm diameter General Plastics FR-7110, painted with black dots, supported by 0.4 ls−1 air) using two cameras (30 fps, FLIR Blackfly, Computar 8.5 mm 1:1.3 adjustable lens) at the front and side of the fly. A third camera (100 fps, Grasshopper, 94 mm/0.5 × InfiniStix Proximity Series lens, Edmund Optics focal length extenders, working distance 15 cm) was used to track the ball using Fictrac software.70. We illuminated the fly and ball using two infrared LEDs (M850F2) and T-cube LED drivers (LEDD1B) coupled with fiber optic cables (Thorlabs M118L03 flat patch cables). We infused continuously (1 ml min−1) the brain with extracellular saline (103 mM NaCl, 3 mM KCl, 5 mM TES, 8 mM trehalose dihydrate, 10 mM glucose, 26 mM NaHCO31mM NaH2P.O.4H2O, 1.5 mM CaCl22H2O and 4 mM MgCl2.6H2O, pH 7.1–7.4, osmolarity 270–274 mOsm) bubbled with carbogen (5% CO295% O2) and reheated to 33°C.
We performed all imaging under a 20× water objective (Olympus Plan Fluorite Simultaneous fluorescence emissions from GCaMP7f and tdTomato were separated by band-pass filters (Semrock, FF01-525/50-32 for green and FF01-607/70-32 for red) and detected using two GaAsP photomultiplier tubes. We captured volumes consisting of three optical sections of 192 × 96 µm, separated by 15 µm, taken at 8 volumes s−1 with a dwell time of 1.2 µs.
In all imaging experiments, flies walked on a floating ball and received wind (25 cm s−1) and smell (0.5% apple cider vinegar, 0.3 l min−1) stimuli controlled by custom Python code. Wind direction was adjusted by a rotary fitting (Dynamic Sealing Technologies, LT-2141-OF-ES12-F1-F2-C2) controlled by a stepper motor (Oriental PKP566FMN24A, with CVD524-K controller) and a microcontroller (TeensyDuino +USB), and was controlled in a closed loop by the flies’ heading measured by ball movement as we described previously.26. The starting wind direction was randomly chosen from 0°, 45°, −45°, 135°, or −135°. The wind blew between 5 and 60 s for each 65 s trial. The odor signal was randomly selected from five possible patterns in interleaved trials: odor step (15 s) or odor pulses of 1, 4, 7, or 10 pulses (1 Hz, 0.5 s pulse width). When the odor was turned off, a compensating air valve was opened to maintain total air velocity. Air from all lines (wind, ball support, odor, compensated air) passed through a pressure regulator (Cole-Parmer MIR2NA) and carbon filters (Drierite 26800 drying column, with desiccant replaced with activated carbon). The wind and compensated air were also humidified. The air flow of the air line was controlled by a mass flow controller (Aalborg model GFC17), while the air flow for odor, compensated air, and ball media were controlled by flow meters (Cole-Parmer PMK1-010608). We controlled the timing of wind stimuli using a solenoid valve (Cole-Parmer Masterflex 01540-11), as well as the timing of odors and compensated using high-speed three-way solenoid valves (Lee Company, LHDA1233115HA).
During the wind shift experiments, the wind rotated 90° for 2.2 s, either in the presence of odor (10 pulses at 1 Hz) or without odor. The start of the change was expected to occur 4 seconds after the appearance of the odor. We also included control trials in which the wind was not displaced in the presence or absence of odor. Data from trials without team control were included in all analyzes that did not depend on the specific olfactory stimulus.
Electrophysiology
For electrophysiology, we anesthetized flies on ice, stuck them on custom 3D-printed mounts, and then removed their two front legs. To access the dorsal cell bodies, we removed a large piece of cuticle, trachea, and air sacs from the back of the brain, then manually detached the sheath using fine forceps. We minimized brain movement by removing brain muscles and stabilizing the tube with glue. Starting from the dissection and throughout the duration of the experiment, we continuously perfused an extracellular saline solution (same recipe as above), bubbled with carbogen, onto the brain. Using a 40× objective (Olympus, LUMPLFLN40XW), LED source (Cairn Research MONOLED), and filter (U-N19002 AT-GFP/F LP C164404), we visualized GFP-positive cell bodies for recordings. Before recording, we cleaned the area around the target cell using fine-tipped glass pipettes filled with extracellular saline.
For patch-clamp recordings, we extracted glass pipettes with a Sutter P-1000 extractor, pressure polished the pipettes (3–5 MΩ final resistance), and then filled them with intracellular solution (140 mM KOH, 140 mM aspartic acid, 10 mM HEPES, 1 mM EGTA, 1 mM KCl, 4 mM MgATP, 0.5 mM of Na).3GTP and biocytin hydrazide 13 mM). We amplified the voltage signals using an Axonpatch 200B amplifier with a Brownlee Precision 410 preamplifier, then digitized the signals at 10 kHz. We delivered 73 µW mm−2 red light (625 nm, measured at the light source) to activate CsChrimson using a Thorlabs LED (M625F2) and T-Cube LED driver (LEDD1B) coupled with fiber optic cables (Thorlabs M118L03 flat patch cables) positioned under the head.
To better observe a mixture of excitation and inhibition, we depolarized cells to −38.1 ± 7.1 mV (mean ± standard deviation, n= 37 cells) using a small amount of positive current. Cells that did not grow were discarded. In all experiments, we randomly cycled through 11 stimuli: seven optogenetic light stimuli (4 s of 12 µW mm−2 low power; 4 s of 23 µM mm−2 medium power; 4 s of 73 µM mm−2 high power; 1 Hz pulses with a duty cycle of 0.2; 1 Hz pulses with a duty cycle of 0.5; 1 Hz pulses at a duty cycle of 0.8; and a light plume stimulus), three current stimuli (4 s of −4 pA; 4 s of 0 pA; and 4 s of 4 pA), and a wind or odor stimulus (wind on for 20 s, 5% apple cider vinegar on for 4 s). We constructed the light plume stimulus by filtering odors from a fly navigating in a virtual olfactory plume.26 with a positive derivative filter. Stimuli were repeated five times in all cells and then five times per drug condition. Although we only report results from light pulse stimuli in this paper, the voltage changes we observed, such as rapid inhibition or slow, persistent excitation, were observed in all optogenetic temporal patterns used.
In several experiments, we infused drugs into the brain to block neurotransmitter receptors. In these experiments, drugs were mixed with extracellular saline and infused into the brain for at least five minutes before resuming stimulus presentation. Because picrotoxin generated large excitatory responses to synaptic input, we often hyperpolarized cells to −50.3 ± 10.2 (mean ± standard deviation, n= 10 cells) to minimize the depolarization block. If the cells entered the depolarization block, we suspended the experiment until the cell recovered. The list of drugs, their sources, and final concentrations used are listed in Supplementary Table 4.
Immunohistochemistry
To perform immunohistochemistry, dissected brains were fixed in 4% paraformaldehyde (dissolved in PBS) for 15 min, washed 3 times in PBS, incubated in 5% normal goat serum (dissolved in PBST) for 60 min, incubated overnight in primary antibody solution (dissolved in 5% normal goat serum), washed 3 times in PBST, incubated overnight in secondary antibody solution (dissolved in 5% normal goat serum). goat serum), washed 3 times in PBST and washed 3 times in PBS. The primary antibody solution contained chicken anti-GFP (Fisher Scientific RRID: AB_1074893) 1:50, mouse anti-nc82 (DSHB RRID: AB_2314866) 1:50, and rabbit anti-dsRed (Clontech 632496) 1:500. The secondary antibody solution contained Alexa488-conjugated goat anti-chicken (Fisher Scientific RRID: AB_2534096) 1:250, Alexa633-conjugated goat anti-mouse (Fisher Scientific RRID: AB_2535719) 1:250, and Alexa568-conjugated goat anti-rabbit (Fisher Scientific RRID: AB_2576217). 1:250. For imaging, brains were mounted on microscope slides, immersed in Vectashield (Vector Labs H-1000), sealed with coverslips, and then imaged using a 20× objective (Zeiss W Plan-Apochromat 20×/1.0 DIC CG 0.17 M27 75 mm) on a Zeiss LSM 800 confocal microscope at a depth resolution of 1.25 μM.
To compare the morphology of hemibrain neurons to R65C03-GAL4 (Extended Data Fig. 2c), we deformed a patch of R65C03 (from Flylight71) and the hemibrain skeletons of layer 6 tangential neurons using the Janelia 2018 female model brain72. We overlaid the distorted patch and distorted skeletons and identified neurons with high overlap.
Data analysis
Connection analysis
Hemibrain connectome data16 were obtained from neuprint explorer (http://neuprint.janelia.org, hemibrain:v1.2.1) and analyzed…
Gn Health

