Main

Drosophila males woo potential mates by vibrating their wings to produce a species-specific courtship song. The male song induces deflections of the female aristae, thereby activating auditory sensory neurons that project to the central brain5. Several types of song-responsive neurons have been identified in the female brain6,7,8,9, but it is unknown whether and how these neurons regulate sexual receptivity. How a female responds to the song of a male is highly dependent on whether or not she has previously mated. Once mated, females store sperm for days to weeks, and during this time are reluctant to mate again10. A male seminal fluid peptide (sex peptide) binds to sperm and signals the presence of sperm in the female reproductive tract through an ascending pathway from the sex peptide sensory neurons (SPSNs) in the uterus via the sex peptide abdominal ganglion (SAG) neurons in the ventral nerve cord to the pC1 neurons in the brain3,4,11,12,13. Sex peptide attenuates neuronal activity in the SPSN, SAG and pC1 neurons4,13, thereby reducing sexual receptivity after mating3,4,11,12,13. We sought to investigate how these distinct external and internal signals are integrated in the female brain to control VPO (Supplementary Video 1), the motor output that signals the willingness of the female to mate.

Female receptivity is impaired by blocking the activity of the approximately 2,000 neurons that express either of the two sex-determination genes, fruitless (fru)14,15 or doublesex (dsx)16. This class of neurons includes the fru+ dsx+ SPSNs11,12, the dsx+ SAGs13 and the dsx+ pC1 cells3. To search for other fru+ or dsx+ neurons that contribute to female receptivity, we screened a collection of 234 sparse driver lines specific for various fru+ or dsx+ cell types. We used these driver lines to genetically silence each of these cell types, and assayed virgin females for their frequency of copulation within 10 min of being individually paired with naive wild-type males (Extended Data Fig. 1). Of the seven lines with the strongest reduction in receptivity, two labelled the SPSNs, one labelled the SAGs and one labelled the pC1 cells. The other three lines targeted a pair of female-specific descending neurons, which we named vpoDNs (Fig. 1a, Extended Data Fig. 2a). These neurons are dsx+, fru and cholinergic (Extended Data Fig. 2b, c). Their dendrites arborize primarily in the lateral protocerebrum and their axons project to multiple regions of the ventral nerve cord, including the abdominal ganglion (Fig. 1a).

Fig. 1: Female-specific vpoDNs control vaginal plate opening (VPO).
figure 1

a, Electron microscope (EM) reconstruction and confocal (LM) images of vpoDNs in the female central nervous system. b, c, Percentage of virgins copulating (b) and frequency of VPO (c) within 10 min of being paired with a wild-type male, with (ON) or without (OFF) constant optogenetic inhibition (560 nm, 10 μW mm−2 and 635 nm, 57 μW mm−2). d, Percentage of isolated virgins exhibiting VPO upon photoactivation (5 s, 635 nm, 57 μW mm−2). e, Frequency of VPO by wild-type females during a 10-min courtship assay. f, Percentage of mated females copulating within 1 h of courtship, with or without photoactivation (635 nm, 57 μW mm−2 in alternating 30-s ON–OFF periods). Data are mean ± s.e.m. P values indicated; two-sided Fisher’s exact test in b, d, f; two-sided Wilcoxon test in c, e. See Supplementary Table 3 for details of statistical analyses.

Acute optogenetic silencing or genetic ablation of the vpoDNs rendered virgin females unreceptive (Fig. 1b, Extended Data Fig. 3a), markedly reducing the frequency of VPO (Fig. 1c, Extended Data Fig. 3b) but not the intensity of male courtship (Extended Data Fig. 3c). Conversely, photoactivation of vpoDNs reliably triggered VPO in isolated virgin females (Fig. 1d, Extended Data Fig. 3d, Supplementary Videos 2, 3). We did not detect any peripheral expression driven by our vpoDN lines and by severing the abdominal nerve, confirmed that the VPO response is indeed due to activation of central neurons (Extended Data Fig. 3e).

Mated females are less receptive than virgins10, which we found to correlate with a lack of VPO (Fig. 1e). To assess whether the failure to perform VPO accounts for the low receptivity of mated females, we photoactivated the vpoDNs in mated females as they were being courted by wild-type males. Whereas control females never copulated during a 1-h assay, approximately 30–50% of the vpoDN-activated females did remate (Fig. 1f). A similar remating frequency was observed upon vpoDN activation in mated females paired with wingless males, which court but cannot sing (Fig. 1f). Thus, direct activation of vpoDNs bypasses the need for both the internal state (virginity) and the external cue (song) that normally combine to elicit VPO.

We observed that wing extension is the most frequent male action just before female VPO (Extended Data Fig. 4a), and that both VPO and copulation rates are reduced if males are muted by removing their wings or females deafened by removing their aristae (Fig. 2a). These results suggested that the vpoDNs might be activated by male song. Indeed, in two-photon calcium-imaging experiments, we detected a robust increase of calcium levels in the neurites of vpoDNs in virgin females upon playback of male courtship song (Fig. 2b), but not in response to white noise (Extended Data Fig. 4b). The response to courtship song was lost when the aristae were immobilized to deafen the female (Fig. 2b). Song responses have also been reported for the pMN2 neurons9, which are morphologically similar to vpoDNs and also dsx+, although their reported functions differ17 (Supplementary Information).

Fig. 2: Auditory inputs to vpoDNs.
figure 2

a, Percentage of virgins copulating and frequency of VPO. b, Changes in signal from the calcium sensor GCaMP6s in vpoDNs in response to conspecific courtship song, with or without immobilization of aristae. Lines indicate data from the same fly. c, Electron microscopy reconstructions showing 2 vpoENs and 14 vpoINs in the right hemisphere, and confocal images showing 2 vpoENs and 7–8 vpoINs in each hemisphere. Dashed lines indicate AMMC (red) and wedge (black). d, Example traces of membrane potential changes in vpoDNs upon photoactivation (red bar) of vpoENs or vpoINs. e, vpoDN membrane potential changes upon photoactivation of vpoENs or vpoINs, before and after mecamylamine (mec) application. f, g, Copulation (f) and VPO (g) rates upon photoinhibition (560 nm, 10 μW mm−2 and 635 nm, 57 μW mm−2), for virgins paired with wild-type males. h, Percentage of virgins exhibiting VPO upon vpoEN photoactivation (10 s, 635 nm, 57 μW mm−2). i, j, Copulation (i) and VPO (j) rates upon vpoIN photoactivation (10 s, 635 nm, 57 μW mm−2), for virgins paired with wild-type males. Data are mean ± s.e.m. P values indicated; two-sided Fisher’s exact test in a, f, h, i; paired two-sided Wilcoxon test in b; unpaired two-sided Wilcoxon test in e, g, j. See Supplementary Table 3 for details of statistical analyses.

The vpoDN dendrites lie mostly in the superior lateral protocerebrum, with no obvious arborizations within the antennal mechanosensory centre (AMMC), the primary auditory neuropil, or in the wedge region, a secondary auditory neuropil known to include song-responsive neurons7,8 (Fig. 1a). We therefore sought to trace potential pathways from these auditory centres to the vpoDNs within the electron microscopy volume of a full adult female brain18 (FAFB). We identified a single vpoDN in each hemisphere and extensively traced the vpoDN in the right hemisphere (Fig. 1a, Supplementary Video 4) as well as its presynaptic partners, identifying a total of 45 neurons with at least 10 synapses impinging onto vpoDN (Extended Data Fig. 4c, Extended Data Table 1).

None of the vpoDN input neurons innervate the AMMC, but at least two cell types have extensive arborizations within the wedge (Fig. 2c, Supplementary Video 5). We obtained multiple split-GAL4 driver lines specific for these two cell types (Extended Data Fig. 5a). Fluorescence in situ hybridization predicted (Extended Data Fig. 5b), and whole-cell recording confirmed (Figs. 2d, e), that one of these cell types is excitatory and the other is inhibitory. Accordingly, we named these two cell types the vpoENs and vpoINs, respectively (Fig. 2c). Within FAFB there are two vpoEN cells and 14 vpoIN cells in each hemisphere.

We next performed optogenetic silencing and activation experiments to examine the roles of vpoENs and vpoINs in VPO and receptivity. Acute inhibition of the vpoENs significantly reduced the frequency of copulation (Fig. 2f) and VPO (Fig. 2g) when virgin females were paired with males. Conversely, strong optogenetic activation of vpoENs elicited VPO in isolated females (Fig. 2h), mimicking activation of vpoDNs (Fig. 1d). In virgin females paired with males, activating vpoINs suppressed mating (Fig. 2i) and VPO (Fig. 2j), whereas silencing vpoINs had no effect (Fig. 2f, g). Thus, vpoENs and vpoINs promote and suppress, respectively, both VPO and receptivity.

Using two-photon calcium imaging, we found that both vpoENs and vpoINs, as with vpoDNs (Fig. 2b), responded to playback of male courtship songs (Fig. 3). The courtship song varies considerably between different Drosophila species and is the primary cue the female uses for species recognition19,20. To test whether the vpoDNs, vpoENs and vpoINs are specifically tuned to the D. melanogaster courtship song, we presented natural courtship songs from seven other Drosophila species, selecting two representative audio clips from each species (Extended Data Fig. 6a). The vpoDNs showed little or no response to any of these songs, the vpoENs responded to one or two clips from five species, and the vpoINs responded to all but one clip from one species (Fig. 3, Extended Data Fig. 6b).

Fig. 3: vpoENs and vpoDNs are tuned to conspecific courtship song.
figure 3

a, Traces of natural and synthetic Drosophila songs used as auditory stimuli. b, Sound-evoked GCaMP6s responses in vpoDNs, vpoENs and vpoINs of virgin melanogaster females (n = 10–14). Darker traces indicate mean response; lighter colours indicate s.e.m. Grey bars indicate stimuli (5 s).

The Drosophila song comprises two main components: brief trains of high-amplitude pulses (pulse song) and continuous low-amplitude oscillations (sine song)19. The pulse song is the primary basis for species recognition19,20, and in D. melanogaster consists of a series of pulses with an inter-pulse interval (IPI) of approximately 35 ms and a carrier frequency of 200–400 Hz (refs. 19,20,21). We generated synthetic D. melanogaster pulse songs in which we systematically varied the IPI from 10 ms to 300 ms (Fig. 3a) and the carrier frequency from 100 Hz to 800 Hz (Extended Data Fig. 6c). Both vpoDNs and vpoENs responded robustly only to pulse songs with an IPI near 35 ms (Fig. 3b), and preferred lower carrier frequencies (Extended Data Fig. 6d). Neither vpoDNs nor vpoENs responded to white noise or synthetic sine song, even if its amplitude was increased to match that of the pulse song (Fig. 3b). The vpoINs were much more broadly tuned, responding to pulse songs across a wide range of IPIs (Fig. 3) and with higher carrier frequencies (Extended Data Fig. 6d). They also responded weakly to both sine song and white noise (Fig. 3b).

We also generated artificial pulse songs for each of the other species, again systematically altering the IPI from 10 ms to 300 ms (Fig. 3a, Extended Data Fig. 6e). Notably, the vpoDNs responded to the pulse songs of five other species once their IPI was shifted to match that of the D. melanogaster song (Fig. 3b, Extended Data Fig. 6f). Together, these data establish that the vpoDNs are finely tuned to the D. melanogaster pulse song, owing to their selectivity for an IPI of about 35 ms. This narrow tuning may arise through a combination of strong excitation from highly selective vpoENs and weak inhibition from broadly responsive vpoINs.

Having determined how auditory input controls VPO and sexual receptivity, we next examined how this response is modulated by the mating status of the female. VPO may be attenuated after mating either because the vpoENs and vpoDNs are less potent at eliciting VPO, or because they are less excited by song. In optogenetic activation and calcium-imaging experiments, we found that vpoDNs are equally potent in mated and virgin females (Fig. 4a), whereas both the basal calcium levels (Fig. 4b) and the response to courtship song (Fig. 4c) were lower in mated females than in virgins. By contrast, the vpoENs were significantly less potent at eliciting VPO in mated than in virgin females (Fig. 4a). Although basal fluorescence of vpoENs was slightly higher in mated females than in virgins, their song responses were indistinguishable (Fig. 4b, c). We also imaged calcium levels in vpoINs and found that the basal fluorescence and song responses of these cells were similar in mated and virgin females (Fig. 4b, c). Thus, these data show that vpoENs have a similar response to song in mated females as they do in virgins, but they are less able to excite vpoDNs in mated females.

Fig. 4: vpoDNs integrate mating status and song.
figure 4

a, Percentage of isolated flies exhibiting VPO upon photoactivation of vpoDNs (2 s, 635 nm) or vpoENs (10 s, 635 nm) at varying light intensities. Upper bars indicate 95% confidence intervals for the intensity eliciting a 50% response, derived from nonlinear regression. b, c, Basal (b) and song-evoked (c) GCaMP6s signals. d, Electron microscopy reconstructions of cell types and counts of impinging synapses. Asterisk indicates incomplete reconstruction. e, Membrane potential changes in vpoDNs upon photoactivation of pC1 neurons (red bar) before and after mecamylamine (mec) application. f, VPO frequency by virgin females during courtship with (ON) or without (OFF) constant optogenetic inhibition of SAG or pC1 neurons. g, h, VPO (g) and copulation (h) frequencies for mated females paired with wild-type males, with (ON, 635 nm, 57 μW mm−2) or without (OFF) constant photoactivation of pC1 neurons. i, Example GCaMP6s traces (left) and plots (right) of responses in vpoDNs of mated females upon pC1 photoactivation (red) and song playback (blue) either alone or at varying delays (n = 7 flies). j, Model for the integration of song responses and mating status in vpoDNs. Data are mean ± s.e.m. P values indicated; two-sided Fisher’s exact test in a, h; two-sided Wilcoxon test in b, c, eg. See also Supplementary Table 3 for details of statistical analyses.

The cell type with the most synaptic inputs to the vpoDNs was the pC1 cells (Fig. 4d, Extended Data Fig. 4c, Extended Data Tables 1, 2, Supplementary Video 5). Photoactivation of pC1 cells elicited a strong depolarization and action potentials in vpoDNs (Fig. 4e). The pC1 cells receive input from the SPSN–SAG pathway, which is silenced upon mating4,13. The reduced excitability of vpoDNs after mating may therefore be explained at least in part by the lower activity of pC1 cells4, one of their major excitatory inputs. In support of this hypothesis, we found that acutely silencing either SAG or pC1 neurons reduced the frequency of VPO in virgin females to that of mated females (Fig. 4f). Conversely, photoactivation of pC1 cells in mated females restored both VPO (Fig. 4g) and sexual receptivity in response to courtship by intact but not wingless males (Fig. 4h). Moreover, transient (5-s) photoactivation of the pC1 neurons in mated females increased the sensitivity of vpoDNs to courtship song, demonstrating that pC1 cells control vpoDN excitability (Fig. 4i). This effect persisted for up to 25 s after photoactivation of pC1 cells (Fig. 4i).

We conclude that the decision of the female fly to mate or not to mate is largely determined by how the vpoDNs integrate signals from two direct synaptic inputs: the vpoENs, which are selectively tuned to the conspecific male courtship song, and the pC1 cells, which encode the mating status of the female (Fig. 4j). When the male sings, female vpoENs are activated; whether or not this leads to vpoDN activation and hence VPO depends on the level of pC1 activity, which is higher in virgins than in mated females. The neural computation that underlies this state-dependent sensorimotor transformation remains to be determined; this will require methods for simultaneously manipulating and recording from all three cell types. One possibility is that the pC1 inputs gate the vpoEN inputs in a nonlinear fashion. We did not note any obvious spatial segregation of vpoEN and pC1 synapses onto the vpoDN dendrites, as might be expected if these inputs are indeed processed hierarchically. Alternatively, vpoDNs might simply use a sum-to-threshold mechanism, in which the combined input from vpoENs and pC1 s must exceed a certain level to elicit action potentials in vpoDNs. In this scenario, the lower pC1 activity after mating would necessitate a stronger vpoEN input to activate the vpoDNs. This model may account for the observation that wild-caught females are often multiply mated22,23, consistent with the prediction from evolutionary theory that a mated female would increase her reproductive fitness by remating when she is courted by a male of higher quality than her first partner.

The many other, as yet uncharacterized, inputs to pC1, vpoEN and vpoDN cells may convey additional signals that modulate female receptivity. For example, pC1 cells are reported to respond to a male pheromone3, which may serve to enhance the receptivity of both virgin and mated females. The persistent enhancement of vpoDN song responses upon transient activation of pC1 cells resembles the persistent state of courtship arousal induced in males by transient activation of the male pC1 counterparts24,25. The female pC1 cells may therefore encode both mating status and, as with their male counterparts, a lasting state of mating arousal induced by sensory cues from potential mates. The ensuing interaction between the two sexes involves a coordinated sequence of signals and responses, as exemplified by the male singing to elicit female VPO. In both sexes, these sensorimotor transformations may not be directly mediated by pC1 cells, as commonly thought26, but rather modulated by the arousal states they encode. The neural architecture that we report here for the control of Drosophila female sexual receptivity may thus also serve as a paradigm for understanding male sexual behaviour, and perhaps more generally for the state-dependent signal processing that underlies behavioural decisions across a range of species.

Methods

No statistical methods were used to predetermine sample size. The experiments were not randomized. The screening of 234 split-GAL4 lines (Extended Data Fig. 1) was performed and analysed by investigators blind to the genotype. All behavioural videos were analysed blind to the genotype. Calcium imaging and electrophysiology experiments were not performed blind to group allocation.

Flies

Flies were reared on standard cornmeal–agar–molasses medium, except for the females used for egg-laying test, which were kept on protein enriched food27 after mating. Flies used in optogenetic experiments were supplied with 0.2 mM all-trans-retinal (Sigma-Aldrich) in food and reared in darkness, before and after eclosion. Flies were raised at 25 °C with relative humidity of about 50% and a 12 h:12 h light:dark cycle, unless otherwise noted. Flies stocks used in this study are described and listed in Supplementary Table 1, and full genotypes of flies used for experimental data presented in each figure are listed in Supplementary Table 2.

Split-GAL4 screening and stabilization

Split-GAL4 lines used in this study were generated and screened as previously described4.

Neuron tracing in FAFB

We manually traced the neuron skeletons in a serial section transmission electron microscopy volume of the adult female Drosophila brain18, using the annotation software CATMAID28 (http://www.catmaid.org) as previously described4. We used confocal image stacks of the target cell types acquired with light microscopy as a guide to find and identify the same cell types in FAFB. We used neuroanatomical landmarks in the EM volume such as fibre tracts, cell body size and position, and neuropil boundaries to search for potential candidates of vpoDN. We looked for distinguishing features such as cell body position and tract orientation, and overall dendritic projection patterns in the confocal images. We then searched for corresponding areas of cell body position in the EM volume and followed the primary neurite emerging from the cell body as it formed fibre bundles and traversed the brain in an orientation that matched the data in the confocal images. We traced just enough of the primary and secondary neurites (backbone) of each potential candidate to compare with confocal data, and neurons that lacked prominent morphological features in the EM volume were eliminated from consideration. We identified synapses on these neurons using previously described criteria for a chemical synapse18. In brief, we marked instances in which vpoDN was postsynaptic indicated by the presence of postsynaptic densities (PSDs) on vpoDN and by the presence of a T-bar and vesicles at an active zone in the presynaptic partner across a synaptic cleft. After the vpoDN was traced to completion and all PSDs were marked, we used CATMAID’s ‘reconstruction sampler’ tool to randomly select upstream partners of the vpoDN, which were then manually traced to identification. Using the sampler tool the reconstructed vpoDN skeleton was divided into intervals of 5,000 nm. Within each interval, the sampler lists the upstream or downstream connections of the neuron that were previously marked. The sampler selects a random synapse within a given interval, for which we identified the pre-synaptic T-bar and manually traced the neuron to which it belonged. All upstream partners were selected in this manner, and each was traced completely in the region of overlap with the vpoDN, and sufficiently to identify it.

Fluorescent staining and confocal imaging

Immunofluorescence staining4 and fluorescent in situ hybridization29 (FISH) were performed as previously described. In brief, polarity staining was used to determine the cell types labelled by a given split-GAL4 line, and multicolour stochastic labelling was performed to reveal morphology of individual cells. Detailed protocols for these two staining methods can be found online (https://www.janelia.org/project-team/flylight/protocols). For staining of Chrimson–tdTomato and GCaMP6, the central nervous systems were fixed in 4% paraformaldehyde (PFA; sc-821692, Santa Cruz, TX) at 22 °C for 15 min. After being washed in phosphate-buffered saline containing 0.5% (vol/vol) Triton X-100 (PBT) for 1 h at 22 °C, the samples were incubated in blocking buffer (50062Z, Thermo Fisher) containing primary antibodies with rabbit anti-dsRed (1:500, 632496, Takara Bio), chicken anti-GFP (1:500, A10262, Thermo Fisher), and mouse anti-Bruchpilot (nc82, 1:25, DSHB, IA) for 24–48 h at 4 °C. Then the samples were washed in PBT for 2–4 h before being incubated in blocking buffer containing secondary antibodies, which include AF488-conjugated goat-anti-chicken (1:300, A32931, Thermo Fisher), AF546-conjugated goat-anti-rabbit (1:300, A11035, Thermo Fisher), and AF647-conjugated goat-anti-mouse (1:300, A21235, Thermo Fisher) at 4 °C for 24 h. After being rinsed in PBT for 15 min at 22 °C, the samples were dehydrated and mounted on a slide. Confocal microscopy and image analysis were done as previously described4.

Calcium imaging

The in vivo calcium imaging was performed on females aged 4–6 days using a customized two-photon microscope with ScanImage software (Vidrio Technologies) as previously described4. Sample preparation was as described, except that the two forelegs were immobilized by applying small amounts of UV curing adhesive (Loctite 352) to prevent them from touching the antennae. A loudspeaker was placed about 20 cm away from the back of the fly to play sound. To test whether song-evoked responses in vpoDNs require movement of the aristae, the same courtship song was presented to a single female with neither, one, or both aristae sequentially immobilized by applying a small amount of UV-curable adhesive to glue the arista to the cuticle. The songs were either recorded during fly courtship by using particle-velocity microphones (NR-23158, Knowles), or synthesized in MATLAB (Mathworks). Sound clips of 5 s length were played with 20 s or 40 s start-to-start intervals. Analysis of calcium-imaging data was done in Fiji30 and MATLAB as previously described4.

Electrophysiology

Whole-cell recordings were performed on central nervous system explants of 4-day-old females as previously described4. Data were collected using pCLAMP 10 software (Molecular Devices) with a Multiclamp 700B amplifier (Molecular Devices), low-pass filtered at 2 kHz and acquired at 10 kHz with a Digidata 1440A digitizer (Molecular Devices), and analysed offline in MATLAB (MathWorks).

Behavioural assays and analysis

The flies used in behavioural assays were collected, reared, and videotaped from above as previously described4. Videos were taken at 30 fps with a resolution of 0.02 mm per pixel unless otherwise noted. Infrared illumination (880 nm) as well as stimulations for optogenetic activation (635 nm, 57 μW mm−2) or silencing (560 nm, 10 μW mm−2, and 635 nm, 57 μW mm−2) were provided from below. In experiments in which a female was paired with a male, low level of constant blue light (470 nm, 0.5 μW mm−2) was provided for the flies to see each other.

The percent of copulation was calculated from the fraction of fly pairs that copulated within a 10-min or 1-h observation window. In the remating assay, virgin females aged 4 days were first paired individually with wild-type males for 1 h. Those females which finished copulating within this time were subsequently kept in fresh food vials in groups of 8–10 flies; those which did not copulate, or terminated copulation within 10 min, were discarded. Two days later, the mated females were paired individually with naive wild-type males, and the percentage of females copulating within 1 h was scored. In the remating assay in which pC1 neurons were photoactivated, a constant optogenetic activation (635 nm, 57 μW mm−2) was given. In remating assays in which vpoDNs were photoactivated, 30-s light pulses (635 nm, 57 μW mm−2) were repeated 60 times with 30-s intervals.

For evaluating VPO by female flies, courtship chambers (diameter = 18 mm, height = 2 mm) were used to house single females or male–female pairs. VPO was identified as opening of the vaginal plates without any extension of the tube-like ovipositor (Supplementary Video 3). For examining VPO at higher resolution from the ventral side, females were chilled on ice for about 30 s, and glued on a glass with ventral side facing above. Small amounts of UV curing adhesive were applied at the back of thorax and back of abdomen to minimize the movement of the fly. In some flies, the hindlegs and cuticle over the posterior ventral nerve cord were removed with forceps to expose the abdominal ganglion and the abdominal nerve trunk. A small hook made from dissecting pin (26002-10, Fine Science Tools) was used to cut the exposed abdominal nerve trunk. The field-of-view of camera was zoomed in and focused at the tip of abdomen with a resolution of 1.8 μm per pixel. Female receptivity and egg-laying by females were carried out as previously described4.

For annotating male behaviours around the onset of VPO by females, 10-min videos were manually analysed offline in Fiji. The onset of female VPO was defined as the frame in which the vaginal plates open. Wing extension was defined as frames in which the male extended its wings in a singing posture. Proboscis extension was defined as frames in which the male extended its proboscis to reach female’s abdomen or genitalia. Abdomen bending was defined as frames in which the male bent its abdomen such that a line connecting the haltere and the abdominal tip came to meet at an angle of 15° or larger to the thoracic midline. Licking was defined as frames in which the male’s proboscis touched female’s genitalia. Holding was defined as frames in which the male held the female’s abdomen with two forelegs. Copulation attempt was defined as the frame in which the male’s genitalia touches the female’s genitalia.

Statistical analysis

Female copulation and VPO frequencies were analysed using two-sided Fisher's exact tests. Egg-laying, calcium imaging, electrophysiology and all other behavioural data were analysed by unpaired two-sided Wilcoxon signed-rank tests unless otherwise noted. Stimulus intensities required to achieve a 50% response upon vpoDN or vpoEN activation were determined by fitting a sigmoidal curve using nonlinear regression. All analyses were performed using R software or MATLAB. To minimize clutter, only the most relevant statistical comparisons are presented in each figure. A full statistical analysis of all data are presented in Supplementary Table 3.

Reporting summary

Further information on research design is available in the Nature Research Reporting Summary linked to this paper.