Abstract
Long-lasting internal arousal states motivate and pattern ongoing behavior, allowing for the temporary emergence of innate behavioral programs like fighting, feeding, and mating that subserve the needs of an animal. Yet how internal states shape sensory processing or behavior has remained unclear. In Drosophila, male flies perform a lengthy and elaborate courtship ritual, triggered by activation of sexually-dimorphic P1 neurons1–5, during which they faithfully follow and sing to a female6,7. Here, by recording from males as they court a virtual ‘female’, we gain insight into how the salience of visual cues is transformed by a male’s internal arousal state to give rise to persistent courtship pursuit. We reveal that the gain of LC10a visual projection neurons is selectively increased during courtship, enhancing their sensitivity to moving targets. A concise network model indicates that visual signaling through the LC10a circuit, once amplified by P1-mediated arousal, almost fully specifies a male’s tracking of a female. Furthermore, we show that P1 neuron activity correlates with ongoing fluctuations in the intensity of a male’s pursuit to continuously tune the gain of the LC10a pathway. Together, these results reveal how a male’s internal state can dynamically modulate the propagation of visual signals through a high-fidelity visuomotor circuit to guide his moment-to-moment performance of courtship.
In Drosophila, mate recognition triggers a striking switch in a male’s behavior, as he transitions from being apathetic or “blind” to a female to vigorously chasing and singing to her to entice her to copulate6,7. Recent work has identified a population of ~20 sexually-dimorphic P1 neurons as a central node within the courtship circuitry, as they are tuned to the pheromones of conspecific female mates8–12 and regulate a male’s entry into courtship1–5. Indeed, transient activation of P1 neurons drives persistent courtship displays even towards inanimate objects, suggesting they serve as a gate for an enduring state of sexual arousal5,8,10,13–15. How does this internal state restructure sensorimotor circuits to convert a female from an indifferent visual object to a target of desire?
Courtship reflects a dynamic arousal state
To explore how sensory processing is altered by a male’s arousal, we developed a virtual-reality visual system based on previous hardware designs (Jazz L. Weisman and Gaby Maimon, personal communication; Fig. 1a, Extended Data Fig. 1) in which a tethered male can court a ‘female’ represented as a high-contrast dot projected onto a conical screen. Optogenetic activation of P1 neurons induced males to chase the autonomously moving visual target for several meters in this 2D virtual world while performing the ipsilateral wing-extensions characteristic of courtship song (Fig. 1b, Extended Data Fig. 2a–b, Supplementary Video 1). Males maintained the target at close range within the center of their visual field during P1 activation, replicating the oriented pursuit displayed in free courtship, while wild-type males exhibited no behavioral response to the visual stimulus (Fig. 1c, Extended Data Fig. 2b–g, Supplementary Video 2).
The dynamics of a male’s arousal have been challenging to elucidate during natural social encounters, where continuous sensory feedback from another fly could contribute to its regulation. To dissociate changes in a male’s external sensory environment from his internal state we monitored his response to a dot that traversed back and forth along an arc at a constant angular velocity, rather than his courtship of the fictive ‘female’ in closed-loop. Tethered males were initially indifferent to this visual stimulus but after brief (3 sec) optogenetic activation of P1 neurons began to track it for many minutes while performing unilateral wing extensions (Fig. 1d–f, Supplementary Video 3), consistent with evidence that P1 neurons trigger enduring courtship pursuit 5,10,13–15 (Extended Data Fig. 4o). The vigor of other visually-guided behaviors, such as optomotor turning in response to wide-field motion16, however, was not enhanced (Extended Data Fig. 4g–i), pointing to the specificity of P1-evoked arousal.
To quantify how the intensity of a male’s courtship unfolded over time, we defined a ‘Tracking Index’ that reflects both the fidelity and vigor of his visual pursuit (see Methods, Fig. 1f, Extended Data Fig. 3a–d). Aroused males did not incessantly court the visual target but rather the intensity of their pursuit fluctuated over a trial. Occasionally, they even temporarily disengaged and ceased tracking despite the continued presence of the visual stimulus (Fig 1e–f, Extended Data Fig. 3b, g). Disengaged males were indistinguishable from unaroused animals based on their behavioral kinematics but remained primed to rapidly reinitiate courtship (Extended Data Fig. 3h–k). Moreover, males induced to disengage by briefly (30 sec) removing the visual stimulus quickly resumed pursuit when it was reintroduced (Extended Data Fig. 4a–b), demonstrating that their arousal state remains latent even in the absence of continuous sensory input or behavior. Over time, the probability of the male transitioning from disengagement to active pursuit decreased, indicating that his arousal slowly wanes (Extended Data Figs. 3j–k, 4o).
Persistent courtship of the virtual target could also be triggered by allowing males to sample the pheromones on a conspecific female, replicating his assessment of a prospective mate6,10–12 (Extended Data Fig. 4c–f). However, while pheromone pathways converge onto P1 neurons10,11, these chemical cues are not essential to arouse a male17,18. Indeed, by modifying the stimulus to more closely mimic the natural statistics of female motion (Extended Data Fig. 4j–l, Supplementary Video 4) and socially isolating males to enhance their mating drive8,14,17,19, we found that males would spontaneously initiate courtship even in the absence of exogeneous activation of P1 neurons (Fig. 1g–h, Extended Data Fig. 4m–o, Supplementary Video 5). Visual cues are therefore sufficient to release a persistent state of arousal in Drosophila males.
P1 neurons reflect the intensity of courtship pursuit
To examine the dynamics of P1 neurons during spontaneous courtship, we performed functional calcium imaging of their axonal terminals using a selective genetic driver line15 (Fig. 1i). P1 neurons became robustly activated as males initiated courtship, even when they began tracking many seconds after presentation of the visual stimulus (Fig. 1j–k, Extended Data Fig. 5d). Following courtship onset, P1 activity continued to fluctuate throughout the duration of a courtship bout, providing an ongoing representation of the intensity of a male’s pursuit as reflected by its tight correlation with a male’s Tracking Index over the course of a trial (Fig. 1j–l, r = 0.69±0.075, mean±st.d, Extended Data Figs. 5b, 6f,j). P1 activity was disproportionally higher at the onset of courtship (Extended Data Fig. 5c–g), indicating they may signal additional aspects of a male’s internal state or behavior that we are not measuring.
P1 activity was poorly correlated with the visual stimulus (r=−0.10±0.008, mean±st.d), but displayed a weak relationship to a male’s linear (r=0.23±0.099, mean±st.d.) and angular speed (r=0.28±0.062, mean±st.d., Fig. 1n–o, Extended Data Figs. 5a, 6f–j) – likely because males must run and turn to track the target. Indeed, P1 fluorescence remained low in sexually-unaroused males turning vigorously in response to wide field motion, confirming that P1 activity more closely aligns with a male’s courtship state than the kinematics of his pursuit (Extended Data Fig. 6a–e, k–o). Moreover, while P1 neurons activity was time-locked to the initiation of courtship, their calcium signals decayed back to baseline when males transiently ceased courting, indicating that a male’s enduring arousal is stored either subcellularly or in the activity patterns of downstream neurons (Fig. 1j–k,m). Therefore, while P1 neurons gate entry into a lasting arousal state10,13–15, their ongoing activity corresponds to the moment-to-moment changes in the intensity of a male’s courtship pursuit.
LC10a gain is modulated during courtship
LC10a visual projection neurons are motion detectors that convey retinotopically organized visual signals to the anterior optic tubercle (AOTu)20–22, and are essential for accurate tracking of conspecifics during courtship20. Consistent with this role, unilateral optogenetic silencing of LC10a neurons strongly attenuated turning towards the ipsilateral visual target during tethered courtship (Extended Data Fig. 7a–c). Monitoring GCaMP activity in the LC10a axon terminals in the AOTu in unaroused males revealed only weak responses to the visual target. At the initiation of courtship pursuit, however, LC10a axon terminals became robustly activated each time the visual target swept across the male’s ipsilateral hemifield (Fig. 2a–b,d, Extended Data Fig. 7d–h). The shape of LC10a responses remained unchanged, pointing to alterations in their gain rather than changes to their tuning (Fig. 2e). Notably, during periods when males transiently ceased tracking, LC10a neurons returned to their low baseline activity level (Fig. 2b, Extended Data Fig. 7e), highlighting that the gain of these pathways is modulated on a moment-to-moment timescale.
While males increased their velocity during courtship, the gain of LC10a neurons was significantly more correlated with a male’s Tracking Index (r2 = 0.63±0.16) than either his linear (r2 = 0.29±0.26) or angular speed (r2 = 0.43±0.21, mean±st.d., Extended Data Fig. 8a–f). To further dissociate the gain of LC10a neurons from the motor implementation of visual pursuit, we took advantage of the fact that males cannot turn left and right simultaneously and introduced a second target to courting males whose position was opposite to the first, yielding identical stimulation to both eyes (Extended Data Fig. 8g). LC10a neurons continued to respond even when males failed to turn towards a visual stimulus or turned in the contralateral direction (Extended Data Fig. 8g–i), thus decoupling the gain enhancement of LC10a neurons from the kinematics of tracking (Extended Data Fig. 8i–j).
To explore the specificity of the LC10a gain modulation, we examined the responses of LC10b, LC10c, and LC10d visual projection neurons – which are morphologically similar to LC10a and sample from overlapping layers of the lobula (Fig. 2c)21,22 – but found that their responses to the target remained unchanged as males initiated courtship (Fig. 2d, Extended Data Fig. 8k–l). Consequently, only LC10a neurons displayed a tight correspondence between the magnitude of evoked visual responses and a male’s ipsilateral turns (Fig. 2f). Supporting this specificity, the female connectome23 indicates that LC10a-d neurons display distinct patterns of synaptic connectivity within the AOTu (Extended Data Fig. 9a–f), suggesting they potentially comprise parallel visual streams that can be independently modulated.
Consistent with previous work20,21, unilateral optogenetic activation of LC10a axon terminals drove acute ipsilateral turning (Fig. 2g–h), indicating that LC10a neurons may underlie a male’s faithful pursuit. Indeed, anterograde tracing using trans-Tango24 in males and the female connectome23 revealed that LC10a’s downstream synaptic partners richly innervate the lateral accessory lobe (LAL) (Extended Data Fig. 9g–k), a neuropil targeted by multiple descending neurons (DNs) implicated in the control of steering behavior25–27. Sexual arousal is thus poised to gate the flow of sensory signals through a concise visuomotor circuit.
P1 neurons regulate LC10a signaling
Although P1 neurons do not directly innervate the AOTu, the tight correspondence between P1 activity and ongoing changes in the intensity of a male’s courtship pursuit (Fig. 1i–l) suggests they may signal to LC10a neurons to regulate their gain. Consistent with this possibility, synchronous recordings revealed that the activity of P1 and LC10a neurons was highly correlated (Fig. 3a; Extended Data Fig. 10a), and jointly reflected a male’s ipsilateral turning (Fig. 3b). Indeed, the magnitude of P1 activity was near linearly (m=0.86) predictive of the amplitude of LC10a responses evoked by the visual target (r = 0.68, p < 0.00001; Fig. 3c). Moreover, exogeneous activation of P1 neurons drove LC10a neurons to robustly respond to every sweep of the visual stimulus, transforming the idiosyncratic structure of spontaneous courtship to incessant high-fidelity tracking (Fig. 3d–g).
P1 modulation could gate the flow of all visual signals through the LC10a pathway or by reshaping their receptive fields to preferentially enhance responses to the visual profile of a female. However, the responses of LC10a neurons to a panel of diverse visual targets– including moving dots of various angular sizes, long bars, or a slowly expanding sphere – were uniformly amplified by P1 activation (Extended Data Fig. 10b–h). State-dependent modifications to visual processing therefore appear to reflect alterations in the gain of LC10a neurons rather than a restructuring of their receptive fields, suggesting that LC10a neurons either serve as the direct target of modulation or their input pathways are uniformly amplified.
Notably, LC10a responses to all visual stimuli were in aggregate stronger to progressive than regressive motion in both unaroused and courting males (Extended Data Fig. 10b–e,i). The elevated signaling in aroused males made LC10a direction selectivity appear more pronounced (Extended Data Fig. 10b–e), however, providing a potential explanation for why these neurons were previously characterized as relatively insensitive to the direction of visual motion20. Examining correlated pixels within the AOTu, which likely correspond to individual LC10a axonal boutons (Extended Data Fig. 11a), underscored that direction selectivity is a general characteristic of this population (Extended Data Fig. 11b–d). The behavioral responses of courting males mirrored this directional tuning, as they executed ipsiversive turns only when the stimulus swept progressively but not regressively in front of one eye (Extended Data Fig. 11e).
A network model of courtship pursuit
To assess whether P1-mediated modulation of LC10a signaling could capture the dynamics of courtship pursuit, we constructed a network model mimicking the concise architecture of this visuomotor circuit. We modeled LC10a neurons as a population of integrate-and-fire units, each of which covered a portion of the male’s visual field, with 15° of binocular overlap28, and utilized the motion-based receptive fields estimated by Ribeiro et al.20 to structure excitatory input (Fig. 4a). The LC10a population in the right and left hemisphere was integrated by downstream units, which triggered ipsilateral turns whose magnitude was proportional to the difference in firing rate between them.
Small deviations in the model’s temporal receptive field strongly degraded its performance, indicating that the measured tuning properties of LC10a neurons are well-suited to replicate a male’s pursuit (Fig. 4b, Extended Data Fig. 11g). Moreover, consistent with our functional and behavioral analyses, complete selectivity to progressive motion was necessary for the model to accurately track a simple visual target in a time-locked fashion (Extended Data Fig. 11f). The model also correctly predicted that this direction selectivity, coupled with the small region of binocular overlap, enables males to anticipate the future position of the ‘female’ target when it briefly stops at the center of his field of view (Fig. 4c, r = 0.86, p<0.00001; Extended Data Fig. 11h), giving rise to an overshoot in the male’s turning. This is consistent with behavioral evidence from houseflies that males may predict the motion of a target as it passes from one visual field to the next during courtship, enhancing the fidelity and continuity of pursuit29.
To test whether the linear integration between LC10a signals in the two hemispheres could predict the direction and strength of a male’s turns, we introduced a second visual target that oscillated at 98% of the velocity of the first target, allowing us to measure a male’s steering behavior as the phase relationship between the two dots varied (Supplementary Video 6). Males presented with this complex stimulus responded nearly indistinguishably from our model; ceasing to respond to visual motion when the targets were in opposite phases, and otherwise preferentially turning in response to the leading target (Fig. 4d, r = 0.83, p<0.00001, Extended Data Fig. 11i–j).
Inspired by classic studies on the control systems employed by other Dipteran species during aerial pursuit29,30, we asked whether our model could also replicate the dynamics of freely moving males in natural courtship. Using just the estimated position of the female on the male’s retina, the model accurately predicted the steering behavior of courting males over many minutes (Fig. 4e–g, Extended Data Fig. 12, mean r = 0.52±0.06, n = 6 pairs, p < 0.00001 for all flies). Furthermore, by assuming that model males match their linear speed to that of the female, we could simulate the high-fidelity tracking of a courting male within a circular arena (Supplemental Video 7). The properties of this simple visuomotor circuit are thus largely sufficient to account for the faithful tracking of a female, although additional visual pathways are likely to also be engaged for long-distance orientation.
Finally, we reasoned that incorporating the ongoing activity of P1 neurons into our model should enhance its predictive power by accounting for fluctuations in a male’s arousal during spontaneous courtship. Strikingly, we found that simply scaling the net input current of LC10a neurons by the experimentally measured activity of P1 neurons (ΔF/F, Fig. 4h) significantly improved the model’s accuracy (Fig. 4h–i, Extended Data Fig. 13b–d). The model no longer incessantly responded to the visual stimulus, but instead accurately predicted the intermittent bout structure of spontaneously courting males (Extended Data Fig. 13a). Consistent with the linear relationship between evoked LC10a responses and P1 activity (Fig. 3c), modeling the input of P1 neurons as a continuous-gain function yielded a linear relationship between P1 activity and the strength of a male’s ipsiversive turns that closely matched the experimental data, while a threshold-based model predicted a sigmoidal relationship (Fig. 4j). These results further support that the intensity of a male’s courtship drive operates along a continuum, allowing for P1 neurons to continuously regulate the strength of signaling through visuomotor circuits to shape ongoing behavior (Fig. 4k).
Discussion
In the wild, Drosophila meet and mate on fermenting fruits where diverse species frequently congregate31. Consequently, a male must not only be persistent in his courtship to entice choosy females to copulate32, but also remain sensitive to sensory feedback to prevent continued pursuit of inappropriate or unreceptive mates. Here, we reveal a segregated circuit logic that balances this need for persistence and flexibility to guide a male’s moment-to-moment performance of the courtship ritual. We find that courtship pursuit is mediated by a highly-reliable visuomotor circuit whose gain is modulated on a moment-to-moment timescale by P1 neuron activity, which functions like a rheostat to control the propagation of visual signals in a graded manner. Consequently, the LC10a pathway lies dormant in the brain unless P1 neurons are active, rendering males effectively blind to the visual profile of a female until she is recognized as a potential mate. As the site of convergence for both excitatory and inhibitory sensory cues emanating from other flies8–12,33, P1 neurons offer a powerful nexus for such ongoing behavioral control. Indeed, as inhibitory pheromone pathways directly impinge onto P1 neurons10–12, they could acutely reverse the gain of LC10 signaling to suppress futile pursuit of an inappropriate mate. The dynamic gating of sensorimotor circuits we describe thus offers a mechanism to hone the expression of behavioral programs, suggesting a circuit mechanism for how a fixed and reflexive motor pattern can be unleashed via an innate releasing mechanism from classic ethology34.
METHODS
Data reporting
Preliminary experiments were used to assess variance and to optimize behavioral conditions. Experiments were not randomized, and the experimenters were not blind to conditions. Sample sizes were not predetermined. For tethered courtship assays, unless otherwise noted, only experiments during which animals exhibited courtship towards the visual targets were included for analysis, selected based on a tracking index > 0.3 for at least 1 second and the presence of at least one unilateral wing extension. For modelling of free behavior, only flies that courted for >90% of the time before copulation were included. For wide-field motion experiments, only flies that exhibited an average optomotor response of at least 5rad/s were included.
Fly stocks and husbandry
Flies were housed under standard conditions at 25°C on a 12h light-dark cycle, except for flies expressing channelrhodopsin variants which were dark-reared. Fly stocks used were as follows: Split-P1 GAL415 (D. Anderson, California Institute of Technology); LC10a GAL420, LC10a-LexA20, and LC10a-LexA, UAS-CsChrimson:tdTomato;LexAop-GCaMP6m20,35,36 (I. Ribeiro and B. Dickson, Janelia Research Campus); UAS-GtACR137 (A. Claridge-Chang, Duke-NUS); 20X-UAS-CsChrimson.mVenus35 (V. Jayaraman, Janelia Research Campus); R;Trans-Tango24 (G. Barnea, Brown University). The following stocks were obtained from the Bloomington Drosophila Stock Center: CantonS, 20XUAS-IVS-jGCaMP7f38 (BDSC 79031), 20XUAS-IVS-GCaMP6s36 (BDSC 42746), OL0019B21 (BDSC 68336). LC10b/c-GAL421 (GMR_OL0023B) and LC10d-GAL421 (JRC_SS03822) were obtained from the Janelia Fly Bank.
Supplementary table 1 provides detailed descriptions for all genotypes used in each experiment.
Behavioral definitions
Here for clarity, we explicitly define the terms used to describe different states in our study based on the behavioral statistics of a courting male. See also Extended Data Fig. 3b.
Arousal:
A period during which males exhibit an increased probability to engage in courtship following spontaneous or exogeneous activation of P1 neurons. Males may or may not engage in courtship continually throughout a period of arousal. ‘Unaroused’ males do not exhibit any propensity to court visual targets.
Disengagement:
A behavioral state adopted by aroused animals when courtship drive becomes very low, during which the visual target fails to elicit behavioral responses completely. Disengagement could not be distinguished from unarousal by behavioral kinematics but was instead inferred post-hoc from the fact that males later reinitiated courtship.
Free behavior assays
All assays were performed with male and virgin female flies 3–5 days post-eclosion. Flies were isolated 4–12 hours post-eclosion and reared with flies of same sex at low density (5–10 animals) in food vials (d = 3cm, h = 9cm) for 3–4 days. Courtship assay chambers were custom-milled bowls with a 38.5mm diameter, 3mm depth, and sloped edges to prevent flies from walking upside-down. Chambers were covered with a thin sheet of clear acrylic to prevent flight. Flies were added to the chamber by aspiration without anesthetization and videos were then recorded for 30 minutes with a Point Grey FLIR Grasshopper USB3 camera (GS3-U3–32S4M-C: 3.2 MP, 121 FPS, Sony IMX252, Monochrome) using the Flycapture2 Software Development Kit (FLIR). Videos were captured from underneath the chamber at 40 frames per second and with a resolution of 34 ± 1 pixel per micron. All behavioral assays were conducted in a heated, humidified room (25 °C, 46% average relative humidity) on a back-lit surface (Logan Electric Slim Edge Light Pad A-5A, 5400K, 6 klx). The x-y coordinates and orientations of the male and the female flies were tracked using the Caltech FlyTracker39. The angular position of the female target in the male’s visual field was calculated with a custom MATLAB (MathWorks) script wherein, for each frame, the male and female x-y coordinates and orientations were translated and rotated such that the male was situated at the origin, facing zero degrees. The angular position of the female was then calculated as the inverse tangent of her y-coordinate over her x-coordinate in this new basis.
Fly tethering and dissection
Flies used for closed-loop behavioral assays were briefly (<30 sec) anaesthetized on CO2, and subsequently tethered to a stainless-steel insect pin (size 00, d=0.3mm, l=4cm, Fine Science Tools) by their thorax. Anaesthetized flies were placed on a custom-milled plate and held in place by a short string across the neck, and an insect pin was brought in and centered on the back of the thorax. A small dollop of UV-curable clue (Loctite AA 3106) was manually placed at the contact point and cured with a UV gun for 0.5 sec. Flies were left to recover from anesthesia for 1–4 hours in a dark chamber humidified by a small wet paper towel.
For open-loop behavioral assays and two-photon functional imaging, flies were briefly anaesthetized on CO2 and tethered to a custom-milled plate similar to those used in previous studies9,40. Flies were held in place by a string across the neck and fixed to the holder by both eyes and the back of the thorax using UV-curable glue (Loctite 3106). To minimize brain motion during functional imaging, the proboscis was also glued to the mouthparts. The string was subsequently removed, and flies were left to recover in a warm, humidified chamber (25°C, 50–70% humidity) in the dark. For behavioral experiments, flies were transferred to the ball after 2–6 hours. For functional imaging experiments, flies were left in the dark until immediately before the assay, at which point the cuticle was removed to give optical access to the central brain without anesthesia. The tethering plate was filled with saline (108mM NaCl, 5mM KCl, 2mM CaCl2, 8.2 mM MgCl2, 4 mM NaHCO3, 1 mM NaH2PO4, 5 mM trehalose, 10 mM sucrose, 5 mM HEPES, pH 7.5 with osmolarity adjusted to 265 mOsm) to cover the fly’s head, and the cuticle between the eyes was cut with a 30-gauge needle and removed with forceps. The trachea covering the top of the central brain was removed from both hemispheres with forceps. Flies were subsequently transferred to the ball and left to recover in darkness for at least 30 minutes.
Virtual reality preparation
For our virtual courtship preparation, we adapted an existing hard-ware design for presenting tethered flies with visual stimuli (Jazz L. Weisman and Gaby Maimon, in preparation). Male flies rested on a small 6.35mm diameter ball shaped from Last-A-Foam FR-4618 (General Plastics)41,42 painted manually with uneven black spots using a Sharpie. The Styrofoam ball was held by a custom-milled aluminum base with a concave hemisphere of 6.75mm. A 1mm tract drilled through the base connected to air supplied at ~0.8 L/min. The aluminum base was held in place by a custom printed (Carbon 3D) contraption. The ball was illuminated by infrared LED flood lights, and imaged with a Point Grey FLIR Firefly camera (FMVU-03MTM-CS) with a 94mm/1x WD Video Lens (InfiniStix) by way of a mirror (ThorLabs #ME05-G01). The ball was surrounded by a 270° conical screen with a large diameter of ~220 mm, a small diameter of ~40mm, and a height of ~60mm. The screen was cut from matte white 80lb cardstock (Desktop Publishing Services, Part #59421–50) using a laser cutter and fitted into a custom 3-D printed screen-holder with a tilted slit for placing and forming the screen shape (Extended Data Fig. 1).
The visual stimulus was projected around the male from a DLP 3010 Light Control Evaluation Module (Texas Instruments). During optogenetic behavioral assays (e.g. Fig. 1b–f), light was projected by way of a 40×40cm mirror (First Surface Mirrors, custom cut) from above the fly, whereas it was rear-projected onto the front of the screen during all other behavioral experiments and for two-photon calcium imaging due to the sterics of the objective (Extended Data Fig. 1b). The red and green LEDs in the projector were turned off using the DLP Display and Light Control EVM GUI (Texas Instruments), leaving only the blue LED. The lens of the projector was also covered by blue filter-paper (Rosco). Together, this minimized any aberrant activation of neurons in animals expressing the light-gated cation channel CsChrimson, as split-P1>CsChrimson animals did not initiate courtship spontaneously when only the blue LED was on. As males walked on the spherical treadmill, all three rotational axes of the ball were read-out by the FicTrac2.0 software43 at 60Hz in real time. FicTrac was linked by a socket to MATLAB, which read out the estimated angular position of the ball at each frame. The projector received input from the same computer running FicTrac via an HDMI cable, and was controlled via a mini-USB cable to the same computer. Visual stimuli were generated in the MATLAB-based ViRMEn software44 and projected onto the screen using custom perspective transformation functions. On each frame of an experiment, the animal’s updated position was read-out in MATLAB, and either stored or used to transform the position of the visual stimulus in the case of closed-loop assays. The net visual refresh rate of the visual stimulus ranged from 47.6Hz to 58.9Hz. All other experimental variables were regulated in MATLAB on a single computer interfacing with an Arduino Uno that controlling the LED. Wing-extensions were detectable via the same camera used for ball tracking, but a second camera (Point Grey, FMVU-03MTM-CS) was used for better visual access to the wings during manual scoring of wing-extensions.
Closed loop behavioral assays
All flies used for closed-loop experiments were reared in the dark on sugar-yeast food to prevent low levels of ion-flux through light-gated ion channels during development, as previously described9. Male flies were transferred 1–2 days after eclosion to food containing 400μM all-trans-retinal 48 h before behavioral assays14 and kept at low density (3–7 males/vial). Pin-tethered male flies were placed at the center of the ball and left to acclimate to the ball for 30–60 minutes in darkness before the experiment was started. This also served to bring male arousal to a baseline before optogenetic activation of P1 neurons. The change in the animal’s heading and the integrated x-y position of the ball was read out from FicTrac on each frame. This positional information was used to update the animal’s position and heading in the virtual ViRMEn world. Thus, when the fly turned clockwise, the world was rotated counter-clockwise, and vice versa, simulating the natural visuo-motor coupling of a freely behaving fly. Optogenetic stimulation was delivered by way of the red-LED in the projector (4μW/mm2 at 600nm), which consistently drove animals to court. The visual stimulus in closed loop experiments either consisted of a black dot that followed a random trajectory influenced by the male’s own motion (Fig. 1b,), presented on a white background with a light-grey floor (Supplemental Video 2).
For the former case, the diameter of the dot was such that it occupied ~30° of the screen when positioned 10mm in front of the animal in the virtual world. This is larger than the size of a natural female at the same distance but allowed us to keep the female some distance away from the male in the virtual world while she could still exhibit a similar angular size to a close-up female. This extra distance between the male and female was important to prevent males from accidentally colliding with the female in virtual world, as there is no tactile feedback available. Distances in the virtual world were determined such that 1 radian of the ball the fly walked on was equivalent of one virtual unit. The object rotated in a circle around the virtual world, whose diameter was equivalent of 20cm, with a rotational velocity of ~10°/s.
For the latter case, the diameter of the dot was the same as during (i), but the female moved in an unpredictable and pseudorandom pattern. The female target originally moved in a random direction with a constant linear speed of ~30mm/s. At each point, she had 20% probability of switching her current heading direction to a new heading direction, drawn pseudorandomly from a normal distribution with its mean equaling the current heading and a variance of 35°. After a switch, she was prohibited from switching direction over the course of the next second. To prevent the male from losing the female in the infinite world, the female was softly-bounded around 120mm away from the male in all directions. If the female reached the edge of this bound, her path was redirected towards the male to attempt to ‘re-entice’ him. To prevent the female from being on top of the male, she was also softly-bounded 10mm from the male (her turns were biased away from the male’s current location). Experiments ranged from 10–30 minutes in duration, but, for consistency, only the first 10 minutes from each animal was included for further analysis.
Open loop behavioral assays
Optogenetically induced courtship:
All flies used for closed-loop experiments that expressed channelrhodopsin variants were reared in the dark on sugar-yeast food. Male flies were transferred 1–2 days after eclosion to food containing 400μM all-trans-retinal 48h before behavioral assays and kept at low density (3–7 males/vial). After plate tethering, male flies were transferred to a humidified warm chamber to recover from anesthesia for 2–6h. Flies were subsequently placed on the center of the ball and left to acclimate for at least 1h. This ensured that any remnant arousal caused by activation of P1 neurons during mounting had ample time to decay, and that flies were in a baseline state at the onset of the trials. Two 1.5-mm optic fibers (Edmund Optics) were coupled to two high-power red LEDs (660nm, LED Engin) mounted on a heat-sink (Ohmite), and placed directly above the head of the fly. Optical activation of P1 neurons was made with a single optical pulse, yielding a net power 8μW/mm2 at 600nm. Since the power of the red and green LEDs in the projector was set to zero, flies were presented with a small dark blue dot (ø ~28°, mimicking the angular size of a female fly 2 mm away from the male) on a light blue background. This dot oscillated in a symmetric 75° or 160° arc about the male, at a constant distance (i.e. size) and with a constant angular velocity.
For most single-stimulus experiments (see exception below), the visual target oscillated with a velocity such that they completed left-right sweeps at ~1Hz (75°/s or 160°/s). Flies were presented with the visual stimulus for 60–120s before optogenetic activation of P1 neurons. This allowed us to examine the flies’ baseline responses to the visual target, and ascertain that P1 neurons were not being activated by light from the projector as animals did not initiate tracking during this baseline period. P1 neurons were subsequently transiently activated by a single 3-s continuous optical pulse. Following initial P1 activation, we continued to monitor the animal’s motion in response to the visual stimulus for the remainder of the trial (between 9 to 29 minutes). For consistency, only the first 10 minutes from each animal was included for analysis.
For stop-and-go motion, the target ceased to move for 500ms at the center of the screen on each cycle, and subsequently continued on along its arc path (Extended Data Fig. 11h). For experiments where two dots of different velocity were presented, trials began with a 1–3 minute “blank” period where no stimulus was presented, after which a single stimulus appeared for 1–2 minutes. All males robustly courted the target. A second stimulus was subsequently added to the screen. This stimulus was identical to the first stimulus, but moved at 98% of the velocity (Extended Data Fig. 11i–j). The velocity of the faster dot was 80°/s. When examining model parameters, we continuously activated P1 neurons optogenetically during tethered behavioral experiments, allowing us to measure visual responses from males in a uniformly heightened arousal state (Fig. 4).
Pheromone induced courtship:
Virgin male flies were collected following eclosion and group-reared at low density for 2–3 days before behavioral assays. To prepare the stimulating female abdomen, we removed the wings and legs from a 3–7-day old CantonS virgin female to ensure that the distal portion of the male’s forelegs could readily contact her abdomen. We subsequently manually glued a pin to her dorsal thorax, and attached this pin to a long custom 3-D printed holder designed to fit around the conical screen. The female abdomen was positioned ~1.5cm and 90° to the right of the male before the trial was started and viewed from the side using an IR-sensitive camera (Point Grey, FMVU-03MTM-CS) equipped with a 94-mm focal length lens (InfiniStix). As during optogenetic activation of P1 neurons, male flies were presented with the visual stimulus for several minutes before he was presented with the stimulating abdomen of a conspecific female, allowing us to internally control his baseline response to the visual target. To allow the male to sample the abdomen, the experimenter centered the abdomen in front of the male and gently brought it into contact with the male’s foreleg using a micromanipulator (Scientifica). The female abdomen was subsequently returned to its initial position to minimize the extent it blocked the male’s field of view.
Visually induced courtship:
Virgin male flies were collected 2–8h following eclosion and single-housed for 42–48h to increase their motivation to court8,14,17,19. All courtship assays were performed at Zeitgeber 0–3h. After plate tethering, male flies were transferred to a humidified warm chamber to recover from anesthesia for 1–3h. Flies were subsequently placed on the center of the ball and left to acclimate for at least 30min in the dark. Each trial was initiated by the presentation of a stationary visual target for 60 sec to examine the animal’s baseline locomotion, after which the visual target began to oscillate. The visual target oscillated in a 75° arc about the animal with a constant angular velocity of ~75°/s, but the angular size of the dot was continuously altered to mimic the dynamics of a natural female during courtship. The angular size was altered by changing the distance between the male and the target in the ViRMEn world. The distance between the male and the target was taken from the inter-fly-distance (IFD) in a courting pair over the course of two minutes of courtship, and at each frame the angular position of the target was scaled by this IFD to give rise to a more dynamic female path. Angular sizes ranged between ~8–50°, with the average size being 22.5°. Each stimulus frame was thus unique for 2 minutes of time, and subsequently repeated until the end of the trial, until it intersected it’s original position. Experiments ranged from 10–30 minutes in duration, but, for consistency, only the first 10 minutes from each animal was included for further analysis. Across genotypes, ~70% of male flies spontaneously initiated courtship toward the visual target. Importantly, tethered females (n=9, data not shown) showed no response to the visual target stimulus, consistent with the sexually dimorphic nature of courtship pursuit.
Optomotor assays:
Male flies were isolated 12–24h after eclosion and single-housed in vials with food for 2–3 days until adulthood. After plate tethering, male flies were transferred to a humidified warm chamber to recover from anesthesia for 1–3h. Flies were subsequently placed on the center of the ball and left to acclimate for at least 30min in the dark. Wide-field motion stimuli were generated in ViRMEn and consisted of a square-wave grating on a light background with a wavelength of 10° and a rotational velocity of 115°/s. To allow us to compare neuronal activity during optomotor tracking to baseline periods, we interleaved presentations of a static grating with presentations of a moving grating during each trial, with each epoch lasting for 200s. To approximate the turning responses of courting flies in response to an oscillating target stimulus, the moving grating switched its rotational direction (i.e. clock-wise to counter clock-wise) every 1500ms.
Interleaved courtship-optomotor assays:
Male flies were isolated 12–24h after eclosion and housed in vials with food containing 400μM all-trans-retinal 48h before behavioral assays, kept at low density (3–7 males/vial). After plate tethering, male flies were transferred to a humidified warm chamber to recover from anesthesia for 1–3h. Flies were subsequently placed on the center of the ball and left to acclimate for at least 30min in the dark. Males were presented with a blank white screen for 60 seconds, and afterwards interleaved 30-second periods of either an oscillating ‘female’ target (as described under Optogenetically induced courtship) or a wide-field grating stimulus. Wide-field grating stimuli altered between clock-wise and counter-clockwise rotations (each for a duration of 2 seconds), spaced by a 3-second “rest” period during which the grating was stationary. Wide-field motion stimuli were generated in ViRMEn and consisted of a square-wave grating on a light background with a wavelength of 15° and a rotational velocity of 30°/s. After 480 seconds of assessment of the male’s baseline response to both the wide-field motion stimulus and the ‘female’ target, we optogenetically activated P1 neurons for 300 seconds with the same preparation described under Optogenetically induced courtship and continued to monitor behavioral responses.
Monocular stimulation:
To dissociate a male’s behavioral response to progressively versus regressively moving visual targets, we presented the ‘female’ visual target to only one eye while optogenetically activating P1 neurons (split-P1 > UAS-CsChrimson). Males were reared as described under Optogenetically induced courtship and presented with a small dark dot (ø 25°) that moved from an angular position of 35° to the males right or left side to the 0° position right in front of the male, and subsequently back again after a 5-second delay. This stimulus was repeatedly presented, interleaved by 5-second delays, for 600 seconds while we monitored the male’s behavioral response.
Analysis of behavioral assays
Heat maps of turning:
Turning was computed on a frame-by-frame basis as the circular distance between the animal’s current heading and the animal’s heading in the next frame using the MATLAB circular statistics toolbox (v. 1.21.0.0)45. Heat maps were constructed by computing the phase length (in frames) of the stimulus and multiplying it by 3 (3PL). All frames were fit into a matrix of size Nx3PL. A very small number of remnant frames (typically < 0.5% of frames) at the end of the trial, caused by the total frames not being divisible by 3PLN, were discarded from heat maps but included in all other analysis.
Fidelity, Vigor, and Tracking Index:
To estimate how well animals were actively tracking the stimulus, we computed both the vigor and fidelity of their pursuit in a sliding time-bin of 180 frames (~3.7 sec). We defined the fidelity of a male’s pursuit as the correlation between the position of the visual target and the males change in heading (rad/s), and the vigor as the net amount of turning the male exhibited in the direction ipsilateral to the visual target. Because neither of these metrics fully captured male behavior, we defined a Tracking Index as the product of the fidelity and the within-animal normalized vigor of pursuit (vigor in the current cycle divided by the maximum vigor observed). This normalization step was done to bound the Tracking Index between −1 and 1, and to correct for any difference in males’ ability to turn on the ball. To compute a tracking index for the optomotor response, we used only the normalized vigor of a male’s turning (net amount of turning in the direction of wide-field motion), as turning responses typically lagged a change in motion-direction (making fidelity a poor metric), and used a larger time-bin due to the relatively slower visual stimulus alterations (444 frames, 9.3 sec). The Tracking Index was set to zero in the first and last 90 frames, as we did not have a sufficient number of frames to compute it.
Classification of behavioral epochs:
Courtship was classified as any period where the tracking index exceeded 0.3. To separate periods of general locomotion versus periods of courtship (e.g. Fig. 2d) when analyzing responses to visual stimuli, we averaged the male’s velocity for three stimulus cycles and selected all periods where the average tracking index was greater than 0.3 versus periods where it was less than 0.3 but the male’s average linear speed exceeded 5mm/s, or his angular speed exceeded 2rad/s (‘moving’). The threshold value for the tracking index was selected so as to be above fluctuations in the tracking index during random running (Extended Data Fig. 3d). The threshold for angular and linear speed was selected to be well above the noise of a fly standing still caused by small vibrations in the floating ball (Extended Data Fig. 3e–f). The distribution of angular velocities and linear speeds exhibited by animals in epochs classified as ‘moving’ or ‘courting’ is shown in Extended Data Fig. 8a–b.
To examine the behavioral kinematics of animals during times of disengagement versus times of active courtship (Extended Data Fig. 3h–i), we found periods where animals were actively courting (TI>0.3) versus periods where the Tracking Index was less than 0.3. To ensure that we robustly sampled data from each epoch and not transition periods, only epochs that lasted at least 10 seconds were included in this analysis. To examine the duration of these pausing bouts versus the duration of courtship bouts (Extended Data Fig. 3g), we used the same thresholds but did not set a minimum amount of time for the bout durations. To quantify the probability of an animal transitioning from courtship into a state of disengagement and vice-versa (Extended Data Fig 3j–k), we segregated behavioral data into 10 second bins and calculated the number of times that the animal transitioned from courtship into disengagement in the given bin, and divided this number by the total amount of time the animal spent in courtship (i.e. number of opportunities it had to transition). This yielded the probability that, in any given second, the animal transitions from one state to the other.
Two photon functional imaging
Functional imaging experiments were performed with an Ultima two-photon laser scanning microscope (Bruker Nanosystems) with a Chameleon Ultra II Ti:Sapphire laser. All samples were excited at a wavelength of 920nm, and emitted fluorescence was detected with a GaAsP photodiode detector (Hamamatsu). All images were acquired with a 40X Olympus water-immersion objective with 0.8 NA. To reduce high-frequency noise caused by emitted light from the projector during imaging, we placed a piece of blue-light filter-paper (Rosco) in front of the projector lens, and 3D printed a custom light-shield that fit over the objective to prevent light from entering the brain from above.
After cuticular removal as described above, flies were carefully lowered onto the ball using a micromanipulator (Scientifica) and the shrouded objective lowered over the brain. We subsequently identified the brain region of interest and centered a small ROI over it, yielding an imaging rate of 7–12Hz. Power was kept low and we ensured that no pixels were saturated. On rare occasions flies were discarded because the glue holding the proboscis broke loose from the mouthparts, causing severe motion artifacts in the z-direction, or because the expression of GCaMP was too weak to detect the neuropil of interest at low imaging power.
LC10 imaging:
An ROI was selected to cover the entire AOTu on a single hemisphere at the depth with the broadest axon terminal distribution, roughly the center of the glomerulus in the superior-inferior axis. Flies were subsequently left to acclimate to the ball for at least 30 minutes before imaging commenced. The hemisphere targeted for imaging was selected pseudorandomly for each fly to ensure that there were no significant biases in expression between the hemispheres. Trials were structured as described under Visually Induced Courtship. When temporal specificity was critical (e.g. in comparing LC10a responses to turning responses or characterizing receptive field properties), we used the faster jGCaMP7f sensor instead of the brighter GCaMP6s sensor. We observed no differences in the Δgain between experiments using the two sensors (Extended Data Fig. 7f–g). These same protocols were employed for imaging LC10b/c (OL0023B) and LC10d (SS03822) neurons.
During imaging of LC10 axon terminals in animals expressing a channelrhodopsin in P1 neurons we expressed GCaMP6m under control of LC10a-LexA20, a weaker but highly selective driver line46. We selected a narrow ROI encompassing the AOTu and avoiding the adjacent Lateral Protocerebral Complex (LPC) due to possible aberrant excitation of P1 neurons expressing CsChrimson. During all experiments involving ‘continuous’ P1-activation, we first delivered a single 2 second pulse of red light, and subsequently pulsed the red light (0.2 Hz, 100ms pulse width) and imaged in-between pulses of light. For experiments where we examined the effect of P1 activation on LC10 signaling and behavior, we first monitored the baseline response. After a 60-second baseline period the stimulus target began to oscillate dynamically to drive males to spontaneously initiate courtship. Males were allowed to court the target spontaneously for four minutes, after which we continuously activated P1 neurons optogenetically for five additional minutes as the target continued to oscillate. For experiments with two symmetrically opposing targets (Extended Data Fig. 8g–j), we similarly avoided including the LPC in our ROIs. After a 60-second baseline period we began to continuously activate P1 neurons optogenetically, and a single stimulus target began to oscillate for 30 seconds to monitor the baseline response of LC10 neurons. After these initial 30 seconds, a second visual target whose angular position was equal and opposite to the first target was added, yielding identical stimulation of both eyes.
For experiments where we monitored the responses of LC10 neurons to a wider panel of visual targets (Extended Data Fig. 10b–i), animals were first presented with a sequence of visual targets in the absence of P1 activation. Each visual stimulus was presented 10 times in each motion direction (left-right and right-left sweeping), separated by a 5 second Inter-Stimulus Interval (ISI). The sequence of visual targets was pseudorandomized. After this baseline panel, we repeated the stimulus presentations in identical order while continuously activating P1 neurons as described above. The stimulus panel consisted of four distinct stimuli: a dark 10° wide sphere sweeping at 75°/s; a dark 25° wide sphere sweeping at 75°/s; a tall dark 10° wide bar sweeping at 75°/s; and a dark sphere that expanded from an initial size of 10° to a final size of 100° with constant angular velocity (20°/s) for 4.5.
P1 imaging:
An ROI was selected to cover the lateral junction in the medio-lateral and dorsal-ventral axes, below the P1 arch and above the protrusion of the P1 ring4. As with LC10a imaging, flies were left to acclimate after ROI selection, and the hemisphere targeted for imaging was altered between experiments. Trials were structured as described under Visually Induced Courtship or Optomotor Assays.
Co-imaging of LC10a and P1:
To simultaneously monitor calcium transients in P1 neurons and LC10a neurons, we expressed GCaMP6s under control of both 71-G01 GAL4 and LC10a GAL4. An ROI was selected to cover the lateral junction as described under P1 imaging, but extended to incorporate the ipsilateral AOTu as well. During analysis, separate ROIs were drawn to encompass either the LPC or the AOTu. Trials were structured as described under Visually Induced Courtship.
Imaging analysis
Image stacks were motion corrected using Non-Rigid Motion Correction (NoRMCorre)47 and were subsequently manually validated for motion artifacts. For each experimental recording, an ROI was drawn in FIJI (ImageJ, NIH) across the entire population of interest containing neuropil (e.g. for LC10a imaging, an ROI was drawn around the bundle of axon terminals in the AOTu) and the average fluorescence extracted. Fluorescence was normalized in MATLAB by assuming that the pre-stimulus/pre-courtship epoch represented the baseline fluorescence of the populations of interest. The average fluorescence of first 100 frames (~10s) of recording were thus used as the baseline (F0), and a ΔF/F0 was defined as: , where i denotes the current frame. To allow us to compare the shape of the responses of LC10a-d neurons during courtship and during plain running, we normalized the average response to one stimulus cycle of each animal to its maximum value across all stiumulus cycles (i.e. ).
Image-behavior correlations:
Because imaging data was collected at a lower frame rate than behavioral data, we downsampled the behavioral data using linear interpolation at the imaging time points to allow us to compute correlations between behavior and imaging. Behavioral data was binned, and the imaging frames corresponding to each bin averaged. To correlate the fluorescence of LC10a-d neurons with the fly’s turning (Fig. 2f), we convolved the fly’s heading signal by an exponential with dynamics closely resembling that of jGCaMP7f (rise τ = 105ms, decay τ = 170ms)38 to account for the delay introduced by the calcium sensor. When calculating the average evoked response of LC10a to the visual stimulus, we averaged the responses of all stimulus cycles during courtship and ‘moving’ (determined as described above) and found the peak ΔF/F0 of this averaged response for each animal. For computing the gain, we divided the peak-trough difference during running by the peak-trough difference during courting. For computing the correlation between evoked LC10 responses and evoked turning/speed (Extended Data Fig. 8c–f, j; Extended Data Fig. 10f–g) we computed the average maximum evoked response when the stimulus was ipsilateral to the imaged AOTu, as well as the average (or total) turning and linear speed of the animal in the same time-period.
To assess the activity of P1 neurons in the different behavioral epochs of a courtship trial (Fig. 1m), we segregated the data into three categories: periods where animals were actively courting (TI>0.3), periods where the animal had previously courted and would court at least once more during the trial (‘disengaged’ periods), and the period before animals initiated courtship. To ensure that we robustly sampled data from each epoch and not transition periods, only epochs that lasted at least 10 seconds were included in analysis. To correlate P1 activity with behavioral data during optomotor trials and during courtship trials (e.g. Fig 1n–o; Extended Data Figs. 5b, 6f–o), we downsampled the behavioral data using linear interpolation at the imaging time points to allow us to compute correlations between behavior and imaging. To analyze how the relationship between P1 activity and behavior changed over time, we took two approaches: (1) we scatter plotted P1 activity versus the tracking index in the first minute of courtship versus the remainder of the trial (Extended Data Fig. 5c); and (2) we segregated the trial into 30-second bins and computed the correlation between P1 and the tracking index, the maximum P1 activity, and the maximum tracking index in each bin (Extended Data Fig. 5e–g).
To compare the relationship between the responses of LC10 neurons in the AOTu and tracking during spontaneous courtship versus during continuous activation of P1 neurons, we generated 2-D density plots of animal’s tracking indices versus the evoked response of LC10 neurons (Fig. 3g). For each stimulus cycle, we computed the averaged tracking index and the maximum ΔF/F0 in the AOTu and counted the number of observations in each bin. This was normalized by the total number of observations across animals.
Co-imaging of LC10a and P1 neurons:
To analyze the relationship between LC10a activity and P1 neuron activity, we computed the maximum evoked LC10 response each time the stimulus swept across the ipsilateral field-of-view versus the average activity of P1 neurons in the same time-period. The responses of each were normalized within animals to account for variations in GCaMP expression (Fig. 3c). To examine the relationship between LC10a activity and ipsilateral turning at differing levels of P1 activity (Fig. 3b), we computed the evoked LC10a activity each time the stimulus swept across the ipsilateral hemifield and versus the total turning of the animal in the direction of the stimulus and the average P1 activity in the same period. To estimate whether P1 neuron activity or LC10a activity occurred first, we computed the cross-covariance of the raw GCaMP signals collected from each neuropil (Extended Data Fig. 10a). Cross covariances were normalized such that the autocovariance at zero lag equaled 1. For computing the cross-covariances, all recordings were linearly interpolated to a common time-basis of 10Hz to correct for slight variations in imaging rates across animals (images were acquired at 8–12Hz).
Size-dependence of response:
To estimate the extent to which the animal’s turning response and the magnitude of the evoked ΔF/F0 of LC10a neurons depended on the angular size of the stimulus (Extended Data Fig. 8m–n), we computed the average angular size of the target stimulus for each stimulus cycle during visually induced courtship trials, and computed the average behavioral and neural response for each 2° bin of angular sizes.
Stimulus panel:
To examine the responses of LC10 neurons to our panel of stimuli, we computed the average evoked LC10 response for each animal from 2 seconds before the stimulus started moving to 2 seconds after it had ceased moving, and plotted the average of these responses across animals. To estimate the magnitude by which responses to the different stimuli were modulated by P1 activation (Extended Data Fig. 10f), we computed a Response Modulation Index as the relative difference between evoked LC10a response during P1 stimulation versus baseline. That is:
Where LC10 denotes the average response in the given condition (+/− P1 activation). This metric is beneficial because it is bounded between −1 and 1, and because it preserves the relative difference between responses with and without P1 activation (e.g. a 2-fold amplification by P1 activation always yields the same value, regardless of the magnitude of the responses).
Direction selectivity of LC10 neurons:
To examine the direction selectivity of LC10a neurons across the population, we examined the average evoked LC10a ΔF/F0 response progressively versus regressively moving targets in the presence or absence of P1 activation and calculated a Direction Selectivity Index. The Direction Selectivity Index was computed analogously to the Response Modulation Index described above:
Where LC10 denotes the average response in the given condition (progressive vs. regressive motion). When the average ΔF/F0 for an ROI was negative, the average response was set to zero as it would otherwise interfere with calculation of the Direction Selectivity Index.
While LC10 neurons, on aggregate, responded more strongly to progressively moving stimuli than regressively moving ones (Extended Data Fig. 10i), we wondered whether this may be attributable to distinct subpopulations of LC10 neurons given that this feature was not found by previous studies20. To examine the direction selectivity of individual LC10a boutons in the AOTu, we analyzed data from the multi-stimulus panel where animals were presented with 25° sweeping dots, separated by a 5-second inter-trial-interval, during continuous P1 activation. To identify ROIs, we used semi-unsupervised constrained non-negative matrix factorization (CNMF)48 using a Greedy initialization method on motion-corrected videos (Extended Data Fig. 11a–b). This algorithm is beneficial because it segregates pixels into ROI’s depending both on their temporal and spatial footprints, identifying contiguous sets of strongly correlated pixels that presumably correspond to the axon boutons of individual LC10a neurons. It can also extract components with overlapping spatial footprints. A small number of ROI’s were manually discarded because they labeled regions outside of the AOTu where no GCaMP was expressed.
Two photon optogenetic stimulation
Activation:
For targeted activation of LC10a neurons in LC10a>UAS-CsChrimson animals, animals were placed on the ball and a small “stimulation” ROI over the AOTu was defined as described above. We subsequently identified a second “sham” ROI of similar size, and set the frame rate of both ROIs to 10Hz. The “sham” ROI was adjacent to the “stimulation” ROI and within the same hemisphere, but did not include any fluorescent neuropil. After ROI identification, animals were left to acclimate to the ball for at least 1h before the experiment commenced. During the experiment, we increased the power of the laser to intermediate levels, and switched between focusing the laser over the “stimulation” ROI and the “sham” ROI every ~4 sec (40 frames plus a 750ms delay to switch the laser focus) while recording the animal’s motion in FicTrac as described above. Animals were in the dark and no visual stimulus was presented. Each trial lasted 10–30 minutes, but only the first 10 minutes were included in analysis for consistency.
Silencing:
For targeted silencing of LC10a neurons in LC10a>UAS-GtACR1, we selected a “sham” ROI and a “stimulation” ROI as detailed above. Note that only one z-slice of the AOTu was targeted, making two-photon silencing less profound than broad optogenetic silencing but exquisitely spatially targeted, allowing us to focus on one hemisphere without affecting the other. After resting, trials were structured as described under Visually Induced Courtship. The laser was focused over the “sham” ROI during the first stimulus oscillations to ensure that animals properly initiated courtship, and subsequently moved between the “stimulation” ROI and the “sham” ROI every 60–90 seconds for the duration of the trial to intermittently silence LC10a neurons in one hemisphere. As with activation, the first 10 minutes of each trial were included in analysis.
Model of turning dynamics
We constructed a network model of the visuo-motor transformation underlying animal’s behavioral responses to small moving targets during courtship. The core of the model consists of 20 LC10a neurons per hemisphere, modeled as leaky integrate-and-fire units with spike-rate adaptation49. Membrane voltage was computed as:
with a membrane time constant ( of 10ms, a resting membrane voltage ( of −65mV, a membrane resistance ( of 10MΩ, and a potassium reversal potential () of −70mV. The threshold for spiking is −50mV, after which the membrane voltage is reset to The spike rate adaptation is modeled as a potassium conductance ( which increases with each spike in the unit, such that where nS. The potassium conductance is altered such that:
It thus decays to exponentially zero with a time constant ms. The system of equations was estimated over the entire duration of the trial using Euler’s method with a time-step of 3ms. The input to the model was the angular position of the target stimulus, updated at the same framerate as it was presented to animals (~50Hz).
In each hemisphere, each LC10a neuron covers a non-overlapping region of space. Because stimuli were only presented to the front of the male during tethered behavior, the modeled field of view ranged from 0° to 180° with 15° of binocular overlap28 (i.e. each neuron coved 10.5° of the visual field). Each neuron was only sensitive to motion in its designated field-of-view and was assumed to be completely selective for progressive motion, with zero response to regressive motion. Importantly, model neurons were sensitive to the change in the angular position of moving objects, but not their angular size on the retina, consistent with the broad tuning of LC10a receptive fields and behavioral evidence that males track targets of varying size with equivalent vigor during close-range pursuit20 (Extended Data Fig. 8m–n).
To compute the input current to each unit of the model, we transformed the estimated temporal receptive fields of LC10a neurons20 into a continuous equation by fitting softmax functions to the rising and falling phase independently, and subsequently multiplying the two (Fig. 4a):
Where indicates the time that motion occurred. Values , and provided the best fit to the estimated receptive field according to a grid search. Note that the product of the softmax functions is bounded between zero and one, and thus only provided the relative structure of the receptive fields. To compute the total amount of input current to LC10a neurons in a given moment, we summed up this equation for all periods in time that visual motion had occurred in the model neuron’s spatial receptive field, and scaled it by a constant factor such that:
where was set to 1.5nA. As indicated, the total input current was the sum of the receptive fields up to the current time point, multiplied by the scaling factor. Input was thus primarily driven by visual motion that occurred in the past 500ms, and visual motion that occurred further than ~2 seconds ago yielded essentially no input current in accord with the estimated receptive fields. Neurons only received input from the time points where the stimulus was present in the neuron’s spatial receptive field.
Modelling free behavior:
To model turning responses of freely behaving animals in response to female motion, we selected courtship assays during which the male courted the female for at least 90% of the time before copulation. This ensured that our model was primarily compared to the male’s behavior during active, close-range courtship. To generate input, we estimated the female position on the male’s retina on each frame as a point as described above and provided this positional information to the model to generate turning. Because the female could occupy any position relative to the male in this preparation, we modeled the full estimated field 270° field-of view with 15° of binocular overlap28, and slightly increased the visual resolution of the model so that each LC10a model neuron covered only 7.5° of visual space (40 model neurons total). Because this caused each unit to receive less input current (as the stimulus spent less time within each receptive field), we also increased to 2.5nA to compensate.
To model pursuit in 2-D space (Supplementary Mov. 7), rather than turning responses alone, we initialized the model with the same heading and position as the real male and provided the initial angular position of the female relative to the model. On each frame of the video recording, we updated the angular position of real female fly, and allowed the model to reorient proportionally to the firing rate in the left and right LC10a populations (with a net 200 spikes equaling a 1 radian turn). To move the model in 2-D and allow it to keep up pace with the female, we displaced the model by the same magnitude as the female on each frame, oriented in the direction of the model’s heading. The only exception to this displacement was when the female exhibited an instantaneous velocity less than 2.5mm/s, at which point the model reoriented but was not displaced in 2-D space.
Importantly, from this initialization of the model and onwards, the real male and the model were completely decoupled from each other, and independently pursued the target along similar trajectories. In computing the cross covariance between the model and male behavior, we normalized cross covariances such that the autocovariance at zero lag equaled 1.
Incorporating P1 activity:
To incorporate the fluorescence of P1 neurons, we denoised the ΔF/F0 time series50 and corrected for any drift in the baseline fluorescence using a sliding percentile filter with a window size of 200 seconds. To modulate the response of LC10a neurons in our continuous model, we simply multiplied the input current by the ΔF/F0 recorded in the closest previous imaging frame. In our threshold-based model, we set a threshold limit of 0.15ΔF/F0 (approx. 3σ of the baseline ΔF/F0 distribution of P1 neurons). When the fluorescence of P1 neurons exceeded this limit, the model received strong input (equivalent of 0.5ΔF/F0 in the continuous model); when it did not, the model received no input on the given frame.
Analysis of model results
To transform spiking in LC10a model neurons to estimates of turning, we implemented a contralateral inhibition component in which we subtract the number of spikes from LC10a neurons in the left hemisphere from LC10a neurons in the right hemisphere in discrete time bins of 30ms. The model turned in the direction with the highest net number of spikes in the given bin, scaled by the magnitude of the net number of spikes. The model was aimed at capturing the dynamics of turning during courtship and the relative magnitude of turns. The absolute magnitude of turning each spike corresponds to in the courting animal is an unconstrained problem and subject to the magnitude of the scaling factor . For P1 incorporation and during free behavior we found that a net 300 spikes/s corresponded to roughly 1 rad/s. These values were used for converting spikes to estimated turning (e.g. Fig. 4e).
Each representative alignment of the model and behavior was replicated across at least 4 animals. For computing the Pearson correlation or the cross-correlation between the model’s predicted turning and the animal’s actual turning, we downsampled the model net spiking data using linear interpolation at the behavioral time points since the model frame rate was several times faster than the behavioral recording rate. The animal’s heading signal was smoothed using a moving average window of 30ms. To estimate the fraction of turns that the model accurately predicted (Extended Data Fig. 13a; the model “hit” rate) we detected all cycles during which the animal executed an ipsiversive turn of at least 2 radians and calculated the fraction of these peaks that were accompanied by a model in the same direction. To estimate the fraction of turns that the model took but the animal did not take (Extended Data Fig. 13a; the model “false alarm” rate), we similarly detected all ipsiversive model turns of at least 1 radian, and calculated the fraction of these peaks that were accompanied by an animal turn of at least 1 radian in the same direction. The threshold for detecting a turn was lower for the model because it, in difference from behavior, is effectively noiseless.
To estimate importance of the temporal structure of the LC10a receptive fields, we varied the parameter in the input function of our model to yield faster or slower rise-times and compared the Pearson correlation between the model and animals over a 60 sec period of courtship (Extended Data Fig. 11g). This variation in the receptive fields causes a narrowing or broadening of the receptive fields, with smaller rise-times yielding less net excitatory input to the model and vise-versa. To correct for this variation, we normalized the area under the curve of the receptive fields by that of the standard model described above (i.e. ).
To compute the turning responses of animals and the model for varying levels of P1 activity, we computed the total turning in the direction of the target stimulus for each stimulus cycle, and binned these turning responses based on the maximum ΔF/F0 exhibited by P1 neurons in the same stimulus cycle.
EM connectivity
Identifying LC10 subtypes:
We analyzed the skeletons and synapses of traced neurons in the female adult hemi-brain connectome (hemibrain:v1.2)23 using the Neuprint toolkit in R51. 449 LC10 neurons have been labeled as such in the connectome, but the four subtypes (a-d) of LC10 neurons21,22 have not been separated. To separate these, we manually inspected each of the LC10 neurons and designated each of them as LC10a, LC10b, LC10c, LC10d, or unknown. We payed particular attention to the somatic location, the branching structure of dendrites in the lobula, the depth of dendritic branches in the lobula, and the branching structure of axons in the large subunit of the AOTu. We were highly selective in our designation and thus denoted roughly half of LC10 neurons as unknown when we could not ascertain the cell-type based on morphology. We repeated this process twice and only designated neurons as belonging to a cell-type when it was independently identified on both rounds. In total, we designated 59 LC10a neurons, 44 LC10b neurons, 66 LC10c neurons, and 80 LC10d neurons. The Neuprint ID number for each of these neurons is given in Supplementary Table 2.
Analysis of connectomics data:
To examine the difference in presynaptic and postsynaptic partners of the different LC10 subtypes, we first computed the correlation between the output/input vectors for all pairs of labeled LC10 neurons. The sorted correlation matrices for inputs and outputs are shown in Extended Data Fig. 9c,e. Second, we visualized differences in the output and input connectivity matrices using t-distributed stochastic neighbor embedding (t-SNE) with a perplexity of 30 and labeled individual LC10 neurons according to their subtype. To group outputs of LC10a neurons by brain region, we examined each of the post-synaptic partners of all LC10a neurons and determined the 3 brain regions in which these partners innervated most densely based on total pre-synaptic counts. To group inputs, we examined each of the pre-synaptic partners LC10a neurons and determined the 3 brain regions in which these partners received the most input based on total post-synaptic counts. Brain regions were defined according to standard meshes included in the hemibrain dataset. We excluded connections from or to optic neuropils, and brain regions to which LC10a neurons were connected to by less than 50 synapses total across the whole population (for example, LC10a neurons form only 27 synapses with post-synaptic partners projecting to the bulb (BU), and this connection was thus not plotted). The full brain-region connectivity is included in Supplementary Table 2. We plotted the full morphology only of neurons which were strongly connected to LC10a neurons, assessed by the existence of at least 10 synaptic connections between an LC10a neuron and the connected neuron. These were grouped manually as either projecting to the Lateral Accessory Lobes or the Inferior Bridge.
Trans-tango and immunohistochemistry
The LC10a GAL4 line used for all other experiments also labels a sparse number of Kenyon cells20, which is amplified to label many Kenyon cells by the trans-tango expression system24. To visualize the downstream synaptic partners of LC10a, we instead used a sparser split-GAL4 line that exclusively labels LC10a neurons (OL0019B)21. This line was not used for functional imaging experiments due to low expression levels. OL0019B > R; Trans-tango males were selected 8–12h after eclosion and group housed at medium density (15–20 flies/vial). To allow for proper expression, males were aged for 30–40 days at 20°C before dissections. Brains were dissected in Schneider’s medium (Sigma Aldrich S0146) for 30 min and then immediately transferred to cold 1% paraformaldehyde (Electron Microscopy Sciences) and fixed for 16–20h at 4°C. Samples were then washed in PAT3 buffer (0.5% BSA, 0.5% Triton X-100, 1X PBS, pH 7.4) three times. The last two washes were made by incubating samples for 1h on a nutator at room temperature. A 3% goat serum block was added, and brains were incubated on a nutator for 90 min at room temperature before block was removed and 1mL of fresh 3% goat serum was added back, along with primary antibodies. Primary antibodies used were 1:50 mouse anti-Brp (nc-82, Developmental Studies Hybridoma bank), 1:1000 rabbit anti-GFP (A11122, Invitrogen; against OL0019B > UAS-myrGFP), and 1:100 rat anti-HA (11867423001, Roche; against QUAS-mtdTomato). Brains were incubated with primary antibodies on a nutator for 3h at room temperature, and then moved to a nutator at 4°C for 12–16h. Samples were subsequently washed thrice with PAT3 buffer as detailed above. The final wash was removed and 1mL of fresh 3% goat serum added along with secondary antibodies. Secondary antibodies used were 1:500 AF555 goat anti-Rat (A21434, Invitrogen), 1:500 AF633 goat anti-mouse (A21052, Invitrogen), and AF488 goat anti-rabbit (A11034, Invitrogen). Samples were incubated with secondary antibodies for 4 days at 4°C on a nutator, and subsequently mounted in Vectashield (Vector Laboratories) in 5/8th inch hole reinforcements placed on glass slides. Images were captured on an inverted Zeiss LSM 780 confocal microscope using a 25x objective.
Statistics and reproducibility
Please see Supplementary Table 1 for details on statistics. All statistical analyses were performed in MATLAB R2019a or GraphPad Prism 9. Data sets were tested for normality using Shapiro-Wilk, and appropriate statistical tests applied as described in Supplemental Table 1 (e.g. t-test for normally distributed data, Fischer’s exact test for categorical observations, Mann Whitney U-test for non-parametric data, Friedman test with Dunn post hoc test for non-parametric data with repeated measurements). All statistical tests used were two-tailed. Our model was noise-less and thus fully deterministic. Shaded regions surrounding line-plots indicate ± s.e.m. unless otherwise stated. Experimenters were not blind to the conditions of the experiments during data collection and analysis. All attempts at replication were successful.
Extended Data
Supplementary Material
ACKNOWLEDGEMENTS
We thank K. Kuchibhotla, B. Noro, L. Abbott, S.R. Datta, R. Coleman, and P. Brand for comments on the manuscript; I. Ribeiro for discussions and sharing the LC10a split-GAL4 and LC10a-LexA driver lines, and Y. Aso for LexAop-GCaMP6s/UAS-CsChrimson flies; J. Weisman and G. Maimon for generously sharing their designs for an integrated, projector-based system for presenting tethered, walking flies with visual stimuli in advance of publication; R. Coleman, I. Morantte, A. Siliciano, J. Petrillo, and Rockefeller Precision Instrumentation Technologies for technical advice; and G. Maimon, C. Bargmann, L. Abbott, and members of the Ruta laboratory for discussion. This work was supported by the Simons Collaboration to the Global Brain, a Reem-Kayden Award, and 5R35NS111611 from the National Institute of Health to V.R., a David Rockefeller Fellowship to T.H.S, and an HHMI Hanna H. Gray Fellowship to A.O. This material is based upon work supported by the National Science Foundation Graduate Research Fellowship Program under Grant No. 1946429. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.
Footnotes
COMPETING INTERESTS STATEMENT
The authors declare no competing interests.
DATA AVAILABILITY
All data underlying this study available upon request from the corresponding author.
CODE AVAILABILITY
Code underlying the network model is available at https://github.com/rutalaboratory/LC10NetworkModel.
REFERENCES
- 1.Kimura K, Hachiya T, Koganezawa M, Tazawa T. & Yamamoto D. Fruitless and Doublesex Coordinate to Generate Male-Specific Neurons that Can Initiate Courtship. Neuron 59, 759–769 (2008). [DOI] [PubMed] [Google Scholar]
- 2.von Philipsborn AC et al. Neuronal Control of Drosophila Courtship Song. Neuron 69, 509–522 (2011). [DOI] [PubMed] [Google Scholar]
- 3.Yamamoto D. & Koganezawa M. Genes and circuits of courtship behaviour in Drosophila males. Nature Reviews Neuroscience 14, 681–692 (2013). [DOI] [PubMed] [Google Scholar]
- 4.Yu JY, Kanai MI, Demir E, Jefferis GSXE & Dickson BJ Cellular Organization of the Neural Circuit that Drives Drosophila Courtship Behavior. Current Biology 20, 1602–1614 (2010). [DOI] [PubMed] [Google Scholar]
- 5.Pan Y, Meissner GW & Baker BS Joint control of Drosophila male courtship behavior by motion cues and activation of male-specific P1 neurons. Proceedings of the National Academy of Sciences 109, 10065–10070 (2012). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 6.Bastock M. & Manning A. The courtship of Drosophila melanogaster. Behavior 8, 85–111 (1955). [Google Scholar]
- 7.Spieth HT Courtship Behavior in Drosophila. Annu. Rev. Entomol. 19, 385–405 (1974). [DOI] [PubMed] [Google Scholar]
- 8.Kohatsu S. & Yamamoto D. Visually induced initiation of Drosophila innate courtship-like following pursuit is mediated by central excitatory state. Nature Communications 6, (2015). [DOI] [PubMed] [Google Scholar]
- 9.Seeholzer LF, Seppo M, Stern DL & Ruta V. Evolution of a central neural circuit underlies Drosophila mate preferences. Nature (2018) doi: 10.1038/s41586-018-0322-9. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 10.Clowney EJ, Iguchi S, Bussell JJ, Scheer E. & Ruta V. Multimodal Chemosensory Circuits Controlling Male Courtship in Drosophila. Neuron 87, 1036–1049 (2015). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 11.Kallman BR, Kim H. & Scott K. Excitation and inhibition onto central courtship neurons biases Drosophila mate choice. eLife 4, (2015). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 12.Zhang SX, Miner LE, Boutros CL, Rogulja D. & Crickmore MA Motivation, Perception, and Chance Converge to Make a Binary Decision. Neuron 99, 376–388.e6 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 13.Bath DE et al. FlyMAD: rapid thermogenetic control of neuronal activity in freely walking Drosophila. Nat Methods 11, 756–762 (2014). [DOI] [PubMed] [Google Scholar]
- 14.Inagaki HK et al. Optogenetic control of freely behaving adult Drosophila using a red-shifted channelrhodopsin. Nat Methods 11, 325–332 (2014). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 15.Hoopfer ED, Jung Y, Inagaki HK, Rubin GM & Anderson DJ P1 interneurons promote a persistent internal state that enhances inter-male aggression in Drosophila. eLife 4, (2015). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 16.Götz KG & Wenking H. Visual Control of Locomotion in the Walking Fruitfly Drosophila. J. comp. Physiol. 85, 235–266 (1973). [Google Scholar]
- 17.Agrawal S, Safarik S. & Dickinson M. The relative roles of vision and chemosensation in mate recognition of Drosophila melanogaster. Journal of Experimental Biology 217, 2796–2805 (2014). [DOI] [PubMed] [Google Scholar]
- 18.Billeter J-C, Atallah J, Krupp JJ, Millar JG & Levine JD Specialized cells tag sexual and species identity in Drosophila melanogaster. Nature 461, 987–991 (2009). [DOI] [PubMed] [Google Scholar]
- 19.Zhang SX, Rogulja D. & Crickmore MA Dopaminergic Circuitry Underlying Mating Drive. Neuron 91, 168–181 (2016). [DOI] [PubMed] [Google Scholar]
- 20.Ribeiro IMA et al. Visual Projection Neurons Mediating Directed Courtship in Drosophila. Cell (2018) doi: 10.1016/j.cell.2018.06.020. [DOI] [PubMed] [Google Scholar]
- 21.Wu M. et al. Visual projection neurons in the Drosophila lobula link feature detection to distinct behavioral programs. eLife 5, e21022 (2016). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 22.Otsuna H. & Ito K. Systematic analysis of the visual projection neurons in Drosophila melanogaster. I. Lobula-specific pathways. Journal of Comparative Neurology 497, 928–58 (2006). [DOI] [PubMed] [Google Scholar]
- 23.Xu CS et al. A Connectome of the Adult Drosophila Central Brain. (2020) doi: 10.1101/2020.01.21.911859. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 24.Talay M. et al. Transsynaptic Mapping of Second-Order Taste Neurons in Flies by trans -Tango. Neuron 96, 783–795.e4 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 25.Namiki S, Dickinson MH, Wong AM, Korff W. & Card GM The functional organization of descending sensory-motor pathways in Drosophila. (2017) doi: 10.1101/231696. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 26.Schretter CE et al. Cell types and neuronal circuitry underlying female aggression in Drosophila. eLife 9, e58942 (2020). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 27.Rayshubskiy A. et al. Neural circuit mechanisms for steering control in walking Drosophila. 10.1101/2020.04.04.024703 (2020) doi: 10.1101/2020.04.04.024703. [DOI] [Google Scholar]
- 28.Heisenberg M. & Wolf R. Vision in Drosophila: genetics of microbehavior. (Springer-Verlag, 1984). [Google Scholar]
- 29.Land MF & Collett TS Chasing behaviour of houseflies (Fannia canicularis): A description and analysis. J. Comp. Physiol. 89, 331–357 (1974). [Google Scholar]
- 30.Wehrhahn C, Poggio T. & Bülthoff H. Tracking and chasing in houseflies (Musca): An analysis of 3-D flight trajectories. Biol. Cybern. 45, 123–130 (1982). [Google Scholar]
- 31.Soto-Yeber L, Soto-Ortiz J, Godoy P. & Godoy-Herrera R. The behavior of adult Drosophila in the wild. PLoS ONE 13, 26 (2018). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 32.Trivers R. Parental Investment and Sexual Selection. in Sexual Selection and the Descent of Man, 1871–1971 (Aldine, 1972). [Google Scholar]
- 33.Kohatsu S, Koganezawa M. & Yamamoto D. Female Contact Activates Male-Specific Interneurons that Trigger Stereotypic Courtship Behavior in Drosophila. Neuron 69, 498–508 (2011). [DOI] [PubMed] [Google Scholar]
- 34.Tinbergen N. The study of instinct. (Oxford Clarendon Press, 1951). [Google Scholar]
- 35.Klapoetke NC et al. Independent optical excitation of distinct neural populations. Nat Methods 11, 338–346 (2014). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 36.Chen T-W et al. Ultrasensitive fluorescent proteins for imaging neuronal activity. Nature 499, 295–300 (2013). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 37.Mohammad F. et al. Optogenetic inhibition of behavior with anion channelrhodopsins. Nat Methods 14, 271–274 (2017). [DOI] [PubMed] [Google Scholar]
- 38.Dana H. et al. High-performance calcium sensors for imaging activity in neuronal populations and microcompartments. Nat Methods 16, 649–657 (2019). [DOI] [PubMed] [Google Scholar]
- 39.Eyjolfsdottir E. et al. Detecting Social Actions of Fruit Flies. in Computer Vision – ECCV 2014 (eds. Fleet D, Pajdla T, Schiele B. & Tuytelaars T) vol. 8690 772–787 (Springer International Publishing, 2014). [Google Scholar]
- 40.Maimon G, Straw AD & Dickinson MH Active flight increases the gain of visual motion processing in Drosophila. Nat Neurosci 13, 393–399 (2010). [DOI] [PubMed] [Google Scholar]
- 41.Green J. et al. A neural circuit architecture for angular integration in Drosophila. Nature 546, 101–106 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 42.Seelig JD & Jayaraman V. Neural dynamics for landmark orientation and angular path integration. Nature 521, 186–191 (2015). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 43.Moore RJD et al. FicTrac: a visual method for tracking spherical motion and generating fictive animal paths. J. Neurosci. Methods 225, 106–119 (2011). [DOI] [PubMed] [Google Scholar]
- 44.Aronov D. & Tank DW Engagement of Neural Circuits Underlying 2D Spatial Navigation in a Rodent Virtual Reality System. Neuron 84, 442–56. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 45.Berens P. CircStat: A Matlab Toolbox for Circular Statistics. Journal of Statistical Software 31, (2009). [Google Scholar]
- 46.Nojima T. et al. A sex-specific switch between visual and olfactory inputs underlies adaptive sex differences in behavior. Current Biology S0960982220318996 (2021) doi: 10.1016/j.cub.2020.12.047. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 47.Pnevmatikakis EA & Giovannucci A. NoRMCorre: An online algorithm for piecewise rigid motion correction of calcium imaging data. Journal of Neuroscience Methods 291, 83–94 (2017). [DOI] [PubMed] [Google Scholar]
- 48.Giovannucci A. et al. CaImAn an open source tool for scalable calcium imaging data analysis. eLife 8, e38173 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 49.Dayan P. & Abbott LF Theoretical neuroscience: computational and mathematical modeling of neural systems. (Massachusetts Institute of Technology Press, 2001). [Google Scholar]
- 50.Friedrich J. & Paninski L. Fast Active Set Methods for Online Spike Inference from Calcium Imaging. in Advances in Neural Information Processing Systems 29 (eds. Lee DD, Sugiyama M, Luxburg UV, Guyon I. & Garnett R) 1984–1992 (2016). [Google Scholar]
- 51.Clements J. et al. neuPrint: Analysis Tools for EM Connectomics. (2020) doi: 10.1101/2020.01.16.909465. [DOI] [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.