Abstract
Whereas progress has been made in the identification of neural signals related to rapid, cued decisions1–3, less is known about how brains guide and terminate more ethologically relevant decisions in which an animal’s own behaviour governs the options experienced over minutes4–6. Drosophila search for many seconds to minutes for egg-laying sites with high relative value7,8 and have neurons, called oviDNs, whose activity fulfills necessity and sufficiency criteria for initiating the egg-deposition motor programme9. Here we show that oviDNs express a calcium signal that (1) dips when an egg is internally prepared (ovulated), (2) drifts up and down over seconds to minutes—in a manner influenced by the relative value of substrates—as a fly determines whether to lay an egg and (3) reaches a consistent peak level just before the abdomen bend for egg deposition. This signal is apparent in the cell bodies of oviDNs in the brain and it probably reflects a behaviourally relevant rise-to-threshold process in the ventral nerve cord, where the synaptic terminals of oviDNs are located and where their output can influence behaviour. We provide perturbational evidence that the egg-deposition motor programme is initiated once this process hits a threshold and that subthreshold variation in this process regulates the time spent considering options and, ultimately, the choice taken. Finally, we identify a small recurrent circuit that feeds into oviDNs and show that activity in each of its constituent cell types is required for laying an egg. These results argue that a rise-to-threshold process regulates a relative-value, self-paced decision and provide initial insight into the underlying circuit mechanism for building this process.
Subject terms: Decision, Decision
The Drosophila egg-deposition motor programme is initiated once a rise-to-threshold process hits a threshold, and subthreshold variation in this process regulates the time spent considering options.
Main
Egg-laying site selection is critical for the survival of a fly’s progeny10. As such, Drosophila search for a high-quality substrate for many seconds to minutes before depositing each individual egg7,8. Egg-laying preferences for many different substrates have been documented10, but how decision-related neural signals evolve in real time to guide the site selection process, and to generate these preferences, is unknown.
A behavioural sequence for egg laying
We took videos of gravid Drosophila in a small chamber with a soft substrate floor and characterized a behavioural sequence for egg laying (see Supplementary Tables 1 and 2 for genotypes and conditions in all experiments). The six-step sequence begins with the fly standing still and performing an abdomen elongation (step 1) followed by a scrunch (step 2) (Fig. 1a). The fly then increases its locomotor speed during a search period (step 3), and finally it performs an abdomen bend for egg deposition (step 4), deposits an egg (step 5) and performs a second abdomen bend (step 6), probably for cleaning the ovipositor.
This sequence is consistent with those described previously7,9,11–13 and, although abdominal movements before egg laying have been noted11–13, it remains unclear whether any of these reflect ovulation14, which is the passage of an egg from an ovary to the uterus. We fluorescently imaged, through the cuticle, eggs expressing GCaMP15 while freely walking flies laid eggs (Extended Data Fig. 1a and Methods). By visualization of GCaMP rather than green fluorescent protein (GFP), we could determine not only when eggs moved inside the body but also when each egg was activated to start embryonic development (because activation is associated with a large [Ca2+] increase inside the egg15). We observed that an egg descends from an ovary to the uterus during abdominal elongation and that the same egg exhibits a strong increase in GCaMP fluorescence during the subsequent scrunch (Fig. 1b and Supplementary Video 1). These data demonstrate that elongation (step 1) reflects ovulation and that scrunching (step 2) reflects activation. For brevity we will refer to steps 1 and 2, combined, as ovulation in this paper.
We quantified the egg-laying behavioural sequence by annotating four of the six steps just mentioned: (1) ovulation start (when the abdomen first begins to elongate), (2) search start (when the abdomen returns to a neutral posture after ovulation), (3) ‘abdomen bend complete’ (when the abdomen shows its maximum deflection before egg deposition) and (4) egg deposition (when half of the egg is visible outside the ovipositor) (Fig. 1c, Extended Data Fig. 1d–h, Supplementary Video 2 and Methods). We observed substantial inter-egg variation in search duration—that is, the time between search start and completion of the abdomen bend for egg deposition (Fig. 1c). Because the decision to lay an egg is made within this variable time window, we sought to find a neural signal whose dynamics in this time period could illuminate the decision process.
Neurophysiology during egg laying
We developed an agarose-laden, rotatable, cylindrical treadmill on which a head-fixed fly could walk and lay eggs while we simultaneously performed either two-photon imaging or electrophysiological recording from neurons in the brain (Fig. 1d, Extended Data Fig. 2a–e and Methods). Each egg-laying wheel had regions with agarose interspersed with thin plastic barriers. The agarose substrates varied in their sucrose concentration (Fig. 1d, light and dark blue), but always contained 1.6% ethanol and 0.8% acetic acid, which simulate the chemical environment of a rotting fruit and thereby promote egg laying. We found that the egg-laying behavioural sequence measured on the wheel resembled that in free behaviour (Extended Data Fig. 2f,g). One difference was that flies on the wheel walked less vigorously during the search period (compare fly speed in Extended Data Figs. 1f and 2k), probably because they found it physically difficult to restart rotating the heavy wheel after standing still for a minute or more during ovulation (Methods). With head-fixed flies, we therefore often refer to the search period as the search/delay period.
We decided to image the activity of oviposition descending neurons (oviDNs)9 during egg laying. These neurons appeared to be suitable candidates for informing the decision process because, when they are inhibited, egg laying is completely suppressed and when they are stimulated an egg is often laid9. Three oviDNs9 and two uncharacterized oviDN-like neurons are present on one side of the female fly brain, as anatomically characterized in the hemibrain connectome16 (totalling ten neurons per brain; Extended Data Fig. 3a). Each neuron primarily receives input in the brain and has synaptic outputs in the abdominal ganglion (Fig. 1e). We used two different driver lines to gain genetic access to oviDNs—oviDN-GAL4 and oviDN-SS1 (ref. 9). OviDN-GAL4 labels all oviDN and oviDN-like neurons (Extended Data Fig. 3b); OviDN-SS1 labels two of three oviDNs per side (cholinergic neurons named oviDNa and oviDNb)9 and neither of two oviDN-like neurons per side (Fig. 1f). In two-photon imaging experiments, unless otherwise stated, we used the oviDN-SS1 driver and targeted the oviDNb soma on one side of the brain; by targeting a single soma we could consistently image the same identified cell across all flies rather than intermixed neurites (Extended Data Fig. 3c).
A rising signal in oviDNs
We imaged GCaMP7 (ref. 17) fluorescence from oviDNs during egg laying (Fig. 1g–l). We found that the oviDN ∆F/F signal dropped to its minimum value during ovulation and then peaked near the moment of the abdomen bend for egg deposition (Fig. 1g). In some cases we observed a monotonic rise (Fig. 1g, left and Supplementary Video 3) while in others the signal drifted up and down before reaching its peak (Fig. 1, right and Supplementary Video 4). The peak in the population-averaged ∆F/F signal was higher when we aligned the oviDN [Ca2+] signal with the moment when the abdomen finished bending to lay the egg (Fig. 1h,i) than when aligning with the moment that the egg became half-visible outside the fly (Extended Data Fig. 2l versus Extended Data Fig. 2m). On average, the [Ca2+] signal dipped when ovulation started (Fig. 1j) and reached a minimum when the abdomen was longest (Extended Data Fig. 2i). The average [Ca2+] signal then began to rise and returned to near baseline (∆F/F = 0 in our normalization; Methods) when ovulation was completed (that is, the beginning of the search/delay period; Fig. 1k). We often observed in individual traces an upward inflection in the [Ca2+] signal soon after the search/delay period began (Fig. 1g, right trace), which was evident as a small inflection in the mean trace (Fig. 1k, upward inflection just after time 0). The average [Ca2+] signal peaked at around 3 s before completion of abdomen bend for egg deposition (Fig. 1l)—that is, approximately when the bend was initiated. The average [Ca2+] signal returned to baseline after egg laying, while flies performed a second abdomen bend presumably to clean their ovipositor (Extended Data Fig. 2n).
The [Ca2+] rise was evident across multiple egg-laying events in single flies (Fig. 1m), reaching a qualitatively similar ∆F/F value of roughly 0.35 immediately before the abdomen bend for egg laying (Fig. 1n). In some flies we simultaneously imaged oviDNa and oviDNb, with both neuron types showing a similar rising signal (Extended Data Fig. 3d). When cross-correlating oviDNa and oviDNb GCaMP signals on the same side of the brain or oviDNb signals across both sides of the brain, we observed a peak with zero lag (Extended Data Fig. 3e,f). This observation supports a model in which all four oviDNs in the oviDN-SS1 line exhibit the same first-order calcium dynamics during egg laying. Thus, in our recordings of single oviDNs, when we observe an occasional ∆F/F peak with no egg or an egg without a peak in the ∆F/F signal (Fig. 1m and Extended Data Fig. 4), this may be because the functionally relevant signal is a population-level one across all six oviDNs. Aspects of this ∆F/F variability might also reflect technical considerations associated with stable acquisition of long [Ca2+] measurements from a single, tiny, soma in a behaving fly. During non-egg-laying periods, the oviDN ∆F/F signal still correlated with abdominal movements and locomotion (Extended Data Fig. 5a–d). Approximately once every 30 min the oviDN ∆F/F signal reached around 0.35 without ovulation having occurred beforehand, and at these moments the fly exhibited an abdomen bend that yielded no egg (Extended Data Fig. 5e). In sum, oviDNs express a signal whose dynamics correlate with the behavioural sequence of Drosophila egg laying, drifting up and down during the search period until a consistent level is reached just before egg deposition. These dynamics suggested that a rise-to-threshold process governs Drosophila egg-laying behaviour, a hypothesis that we next tested with optogenetics.
Optogenetics supports a threshold
To test whether a neural activity threshold triggers the egg-deposition motor programme, we coexpressed in oviDNs GCaMP7f and the light-gated ion channel CsChrimson18. We measured oviDN ∆F/F and fly behaviour while providing 5-s-long, high-intensity light pulses (Methods). Stimulations after ovulation typically yielded an abdomen bend and egg deposition (Fig. 2a,b and Supplementary Video 5). When we averaged [Ca2+] and behavioural signals around the time of stimulations that yielded an egg we observed an increase in ∆F/F in the oviDN, a synchronous abdomen bend and—with more variable latency—egg deposition (Fig. 2c).
In our initial experiments we stimulated oviDNs at user-defined moments, sometimes purposefully waiting for flies to finish ovulating before stimulating (Methods). In later experiments we performed regularly spaced stimulations in flies expressing or not expressing CsChrimson, independent of the flies’ ovulation status. Flies expressing CsChrimson bent their abdomen, on average, even on stimulation pulses that did not result in egg deposition (Fig. 2d), whereas control flies did not bend their abdomen (Fig. 2e). We interpret this result—alongside the observation that flies tended to bend their abdomen when oviDN ∆F/F was spontaneously high without previous ovulation (Extended Data Fig. 5e)—to mean that they initiate the egg-deposition motor programme when a neural process reflected in the oviDN [Ca2+] signal reaches a certain level. If an egg is available in the uterus, egg deposition occurs—although with temporal variability that may be related to sensory feedback signals in the uterus12 or motor aspects of how eggs are released13. The temporal variability in egg deposition was qualitatively similar in optogenetically stimulated (Fig. 2c) and spontaneous (Fig. 1h) egg laying in head-fixed flies.
To quantitatively assess whether the egg-deposition motor programme is initiated in an all-or-nothing fashion when neural activity crosses a threshold, we stimulated oviDNs at a regular interval while cycling through four different intensities of light. We assigned each stimulation trial to one of seven bins depending on the oviDN ∆F/F maximum on that stimulation pulse (Fig. 2f). We found that, when our stimulation pulse induced ∆F/F changes of approximately 0.32 or higher, the pulse produced large mean abdomen bends and, when our stimulation pulse induced ∆F/F changes below that level, the pulse did not induce such bends (Fig. 2g,h). This bimodality was robust to how we binned ∆F/F responses (Extended Data Fig. 5f–n). (Note that although the ∆F/F threshold value here is similar, but not identical, to that observed during spontaneous egg laying, any such quantitative comparison is not necessarily biologically meaningful (Methods).) We also found supportive evidence for a threshold when we provided gentle stimulation to oviDNs for tens of seconds and correlated the moment at which oviDN ∆F/F reached a common value with when an abdomen bend was observed (Extended Data Fig. 5o–s). Altogether, these data support the hypothesis that a threshold level of activity initiates the egg-deposition motor programme in an all-or-nothing fashion.
In these experiments we measured [Ca2+] in the oviDN soma. Somatic [Ca2+] is often thought of as a proxy for a cell’s spike rate19. To gain insight into the relationship between membrane potential (Vm), spike rate and [Ca2+] in oviDNs, we activated CsChrimson while performing either whole-cell patch-clamp recordings or calcium imaging at the oviDN soma (Extended Data Fig. 6a–g). The oviDN spike rate and Vm rose and fell quickly with stimulation (around 400 ms half-decay time for both) whereas somatic [Ca2+] changed much more slowly (roughly 5.7 s half-decay time in the ∆F/F signal; Extended Data Fig. 6d–f and Methods). Given these slow [Ca2+] dynamics, the ∆F/F threshold that we measured at the soma may not represent a consistent spike-rate threshold in the same cell, which raises the question of how the somatic signal we analysed induces behaviour. One possibility is that the [Ca2+] signal in the oviDN soma acts as a proxy for a functionally relevant rise-to-threshold process in the abdominal ganglion, perhaps in the oviDN axon terminals. Consistent with this possibility, when we imaged GCaMP fluorescence in the axonal terminals of oviDNs during CsChrimson stimulation we also observed relatively slow [Ca2+] dynamics (Extended Data Fig. 6h–p and Supplementary Discussion). Thus, the rising [Ca2+] signal in the soma might reflect a similarly rising [Ca2+] signal in the axon terminals, with a biochemical process in the presynaptic terminals of oviDNs potentially reading out the rising [Ca2+] signal with a sharp nonlinearity to trigger the egg-laying motor programme. Alternatively, oviDNs may transmit a graded synaptic signal to their postsynaptic partners, with the threshold implemented downstream of oviDNs. Additional work will be needed to test these hypotheses.
Searching for a substrate of high value
If a threshold triggers initiation of the egg-deposition motor programme, might substrate quality modulate oviDN activity to influence when threshold is reached and thus where an egg is laid? We analysed the behaviour of freely walking flies to better understand how they use substrate experiences during their search—that is, the time period after ovulation and before egg deposition—to guide egg-laying decisions. Specifically, we quantified where flies laid eggs within custom, high-throughput behavioural chambers with two different substrate options20 (Fig. 3a, Extended Data Fig. 1b, Supplementary Video 6 and Methods).
We observed, in line with past work7,8, that Drosophila melanogaster target the majority of their eggs to substrates with lower, not higher, concentrations of sucrose (Fig. 3b). This bias makes sense in light of the fact that D. melanogaster prefer to lay eggs on rotting or fermenting fruit21, and a soft substrate with clearly detectable ethanol and relatively low levels of sucrose22 mimics the portion of a rotting fruit where fermentation (conversion of sugar to alcohol) is actively taking place. Beyond simply preferring low sucrose, we further replicated past findings arguing that sucrose-based choice is a relative-value decision7,8. That is, flies strongly bias egg laying to the lower of two sucrose options rather than preferring an absolute sucrose concentration. For example, they laid over 90% of eggs on the 0 mM option in 0 versus 200 mM chambers and over 90% of eggs on the 200 mM option—the previously avoided substrate—in 200 versus 500 mM chambers (Fig. 3b). Flies laid a similar total number of eggs in all chambers7,8 (Fig. 3c).
In these high-throughput chambers we did not have the spatial resolution to clearly detect abdominal elongations and scrunches (Extended Data Fig. 1b,c and Methods). However, we could still detect ovulation and thus when flies start to search immediately thereafter, because they stand still for about 1 min when they ovulate (Extended Data Fig. 1d–f and Methods). We could also denote the end of the search period as the moment when an egg was half-way out of the ovipositor, which consistently follows the final abdomen bend for egg laying by only a few seconds in these chambers (Methods). The duration of the search period was highly variable (Fig. 3d). Flies laid more eggs on the lower-sucrose option despite spending appreciable time on the higher option during the search epoch8 (Fig. 3e). Specifically, in 0 versus 500 mM chambers, 95% (734 of 771) of eggs were laid on 0 mM whereas only 77% (592 of 771) of search periods started on 0 mM (P < 0.001; Methods). (More search periods started on 0 mM than 500 mM because ovulation tended to occur soon after the previous egg-laying event (Extended Data Fig. 1d) and egg laying tended to occur on 0 mM.) We additionally noticed that, when flies started the search on 500 mM, they frequently left this substrate while searching (83%, 149 of 179) but when they started their search on 0 mM they left less often (36%, 212 of 592; P < 0.001; Methods). Leaving a higher-sucrose substrate more often at the onset of search is not an intrinsic property of the substrate, because flies left substrate islands at a similar rate in 500 versus 500 and 0 versus 0 mM chambers (299 of 528, 57% and 441 of 895, 49%, respectively). Because sucrose cannot be sensed at a distance, we conclude that flies retain information about the substrate options available to them from experiences outside of the current search period and use this information to regulate the current search. We tested for the possibility of flies using spatial memories to guide their egg-laying behaviour in our chambers but we could not find supportive evidence (Extended Data Fig. 7a–d). We also did not find evidence that flies were pausing to feed on the higher-sucrose substrate while searching, suggesting that in our experiments a competing feeding drive is not the reason for suppression of egg laying on higher-sucrose substrates (Extended Data Fig. 7a–d).
We noticed that flies would occasionally lay eggs on the higher-sucrose option if a few minutes had elapsed since they last visited the preferred, lower-sucrose option (Fig. 3a bottom, first two eggs). To quantify this observation we calculated the egg-laying rate during the search period as a function of time since the last substrate transition (regardless of whether the last transition occurred in the current search period or previously; Methods). Flies in 0 versus 500 mM sucrose choice chambers strongly inhibited egg laying on 500 mM if they had visited the 0 mM option within the previous 2 min or so (Fig. 3f). After about 2 min, however, the egg-laying rate on 500 mM began to increase gradually, approaching—albeit not completely—that on 0 mM at the 2 h time point. One interpretation of this egg-laying-rate plot is that the relative value of the 500 mM substrate gradually increased over time, eventually approaching the value of the 0 mM substrate (if 0 mM is not revisited). This phenomenon was also evident in 0 versus 200 mM and 200 versus 500 mM chambers (Fig. 3g,h).
Substrate value alters oviDN physiology
How might the rise-to-threshold process evident in oviDN [Ca2+] guide flies to lay most of their eggs on substrates with high relative value? We hypothesized that, when flies are on a high-value substrate, the oviDN [Ca2+] signal might rise briskly and, when they are on a low-value substrate, it might rise more slowly or even fall, thus creating time for the fly to find a better option before threshold is reached (Fig. 4a).
To test this idea we analysed how the oviDN ∆F/F signal changed as flies transitioned across substrates on the egg-laying wheel. On wheels with 0 and 500 mM sucrose options we observed a mean increase in ∆F/F after flies walked onto the higher-relative-value substrate (500 → 0 mM transitions) and a mean decrease after they transitioned to the lower-relative-value substrate (0 → 500 mM transitions) (Fig. 4b). This result was not explained by differences in feeding, locomotor speed or abdomen movements across the two options (Extended Data Fig. 8). We observed similar, but qualitatively faster, changes in oviDN activity with substrate transitions at the level of Vm (Fig. 4c) and spike rate (Extended Data Fig. 9a–e).
If oviDN [Ca2+] tracks the relative value of substrates, rather than just sucrose concentration, one might expect that oviDN ∆F/F would gradually increase on the 500 mM option because that option becomes more acceptable over several minutes. Indeed, when we split 500 to 0 mM substrate transitions into four groups—depending on the time spent on 500 mM before the transition—we found that the mean, ‘baseline’, ∆F/F on 500 mM became progressively higher. After more than 3 min on 500 mM, the mean ∆F/F on 500 and 0 mM became indistinguishable (Fig. 4d). It is intriguing that this slow increase in oviDN mean [Ca2+] in flies residing on a 500 mM substrate occurred on a time scale of minutes, which roughly matches the time scale over which egg-laying rates recover in flies residing on 500 mM in free behaviour (compare Fig. 4d with Fig. 3f). Consistent with the notion that the mean oviDN [Ca2+] signal tracks relative value and not just sucrose concentration, the magnitude of the average ∆F/F changes during substrate transitions in 0 versus 500 mM wheels, 0 versus 200 mM wheels and 200 versus 500 mM wheels were similar (Extended Data Fig. 9f–k).
We hypothesized that excitatory inputs associated with the relative value of the current substrate interact with additional excitatory drive associated with the search state. These two inputs ultimately drive oviDN activity to hit threshold, inducing egg laying. One prediction of this model is that the oviDN [Ca2+] signal should have a lower propensity to rise on the less valued substrate because of reduced drive from putative relative-value inputs, and a higher propensity to rise on more valued substrates. Although the number of eggs available for analysis was very low, we found that the mean slope of oviDN ∆F/F rise toward threshold was shallower on the lower-relative-value substrate than on the higher one (Fig. 4e). A change in slope was also evident, to near statistical significance, in an analysis of individual traces (Fig. 4f). The path to threshold of individual traces was not as gradual as in the average trace, often containing acute upward and downward fluctuations (Fig. 1g,m and Extended Data Fig. 4). These fluctuations could reflect internal gating of when substrate value inputs impact oviDN physiology, or other factors that influence egg laying. Indeed, such fluctuations may underlie the sizeable variability in search duration we observed in freely behaving flies regardless of whether they were presented with one or more substrate options (Figs. 1c and 3d). Note that, in free behaviour, we would expect modulations of the oviDN signal to show even more marked upward or downward adjustments than those in Fig. 4e because, unlike head-fixed flies, freely walking flies will transition more often between low- and high-relative-value substrates during search.
Hyperpolarization of oviDNs alters choice
Given the above framework for how the oviDN signal relates to egg-laying substrate choice (Fig. 4a), we asked whether we might be able to perturb oviDNs in a manner that would cause flies to lay even more eggs than normal on the option with higher relative value. Specifically, we reasoned that gentle hyperpolarization of all oviDNs (using the oviDN-GAL4 line) could lengthen the time required for the decision process to reach threshold, providing flies with more time than usual to encounter the higher-value substrate and thus leading to more eggs on the higher-value option.
Expressing the human Kir2.1 (ref. 23) potassium channel in oviDNs completely eliminated egg laying9 (Fig. 5a and Extended Data Fig. 10a), as did genetic ablation of oviDNs9 (Extended Data Fig. 10b) and optogenetic inhibition using the light-gated anion channel, GtACR1 (ref. 24) (Fig. 5b and Extended Data Fig. 10c). Each of these perturbations probably prevented the decision process from ever reaching threshold. Serendipitously, however, we introduced a modified mouse Kir2.1 (hereafter Kir2.1*) and a non-conducting control (Kir2.1*Mut) channel into Drosophila25 and found that flies expressing Kir2.1* in all oviDNs (oviDN>Kir2.1* flies) could still lay eggs, albeit at lower mean levels compared with genetic-background-matched controls (Fig. 5c and Methods). Whole-cell, patch-clamp recordings showed that Kir2.1*-expressing oviDNs (or oviDN-like neurons) were hyperpolarized by around 14 mV, on average, compared with Kir2.1*Mut-expressing (control) cells (Fig. 5d). This is a moderate hyperpolarization that still permitted most Kir2.1*-expressing neurons to fire spikes with sufficient current injection (Extended Data Fig. 10d). This fact could explain why many oviDN>Kir2.1* flies could lay eggs.
We tracked the x–y trajectories and egg-laying behaviour of oviDN>Kir2.1* and oviDN>Kir2.1*Mut flies in two-substrate, free-behaviour chambers. We observed a two- to threefold increase in the length of the search period in oviDN>Kir2.1* compared with oviDN>Kir2.1*Mut flies when comparing the full distribution of traces from all flies (P < 0.001; Fig. 5e,f and Methods), or when quantifying median search duration per fly (comparing flies that laid sufficient eggs for analysis—that is, at least five eggs; Fig. 5g). The increase in search duration could not be attributed to a general increase in the fraction of time spent walking (Fig. 5h), nor to a broad defect in egg-laying-related motor functions (Extended Data Fig. 10e,f). Remarkably, just as we imagined, the increase in search duration was accompanied by a higher fraction of eggs laid on the substrate of higher relative value (Fig. 5i), probably because oviDN>Kir2.1* flies have more time to encounter the higher-relative-value option before threshold is reached.
A neural circuit for egg laying
Finally, we wished to provide an inroad into the circuit mechanisms underlying the rising [Ca2+] signal in oviDNs. We created split-GAL4 driver lines that allowed selective inhibition of several neuron classes that have extensive synaptic input onto oviDNs16 (Methods, Supplementary Table 3 and Extended Data Fig. 11a–r). We found three groups of neurons—oviEN9, group U cells and group G cells—that when inhibited with GtACR1 markedly reduced the total number of eggs laid by flies (Fig. 6a; see Methods for discussion of group Z). Although oviEN activity is known to be required for egg laying9, the requirement for activity in group U and group G neurons—which make far fewer direct synapses onto oviDNs than oviENs or many of the other neuron types tested (Fig. 6a)—is a new finding.
To identify what might be special about oviEN, group U, and group G cells we analysed their connectivity in the hemibrain16, discovering that these cells, at the anatomical level, form a recurrent circuit that feeds into oviDNs (Fig. 6b,c and Supplementary Table 4). This recurrent circuit comprises just five neurons per side of the brain, and silencing any of its constituent neuron groups eliminates egg laying, presumably by preventing the decision process from ever reaching threshold. None of the other groups of neurons we tested formed a recurrent circuit with the same or fewer number of neurons (Fig. 6d; see Methods for further analysis and discussion; Extended Data Figs. 11s–v and 12). Cells in this circuit on both sides of the brain are reciprocally connected, and a pair of GABAergic inhibitory neurons, oviINs9, may act to keep activity in the circuit from rising too rapidly, in addition to gating egg laying on the basis of internal state9 (Fig. 6e).
Discussion
Rise-to-threshold signals have been linked to decision-making and action-initiation processes in humans26, monkeys3,27–30, rodents31–34, zebrafish35–37 and insects38–42. These signals have been shown to rise, or suggested to rise, on the hundreds-of-milliseconds to seconds time scale. Some of the most influential work in this domain has focused on rise-to-threshold signals that integrate noisy sensory input so that an animal can report a percept1–3—that is, form a ‘perceptual decision’. Our work helps to extend the rise-to-threshold framework beyond perceptual decisions to ethologically relevant, self-paced decisions in which animals decide among non-noisy, perceptually distinct, options43 (for example, egg-laying substrates with easily distinguishable differences in sucrose concentrations). Our work further emphasizes three features of rise-to-threshold processes that were not easily appreciated previously: (1) they can regulate decisions that take minutes, not just seconds; (2) they can cause behaviour to start when threshold is crossed33,41; and (3) their rate of rise can be modulated by the relative value (and not just the more veridical sensory properties) of stimuli. These features expand on past work on rise-to-threshold processes26–42, suggesting that they may underlie a wide array of ethological, self-paced decisions made by animals in the real world.
Recurrent neural circuits have been proposed as a mechanism for rising or persistent neuronal activity44,45. Here we describe a small, anatomically recurrent circuit where silencing activity in any constituent cell class eliminates egg laying. Although we have not yet measured physiological activity in all circuit constituents during egg laying, we speculate that synaptic interactions in this circuit contribute to the generation of a rising or persistent oviDN spike rate, which is then integrated by oviDN’s slow calcium dynamics to create the signal we report in this paper.
If one compares a fly’s decision to lay an egg in an environment with several discrete substrate options20 with a human’s decision to choose a dish at a restaurant, there are interesting parallels. Both processes start with an initiation event: ovulation in flies or opening a menu in humans. Then the individual’s own behaviour reveals new options over time—that is, more egg-laying substrates to the fly walking around an environment or more dish options to the human scanning the menu. Finally, the decision is terminated when one option is selected and a motor programme, of varying complexity and delay relative to the end of the decision, is implemented. This analogy highlights that the process characterized herein may help to inform decision-making quite broadly.
Methods
Flies
Flies (D. melanogaster) were reared on a standard cornmeal medium at 25 °C, ambient humidity and 12/12 h light/dark cycle unless otherwise noted. Genotypes and conditions for each experiment are described in Supplementary Tables 1 and 2, respectively. Supplementary Table 1 also lists the source of each genotype.
Egg-laying chamber with sloped ceiling
We designed a new chamber for imaging egg laying in freely walking flies, which enforced them to remain in a tarsi-down body posture on the agarose at all times. The flies could not tilt their bodies in this chamber and thus they could not walk on the side walls or ceiling. This constraint meant that the flies’ bodies were always in the same general orientation, parallel to the imaging plane, making quantitative measurements of postural parameters more straightforward with a single camera view.
Chambers were made by sandwiching and tightly screwing layers of acrylic and three-dimensionally (3D)-printed plastic and then fitting a glass ceiling (Extended Data Fig. 1a). The acrylic layers were laser-cut (VLS6.60, Universal Laser Systems). The side-wall layer was 3D-printed using VisiJet M3 Crystal plastic material (Projet 3510 HD Plus, 3D Systems). The glass was treated with Sigmacote (Sigma-Aldrich) to make it slippery to a fly’s tarsi—preventing walking on the ceiling46. Glass was retreated with Sigmacote after roughly ten uses. The 3D-printed spacer layer incorporated a sloped edge that kept the fly completely parallel to the imaging plane by preventing access to the side of the chamber (Extended Data Fig. 1a). The sloped-ceiling design was inspired by a sloped-floor plastic chamber46. A sloped floor does allow the fly to tilt and thus was not suitable for our application.
Chambers were used multiple times and washed before each use. They were assembled with only the two bottom layers and then cooled at 4 °C. Fresh substrate containing 1% agarose (SeaKem LE Agarose, Lonza), 0.8% acetic acid and 1.6% ethanol was pipetted to completely fill the well around 5 h before each assay. Careful pipetting with only the two bottom layers assembled was critical to forming a flat layer of agarose—preventing the formation of a meniscus, which would allow the fly to tilt. Acetic acid and ethanol were included to help simulate rotten fruit and generally promote egg laying7. After solidification of the agarose solution (about 1 h) the chamber was fully assembled, minus the glass ceiling, and equilibrated at room temperature.
Females were separated on their day of eclosion and group housed in vials. At age 3–6 days around 20 females were exposed to about 20 Canton-S males in an empty bottle with wet yeast paste and a Kimwipe (Kimberly-Clark) soaked with 2 ml of water. The wet yeast paste was applied to the side of the bottle and comprised 1 g of dry yeast (Fleischmann’s) and 1.5 ml of 4.25 mM putrescine dihydrochloride in water. This treatment allowed females to mate and caused them to accumulate many eggs. Flies fed with yeast7,47 or putricine48 increase the number of eggs they develop. These eggs are retained by the flies during the treatment period because they lack a soft medium for egg deposition7. After about 24 h, individual gravid females were placed into chambers under gentle cold anaesthesia from which they typically recovered within 30 s. Because we had only one imaging setup for these high-resolution experiments (see below), and the ability of a fly to tilt was sensitive to both its size the exact level of agarose, multiple flies were loaded in independent chambers (Extended Data Fig. 1a) and the fly with the least ability to tilt was chosen for imaging for a few hours in near-complete darkness (under a shroud) at around 24 °C and 40–60% humidity.
For imaging eggs inside the fly’s body, a 470 nm LED (pE-100, CoolLED) double filtered (optical density (OD) 4 475 nm and OD 4 500 nm shortpass, Edumund Optics) provided excitation light at 30 µW mm–1. This excitation light arrived at the fly from below after first passing through the agarose substrate. Videos were recorded using HCImage software (Hamamatsu) at ten frames s–1 (fps) with 100 ms exposure time per frame, using an ORCA-Fusion C14440-20UP camera (Hamamatsu) equipped with a 15.5–20.4 mm Varifocal Lens (Computar) and two 510 nm longpass filters (Chroma). We used GCaMP3, rather than the more recent GCaMP variant, for imaging of eggs because a UASp-driven GCaMP3 transgene, which is more highly expressed in the female germline than the traditional UAS49, was constructed in a previous study15 and available for use without the need to generate a new transgenic fly.
For imaging of body posture, 850 nm LEDs illuminated the arena from above through a white acrylic diffuser (1 µW mm–2 at the fly). Videos were recorded at 25 fps using FlyCapture software (FLIR) and a GS3-U3-41C6NIR-C Grasshopper camera (FLIR) equipped with a 15.5–20.4 mm varifocal lens and a 780 nm longpass filter (MidOpt). DeepLabCut50 was used for offline tracking of body parts, including the neck and ovipositor. DeepLabCut models were iteratively fine-tuned by identification of poorly tracked frames in iteration i and adding them to the training dataset for iteration i + 1. A total of 1,568 training frames were manually annotated. DeepLabCut output coordinates were filtered by setting coordinates to not-a-number (NaN) if either (1) the probability score was less than 0.95 or (2) the body part jumped more than an empirically determined distance in consecutive frames. Ovulation start was manually annotated as the first frame in which the abdomen appeared to begin the elongation process. Search start was manually annotated as the first frame in which the abdomen returned to a stable neutral posture after ovulation. Abdomen bend complete was manually annotated as the frame in which the bend to lay an egg was completed (abdomen maximally deflected). Identification of the frame in which the abdomen bend was completed was much easier than attempting to identify when the abdomen bend was initiated. Note that, although flies bend their abdomen to deposit an egg, they also bend their abdomen for other reasons. Some non-egg-laying-related reasons a fly could bend its abdomen include defaecation, grooming and sampling the substrate with sensory organs near the ovipositor. ‘Egg deposited’ was manually annotated, often with assistance from a computer algorithm. Briefly, our computer code found groups of pixels whose intensities stably changed at a particular frame in the video. The output frame numbers from the code pointed an experimenter to video frames proximal to egg deposition, and the exact frame for egg deposition was adjusted manually. Videos were also carefully inspected by an experimenter to identify eggs missed by the code. This code markedly accelerated manual annotation and was particularly useful for high-throughput egg-laying choice chambers where thousands of eggs were annotated (see below). The first frame in which half of the egg was visible (emerging from the ovipositor) was annotated as the egg-deposited frame.
High-throughput egg-laying choice chamber
We designed a new chamber for studying egg-laying choice behaviour with high throughput. This chamber ensured that the fly was nearly always in contact with an agarose egg-laying substrate option. The substrate on which the fly was standing could be unambiguously defined by its y position and orientation. In previous egg-laying choice studies8,51,52, flies could walk on the side walls or ceiling and yet were assigned to a substrate beneath them during tracking, which makes it very hard to determine how previous substrate experiences influence the decision to lay an egg.
Chambers were made by sandwiching and tightly screwing layers of acrylic or Delrin plastic and then affixing a glass ceiling (Extended Data Fig. 1b). Acrylic and Delrin plastic were laser-cut and the glass was treated with Sigmacote.
Chambers were used multiple times and washed before each use. They were assembled without the glass ceiling and cooled at 4 °C. Fresh substrate (1 ml, containing 1% agarose, 0.8% acetic acid and 1.6% ethanol) was pipetted to fill the acrylic well and form a meniscus with the Delrin plastic spacer about 5 h before each assay. The meniscus ensured that the fly could not walk directly on the side (Delrin plastic) of the chamber and was inspired by plastic chambers with a sloped floor46. Quantitative measurements of body posture were not possible because flies could tilt by walking on the meniscus. Sucrose-containing substrates were supplemented with the appropriate amount of sucrose. Acetic acid and ethanol were uniformly distributed in all substrates. Following solidification of the agarose solution (about 1 h), the chamber was equilibrated at room temperature.
These egg-laying chambers and assay protocols were specifically designed to minimize the following confounds: (1) diffusion between substrate islands; (2) visual landmarks; (3) fly-to-fly communication; (4) olfactory landmarks; (5) temperature and humidity fluctuations; and (6) variability in fly rearing. Diffusion was minimized by a barrier of approximate width 2.5 mm between the substrate islands and by loading the agarose at 4 °C. Visual cues were minimized by conducting the assay in near-complete darkness. Illumination of 850 nm, to which the fly’s visual system has no measurable sensitivity53–55, was provided from below for tracking (1 µW mm–2 at the agarose beneath the fly). Fly-to-fly communication was minimized by assaying individual flies in isolated chambers separated by an opaque Delrin plastic spacer. Olfactory landmarks were minimized using a non-volatile compound, sucrose, as the sole varying variable. Temperature and humidity were kept constant by conducting experiments in an environmental room (24 °C with 40–60% humidity). Air exchange was made possible by four small ventilation holes in each barrier. Variability in fly rearing was minimized by controlling age, mating status, food history and circadian time.
Females and males were separated on their day of eclosion and group housed in vials. At age 3–6 days at zeitgeber time (ZT) 6 (that is, 6 h after lights on), around 20 females were exposed to around 20 Canton-S males in an empty bottle with only wet yeast paste and a Kimwipe soaked with 2 ml of water. Putrescine was not added to the yeast paste in these experiments. On the following day at ZT 8, individual females were placed into egg-laying chambers under gentle cold anaesthesia. Videos were acquired at 2 fps using FlyCapture software with either a FMVU-03MTM-CS Firefly or FL3-U3-13Y3M-C Flea3 camera (FLIR) equipped with either a LM12HC (Kowa), HF12.5SA-1 (Fujinon) or CF12.5HA-1 (Fujinon) lens and a 780 nm longpass filter. The x–y position and orientation of each fly was determined offline using Ctrax56. We assigned a fly to a substrate depending on whether its centroid was above or below the midline of the acrylic barrier. This simplification was appropriate because the acrylic barrier of roughly 2.5 mm (a fly is around 2.5 mm long) practically prevented a fly from standing on both substrates simultaneously, and a Canton-S fly spent only 1.5% of its time in an orientation where all tarsi were likely to be on the barrier. Note that flies do not lay eggs on the plastic barrier (or any plastic used in this study) because it is too hard. Egg deposition was manually annotated, often with the assistance of a computer algorithm, as described in the previous section. The first frame in which half of the egg was visible (emerging from the ovipositor) was annotated as the egg-deposited frame. Annotations by an individual human annotator or across multiple human annotators were reproducible to ±four frames or ±2 s.
For Kir2.1* or Kir2.1*Mut experiments we expressed a GAL80ts transgene in all cells (with the tubulin promoter)57 during development to minimize transcription of Kir transgenes days before assaying egg-laying behaviour. At 18 °C, GAL80ts masks the transcription activation domain of GAL4, thus preventing transcription of the GAL4-UAS-controlled transgene. We could remove the GAL80 block on Kir expression by increasing the flies’ temperature for about 1 day before our egg-laying assays. Specifically, for these experiments: (1) flies were reared at 18 °C; (2) at ZT 6 flies were moved to 31 °C for induction of Kir2.1* or Kir2.1*Mut transgene expression; and (3) the following day at ZT 5 (23 h later), flies were returned to 18 °C. Egg-laying assays were performed at ZT 8 at 24 °C. For one set of controls in Fig. 5i, flies were not moved to 31 °C and instead were kept at 18 °C.
For GtACR1 (refs. 24,58) experiments, flies were kept under low white light (approximately 3 nW mm–2 measured at 567 nm) from egg to adulthood. At approximate age 5–6 days at ZT 6, around ten females were exposed to around ten Canton-S males in an empty bottle with only wet yeast paste and a Kimwipe soaked with 2 ml of 200 µM all-transretinal in water (also kept under low white light). Wet yeast paste was applied to the side of the bottle and comprised 1 g of dry yeast with 1.5 ml of 200 µM all-transretinal in water. Egg-laying assays were performed the following day at ZT 8. Light (567 nm) was provided from above (29 µW mm–2 at the fly; Rebel Tri Star LEDs, LuxeonStarLEDs). Controls for genotype were siblings of experimental flies that were treated identically except that no light was provided from above. Controls for light were flies ‘expressing’ GtACR1 with either an empty-split (empty-SS) or empty-GAL4 driver. Additional controls for light with twice the intensity (57 µW mm–2) provided additional assurance that light alone was not preventing egg laying (data not shown).
Construction of Kir2.1* and Kir2.1*Mut flies
We serendipitously identified that Kir2.1*25 (based on the mouse sequence for the gene, see below) hyperpolarizes oviDNs more gently than the human Kir2.1 traditionally used in flies23,59,60 (Fig. 5c versus Fig. 5a). A matched control channel, Kir2.1*Mut25, does not conduct ions and enabled genetic-background-matched comparisons. A similar strategy of using Kir2.1 paired with a non-conducting control was recently used in flies61, although with the human variant of the gene.
Kir2.1* and Kir2.1*Mut sequences were taken from a previous study in mice25. Briefly, Kir2.1* and Kir2.1*Mut are modified wild-type mouse Kir2.1 channels (KCNJ2)—with either two mutations (Kir2.1*: E224G, Y242F) or five mutations (Kir2.1*Mut: E224G, Y242F, G144A, Y145A, G146A). Both transgenes were fused at their C-terminals with a T2A sequence to a tdTomato. To port these constructs into Drosophila, they were inserted between the Xba1 and Not1 sites of pJFRC81 (ref. 62) and introduced into the attP40 landing site by ΦC31 integrase-mediated transgenesis (transgenic fly lines were generated by BestGene). Kir2.1* and Kir2.1*Mut transgenes differ in protein sequence—and possibly in other ways (for example, transcription and translation)—from the wild-type human Kir2.1 (KCNJ2) transgenes traditionally used to hyperpolarize neurons in flies23,59,60. Previous in vivo fly electrophysiology of central brain and visual system neurons expressing traditional human Kir2.1 (refs. 63,64) transgenes showed larger hyperpolarization than the approximately 14 mV hyperpolarization observed here with Kir2.1* (Fig. 5d).
Automated estimation of search period in free-behaviour, high-throughput choice chambers
Because we did not have a quantifiable view of the abdomen in our high-throughput choice chambers (Extended Data Fig. 1b,c), we used locomotor speed as a proxy for search onset (Extended Data Fig. 1d–f) and egg deposition as a proxy for abdomen bending to lay an egg (Fig. 1c). The end of the search period was the annotated moment of egg deposition (rather than the abdomen bend to lay the egg). For each egg, the start of the search period was determined by smoothing the locomotor speed trace before egg deposition with an 18.5 s boxcar filter and identifying the first frame in which the smoothed signal fell below 0.1 mm s–1. Due to the length of the boxcar filter, the minimum search duration was 9 s. These parameters were empirically established to produce search onset times that were consistent with what an expert human annotator would highlight in visual analysis of the data.
Calculation of egg-laying rates as a function of time since the last substrate transition in free-behaviour choice chambers
Egg-laying rates as a function of time (Fig. 3f–h) were calculated as follows. Before performing any calculations, we combined the data obtained from all flies tested in a particular chamber type. First, we iterated through each time bin on the x axis and, for each bin, we counted the number of egg-deposition events assigned to that bin, denoted as #eggs(bin). Next, we repeated the iteration for the same time bins and tallied the number of video frames in which the flies were assigned to that time bin, referred to as #frames(bin), during a search period. Finally, we performed another iteration for the same time bins and recorded the number of times flies changed assignments into that bin, termed #visits(bin), during an egg-laying search period (that is, we didn't keep incrementing the ‘visits’ counter if the fly remained in a particular time bin from one frame to the next).
To determine the mean egg-laying rate, we computed #eggs/#frames for each bin. Because the videos were recorded at 2 Hz, we multiplied the value obtained for each bin by 120 to convert it to units of eggs min–1. To determine the confidence interval for each bin we utilized the Clopper–Pearson method, also known as the ‘exact’ binomial confidence interval, to compute the 90% confidence interval for #eggs/#visits. We then transformed the confidence interval for each bin to units of eggs min–1 by multiplying it by 120 × #visits/#frames. The confidence interval could not be directly calculated from #eggs/#frames because it would then be contingent on the video frame rate.
For these rate curve calculations, search periods with duration shorter than 30 s were set to 30 s. This prevented very brief search periods from introducing fluctuations in the rate functions (by contributing to the numerator and not contributing much to the denominator). By doing so, the rate curves exhibited less variation across replicates or conditions. Note that search periods already had a minimum duration of 9 s, which was automatically determined by the search period calculation (Methods). Altering the definition of the search period, or having no minimum search duration, does not change our stated conclusions from these curves20. Additionally, the use of different x-axis bins yields qualitatively similar results and does not change our stated conclusions. Rate functions start with low rates after a transition, at least partially, because flies do not lay eggs on the plastic barrier between substrates (Extended Data Fig. 7e,f) and because flies are, by definition, walking (and not pausing to deposit an egg) during a transition (Extended Data Fig. 7g).
Design of egg-laying wheel and setup under microscope
We designed a wheel on which tethered flies walked and laid eggs on agarose-based egg-laying substrates. The design was optimized to maximize a fly’s ability to lay eggs and rotate the wheel.
The wheels were 3D printed from VisiJet M3 Crystal plastic using a Projet 3510 HD Plus 3D printer (Extended Data Fig. 2a). A pivot (N-1D, Swiss Jewel) was press-fit through the centre hole and not removed. Wheels were washed before each use. Three wells were available for loading the same or different agarose-based substrates. Each well was separated by a 1 mm barrier. Wheels were loaded with fresh agarose substrate (as prepared for free-behaviour choice chambers) using a 3D-printed agarose-injecting mould (VisiJet M3 Crystal material) that was cooled on ice (Extended Data Fig. 2b). Food colouring (HY-TOP assorted food colouring) was added at a dilution of 1:10,000 to the agarose solution before loading so that wheel quality could be visualized. Wheels with any mixing between wells were discarded. Food colouring at 2.5-fold this concentration, or the presence of VisiJet M3 Crystal material, did not affect choice in free-behaviour control experiments (Extended Data Fig. 2d). After solidification of the agarose was, the wheel and pivot were suspended between two spring-loaded bearings (VS-30, Swiss Jewel) threaded into clear acrylic that was press-fit into a 3D-printed base (UMA-90 material printed on a Carbon DLS, Protolabs) (Extended Data Fig. 2c). This wheel assembly was stored in a custom humidification chamber to prevent the thin layer of agarose from drying and to allow the wheels to equilibrate to room temperature. Wheels were used within 2 h of preparation. When ready, a wheel assembly was secured in a small custom humidification chamber (roughly 90% humidity) positioned under the microscope objective. The wheel–pivot combinations used in this study had a weight of 87.9 ± 0.3 mg (mean ± s.d.) without agarose and 146.4 ± 0.8 mg with agarose. For reference, a single gravid female weighs around 1.4 mg and a typical foam ball used for fly walking experiments65,66 weighs 40–46 mg. Most of the wheel’s weight is due to the agarose and the wells needed to hold it. A variety of lighter and synthetic materials less prone to evaporation were screened in free-behaviour assays, but egg laying was suppressed in all of them.
The fly was viewed using two CM3-U3-13Y3M Chameleon cameras (from the sides) and one FMVU-03MTM-CS Firefly camera (FLIR) from the front, and videos were captured using FlyCapture software. Two 850 nm LEDs, from front left and front right, illuminated the fly at 5 µW mm–2. Cameras were equipped with a 15.5–20.4 mm varifocal lens and either a 900 nm shortpass (Thorlabs) or 875 nm shortpass (Edmund Optics) filter to dampen visibility of the 925 nm two-photon excitation light. Cameras had an exposure time of 16 ms and were triggered synchronously using a single external trigger source at 25 fps (Arduino Uno, Arduino). A side-facing camera recorded the fly and a single dot painted on the wheel. The dot was painted in a consistent location on the wheel that was defined by an embossed 3D-printed feature. The dot was tracked using DeepLabCut (1,109 training frames, with training and filtering as in the free-behaviour DeepLabCut model). The dot position was converted to wheel degrees by fitting the set of all dot positions to a circle and then computing a wheel angle for each frame. A single frame in which the fly’s centroid straddled the dot was used to convert the wheel angle to the fly’s position on the wheel. This alignment consistently meant that the fly’s neck was situated on the plastic-to-next-substrate boundary during a detected substrate transition. A second side-facing camera was used for a close-up view of the fly’s body. DeepLabCut was used to track body parts including the neck, ovipositor and tip of the proboscis (2,259 training frames, with training and filtering as in the free-behaviour DeepLabCut model). Normalized length was calculated by subtracting the x-coordinates of the neck and ovipositor in each frame and dividing by the median of this value for each recording (Fig. 1i). The median length in free behaviour was approximately 2.35 mm (Extended Data Fig. 1e–h), although we did not measure this value on the wheel. We used this normalized-length metric because it can quantify both an elongated and a bent abdomen and is similar to the neck–ovipositor length measured in free behaviour. Despite the similarity with free-behaviour length, we noticed, on average, a slight difference in the signature of abdomen bends (Extended Data Fig. 1g compared with Fig. 1l), possibly due to the curvature of the wheel. The body angle (°) was the angle between the neck and ovipositor (Fig. 1i). Larger angles indicated a more bent abdomen. Although a fly must bend its abdomen to lay an egg, the magnitude of a physiologically relevant deflection of body angle (as measured in degrees) is not that large (Fig. 1i). ‘Normalized neck to proboscis length’ was calculated by determining the Euclidean distance between the tip of the proboscis and the neck in each frame and dividing by the median of this value for each recording. This underestimated the true deflection of the proboscis because the proboscis does not start at the neck. The neck was used as an origin point because robust tracking was easy. A front-facing camera was used to align the fly on the centre of the wheel width. The body posture slightly varied among flies due to slight differences in tethering. To achieve egg laying it was very important to position the fly at a point on the wheel circumference, and at a vertical distance from wheel, that maximized perpendicular contact of the ovipositor to the substrate when the abdomen was bent while still allowing the fly to walk on the wheel. In some cases flies had to be positioned close to the wheel which, unfortunately, decreased the dynamic range of abdomen bending. A total of 104 flies were imaged to collect the data shown in Fig. 1h. The majority of flies did not lay eggs because, among other considerations, flies often require several hours to start laying their clutch of eggs (even in free behaviour). We could not image, conveniently, for 18 h to wait for a clutch to start.
Moments of distinct behaviours (as in Fig. 1h and Extended Data Fig. 2g) were annotated manually by inspection of behaviour videos while remaining blind to any neural signals (∆F/F). Ovulation start was defined as the first frame in which the abdomen appeared to begin the elongation process; ‘abdomen at its longest’ was the frame in which the abdomen was maximally stretched; ‘abdomen scrunch start’ was the first frame in which the abdomen assumed a stable scrunched position; search start was defined as the first frame in which the abdomen returned to a stable neutral posture after ovulation; abdomen bend complete was defined as the frame in which the first bend before egg laying was complete (abdomen maximally deflected); egg deposited was defined as the frame in which half of the egg was visible; and ‘ovipositor cleaned’ was defined as the frame in which the first abdomen bend following egg laying was complete.
For CsChrimson18 optogenetics experiments, a 660 nm LED coupled to a 1-mm-wide fibre-optic cable (M660F1 and M35L01, Thorlabs) was focused on the front midpoint of the fly’s head using a lens set (MAP10100100-A, Thorlabs). This wavelength is at the tail end of the sensitivity of the fly visual system53–55, which helps to minimize light-related confounds. Two longpass filters—OD 4 550 nm and OD 4 575 nm (Edmund Optics)—minimized the ability of LED light to enter the two-photon detector path, which collected the GCaMP signal. The incident area of the LED was adjusted to be of sufficient width (approximately 3 mm in diameter) to cover the whole front of the fly, from the part of the head glued to the custom holder to the tips of the tarsi (see Extended Data Fig. 2f for representative fly positioning), such that all CsChrimson-expressing oviDN cell bodies and neurites in the brain could be stimulated. CsChrimson-expressing oviDN neurites and synapses in the abdominal ganglion (situated in the thorax) were also probably stimulated—albeit to a lesser degree due to obstruction from the head, proboscis and front tarsi—because the whole front of the fly head and body was illuminated. LED intensity was controlled by adjusting the duty cycle of a 490 Hz PWM signal (Arduino Uno, Arduino) that was fed into an LED driver (T-Cube, Thorlabs). The CsChrimson stimulation intensity for Fig. 2a–e was 641 µW mm–2. For Fig. 2f–h and Extended Data Fig. 6a–f, intensities were 641, 159, 148 and 136 µW mm2. For the prolonged, gradual CsChrimson experiments in Extended Data Fig. 5o–s, data from three separate stimulation paradigms were combined: 159 µW mm–2 was applied (1) at 100 ms on, 400 ms off, for 30 s; (2) at 100 ms on, 900 ms off, for 39 s; or (3) at 50 ms on, 950 ms off, for 50 s. Sample traces shown in Extended Data Fig. 5o are both from stimulation paradigm (3). For Extended Data Fig. 6l–p, intensity was approximately 148 µW mm–2.
Treatment of flies for tethered egg-laying and optogenetic experiments
Females and males were collected on their day of eclosion and group housed together in standard cornmeal medium vials supplemented with 2.5 mM putrescine dihydrochloride and wet yeast paste. Wet yeast paste was applied to the side of the vial and comprised 1 g of dry yeast and 1.5 ml of 4.25 mM putrescine dihydrochloride in water. At around age 5–6 days, females were gravid because larvae occupied the cornmeal medium and there was no additional room to deposit eggs. This treatment was more convenient than that used in free-behaviour choice experiments and was inspired by separate aspects of two studies8,48. Free-behaviour controls indicated that this treatment increased the number of eggs laid by a fly without affecting choice behaviour (Extended Data Fig. 2e).
For CsChrimson optogenetics experiments, flies were treated as above but were kept under low white light (about 3 nW mm–2 measured at 660 nm) from egg to adulthood. At around age 5–6 days, roughly 20 females were exposed to around 20 Canton-S males in an empty bottle containing only wet yeast paste and a Kimwipe soaked with 2 ml of 200 µM all-transretinal in water (also kept under low white light). Wet yeast paste was applied to the side of the bottle and comprised 1 g of dry yeast with 1.5 ml of 4.25 mM putrescine dihydrochloride and 200 µM all-transretinal in water. Flies were tethered about 24 h later. Flies for CsChrimson control experiments were always treated identically to CsChrimson-expressing flies.
Flies were anaesthetized at roughly 4 °C and tethered to a custom holder67, except where the back wall of the pyramid leading up to the fly was tilted at an angle rather than rising at 90°, to allow more light from the brain to reach the objective66 (Fig. 1d). The head was pitched forward during tethering to provide a view of oviDN cell bodies. For electrophysiology the head was inserted deeper into the holder for unobstructed access to oviDNs with electrodes. Flies were attached to the holder with blue-light-cured glue (Bondic). The proboscis was gently extended and the dorsal rostrum glued to the head capsule. This prevented brain movement associated with proboscis extension but still allowed measurement of proboscis extension (albeit with a smaller dynamic range than natural proboscis extension). Extracellular saline solution was added to the holder well (bath) and a window was cut in the cuticle with a 30-gauge needle (BD PrecisionGlide). The cuticle and some trachea were removed with forceps to expose the posterior aspect of the brain. The holder was stabilized with magnets above the egg-laying wheel inside a small custom humidification chamber.
Extracellular saline68 comprised 103 mM NaCl, 3 mM KCl, 5 mM N-Tris(hydroxymethyl) methyl-2-aminoethanesulfonic acid, 10 mM trehalose, 10 mM glucose, 2 mM sucrose, 26 mM NaHCO3, 1 mM NaH2PO4, 1.5 mM CaCl2 and 4 mM MgCl2. Osmolarity was 280 ± 5 mOsm and pH was 7.3–7.4 when bubbled with 95% O2/5% CO2. The temperature of the bath was set to around 17–22 °C by flowing fresh saline through a Peltier device with feedback from a thermistor in the bath (Warner Instruments).
Calcium imaging
We used a two-photon microscope with a moveable objective (Ultima IV, Bruker) and custom stage (Thorlabs, Siskiyou). The microscope was controlled by Prairie View software (Bruker) and was enclosed by a black shroud. A Chameleon Ultra II Ti:Sapphire femtosecond pulse laser (Coherent) filtered by a 715 nm longpass filter (Semrock) provided 925 nm two-photon excitation. Emission light from the brain was collected by a ×16/0.80 numerical aperture (NA) objective (×16 W CFI75 LWD, Nikon), split by a 565 nm dichroic and filtered by a 490–560 nm bandpass filter (Chroma) before entering GaAsP detectors (Hamamatsu). For CsChrimson optogenetics experiments the emission light was split by a 525 nm dichroic and filtered by both a 490–510 nm and a 480–520 nm bandpass filter (Chroma) to prevent optogenetic stimulation light from entering the detector. A Piezo motor was used for volumetric scanning.
A range of optical zooms, z-slice number, z-slice separation, fields of view, laser powers (6–30 mW at the specimen) and frame rates (mean of 1.5 Hz) were used over the course of experiments on oviDN dynamics. Individual data traces were inspected by eye and the reported results were robust to the range of parameters used. All recordings had multiple z-slices within, above and below the cell body permitting effective quantification of recordings with slight z-drift over hours of recording. For example, in Fig. 1g, 14 z-slices were taken at 3 µm steps and only around five or six of these included fluorescence from the oviDNb cell body. The length of each recording (mean of 75 min) varied depending on (1) the perceived health of the fly, (2) the likelihood of future egg-laying events (which were higher if the fly had already laid an egg), (3) the amount of z-drift and (4) the quality of the agarose wheel, which sometimes visibly dried over a period of hours. The experimenter was blind to correlations between the neural signal and behaviour during the vast majority (roughly 95%) of recordings. Flies were excluded only if a technical issue arose (for example, errors in synchronizing behaviour with two-photon imaging or saline leaking from the holder). Only eggs with continuous two-photon imaging from 240 s before to 30 s after egg deposition were analysed.
For CsChrimson optogenetics experiments supporting a rise-to-threshold mechanism (Fig. 2f–h), two-photon imaging parameters were held relatively constant (mean frame rate of 1.5 Hz and two-photon laser power of approximately 10.5 mW). CsChrimson stimulation intensities were determined in pilot experiments. Periodic stimulation cycling four intensities was applied for 5 s every 2 min. The experimenter was blind to correlations between the neural signal and behaviour during all these recordings.
For CsChrimson manual stimulation experiments (Fig. 2a–c), stimulations were initiated by the experimenter while observing the real-time behaviour of the fly. Stimulations were initiated, on average, roughly once every 7.5 min. Manual stimulations were typically halted if the fly began to ovulate or it showed signs that it would ovulate soon (that is, pausing and slight abdominal elongation). Once ovulation was complete, stimulation was triggered when the fly’s abdomen was not touching the substrate (and before any indication that a spontaneous egg-laying event was about to take place). The traces shown in Fig. 2a (and associated Supplementary Video 5) are representative of our manual stimulation protocol. We used manual stimulation because it resulted in around a twofold higher rate of eggs laid than periodic stimulation, and also it allowed us to activate oviDNs after ovulation but before spontaneous egg laying.
For the CsChrimson optogenetics experiments shown in Fig. 2c, two-photon imaging data are shown for only five of the nine flies whereas behavioural data are shown for all nine. The four flies for which we do not show imaging data had bleed-through artefacts in the GCaMP signal from the CsChrimson illumination LED because these data were collected before optimization of the detection path for minimization of this artefact.
Two-photon imaging frames were motion corrected using either custom scripts from a previous study66 or CaImAn69. The regions of interest (ROIs) for a cell body were drawn manually for each z-plane using the time-average of each. ROIs were drawn around the outer boundary of the cell body. The brighter of the two cell bodies in oviDN-SS1 was assigned to be oviDNb (see Extended Data Fig. 3c, in which we show that the brighter of the two cells in oviDN-SS1 is oviDNb). In a few cases in which the brighter cell was not obvious, ROIs encompassing both cell bodies were drawn and assigned to be oviDNb. For a given imaging volume time point, the individual pixel intensities in all individual z-plane ROIs for a given cell were pooled and averaged, Fcell(t). An identical average was calculated for a background volume of pixels that did not overlap the oviDN soma, or any other soma or neurite, Fbackground(t). Before calculation of ∆F/F we subtracted the background from the cell, Fcell_actual(t) = Fcell(t) – Fbackground(t). This eliminated non-cell-specific signal such as autofluorescence and constant detector background. This subtraction also made ∆F/F robust to variations in the number of background pixels included in ROIs drawn around the outside of a cell. ∆F/F was calculated using the formula (Fcell_actual(t) – F0(t))/F0(t), where F0(t) is the running mean of Fcell_actual(t) over a 20 min window. The mean over a long time frame was used to estimate a baseline, systematically, for the continuously fluctuating oviDN signal. A similar running mean baseline estimate (albeit with a much shorter window) was previously used to quantify continuously fluctuating dopaminergic signals in mammals70. A ∆F/F of 0.35, for example, indicated that the fluorescence signal in the cell was 35% greater than the 20-min-mean signal in the cell. If the GCaMP7f fluorescence signal is linear with [Ca2+] in this range it would indicate that [Ca2+] in the cell had increased by 35% over the 20-min-mean [Ca2+] in the cell. All stated conclusions were robust to three different methodologies for calculation of ∆F/F, including methods where F0 remained constant. For CsChrimson experiments, F0(t) was the running mean of Fcell_actual(t) over a 20 min window after the 105 s post-triggering CsChrimson stimulation had been set to NaN. This very conservatively prevented any CsChrimson stimulations, or lingering effects, from artificial influence of F0(t). Note that, because both baseline spike rate and Vm are higher for flies expressing CsChrimson (Extended Data Fig. 6a,b; approximately 12 spikes s–1 and –44 mV) than for those that are not (Extended Data Fig. 9a; approximately four spikes s–1 and –57 mV), we would expect the mean GCaMP signal that we use for normalization in CsChrimson flies to be reflective of higher calcium concentrations, resulting in lower ∆F/F values for the same absolute calcium concentration. For this reason—and because our genetic driver in CsChrimson experiments is expressed in only two of three oviDNs per side—quantitative comparisons of ∆F/F in CsChrimson and non-CsChrimson flies are not warranted.
Two-photon imaging-frame pulses, behavioural camera frame triggers and optogenetic LED triggers were all digitized at 10 kHz on a Digidata 1440A (Molecular Devices) and saved to a computer (Axoscope, Molecular Devices). To assign a timestamp to a volume scan we identified the moment that the two-photon volume scan was half complete. To assign a timestamp to a behavioural camera frame we used the beginning of the 16 ms camera exposure period. Calcium imaging was interpolated and behavioural data were downsampled to a common 10 Hz array for all population analyses. Each 100 ms time point was assigned the calcium imaging and behaviour data value from the closest previous respective timestamp (that is, previous neighbour interpolation). A relatively large 100 ms time base was chosen because faster sampling was unnecessary for the current analyses and would be computationally time consuming given the 200+ h of two-photon scanning collected. In the case of triggered averages, the zero point was either the timestamp for the behaviour camera frame with the behaviour of interest or the frame with the onset of optogenetic stimulation. In the case of cross-correlations, the zero point was the timestamp of the first acquired two-photon volume.
Electrophysiology
We used the same two-photon microscope for both calcium imaging and patch-clamp electrophysiology. The microscope was controlled by either Prairie View (Bruker) or µManager71 software. A 470 nm LED (pE-100, CoolLED) provided excitation through the objective to identify 2× EGFP- or GCaMP7f-positive neurons. An 850 nm LED coupled to a 400-µm-wide fibre-optic cable (M850F2 and M28L01, Thorlabs) was focused on the fly’s head to illuminate cells for patch-clamping using a lens set (MAP10100100-A, Thorlabs). Both LEDs were turned off when recording electrophysiology data. A ×40/0.80 NA objective (LUMPLFLN 40XW, Olympus) and CoolSnapEZ CCD camera (Photometrics) were used for patch-clamping.
Cell bodies were exposed by breaching the neural lamella and perineural sheath using gentle application of 0.5% collagenase IV (Worthington) in extracellular saline via pipette. We applied collagenase IV to a small 30 × 30 µm2 area containing the cell bodies of interest67. Collagenase was applied using a 4–6-µm-tip micropipette with 8–80 mmHg positive pressure at around 30–32 °C for about 3 min. Once the cell bodies were exposed, the bath was returned to about 19–21 °C and flushed free of collagenase.
Borosilicate glass (outer diameter 1.5 mm, inner diameter 0.86 mm, with filament) was pulled to create a 7–15 MΩ electrode with a 1.0–1.5 µm tip using a model P-1000 micropipette puller (Sutter Instruments) and fire-polished with a MF-900 Microforge (Narishige). Intracellular saline68 comprised 140 mM potassium-aspartate, 1 mM KCl, 10 mM HEPES, 1 mM EGTA, 0.5 mM Na3GTP, 4 mM MgATP, 13 mM biocytin hydrazide and 20 µM Alexa-568–hydrazide-Na (ThermoFisher Scientific). The pH was adjusted to about 7.3 with KOH, and osmolarity to approximately 265 mOsm with water.
Electrophysiological signals were acquired using a MultiClamp 700B amplifier (Molecular Devices) in current-clamp mode. Electrophysiological signals and behavioural camera triggers were digitized at 10 kHz via a Digidata 1440A and saved to a computer (Clampex, Molecular Devices). The oviDN or oviDN-like subtype (Extended Data Fig. 3) from which recording was taken was not distinguished. Electrophysiology experiments using oviDN-SS1 could target oviDNa or oviDNb and experiments using oviDN-GAL4 could target oviDNa, oviDNb or oviDN-like neurons. Recordings were made without current injection (except for current step protocols) and the reported membrane voltage (Vm) was corrected for a 13 mV junction potential67. Spikes were identified by highpass filtering Vm and finding peaks above a threshold that were separated in time by over 1 ms. Parameters for peak detection were varied from recording to recording based on visual inspection of the data, in which the action potentials were clear. We calculated the spike rate by counting the number of spikes in every 5 s interval (at 0.1 ms steps), dividing by 5 and assigning that value to the middle of the 5 s interval (for Extended Data Fig. 6b,e a 100 ms rather than 5 s interval was used). Spike rate and Vm were thus both measured at 0.1 ms intervals. Data were aligned and analysed identically to calcium imaging. Resting Vm was considered the first stable Vm after breaking into the whole-cell configuration (Fig. 5d and Extended Data Fig. 9a). We calculated a Vm with spikes removed by discarding (converting to NaNs) 150 ms of data centred on the peak of each spike (Extended Data Fig. 9c).
Electrophysiological recordings for 2× EGFP-expressing flies were analysed only if (1) the cell was stably recorded for more than 3 min; (2) Vm was below –43 mV at rest with no large drift or rapid fluctuations that were clearly non-physiological; (3) the fly walked for at least one wheel rotation; and (4) the cell spiked at least once. A total of five cells were rejected for not passing criteria 2, 3 and 4. Three of these five were rejected for not passing criterion 2, and a single cell was rejected for not passing criterion 3, indicating that flies were healthy in this preparation. A single cell passed the first three criteria but was rejected for not spiking (shown in Extended Data Fig. 9a). Cells that passed all four criteria were analysed from the time when the recording first stabilized to when it degraded or was terminated (mean, 41 min).
Electrophysiological recordings for CsChrimson-expressing flies were analysed if Vm was below –43 mV at rest. All recordings were conducted in vivo and with the fly on the wheel.
Electrophysiological recordings for Kir2.1*- and Kir2.1*Mut-expressing flies were analysed if Vm was below –43 mV at rest. These flies were pretreated as described for free-behaviour experiments rather than as described for tethered experiments, so the transgene would be expressed because it was in free behaviour. All recordings were done in vivo on the wheel. Current step protocols were conducted with 5 pA increments with 1 s of current injection (Extended Data Fig. 10d).
Abdominal ganglion calcium imaging
Flies were anaesthetized at approximately 4 °C and their wings clipped near their base before tethering to a custom holder. The holder was similar to that used in our other experiments except that it lacked a pyramid (such that the objective could be lowered to image deep ventral tissue) and had a larger hole (such that the head, thorax and anterior-most part of the abdomen could fit, rather than just the head) (Extended Data Fig. 6h–j). The dorsal part of the thorax was pushed through the hole and the posterior head was aligned and pitched in the hole to be in plane with the holder. The thorax, abdomen and head were glued to the holder with blue-light-cured glue (Bondic). Glue was applied to the anterior abdomen to stabilize the preparation and avoid tearing of the delicate cuticle of the abdomen during dissection. As a result, the fly was not able to bend its abdomen normally. The rostrum was not glued in this preparation because proboscis extension did not cause movements in the abdominal ganglion as it did in the brain. A needle was used to slice a window in the cuticle of the dorsal thorax (Extended Data Fig. 6j; blue box shows dissection area), and the cuticle and indirect flight muscles were removed with forceps such that the dorsal proventriculus and surrounding trachea were visible. Removal of the indirect flight muscles was easier without extracellular saline solution in the bath and thus was done quickly (within 30 s) to prevent desiccation. Extracellular saline was then added. The section of the proventriculus near the neck connective was cut, and the portions of the gut covering the ventral nerve cord, as well as the trachea and crop, were removed. The preparation was flushed with extracellular saline to dilute digestive enzymes that might have been released during dissection. Loose tissue (for example, remaining indirect flight muscles) was carefully removed or retracted such that the abdominal ganglion was visible. Despite removal of several dorsal structures to expose the ventral nerve cord and abdominal ganglion, flies were able to walk. Occasional flies that were not able to move their legs normally either before or after imaging were discarded. Overall, tethering and dissection shared features with previous work72 except that significant time and effort were needed to advance dissection past the neck connective, T1, T2 and T3 neuromeres to the abdominal ganglion. (Previous imaging in walking flies was restricted to the more accessible neck connective and T1 neuromere72,73). The holder was stabilized with magnets above the egg-laying wheel inside a small custom humidification chamber.
Calcium imaging rates of around 0.5 Hz and laser powers of 20–30 mW at the specimen were needed to capture sufficient signal and sample the full presynaptic volume (approximately 50 × 50 × 60 µm3). Imaging rates and laser powers are similar in Extended Data Fig. 6l,m, to aid comparison (mean imaging rate of 0.50 and 0.56 Hz, respectively, with a minimum rate of all data at 0.36 Hz). Because the timestamp assigned to a volume scan was when the volume was half complete, data of around 1 s after cessation of stimulation in Extended Data Fig. 6l,m should minimally include the stimulation period; data 1.4 s (delay for 0.36 Hz) after stimulation do not include the stimulation period at all. These numbers also apply to the increase in ∆F/F at stimulation onset. Half-decay times are the amount of time after cessation of stimulation required for signal value to return half-way between that at the end of stimulation and 5 s mean prestimulation. The half-decay times reported in the main text are the average of those for the three lower intensities shown in Extended Data Fig. 6d–f. To calculate an expected ∆F/F half-decay time given a spike rate, GCaMP7f kinetics and calcium imaging rate, we convolved one of our spike-rate traces (second-lowest intensity shown in Extended Data Fig. 6e) with an exponential filter (τ = 300 ms) that estimates the off kinetics of GCaMP7f17 and then applied a boxcar filter (width, 2.8 s) that simulated the slowest frame rate in all experiments. The half-decay time of this simulated trace was 700 ms.
Substrate transition-triggered averages during calcium imaging or electrophysiology
Substrate transitions were identified using the fly’s position on the wheel. For these analyses, substrate transition i was eliminated if substrate transitions i – 1 and i + 1 occurred within 4 s of each other. This empirically prevented events in which the fly rocked on the substrate boundary from being counted as multiple transitions. Note that, for all transition-triggered averages, if the fly were to have transitioned back to the original substrate—say, 20 s after the first transition—the data from 20 s onwards would not contribute to the post-transition average.
Measurement of light power
All light power levels reported in this paper were measured with a PM100D Compact Power and Energy Console (Thorlabs) at the expected peak intensity of the light source. Lighting with an area smaller than the sensor was divided by the estimated illuminated area rather than by the area of the sensor.
Texas Red fill
Texas Red (100 mg ml–1; dextran, Texas Red, 3,000 MW, lysine fixable) (ThermoFisher Scientific) in patch-clamp intracellular saline (see above) lacking ATP, GTP, biocytin and Alexa-568–hydrazide-Na was backfilled into a patch pipette. The pipette was positioned near the cell body (without any collagenase application) and two to five pulses of 10 V (2 ms duration) were applied using an SD9 stimulator (Grass Instruments). All fills and anatomy were carried out with flies on the wheel under the two-photon microscope (as in calcium imaging, except using a ×40/0.80 NA objective (LUMPLFLN 40XW, Olympus) and a 590–650 nm bandpass filter (Chroma) to filter emitted light before entering a second GaAsP detector (Hamamatsu).
Split-GAL4 screening and stabilization
Split-GAL4 lines were screened and stabilized as described previously9. To determine cell types labelled by a particular split-GAL4 driver, standard immunofluorescence staining was used to count the total number of cells (Extended Data Fig. 11a–r) and stochastic labelling in multiple colours74 was used to visualize the morphology of individual cells. Individual cell morphology was used to manually assign cells to hemibrain connectome body IDs16, and the cell type and instance associated with the body ID were noted (Supplementary Table 3).
In Fig. 6a the number of pairs of oviDN input neurons is an estimate based on correspondence between light microscopy images of neurons labelled in split-GAL4 and the hemibrain connectome16 (above); the number of synapses onto oviDNs is an estimate of the total number of synapses onto oviDNs from those neurons using the electron microscopy connectome (Supplementary Table 3).
Analysis of hemibrain for recurrent-circuit inputs to oviDNs
We analysed synaptic connections in the adult female hemibrain using the neuPrint75 (v.1.2.1) Python interface. All connections with at least one synapse per connection were queried for the circuit architectures investigated (Extended Data Fig. 11s–v). Because oviDNs receive an enormous number (approximately 600–1,100) of input synapses and have very few (roughly between five and 50) output synapses in the hemibrain, direct, two-way reciprocal connections between pairs of oviDNs—or between oviDNs and other cells—were not evident (Extended Data Fig. 11s,t, also diagrammed in Fig. 6d). Of all the recurrent circuits (with at least ten synapses) in the hemibrain that directly involve oviENs—which are the dominant input cells to oviDNs—the neurons diagrammed in Fig. 6e are the only ones that concisely/directly interconnect oviENs on both sides specifically via a single group G, group U or oviIN cell. We could not discover a recurrent circuit that uses a single cell class to interconnect oviDNs on both sides using the same ten-synapse threshold (Extended Data Fig. 11u,v). (Interconnection of oviDNs on both sides is a sensible constraint for an underlying circuit because the calcium signals of oviDNs on both sides track tightly during egg laying.) Although we did not find simpler recurrent-circuit architectures (Extended Data Fig. 11s–v), complementary circuits could still exist particularly in regions of the nervous system where connectome data are unavailable, or via gap junctions, which are not annotated in existing fly connectomes.
Although inhibition of group Z neurons also had an effect on eggs laid (Fig. 6a), 11 of 18 flies with inhibition of group Z still laid more than one egg. Note that group Z neurons provide synaptic input to oviDNs, oviENs, group G and group U cells (Supplementary Table 4), potentially explaining why flies lay fewer eggs when these neurons are inhibited (Fig. 6a). Group Z neurons, however, receive few synapses back from the other relevant cell classes and they thus reside, in our interpretation, outside of the core loop.
The fact that recurrent-circuit neurons on both sides of the brain are reciprocally connected helps to explain why the oviDN [Ca2+] signal on both sides is qualitatively similar (Extended Data Fig. 3f). Group U cells and at least one group G cell were positive for tyrosine hydroxylase (Extended Data Fig. 12), suggesting that the physiology of this recurrent circuit may be more sophisticated than one in which all circuit elements express the same excitatory transmitter to implement simple, runaway excitation76,77.
Immunofluorescence staining and confocal microscopy
Immunofluorescence staining and confocal microscopy were performed as described previously9 (with modifications for Extended Data Fig. 12; see below), using the following antibodies and dilutions: 1:30 mouse anti-Bruchpilot (no. nc82, Developmental Studies Hybridoma Bank), 1:300 rabbit anti-HA Tag (no. 3724S, Cell Signaling Technology), 1:200 rat anti-FLAG Tag (no. NBP1-06712, Novus Biologicals), 1:500 DyLight 550 mouse anti-V5 Tag (no. MCA1360D550GA, AbD Serotec), 1:500 Alexa Fluor 594 donkey anti-rabbit (no. 711-585-152, Jackson ImmunoResearch), 1:600 ATTO 647N goat anti-rat (no. 612-156-120, Rockland), 1:600 Cy2 goat anti-mouse (no. 115-225-166, Jackson ImmunoResearch), 1:800 Alex Flour 488 goat anti-rabbit (no. A11034, Thermo Fisher Scientific), 1:400 AlexaFlour568 goat anti-mouse (no. A11031, Thermo Fisher Scientific) and 1:1,000 rabbit anti-GFP (no. A11122, Thermo Fisher Scientific).
For identification of neurotransmitter identity (Extended Data Fig. 12), brains were dissected in cold Schneider’s insect medium (no. S0146, Sigma-Aldrich) and fixed overnight at 4 °C in Schneider’s insect medium with 1% paraformaldehyde (no. 15713, Electron Microscopy Science). For vGluT staining, brains were instead fixed for 5 min at room temperature in Bouin’s fixative (no. 112016, Ricca Chemical Co.) as described previously78. Primary antibodies and their dilutions were: 1:300 rabbit anti-TH (no. AB152, Sigma-Aldrich), 1:500 rabbit anti-serotonin (no. S5545, Sigma-Aldrich), 1:50 mouse anti-ChAT (no. ChAT4B1-s, Developmental Studies Hybridoma Bank), 1:500 rabbit anti-GABA (no. A2052, Sigma-Aldrich), 1:10,000 rabbit anti-vGluT78 (gift from A. DiAntonio), 1:1,000 chicken anti-GFP (no. 600-901-215, Rockland) and 1:30 mouse anti-Bruchpilot (no. nc82, Developmental Studies Hybridoma Bank) for all but anti-ChAT experiments. Secondary antibodies and their dilutions were: 1:800 goat anti-chicken Alexa Flour 488 (no. A11039, Thermo Fisher Scientific), 1:400 goat anti-mouse Alexa Flour 594 (no. A11032, ThermoF isher Scientific) and 1:400 goat anti-rabbit Alexa Flour 633 (no. A21070, Thermo Fisher Scientific). Samples were mounted in Vectashield H-1000 (Vector Laboratories) and imaged on an LSM 780 confocal microscope (Zeiss) with a ×20/0.8 NA objective (no. 440640-9903-000, Zeiss) at 1 µm z-intervals. Images were analysed using Fiji (ImageJ).
Statistics and reproducibility
We used the two-sided Wilcoxon rank-sum test to calculate all P values.
For egg-laying choice fractions (for example, Fig. 3b), grey bars indicate the fraction of eggs laid on the lower-sucrose option after all eggs from all flies are pooled. Error bars indicate the 95% confidence interval of this fraction calculated using the Clopper–Pearson method (‘exact’ binomial confidence interval). Individual dots represent individual flies.
The first two P values in the main text compare the number of trials with (or without) events in two separate groups. For a single group, trials with an event are treated as 1 and those without an event are treated as 0. The two groups (each a set of 0 and 1) are then compared using the two-sided Wilcoxon rank-sum test (P values calculated using two-sided Fisher’s exact test are similar and similarly significant). Exact P values in the main text are 2.1 × 10–25, 8.4 × 10–29 and 3.3 × 10–54.
For the calculations shown in Fig. 4f we used the point at which ∆F/F crosses 0 as the starting point in the slope calculation, because it relies solely on the ∆F/F signal and not behaviour. A ∆F/F value of 0 is, on average, related to the beginning of the search (Fig. 1k). P values were calculated using the two-sided Wilcoxon rank-sum test; P = 0.030 when comparing slopes in the 25 s before abdomen bend and P = 0.064 when comparing slopes from search start to abdomen bend.
Immunofluorescence examples shown in Fig. 1f and Extended Data Figs. 3b, 11a–r and 12 are representative of at least two brains (four total brain sides) and typically more than three brains (six total brain sides). Electron microscopy-based anatomy shown in Fig. 6c and Extended Data Fig. 3a was generated from a single side of one brain16.
No data were excluded unless explicitly stated. No statistical method was used to choose sample size. Experimenters were not blind to fly genotype. Flies were randomly chosen for each experiment.
Data analysis
All data analyses and instrument control were done using either MATLAB (MathWorks) or Python unless otherwise specified. All design for 3D printing or laser cutting was done using Autodesk Inventor (Autodesk), which was also used to help create Fig. 1d and Extended Data Fig. 2a–c.
Reporting summary
Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article.
Online content
Any methods, additional references, Nature Portfolio reporting summaries, source data, extended data, supplementary information, acknowledgements, peer review information; details of author contributions and competing interests; and statements of data and code availability are available at 10.1038/s41586-023-06271-6.
Supplementary information
Acknowledgements
We thank the Rockefeller University Precision Instrumentation Technologies facility for access to fabrication equipment; the Janelia FlyLight team for generating confocal images of oviDN-GAL4 (in Extended Data Fig. 3b), oviDN-SS1 (Fig. 1e,f) and oviDN input neuron split-GAL4s (Extended Data Fig. 11a–r); the Bloomington Drosophila Stock Center (NIH P400D018537) for various fly stocks; A. Siliciano and V. Ruta for GtACR1 effector flies; M. Wolfer for flies expressing GCaMP in eggs; M. Scanziani for pCAG-Kir2.1Mut-T2A-tdTomato and pCAG-Kir2.1-T2A-tdTomato plasmids (Addgene plasmid nos. 60644 and 60598); G. Rubin for plasmid pJFRC81-10XUAS-IVS-Syn21-GFP-p10 (Addgene plasmid no. 36432); A. DiAntonio for vGluT antibody; M. DeSouto for the template fly drawing that was modified and used throughout the manuscript; Z. Wang for help in developing the first iteration of the fly-tracking setup; K. Fonselius and S. Cohen for initial help in developing tools for computer-assisted manual annotation of egg-deposition events in free behaviour; J. Varikooty, J. Hirokawa and I. Ishida for ideas and help in developing the wheel; J. Weisman for sharing his design for delivery of optogenetic stimulation light; and C. Lyu and J. Green for two-photon and electrophysiology discussions. Research reported in this publication was supported by a Brain Initiative grant from the National Institute of Neurological Disorders and Stroke (no. R01NS121904 to G.M.) and a Leon Levy Foundation fellowship and the Kavli Neural Systems Institute grant to V.V. G.M. is a Howard Hughes Medical Institute Investigator.
Extended data figures and tables
Author contributions
V.V. and G.M. conceived the initial study and wrote the manuscript. V.V., with input from G.M., designed and performed experiments, analysed data, interpreted results and decided on new experiments. F.W., K.W. and B.J.D. created the oviDN and oviDN input genetic driver lines, shared preliminary data on oviDNs and provided helpful feedback on experiments and the manuscript. A.C. and A.A. created Kir2.1* and Kir2.1*Mut flies. H.A. developed code for computer-assisted manual annotation of egg-deposition events in free behaviour.
Peer review
Peer review information
Nature thanks Yvette Fisher and the other, anonymous, reviewer(s) for their contribution to the peer review of this work.
Data availability
All calcium imaging and fly behaviour time-course datasets analysed in the main figures are available on DANDI archive (calcium imaging data, 000247; fly choice tracking data, 000212; fly behavioural sequence tracking data, 000250). Technical documents (for example, CAD files and plasmid maps) and source data for all scatter plots and histograms are available on Figshare (10.6084/m9.figshare.c.6505732).
Code availability
Scripts for data processing and plotting are available on request.
Competing interests
The authors declare no competing interests.
Footnotes
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Contributor Information
Vikram Vijayan, Email: vvijayan@rockefeller.edu.
Gaby Maimon, Email: maimon@rockefeller.edu.
Extended data
is available for this paper at 10.1038/s41586-023-06271-6.
Supplementary information
The online version contains supplementary material available at 10.1038/s41586-023-06271-6.
References
- 1.Gold JI, Shadlen MN. The neural basis of decision making. Annu. Rev. Neurosci. 2007;30:535–574. doi: 10.1146/annurev.neuro.29.051605.113038. [DOI] [PubMed] [Google Scholar]
- 2.Hanks TD, Summerfield C. Perceptual decision making in rodents, monkeys, and humans. Neuron. 2017;93:15–31. doi: 10.1016/j.neuron.2016.12.003. [DOI] [PubMed] [Google Scholar]
- 3.Shadlen MN, Newsome WT. Motion perception: seeing and deciding. Proc. Natl Acad. Sci. USA. 1996;93:628–633. doi: 10.1073/pnas.93.2.628. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 4.Daw ND, O’Doherty JP, Dayan P, Seymour B, Dolan RJ. Cortical substrates for exploratory decisions in humans. Nature. 2006;441:876–879. doi: 10.1038/nature04766. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 5.Hayden BY. Economic choice: the foraging perspective. Curr. Opin. Behav. Sci. 2018;24:1–6. doi: 10.1016/j.cobeha.2017.12.002. [DOI] [Google Scholar]
- 6.Kolling N, Behrens TEJ, Mars RB, Rushworth MFS. Neural mechanisms of foraging. Science. 2012;336:95–98. doi: 10.1126/science.1216930. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 7.Yang C.-H., Belawat P, Hafen E, Jan LY, Jan Y-N. Drosophila egg-laying site selection as a system to study simple decision-making processes. Science. 2008;319:1679–1683. doi: 10.1126/science.1151842. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 8.Yang C-H, He R, Stern U. Behavioral and circuit basis of sucrose rejection by Drosophila females in a simple decision-making task. J. Neurosci. 2015;35:1396–1410. doi: 10.1523/JNEUROSCI.0992-14.2015. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 9.Wang F, et al. Neural circuitry linking mating and egg laying in Drosophila females. Nature. 2020;579:101–105. doi: 10.1038/s41586-020-2055-9. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 10.Cury KM, Prud’homme B, Gompel N. A short guide to insect oviposition: when, where and how to lay an egg. J. Neurogenet. 2019;33:75–89. doi: 10.1080/01677063.2019.1586898. [DOI] [PubMed] [Google Scholar]
- 11.Bräcker LB, et al. Quantitative and discrete evolutionary changes in the egg-laying behavior of single Drosophila females. Front. Behav. Neurosci. 2019;13:118. doi: 10.3389/fnbeh.2019.00118. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 12.Cury, K. M. & Axel, R. Flexible neural control of transition points within the egg-laying behavioral sequence in Drosophila. Nat. Neurosci. 26, 1054–1067 (2023). [DOI] [PMC free article] [PubMed]
- 13.Oliveira-Ferreira, C., Gaspar, M. & Vasconcelos, M. L. Neuronal control of suppression, initiation and completion of egg deposition in Drosophila melanogaster. Preprint at bioRxiv10.1101/2021.08.23.457359 (2021).
- 14.Heifetz Y, Yu J, Wolfner MF. Ovulation triggers activation of Drosophila oocytes. Dev. Biol. 2001;234:416–424. doi: 10.1006/dbio.2001.0246. [DOI] [PubMed] [Google Scholar]
- 15.Kaneuchi T, et al. Calcium waves occur as Drosophila oocytes activate. Proc. Natl Acad. Sci. USA. 2015;112:791–796. doi: 10.1073/pnas.1420589112. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 16.Scheffer LK, et al. A connectome and analysis of the adult Drosophila central brain. eLife. 2020;9:e57443. doi: 10.7554/eLife.57443. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 17.Dana H, et al. High-performance calcium sensors for imaging activity in neuronal populations and microcompartments. Nat. Methods. 2019;16:649–657. doi: 10.1038/s41592-019-0435-6. [DOI] [PubMed] [Google Scholar]
- 18.Klapoetke NC, et al. Independent optical excitation of distinct neural populations. Nat. Methods. 2014;11:338–346. doi: 10.1038/nmeth.2836. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 19.Ali F, Kwan AC. Interpreting in vivo calcium signals from neuronal cell bodies, axons, and dendrites: a review. Neurophotonics. 2020;7:011402. doi: 10.1117/1.NPh.7.1.011402. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 20.Vijayan V, et al. An internal expectation guides Drosophila egg-laying decisions. Sci. Adv. 2022;8:eabn3852. doi: 10.1126/sciadv.abn3852. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 21.Karageorgi M, et al. Evolution of multiple sensory systems drives novel egg-laying behavior in the fruit pest Drosophila suzukii. Curr. Biol. 2017;27:847–853. doi: 10.1016/j.cub.2017.01.055. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 22.Liu W, et al. Enterococci mediate the oviposition preference of Drosophila melanogaster through sucrose catabolism. Sci. Rep. 2017;7:13420. doi: 10.1038/s41598-017-13705-5. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 23.Baines RA, Uhler JP, Thompson A, Sweeney ST, Bate M. Altered electrical properties in Drosophila neurons developing without synaptic transmission. J. Neurosci. 2001;21:1523–1531. doi: 10.1523/JNEUROSCI.21-05-01523.2001. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 24.Mohammad F, et al. Optogenetic inhibition of behavior with anion channelrhodopsins. Nat. Methods. 2017;14:271–274. doi: 10.1038/nmeth.4148. [DOI] [PubMed] [Google Scholar]
- 25.Xue M, Atallah BV, Scanziani M. Equalizing excitation–inhibition ratios across visual cortical neurons. Nature. 2014;511:596–600. doi: 10.1038/nature13321. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 26.Rg O, Pm D, Sp K. A supramodal accumulation-to-bound signal that determines perceptual decisions in humans. Nat. Neurosci. 2012;15:1729–1735. doi: 10.1038/nn.3248. [DOI] [PubMed] [Google Scholar]
- 27.Hanes DP, Schall JD. Neural control of voluntary movement initiation. Science. 1996;274:427–430. doi: 10.1126/science.274.5286.427. [DOI] [PubMed] [Google Scholar]
- 28.Roitman JD, Shadlen MN. Response of neurons in the lateral intraparietal area during a combined visual discrimination reaction time task. J. Neurosci. 2002;22:9475–9489. doi: 10.1523/JNEUROSCI.22-21-09475.2002. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 29.Maimon G, Assad JA. A cognitive signal for the proactive timing of action in macaque LIP. Nat. Neurosci. 2006;9:948–955. doi: 10.1038/nn1716. [DOI] [PubMed] [Google Scholar]
- 30.Quintana J, Fuster JM. From perception to action: temporal integrative functions of prefrontal and parietal neurons. Cereb. Cortex. 1999;9:213–221. doi: 10.1093/cercor/9.3.213. [DOI] [PubMed] [Google Scholar]
- 31.Guo ZV, et al. Flow of cortical activity underlying a tactile decision in mice. Neuron. 2014;81:179–194. doi: 10.1016/j.neuron.2013.10.020. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 32.Hanks TD, et al. Distinct relationships of parietal and prefrontal cortices to evidence accumulation. Nature. 2015;520:220–223. doi: 10.1038/nature14066. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 33.Evans DA, et al. A synaptic threshold mechanism for computing escape decisions. Nature. 2018;558:590–594. doi: 10.1038/s41586-018-0244-6. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 34.Steinmetz NA, Zatka-Haas P, Carandini M, Harris KD. Distributed coding of choice, action and engagement across the mouse brain. Nature. 2019;576:266–273. doi: 10.1038/s41586-019-1787-x. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 35.Mu Y, et al. Glia accumulate evidence that actions are futile and suppress unsuccessful behavior. Cell. 2019;178:27–43. doi: 10.1016/j.cell.2019.05.050. [DOI] [PubMed] [Google Scholar]
- 36.Bahl A, Engert F. Neural circuits for evidence accumulation and decision making in larval zebrafish. Nat. Neurosci. 2020;23:94–102. doi: 10.1038/s41593-019-0534-9. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 37.Dragomir EI, Štih V, Portugues R. Evidence accumulation during a sensorimotor decision task revealed by whole-brain imaging. Nat. Neurosci. 2020;23:85–93. doi: 10.1038/s41593-019-0535-8. [DOI] [PubMed] [Google Scholar]
- 38.von Reyn CR, et al. A spike-timing mechanism for action selection. Nat. Neurosci. 2014;17:962–970. doi: 10.1038/nn.3741. [DOI] [PubMed] [Google Scholar]
- 39.DasGupta S, Ferreira CH, Miesenböck G. FoxP influences the speed and accuracy of a perceptual decision in Drosophila. Science. 2014;344:901–904. doi: 10.1126/science.1252114. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 40.Groschner LN, Chan Wah Hak L, Bogacz R, DasGupta S, Miesenböck G. Dendritic integration of sensory evidence in perceptual decision-making. Cell. 2018;173:894–905. doi: 10.1016/j.cell.2018.03.075. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 41.McKellar CE, et al. Threshold-based ordering of sequential actions during Drosophila courtship. Curr. Biol. 2019;29:426–434. doi: 10.1016/j.cub.2018.12.019. [DOI] [PubMed] [Google Scholar]
- 42.Fotowat H, Harrison RR, Gabbiani F. Multiplexing of motor information in the discharge of a collision detecting neuron during escape behaviors. Neuron. 2011;69:147–158. doi: 10.1016/j.neuron.2010.12.007. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 43.Padoa-Schioppa C. Neurobiology of economic choice: a good-based model. Annu. Rev. Neurosci. 2011;34:333–359. doi: 10.1146/annurev-neuro-061010-113648. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 44.Major G, Tank D. Persistent neural activity: prevalence and mechanisms. Curr. Opin. Neurobiol. 2004;14:675–684. doi: 10.1016/j.conb.2004.10.017. [DOI] [PubMed] [Google Scholar]
- 45.Guo ZV, et al. Maintenance of persistent activity in a frontal thalamocortical loop. Nature. 2017;545:181–186. doi: 10.1038/nature22324. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 46.Simon JC, Dickinson MH. A new chamber for studying the behavior of Drosophila. PLoS ONE. 2010;5:e8793. doi: 10.1371/journal.pone.0008793. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 47.Robertson FW, Sang JH. The ecological determinants of population growth in a Drosophila culture. I. Fecundity of adult flies. Proc. R. Soc. Lond. B Biol. Sci. 1944;132:258–277. doi: 10.1098/rspb.1944.0017. [DOI] [Google Scholar]
- 48.Hussain A, et al. Ionotropic chemosensory receptors mediate the taste and smell of polyamines. PLoS Biol. 2016;14:e1002454. doi: 10.1371/journal.pbio.1002454. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 49.Rørth P. Gal4 in the Drosophila female germline. Mech. Dev. 1998;78:113–118. doi: 10.1016/S0925-4773(98)00157-9. [DOI] [PubMed] [Google Scholar]
- 50.Mathis A, et al. DeepLabCut: markerless pose estimation of user-defined body parts with deep learning. Nat. Neurosci. 2018;21:1281–1289. doi: 10.1038/s41593-018-0209-y. [DOI] [PubMed] [Google Scholar]
- 51.Joseph RM, Devineni AV, King IFG, Heberlein U. Oviposition preference for and positional avoidance of acetic acid provide a model for competing behavioral drives in Drosophila. Proc. Natl Acad. Sci. USA. 2009;106:11352–11357. doi: 10.1073/pnas.0901419106. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 52.Gou, B., Zhu, E., He, R., Stern, U. & Yang, C.-H. High throughput assay to examine egg-laying preferences of individual Drosophila melanogaster. J. Vis. Exp.109, e53716 (2016). [DOI] [PMC free article] [PubMed]
- 53.Feiler R, Harris WA, Kirschfeld K, Wehrhahn C, Zuker CS. Targeted misexpression of a Drosophila opsin gene leads to altered visual function. Nature. 1988;333:737–741. doi: 10.1038/333737a0. [DOI] [PubMed] [Google Scholar]
- 54.Yamaguchi S, Desplan C, Heisenberg M. Contribution of photoreceptor subtypes to spectral wavelength preference in Drosophila. Proc. Natl Acad. Sci. USA. 2010;107:5634–5639. doi: 10.1073/pnas.0809398107. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 55.Sharkey CR, Blanco J, Leibowitz MM, Pinto-Benito D, Wardill TJ. The spectral sensitivity of Drosophila photoreceptors. Sci. Rep. 2020;10:18242. doi: 10.1038/s41598-020-74742-1. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 56.Branson K, Robie A, Bender J, Perona P, Dickinson M. High-throughput ethomics in large groups of Drosophila. Nat. Methods. 2009;6:451–457. doi: 10.1038/nmeth.1328. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 57.McGuire SE, Le PT, Osborn AJ, Matsumoto K, Davis RL. Spatiotemporal rescue of memory dysfunction in Drosophila. Science. 2003;302:1765–1768. doi: 10.1126/science.1089035. [DOI] [PubMed] [Google Scholar]
- 58.Mauss AS, Busch C, Borst A. Optogenetic neuronal silencing in Drosophila during visual processing. Sci. Rep. 2017;7:13823. doi: 10.1038/s41598-017-14076-7. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 59.Johns DC, Marx R, Mains RE, O’Rourke B, Marbán E. Inducible genetic suppression of neuronal excitability. J. Neurosci. 1999;19:1691–1697. doi: 10.1523/JNEUROSCI.19-05-01691.1999. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 60.Hardie RC, et al. Calcium influx via TRP channels is required to maintain PIP2 levels in Drosophila photoreceptors. Neuron. 2001;30:149–159. doi: 10.1016/S0896-6273(01)00269-0. [DOI] [PubMed] [Google Scholar]
- 61.Harrell ER, Pimentel D, Miesenböck G. Changes in presynaptic gene expression during homeostatic compensation at a central synapse. J. Neurosci. 2021;41:3054–3067. doi: 10.1523/JNEUROSCI.2979-20.2021. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 62.Pfeiffer BD, Truman JW, Rubin GM. Using translational enhancers to increase transgene expression in Drosophila. Proc. Natl Acad. Sci. USA. 2012;109:6626–6631. doi: 10.1073/pnas.1204520109. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 63.Kim AJ, Fenk LM, Lyu C, Maimon G. Quantitative predictions orchestrate visual signaling in Drosophila. Cell. 2017;168:280–294. doi: 10.1016/j.cell.2016.12.005. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 64.Okubo TS, Patella P, D’Alessandro I, Wilson RI. A neural network for wind-guided compass navigation. Neuron. 2020;107:924–940. doi: 10.1016/j.neuron.2020.06.022. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 65.Seelig JD, et al. Two-photon calcium imaging from head-fixed Drosophila during optomotor walking behavior. Nat. Methods. 2010;7:535–540. doi: 10.1038/nmeth.1468. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 66.Green J, et al. A neural circuit architecture for angular integration in Drosophila. Nature. 2017;546:101–106. doi: 10.1038/nature22343. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 67.Maimon G, Straw AD, Dickinson MH. Active flight increases the gain of visual motion processing in Drosophila. Nat. Neurosci. 2010;13:393–399. doi: 10.1038/nn.2492. [DOI] [PubMed] [Google Scholar]
- 68.Wilson RI, Laurent G. Role of GABAergic inhibition in shaping odor-evoked spatiotemporal patterns in the Drosophila antennal lobe. J. Neurosci. 2005;25:9069–9079. doi: 10.1523/JNEUROSCI.2070-05.2005. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 69.Giovannucci A, et al. CaImAn an open source tool for scalable calcium imaging data analysis. eLife. 2019;8:e38173. doi: 10.7554/eLife.38173. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 70.Hamilos AE, et al. Slowly evolving dopaminergic activity modulates the moment-to-moment probability of reward-related self-timed movements. eLife. 2021;10:e62583. doi: 10.7554/eLife.62583. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 71.Edelstein A, Amodaj N, Hoover K, Vale R, Stuurman N. Computer control of microscopes using µ Manager. Curr. Protoc. Mol. Biol. 2010;92:14.20.1–14.20.17. doi: 10.1002/0471142727.mb1420s92. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 72.Chen C-L, et al. Imaging neural activity in the ventral nerve cord of behaving adult Drosophila. Nat. Commun. 2018;9:4390. doi: 10.1038/s41467-018-06857-z. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 73.Hermans L, et al. Microengineered devices enable long-term imaging of the ventral nerve cord in behaving adult Drosophila. Nat. Commun. 2022;13:5006. doi: 10.1038/s41467-022-32571-y. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 74.Nern A, Pfeiffer BD, Rubin GM. Optimized tools for multicolor stochastic labeling reveal diverse stereotyped cell arrangements in the fly visual system. Proc. Natl Acad. Sci. USA. 2015;112:E2967–E2976. doi: 10.1073/pnas.1506763112. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 75.Plaza, S. M. et al. neuPrint: an open access tool for EM connectomics. Front. Neuroinform.16, 896292 (2022). [DOI] [PMC free article] [PubMed]
- 76.Aso Y, et al. The neuronal architecture of the mushroom body provides a logic for associative learning. eLife. 2014;3:e04577. doi: 10.7554/eLife.04577. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 77.Pimentel D, et al. Operation of a homeostatic sleep switch. Nature. 2016;536:333–337. doi: 10.1038/nature19055. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 78.Daniels RW, et al. Increased expression of the Drosophila vesicular glutamate transporter leads to excess glutamate release and a compensatory decrease in quantal content. J. Neurosci. 2004;24:10466–10474. doi: 10.1523/JNEUROSCI.3001-04.2004. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 79.Vierock J, Grimm C, Nitzan N, Hegemann P. Molecular determinants of proton selectivity and gating in the red-light activated channelrhodopsin Chrimson. Sci. Rep. 2017;7:9928. doi: 10.1038/s41598-017-09600-8. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 80.Lyu C, Abbott LF, Maimon G. Building an allocentric travelling direction signal via vector computation. Nature. 2022;601:92–97. doi: 10.1038/s41586-021-04067-0. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 81.Cohn R, Morantte I, Ruta V. Coordinated and compartmentalized neuromodulation shapes sensory processing in Drosophila. Cell. 2015;163:1742–1755. doi: 10.1016/j.cell.2015.11.019. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 82.Mann K, Gordon MD, Scott K. A pair of interneurons influences the choice between feeding and locomotion in Drosophila. Neuron. 2013;79:754–765. doi: 10.1016/j.neuron.2013.06.018. [DOI] [PMC free article] [PubMed] [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Supplementary Materials
Data Availability Statement
All calcium imaging and fly behaviour time-course datasets analysed in the main figures are available on DANDI archive (calcium imaging data, 000247; fly choice tracking data, 000212; fly behavioural sequence tracking data, 000250). Technical documents (for example, CAD files and plasmid maps) and source data for all scatter plots and histograms are available on Figshare (10.6084/m9.figshare.c.6505732).
Scripts for data processing and plotting are available on request.