Skip to main content
eLife logoLink to eLife
. 2022 Oct 28;11:e70015. doi: 10.7554/eLife.70015

High-throughput automated methods for classical and operant conditioning of Drosophila larvae

Elise C Croteau-Chonka 1,2,, Michael S Clayton 3,, Lalanti Venkatasubramanian 1, Samuel N Harris 3, Benjamin MW Jones 3, Lakshmi Narayan 2, Michael Winding 1,2, Jean-Baptiste Masson 2,4, Marta Zlatic 1,2,3,‡,, Kristina T Klein 1,2,‡,
Editors: Aravinthan DT Samuel5, K VijayRaghavan6
PMCID: PMC9678368  PMID: 36305588

Abstract

Learning which stimuli (classical conditioning) or which actions (operant conditioning) predict rewards or punishments can improve chances of survival. However, the circuit mechanisms that underlie distinct types of associative learning are still not fully understood. Automated, high-throughput paradigms for studying different types of associative learning, combined with manipulation of specific neurons in freely behaving animals, can help advance this field. The Drosophila melanogaster larva is a tractable model system for studying the circuit basis of behaviour, but many forms of associative learning have not yet been demonstrated in this animal. Here, we developed a high-throughput (i.e. multi-larva) training system that combines real-time behaviour detection of freely moving larvae with targeted opto- and thermogenetic stimulation of tracked animals. Both stimuli are controlled in either open- or closed-loop, and delivered with high temporal and spatial precision. Using this tracker, we show for the first time that Drosophila larvae can perform classical conditioning with no overlap between sensory stimuli (i.e. trace conditioning). We also demonstrate that larvae are capable of operant conditioning by inducing a bend direction preference through optogenetic activation of reward-encoding serotonergic neurons. Our results extend the known associative learning capacities of Drosophila larvae. Our automated training rig will facilitate the study of many different forms of associative learning and the identification of the neural circuits that underpin them.

Research organism: D. melanogaster

Introduction

Animals must rapidly alter their behaviour in response to environmental changes. An important adaptation strategy is associative learning (Dickinson, 1981; Rescorla, 1988), in which an animal learns to predict an unconditioned stimulus (US) by the occurrence of a conditioned stimulus (CS). The US is often a punishing or rewarding event such as pain or the discovery of a new food source (Pavlov, 1927). The circuit mechanisms that underlie associative learning are still incompletely understood. Furthermore, there are different forms of associative learning and the extent to which distinct circuits underlie distinct types of associative learning is unclear.

The nature of the CS distinguishes two major associative learning types. In classical conditioning (Pavlov, 1927), the CS is a stimulus such as an odour. In operant conditioning the CS is the animal’s own action (Skinner, 1938; Thorndike, 1911). Distinct forms of classical conditioning can further be distinguished, for example, based on the timing of CS and US: in delay conditioning they overlap in time, whereas in trace conditioning there is a gap between them (Dylla et al., 2013). Systematic identification and comparison of neurons and circuits involved in distinct types of learning paradigms would be greatly facilitated by automated high-throughput training systems combined with optogenetic and thermogenetic manipulation of neurons in freely behaving animals.

We therefore developed an automated training system for classical and operant learning in the tractable genetic model system, the Drosophila melanogaster larva. The Drosophila larva is particularly well-suited for studying the neural basis of behaviour. Powerful genetic tools have advanced the study of how larval behaviours (Figure 1A) are affected by activity at the cellular level. In Drosophila, individual neurons are uniquely identifiable, with morphology and function preserved across animals (Skeath and Thor, 2003; Wong et al., 2002; Marin et al., 2002; Jefferis et al., 2007). Together with tissue-localised protein expression afforded by binary expression systems like Gal4/UAS and LexA/LexAop (Fischer et al., 1988; Brand and Perrimon, 1993), this knowledge has yielded neuron-specific drivers (Jenett et al., 2012; Luan et al., 2006; Pfeiffer et al., 2010) that reproducibly target the same groups of cells in each individual. Adding fluorescent markers helps to pinpoint a neuron’s location and reveal its anatomical features (Lee and Luo, 1999), while expressing light-sensitive channelrhodopsins and temperature-sensitive ion channels enables optogenetic (Zemelman et al., 2002; Lima and Miesenböck, 2005) or thermogenetic (Hamada et al., 2008; Kitamoto, 2001) modulation of neuronal activity. Furthermore, the larva’s compact central nervous system (CNS) has made it feasible to reconstruct neurons and their synaptic partners from a larval electron microscopy (EM) volume (Berck et al., 2016; Eichler et al., 2017; Fushiki et al., 2016; Ohyama et al., 2015; Schlegel et al., 2016; Larderet et al., 2017; Jovanic et al., 2016; Jovanic et al., 2019). These reconstructions have given rise to a full wiring diagram of the larval mushroom body (MB) (Eichler et al., 2017; Eschbach et al., 2021; Eschbach et al., 2020) - a region known to play a key role in associative learning (Aso et al., 2014; Honegger et al., 2011; Berck et al., 2016; Lin et al., 2014; Owald and Waddell, 2015; Campbell et al., 2013; Turner et al., 2008; Eichler et al., 2017).

Figure 1. Multi-larva tracker combines real-time behaviour detection with either open- or closed-loop stimulation.

(a) Behavioural repertoire of Drosophila larvae. Schematics show the four most prominent actions displayed by Drosophila larvae (crawl, left and right bend, back-up, and roll). The larval contour is displayed as a black outline with a green dot marking the head. (b) Multi-larva tracker schematic showing the relative positions of the camera, digital micromirror devices (DMDs), galvanometers, agarose plate, and backlight. The heat camera is not shown (for visual simplicity), but is mounted directly beneath the background DMD. See multi-larva-tracker-cad.zip for technical drawings. (c) Block diagram of hardware components. AO: analogue output, FPGA: field-programmable gate array. d. Data flow between software elements.

Figure 1.

Figure 1—figure supplement 1. Contour calculation on eld-programmable gate array (FPGA).

Figure 1—figure supplement 1.

A simplied example is shown using a 10 x 10 pixel box containing a small object. (a) The object (black) was detected against the background (white) using binary thresholding. Edge pixels were detected by combining the results of vertical and horizontal image convolution with a 2 x 1 XOR kernel using an OR operator. (b) The contour points were reconstructed in an iterative process, starting with the edge pixel closest to the centre of the box. The next contour point was defined as the first neighbouring pixel that was found to be an edge pixel. Neighbouring pixels were assessed clockwise from the pixel directly above the contour point. The process ended when no eligible edge pixels could be found.

Figure 1—figure supplement 2. Detecting head and tail.

Figure 1—figure supplement 2.

The larval contour (black outline) and head and tail (green) are shown. (a) Initial detection of head and tail. The head was the contour point with the sharpest curvature. The tail was the contour point with the next-sharpest curvature which did not lie in close proximity to the head. (b) The initial detection of head and tail was incorrect in some cases. False detection could be corrected by swapping head and tail, thereby minimising the distances from head and tail in the current frame (solid contour) to head and tail in the previous frame (transparent contour). (c) The correction described in b failed if larvae curled up such that the contour appeared circular (‘ball’). To eliminate this source of false head and tail detection, these events were detected using a ball classier.

Figure 1—figure supplement 3. Calculating a smooth spine and landmark points.

Figure 1—figure supplement 3.

The larval contour is shown (black outline). The spine S was comprised of 11 points (black), including head and tail (green). (a) The raw spine points were obtained by finding the centres between equally spaced contour points on either half of the contour as defined by head and tail. The first spine point was the head, the last spine point was the tail. (b) The smooth spine was obtained by exponentially smoothing the raw spine. (c) Four additional landmark points, neck_top, neck, and neck_down (blue), and the contour centroid (grey), were calculated.

Figure 1—figure supplement 4. Calculating direction vectors.

Figure 1—figure supplement 4.

Three direction vectors were calculated based on head, tail, and the landmark points. (a) direction_vector was the normalised vector from neck_down to neck. (b) direction_head_vector was the normalised vector from neck_top to head. (c) direction_tail_vector was the normalised vector from tail to neck_down.

Figure 1—figure supplement 5. Features describing body shape.

Figure 1—figure supplement 5.

(a) Outline of a larva with contour C (black) and its convex hull H (blue). (b) Shown here are the eigenvectors (blue) of the larval contour (black) structure tensor with respect to neck and their corresponding eigenvalues λ1 and λ2. (c) θi was defined as the angle between direction_vector (blue) and the vector ai that passed through spine points Si and Si+1 (black). (d) θhead was defined as the angle between direction_vector and direction_head_vector. Head and tail are shown in green.

Figure 1—figure supplement 6. Velocity features.

Figure 1—figure supplement 6.

The larval contour is shown in black while head and tail are shown in green. (a) crab_speed (blue) was defined as the component of neck_speed (grey) that was orthogonal to direction_vector_filtered (black). (b) parallel_speed (blue) was defined as the component of neck_speed_filtered (grey) that was parallel to direction_vector_ filtered (black). (c) parallel_speed_tail_raw (blue) was defined as the component of tail_speed_filtered (grey) that was parallel to direction_tail_vector_filtered (black). (d) θtail was defined as the angle between tail_speed_filtered (grey) and direction_tail_vector_filtered (black).

Figure 1—figure supplement 7. Temporal smoothing of features.

Figure 1—figure supplement 7.

(a-b) Example graphs of raw (dark blue) and filtered (mid blue) asymmetry (a) and eig_reduced (b) values over time. (c–d) Example graphs of raw (dark blue), filtered (mid blue), and long-time filtered (light blue) v_norm values over a short (c) and a long (d) period of time.

Figure 1—figure supplement 8. Differentiation by convolution.

Figure 1—figure supplement 8.

Example graphs of raw (dark blue) and convolved squared (green) asymmetry (a), eig_reduced (b), and v_norm (c) values over time.

As with many vertebrates (Andreatta and Pauli, 2015; Brown et al., 1951; Jones et al., 2005; Braubach et al., 2009) and invertebrates (Takeda, 1961; Vinauger et al., 2014; Alexander et al., 1984; Wen et al., 1997; Scherer et al., 2003; Davis, 2005; Cognigni et al., 2018; Vogt et al., 2014), there is overwhelming evidence that Drosophila larvae are capable of classical conditioning. They can be trained to approach an odour paired with a gustatory reward (Schleyer et al., 2011; Hendel et al., 2005; Kudow et al., 2017; Niewalda et al., 2008), or avoid an odour paired with light (von Essen et al., 2011), electric shock (Aceves-Piña and Quinn, 1979; Tully et al., 1994), heat (Khurana et al., 2012), vibration (Eschbach et al., 2011), or the bitter compound quinine (Gerber and Hendel, 2006; Apostolopoulou et al., 2014). A larva’s innate avoidance of light and preference for darkness (Sawin-McCormack et al., 1995) can also be modulated when paired with reward or punishment (Gerber et al., 2004; von Essen et al., 2011).

Adult Drosophila have also been shown to perform trace conditioning when stimuli do not overlap in time (Galili et al., 2011). However, to the best of our knowledge, trace conditioning has never been shown in Drosophila larvae, perhaps reflecting genuine learning limitations in this developmental stage. However, the absence of evidence might also reflect the limitations of current methods for studying larval learning. Such methods often deliver a US using optogenetic stimulation, and deliver an olfactory stimulus via natural odour (Eschbach et al., 2021). Temporal precision is difficult with these approaches, precluding thorough investigation of larval learning and relative timing of stimuli. In addressing these methodological challenges, prior work has combined optogenetics with thermogenetics to independently stimulate larval neurons of differing sensory modalities (Honda et al., 2014). The methods used to heat larvae in these experiments (e.g. hot plates) remain, however, slow relative to optogenetic stimulation. An experimental system equipped with temporally precise opto- and thermogenetic stimulus delivery would be invaluable for executing automated larval trace conditioning tasks.

Despite countless demonstrations of operant conditioning across vertebrates (Nottebohm, 1991; Olds and Milner, 1954; Jin and Costa, 2010; Lovell et al., 2015) and invertebrates (Brembs, 2003; Hoyle, 1979; Abramson et al., 2016; Nuwal et al., 2012; Booker and Quinn, 1981), it is also unknown whether Drosophila larvae can associate their own actions with distinct sensory outcomes. For an animal to learn such a relationship, behavioural information must converge with circuits encoding the outcome’s valence. Although vertebrate basal ganglia-like structures exemplify this (Fee and Goldberg, 2011; Redgrave et al., 2011; Balleine et al., 2009), some learned action–outcome associations do not require the brain (Booker and Quinn, 1981; Horridge, 1962; Grau et al., 1998). Investigating operant conditioning in Drosophila larvae may further elucidate whether such learning can form in more than one area of the CNS. However, designing an automated operant conditioning task for larvae requires consideration of their short life cycle and physical characteristics. Traditional approaches require either extensive training to interact with an object (Jin and Costa, 2010; Fernando et al., 2015; Corbett and Wise, 1980; He et al., 2015) or, as with adult Drosophila, partial immobilisation and usage of remaining motion to control a virtual environment (Nuwal et al., 2012; Wolf and Heisenberg, 1991; Wolf et al., 1998; Brembs, 2011). A more viable and less restrictive system for larvae would not only allow free animal movement but also rapidly deliver a rewarding or punishing US in accordance with a given behaviour.

Temporally precise action reinforcement requires real-time identification of larval behaviours. Numerous algorithms already exist for real-time tracking of freely moving animals (Stowers et al., 2017; Krynitsky et al., 2020; Mischiati et al., 2015; Fry et al., 2008; Straw et al., 2011; Swierczek et al., 2011) and subsequent offline behaviour analysis (Mathis et al., 2018; Veeraraghavan et al., 2008; Dankert et al., 2009; Robie et al., 2017; Mirat et al., 2013; Reddy et al., 2020; Stephens et al., 2008; Gupta and Gomez-Marin, 2019). The Drosophila larva has been of notable analytic interest due its deformable body and limited set of distinguishing physical features. Algorithmic advances have enabled extensive investigation of larval behaviour in response to open-loop stimuli (Luo et al., 2010; Gershow et al., 2012; Denisov et al., 2013; Vogelstein et al., 2014; Ohyama et al., 2013; Ohyama et al., 2015; Jovanic et al., 2019). Most of these approaches are nonetheless not ideal for running in real-time, or require mixing past and future information to perform reliably (Gomez-Marin et al., 2011; Masson et al., 2020). Existing closed-loop trackers that overcame these challenges to achieve real-time behaviour detection and stimulus presentation are themselves limited to investigating one animal at a time (Schulze et al., 2015; Tadres and Louis, 2020).

Here, we introduce a new tracker we built to address some methodological limitations of prior Drosophila larval learning studies. Our system performs real-time tracking and behaviour analysis of up to 16 larvae simultaneously. It also achieves independent opto- and thermogenetic stimulation through rapid illumination and heating of individual larvae. This stimulation is delivered automatically with high temporal precision and is controlled in either open- or closed-loop. Using this system, we demonstrate that Drosophila larvae are capable of both trace conditioning and operant conditioning.

Results

Design of an FPGA-based, multi-larva, real-time behaviour-detection and stimulation system for high-throughput, automated training

We built a high-throughput (i.e. multi-larva) tracker combining live behaviour detection with rapid delivery of light and heat stimuli. All hardware resides within an optically opaque enclosure to ensure experiments are performed without environmental light. Larvae move freely on an agarose plate, backlit from below by an infrared (IR) LED and observed from above through a high-resolution camera (Figure 1B). While real-time behaviour detection has been developed for a single animal (Schulze et al., 2015), our multi-larva system simultaneously tracks up to 16 larvae, using LabVIEW for the user interface and algorithm implementation (Figure 1D). Instrumental to this software architecture is the fast image processing speed afforded by field-programmable gate array (FPGA)-based parallelisation (Soares dos Santos and Ferreira, 2014; Li et al., 2011; Zhang et al., 2017). Neuroscientists have adapted FPGA’s real-time analysis capabilities (Kehtarnavaz et al., 2009; Uzun et al., 2005; Chiuchisan, 2013; Yasukawa et al., 2016) to track rats (Chen et al., 2005), zebrafish larvae (Cong et al., 2017), and fluorescently labelled neurons in freely behaving Drosophila larvae (Karagyozov et al., 2018). In our system, the high-performance FPGA and host computer work together (Figure 1C) to read raw camera images, detect eligible objects, and extract and process object features (i.e. contour, head and tail position, and body axis) (Figure 1D, see Materials and methods for details). Measuring larval body shape, velocity, and direction of motion facilitates robust behaviour detection via machine learning. We detected bends (left and right), rolls, forward and backward peristaltic waves with high precision and recall (see Materials and methods for all values).

The FPGA and host computer also calculate the timing and intensity of light and heat stimuli. Both stimuli can be controlled in either an open-loop or closed-loop configuration. Light stimulation is achieved by directing visible red light through two digital micromirror devices (DMDs), each programmed to project small 1 cm2 squares at the location of individual larvae. The DMDs are positioned to project over the entire plate area and operate simultaneously (Figure 1B; see also Materials and methods). Targeted heat stimulation of individual larvae can be achieved by directing an 1400–1500 nm IR laser beam through a two-axis scanning galvanometer mirror positioning system, a technique previously used to stimulate single adult flies (Bath et al., 2014; Wu et al., 2014). The galvanometer’s high scanning velocity enables rapid cycling of the IR beam between multiple larvae (Figure 1B; see also Materials and methods). To verify the efficiency and speed with which this method heated up individual animals we also installed a heat camera on the setup. Using the camera we demonstrated that larvae are heated to the desired 30℃ within 4 s. The heat camera performed closed-loop adjustments of laser intensity to maintain the desired 30℃ temperature at each larval location (Figure 2—figure supplement 1).

Proof-of-principle experiments verify multi-larva training rig’s stimulation efficiency

We conducted open-loop proof-of-principle experiments to ensure that our tracker could successfully perform optogenetic stimulation of tracked larvae (Figure 2C). We tested whether 69F06>CsChrimson and 72F11>CsChrimson larvae rolled upon exposure to red light (Figure 2C; see also LABEL:sec:materials_and_methods). Rolling is a lateral movement characterised by the larva curling into a C-shape and quickly turning around its own body axis (Robertson et al., 2013; Hwang et al., 2007; Ohyama et al., 2013; Figure 1A). This is the fastest larval escape behaviour and is observed in nature only after exposure to a strong noxious stimulus, such as heat or a predator attack (Ohyama et al., 2015; Robertson et al., 2013; Tracey et al., 2003). Both experimental driver lines drive expression of the red-shifted channelrhodopsin CsChrimson (Klapoetke et al., 2014) in neurons whose activation triggers strong rolling behaviour (Ohyama et al., 2015): 69F06 drives expression in Goro command neurons for rolling, whereas 72F11 drives expression in the Basin neurons, which integrate mechanosensory and nociceptive stimuli. During the 5 s stimulus presentation within each of three stimulation rounds, we observed above-threshold rolls in over 50% of 69F06>CsChrimson larvae and over 90% of 72F11>CsChrimson larvae. Both experimental groups’ rolling behaviour significantly contrasted that of attP2>CsChrimson control larvae during each 5 s stimulus presentation which exhibited virtually no rolling. This significant contrast to the control was also evident for either one or both experimental groups during the first 5 s of break within each stimulation round (Figure 2D). These results suggest that the combined red light emitted by the two tracker DMDs (see Materials and methods) is sufficient to activate targeted neurons of interest.

Figure 2. Optogenetic and thermogenetic stimulation efficiency verified by behavioural readout.

(a) Light stimulation hardware schematic. Only one digital micromirror device (DMD) is shown for simplicity. (b) Heat stimulation hardware schematic. Only one two-axis galvanometer is shown for simplicity. IR: infrared. (c) Proof-of-principle experiment protocol for either optogenetic (light bulb) or thermogenetic (thermometer) stimulation. d, e. Fraction of larvae for which the optogenetic (d) or thermogenetic (e) stimulus protocol triggered at least one detected roll (top pair of plots), bend (middle pair of plots), or forward crawl (bottom pair of plots). For each behaviour, the fraction of larvae is computed within 0.5 s (line plots) or 5 s (scatter plots) time bins across the 60 s experiment. All data shown with 95% Clopper-Pearson interval. Fisher’s exact test with Bonferroni correction was performed within each 5 s time bin between each experiment group (69F06 and 72F11) and the control group (attP2). Sample sizes for each genotype within each 5 s time bin are shown at the bottom of (d) and (e). ns p ≥ .05/24 (not significant), * p < .05/24, ** p < .01/24, *** p < .001/24. See Figure 2—source data 1, Figure 2—source data 2, Figure 2—source data 3.

Figure 2—source data 1. Rolling, bending, and crawling behaviour for each larva over time (separated by genotype) - for data in top row of Figure 2d, e.
elife-70015-fig2-data1.xlsx (665.3KB, xlsx)
Figure 2—source data 2. Rolling, bending, and crawling behaviour for each larva over time (separated by genotype) - for data in middle row of Figure 2d, e.
Figure 2—source data 3. Rolling, bending, and crawling behaviour for each larva over time (separated by genotype) - for data in bottom row of Figure 2d, e.
Figure 2—source data 4. Recorded temperatures during larval IR heating.

Figure 2.

Figure 2—figure supplement 1. Temporal dynamics of larval heating via IR stimulation.

Figure 2—figure supplement 1.

Larval temperature recorded before, during, and after delivery of 1470nm IR laser stimulation. Open-loop experiments began with a 30 s initialisation period during which no stimulus was given. Over a subsequent 20 s stimulation period (beginning at 0 s; grey vertical dashed line), a heat camera performed closed-loop adjustments of laser intensity to maintain the desired 30°C temperature (grey horizontal dashed line) at each larval location. The laser was then turned off to observe the time required for larvae to return to baseline temperature. Temperature readings were stopped 50 s after initial stimulus onset. Inset (grey solid rectangle) shows zoomed in temporal window for ease of visualisation. Temperature data were averaged across larvae (n = 36; data shown as mean ± 95% confidence interval). See Figure 2—source data 4.

When exploring an environment, a larva alternates between crawling via forward peristalsis (Heckscher et al., 2012) and bending its head once or more to the left or right (Gomez-Marin et al., 2011; Luo et al., 2010; Kane et al., 2013; Figure 1A). A common avoidance behaviour exhibited by larvae is bending of the head away from undesirable conditions, including extreme temperature (Luo et al., 2010; Lahiri et al., 2011), light (Kane et al., 2013), or wind (Jovanic et al., 2019; Figure 1A). Prior investigation in our laboratory has shown that Basin activation can evoke bending in addition to rolling, and Goro activation can evoke C-shape bending. We therefore asked whether the fraction of larvae bending during optogenetic stimulation was also significantly different between the experimental groups and control. The fraction of 69F06>CsChrimson and 72F11>CsChrimson larvae that were bending during the 5 s stimulus presentation within each of the three stimulation rounds was significantly higher than that of attP2>CsChrimson control larvae (Figure 2D). The low levels of bending evoked by red light alone in control animals suggest the red light used for optogenetic activation is not very aversive to the animals.

The third larval behaviour we monitored across the duration of these optogenetic efficiency experiments was forward crawling. The fraction of larvae crawling was not statistically different between experimental and control groups at any time during the experiment. The fraction of attP2>CsChrimson control larvae crawling during each 5 s stimulus presentation was, however, consistently elevated compared to that of both experimental groups (Figure 2D). The reduction in experimental larvae crawling matched our expectations, given the high frequency of both rolling and bending behaviour during stimulus presentation.

We also verified the efficacy of our tracker’s galvanometer setup for thermogenetic stimulation (Figure 2B). We tested whether 69F06>dTrpA1 and 72F11>dTrpA1 larvae rolled upon exposure to a 1490 nm IR laser (Figure 2C; see also Materials and methods). Because wavelengths between 1400 and 1500 nm are well-absorbed by water (Curcio and Petty, 1951), we anticipated that heating larvae with this IR beam would activate the ectopically-expressed thermosensitive cation channels (i.e. dTrpA1). During the 5 s stimulus presentation within each of three stimulation rounds, we observed above-threshold rolls in over 60% of 69F06>dTrpA1 larvae and at least 40% of 72F11>dTrpA1 larvae. In stimulation rounds 1 and 2, values in both experiment groups significantly contrasted those of attP2>dTrpA1 control larvae, for which the fraction of larvae rolling was near zero (Figure 2E). The quantitative difference in these rolling responses compared to optogenetic activation of the same Gal4 drivers (Figure 2D) is not surprising. These effects are likely mediated by differing biophysical properties of CsChrimson and dTrpA1 channels including single channel conductance and open state lifetime (Pulver et al., 2009; Vierock et al., 2017). In further contrast to the proof-of-principle optogenetic experiments, the slower kinetics of tissue heating caused a ca. 4–5 s second temporal delay between stimulus onset and behaviour onset (Figure 2E). We concluded from these results that our chosen heating conditions, although slower than optogenetic stimulation, were effective for targeted dTrpA1 channel activation with a predictable temporal delay of 4 s.

Outfitting our tracker with an IR laser enables targeted neuronal activation without risking the spectral cross-talk commonly associated with channelrhodopsins of overlapping activation wavelengths. Further exploration of the proof-of-principle thermogenetic data did, however, reveal an important caveat of our IR-induced stimulation approach. The fraction of attP2>dTrpA1 control larvae that were bending was statistically indistinguishable from that of 69F06 and 72F11 larvae throughout the experiment (Figure 2E). Bending together with rolling accounted for much of larval behaviour across all three groups during each 5 s stimulus presentation; evidenced, in part, by the near-zero fraction of larvae crawling at these times (Figure 2E). The high bending frequency of attP2>dTrpA1 control larvae during IR-induced stimulation is likely indicative of mild heat aversion.

Aversion to fictive Or42b develops after forward-paired trace conditioning

Having verified the efficacy of optogenetic and thermogenetic stimulation in our system, we first studied whether these methods could be used to train larvae in a previously unexplored classical conditioning task that requires precise temporal control of both CS and US. In particular, we focused on trace conditioning, which has not been demonstrated previously in larvae. To provide the CS in these experiments, all larvae expressed CsChrimson in Or42b neurons. Drosophila larvae display innate attraction during Or42b activation. When these neurons are stimulated artificially, larvae reduce their bending frequency immediately after stimulation onset and rapidly increase bending frequency following stimulation offset (Gepner et al., 2015). To provide the US in these experiments, experimental larvae also expressed dTrpA1 in Basin neurons. Pairing an odour with Basin activation has previously been shown to evoke aversive odour memory (when the CS and US overlap in time Eschbach et al., 2020). Importantly, control larvae did not express dTrpA1 in Basin neurons (see Materials and methods for more details).

Figure 3A schematises the classical conditioning protocol. Each forward-paired training round comprised 20 s of optogenetic Or42b activation followed by 20 s of IR heating (activating Basin neurons in experimental larvae), with 5s from light offset to triggering IR stimulation. We note that, while we triggered IR light 5 s after the offset of red light for optogenetic stimulation, it took a further 4 s for larvae to reach the appropriate 30℃ temperature for thermogenetic activation of Basins. The gap between CS offset and US onset is, therefore, ca. 9 s. 60 s without stimulation followed US offset. Backward-paired training followed the same protocol structure except IR heating preceded Or42b activation. Eight replicate training rounds comprised the training period, after which an additional 60 s without stimulation was allocated before the testing period. The testing period included three, 20 s blocks of Or42b activation, each separated by 45 s without stimulation (see Materials and methods for more details). To assess learning, we analysed the behavioural responses of larvae to Or42b activation in the testing period. We calculated the difference in the percentage of larvae bending during versus after Or42b activation (i. e. ON-OFF; see Materials and methods for more details). A large, negative ‘percentage bending difference’ indicates significant attraction to Or42b activation, with less bending during versus after stimulation. In contrast, a difference value closer to zero indicates less attraction and a value greater than zero indicates aversion.

Figure 3. The effects of forward- versus backward-paired aversive training on larval attraction to Or42b.

Figure 3.

(a) Schematic of classical conditioning protocol. After an initialisation period of 30 s, the first training round began. Here, Or42b was activated through red light illumination and was followed (forward-paired) or preceded (backward-paired) by the activation of Basin (72F11) neurons through heating. These stimuli were each delivered for 20 s, with a 5 s gap between them (i.e. inter-stimulus interval; ISI). A break of 60 s was allowed before the start of the next training round. In total, larvae completed eight training rounds (i.e. one training period). Larvae then completed a 60 s pre-test period without stimulation before the start of the testing period. The testing period comprised three testing rounds. During a single testing round, only Or42b was activated through red light illumination for 20 s, followed by a 45 s break. (b) Time-course of the percentage of experimental larvae bending during the testing period, averaged across all three testing rounds. Data were down-sampled from 20 Hz to 1 Hz to aid visualisation. Grey shading indicates the period of Or42b stimulation. Error shading shows the mean ± 95% confidence intervals (c) The average percentage of experimental larvae bending during the PRE (10–0 s before light onset), ON (0–20 s after light onset), and OFF (0–20 s after light offset) testing windows. Bars show medians, as well as upper and lower quartiles of data. (d, e) Data presented as in b and c, but for control larvae. (f) Percentage bending difference (ON-OFF) values after forward- and backward-paired training for both experimental and control larvae. Bars show medians, as well as upper and lower quartiles of data. Statistics calculated with a two-sided Mann-Whitney U test; * p < .01, *** p < .0001. See Figure 3—source data 1.

Figure 3—source data 1. Behavioural data recorded during the testing period of associative conditioning experiments.

Experimental larvae showed attraction to Or42b activation after backward-paired training, bending less to fictive odour onset and more to odour offset in the testing period. However, after forward-paired training, experimental larvae showed reduced attraction to Or42b (Figure 3B). This effect can also be seen in the averaged percentage of larvae bending for each of the three testing windows (Figure 3C). We statistically confirmed this qualitative difference between training conditions for experimental larvae. Percentage bending differences were significantly smaller after forward-paired training (mean = −5.22%, sd = 18.23%, n = 71) compared to backward-paired training (mean = −29.65%, sd = 14.10%, n = 70) (p<0.0001, common language effect size (CLES)=0.852; Figure 3F). This result matched our expectation, given existing knowledge that Basin activation alone produces an aversive response and that larvae avoid odours paired with Basin activation (Eschbach et al., 2020).

The responses of control larvae to Or42b activation were more similar between training conditions (Figure 3D, Figure 3E). However, as with experimental larvae, percentage bending differences were also significantly smaller after forward-paired training (mean = −21.76%, sd = 15.63%, n = 49) compared to backward-paired training (mean = −30.22%, sd = 14.83%, n = 55), although with a substantially reduced effect size (p=0.009, CLES = 0.648; Figure 3F). This difference between training conditions in control larvae suggests that the delivery of mild heat after Or42b stimulation was sufficient to weaken larval attraction to this fictive odour. This result is consistent with prior work showing larval classical conditioning using mild heat as reinforcement (Khurana et al., 2012). Importantly, however, forward-paired training yielded significantly smaller percentage bending differences in experimental larvae compared to control larvae (i. e. mean = −5.22% vs –21.76%) (p<0.0001, CLES = 0.752; Figure 3F). This result shows that activating Basin neurons after Or42b caused significantly greater aversion to this fictive odour, as opposed to delivering mild heat alone. Bending differences following backward-paired training did not differ significantly between genotypes (p>0.5).

These results show that our tracker can be used to perform automated, high-throughput classical conditioning in Drosophila larvae. To the best of our knowledge, these results also provide the first evidence that larvae can perform classical conditioning with significant offset-to-onset gaps (9 s) between stimuli (i.e. trace conditioning).

Operant conditioning of larval bend direction

Our system’s closed-loop stimulation capabilities allowed us to investigate whether Drosophila larvae are capable of operant learning. We chose fictive activation of candidate reward circuits as a US (Figure 4A), but were challenged to determine which neurons could convey a reinforcement signal for operant learning. Across the animal kingdom, biogenic amine neurotransmitters including dopamine, octopamine, and serotonin can provide reinforcement signals (Giurfa, 2006; Hawkins and Byrne, 2015; Meneses and Liy-Salmeron, 2012; Fee and Goldberg, 2011). With this knowledge, we aimed to induce larval operant conditioning by stimulating both dopaminergic and serotonergic neurons across the Drosophila CNS. The Ddc-Gal4 driver is ideally suited for this purpose, covering a broad set of neurons containing these biogenic amines (Li et al., 2000; Sitaraman et al., 2008; Lundell and Hirsh, 1994), including the MB-innervating protocerebral anterior medial (PAM) cluster dopaminergic neurons (Liu et al., 2012; Aso et al., 2012). Although the function of most Ddc neurons is unknown, PAM cluster activation serves as both a necessary and sufficient reward signal in classical conditioning (Rohwedder et al., 2016; Liu et al., 2012; Vogt et al., 2014; Cognigni et al., 2018; Waddell, 2013), and collective activation of Ddc neurons can substitute for an olfactory conditioning reward in adult flies (Liu et al., 2012; Shyu et al., 2017; Aso et al., 2012). If either dopamine or serotonin mediates valence signalling in larval operant conditioning, paired activation of Ddc neurons with behaviour may be sufficient to induce such learning.

Figure 4. Operant conditioning of bend direction in Drosophila larvae requires the ventral nerve cord.

(a) The goal of our automated operant conditioning paradigm is to reinforce an action of interest by coupling real-time behaviour detection with optogenetic activation of reward circuits. (b) High-throughput experiment protocol. During training, each larva (black contour with green head) received optogenetic stimulus (red light bulb) when bent to one predefined side (depicted as left), and no stimulus otherwise (grey light bulb). (c–h) Gal4 expression is depicted as color-coded CNS (see legend). UAS-CsChrimson effector abbreviated as CsChr for visual clarity. Bars show medians, as well as upper and lower quartiles of data. Outliers (filled diamonds) are randomly jittered horizontally to aid visualisation. (c–f) top row. Larval bend rate shown as number of bends per minute, grouped by bends to stimulated side (dark red) or unstimulated side (grey). For larvae that received random, uncorrelated stimulation during 50% of bends (d), left and right bend rate are shown in light red. Statistical comparisons calculated using a paired, two-sided Wilcoxon signed-rank test. (c–f) bottom row. Difference in bend rate (black) shown between the stimulated and unstimulated sides or, in the case of the uncorrelated training group (panel d), between left and right sides. Statistical comparisons calculated using a two-sided Wilcoxon signed-rank test. (c–f). Data shown from the test periods before training round 1 (Before) and after training round 4 (After). n is the number of larvae in each time bin. Exact p-values written above corresponding data. ns p ≥ .05 (not significant), * p < .05, ** p < .01, *** p < .001. (g). Bend rate data after training round 4 (same data as in (c) and (d) top row), with bend rate for uncorrelated training group calculated without stratification by bend direction. Statistics calculated with a two-sided Mann-Whitney U test, with Bonferroni correction; ns p ≥ .05/2 (not significant), ** p < .01/2. (e) Difference in bend rate after training round 4 (same data as in c–f bottom row). Statistical comparisons against Ddc > CsChr calculated with a two-sided Mann-Whitney U test, with Bonferroni correction; * p < .05/3, ** p < .01/3. See Figure 4—source data 1.

Figure 4—source data 1. Source data showing that operant conditioning of bend direction in Drosophila larvae requires the ventral nerve cord.
elife-70015-fig4-data1.xlsx (245.7KB, xlsx)
Figure 4—source data 2. Source data showing that Drosophila larvae exhibit bend direction preference during operant paradigm training.

Figure 4.

Figure 4—figure supplement 1. Ddc-Gal4 expression pattern without and with tsh-Gal80 restriction.

Figure 4—figure supplement 1.

Maximum intensity projections of confocal images obtained after immunohistochemical staining. Plan-Apochromat 20x objective, resolution: 592 x 800 pixels, scale bar: 100 μm. Images courtesy of the HHMI Janelia FlyLight team. (a, e) (green in d and h). Targeting a green fluorescent protein (GFP) antibody to the mVenus tag of CsChrimson. (b, f) (red in d and h). Staining against BP104. (c, g) (blue in d and h) Staining against N-cadherin. (a–d) Ddc>CsChrimson larvae. Manually counting the cell bodies in the image stacks revealed more than 200 GFP-positive neurons located in the brain, subesophageal zone (SEZ), and ventral nerve cord (VNC), including the PAM cluster dopaminergic neurons innervating the mushroom body (n = 2). This confirmed that Ddc- Gal4 drives broad expression across the central nervous system (CNS) ( Li et al., 2000; Lundell and Hirsh, 1994). (e–h) Ddc>CsChrimson, tsh>Gal80 larvae. As expected, no GFP-positive neurons were found in the VNC (n = 6). Ddc brain and SEZ expression remained largely unaffected by Gal80, as the GFP-positive neurons in both areas that could be consistently identified in Ddc>CsChrimson larvae (n = 3) were also present in Ddc>CsChrimson, tsh>Gal80 larvae (n = 3).
Figure 4—figure supplement 2. Drosophila larvae show bend direction preference during operant paradigm training.

Figure 4—figure supplement 2.

High-throughput experiments followed the protocol depicted in Figure 4B. Gal4 expression depicted as color-coded CNS (see legend). UAS-CsChrimson effector abbreviated as CsChr for visual clarity. Data shown in 1 min time bins (separated by vertical dashed lines) across the entire experiment, beginning with the test period before training round 1 and ending with the test period after training round 4. Larval bend rate shown as number of bends per minute, grouped by bends to stimulated side (dark red) or unstimulated side (dark grey). For larvae that received random, uncorrelated stimulation during 50% of bends (panel b), left and right bend rate are shown in light red. Bars show medians, as well as upper and lower quartiles of data. Outliers (open diamonds) are randomly jittered horizontally to aid visualisation. Number of larvae in each time bin is written just below the x-axis. Exact p-values written above corresponding data. Statistical comparisons calculated using a paired, two-sided Wilcoxon signed-rank test. ns p ≥ .05 (not significant), * p < .05, ** p < .01, *** p < .001. See Figure 4—source data 1.
Figure 4—figure supplement 3. Operant conditioning of bend direction in Drosophila larvae with single-larva tracker.

Figure 4—figure supplement 3.

(a) Software framework of single-larva tracker. Still images from the graphical user interface show aerial views of a single Drosophila larva in the behaviour arena (blue outline: contour; head: green dot; tail: red dot; green words: detected behaviours). (b) Hardware schematic for optogenetic stimulation. System hardware was nearly identical to that described in Schulze et al., 2015. A camera and an IR backlight, both mounted on motorised linear slides, tracked the real-time behaviours of a single larva moving along a stationary agarose plate. When a chosen behaviour was detected, the red LED turned on, stimulating the larva. (c) Experiment protocol using the single-larva closed-loop tracker. Behaviours are depicted as larval contours (black) with head (green dot). During training, the larva received optogenetic stimulus (red light bulb) when bent to one predefined side (depicted as left), and no stimulus otherwise (grey light bulb). (d, e, f) Gal4 expression depicted as color-coded CNS (see legend). UAS-CsChrimson effector abbreviated as CsChr for visual clarity. Bars show medians, as well as upper and lower quartiles of data. Outliers (filled diamonds) are randomly jittered horizontally to aid visualisation. d, e top row. Larval bend rate shown as number of bends per minute, grouped by bends to stimulated side (dark red) or unstimulated side (grey). Statistical comparisons calculated using a paired, twosided Wilcoxon signed-rank test. (d, e) bottom row. Difference in bend rate (black) between the stimulated and unstimulated sides. Statistical comparisons calculated using a two-sided Wilcoxon signed-rank test. (d–e) Data shown from the test periods before training round 1 (Before) and after training round 2 (After). n is the number of larvae in each time bin. Exact p-values written above corresponding data. ns p ≥ 0.05 (not significant), * p < 0.05, ** p < 0.01. f. Difference in bend rate after training round 2 (same data as in d and e bottom row). Statistical comparison between genotypes calculated using a two-sided Mann-Whitney U test. * p < 0.05. See Figure 4—source data 2.

The CS in our automated operant conditioning paradigm was larval bending (Figure 4B). We expressed UAS-CsChrimson under the control of the Ddc-Gal4 driver, with the intention of activating corresponding neurons via optogenetic stimulation during bends to a predefined side. Our goal was to establish a learned direction preference, conditioning Ddc>CsChrimson larvae to bend more often to one side than the other. The methodological choice of optogenetics was informed, in part, by a deeper investigation of larval heating dynamics as they relate to average bend duration. We determined that our IR stimulation hardware takes approximately 4 s to heat larval tissue to the nearly 30℃ required for dTrpA1 channel activation (Figure 2—figure supplement 1; see also LABEL:sec:materials_and_methods). Knowing that the average duration of a larval bend is only a third of that time (mean = 1.35 s, sd = 1.67 s, n = 4622 bends), we concluded that closed-loop heat stimulation would activate neurons of interest only after a noticeable delay relative to behaviour detection, with possibly other behaviours occurring during the delay period. Such a task in which different behaviours are occurring prior to reinforcement could be very difficult to learn. Quicker heating was achievable with increased laser intensity, but such an approach risked overshooting the desired temperature and damaging larval tissue (data not shown). Any safe thermogenetic approach would therefore be too slow to temporally align the US induced via larval heating with a specific larval action. A second important methodological consideration was the risk of establishing conflicting valence signals. We wanted to avoid mixing punishment (via IR-induced tissue heating) with reward (via IR-induced activation of Ddc neurons) during training. With mild heat more aversive to larvae than visible red light (compare bending in control larvae in Figure 2D, E, ), we favoured optogenetics over thermogenetics for our operant conditioning paradigm.

Although the direction of bending that triggered optogenetic stimulation was randomised across operant conditioning trials, we summarise the experiment procedure for which this predefined side was the larva’s left (Figure 4B). Each experiment began with a 1 min test period without red light presentation. Four training rounds followed (each 3 min long) in which larvae received optogenetic stimulation for the full duration of every left bend. The time between the tracker detecting a left bend and light onset was no longer than 50 ms. Between training rounds, larvae experienced 3 min without stimulation. This time was used to brush larvae back to the centre of the agarose plate. We performed this recentring to mitigate the experimental side effects of larvae reaching the plate’s edge (see Materials and methods for more details). Following the fourth training round was a 1 min test period without stimulation (Figure 4B). For each larva, bend rate, measured as the number of bends per minute performed towards a given side, served as a read-out for bend direction preference. The difference in bend rate between the stimulated and unstimulated side was also calculated for each larva. This equates to the number of bends per minute to the stimulated side minus the number of bends per minute to the unstimulated side. Within a given time bin (see Materials and methods for more details), the statistical test comparing the difference in bend rate to zero is mathematically equivalent to comparing bend rates against one another. However, computing the difference in bend rate facilitated comparison between genotypes that themselves may differ in basal bend rate.

In the 1 min test before the first training round, we observed no significant difference in bend rate to either side for Ddc>CsChrimson larvae (p>0.5; Figure 4C). Larval bend rate to the stimulated side was significantly greater than that of the unstimulated side throughout the majority of training, with this difference tending to widen over the course of each round (Figure 4—figure supplement 2). These findings suggest that Ddc activation can function as a rewarding stimulus that larvae increasingly seek with time. In the 1 min test after the fourth training round, larvae showed a significantly greater bend rate towards the side paired with red light stimulation during training (mean = 4.84, sd = 2.40, n = 143) compared to the previously unstimulated side (mean = 4.10, sd = 2.23, n = 143) (p=0.0007, CLES = 0.59; Figure 4C) indicating operant conditioning of bend direction.

We also used a previously developed, low-throughput, single-larva, closed-loop tracking system to test the reproducibility of this result on a different system (see Materials and methods for more details) (Schulze et al., 2015). Fictive Ddc activation with this system also yielded a significant bend direction preference to the previously stimulated (mean = 5.77, sd = 2.71, n = 109) versus previously unstimulated (mean = 4.73, sd = 2.73, n = 109) side (p=0.0043, CLES = 0.63), after training. These results contrast those of effector control larvae that had the UAS-CsChrimson transgene but not the Ddc-GAL4. The control larvae show no difference in bend rate to either side after training. Based on these control larvae, we concluded that potential leaky expression of CsChrimson in neurons outside of the Ddc expression pattern is not causing operant learning (Figure 4—figure supplement 3).

To confirm that the observed bend direction preference was attributable to pairing Ddc activation with bends solely in one direction, we conducted another control experiment in our high-throughput multi-larva training rig, in which larvae received random, uncorrelated stimulation during 50% of all bends. Before, during and after training, these larvae showed no difference in absolute left and right bend rates (p>0.5), with the exception of the first minute of training round 4 (Figure 4D, Figure 4—figure supplement 2). These larvae also showed a significantly lower difference between left and right bend rates after training (mean = -0.28, sd = 2.73, n = 160) compared to pair-trained larvae (mean = 0.74, sd = 2.62, n = 143) (p=0.0020, CLES = 0.60; Figure 4H). Further dissection of bend rates to each side showed that, after training, bend rates averaged together for larvae that received uncorrelated training (mean = 4.80, sd = 2.39, n = 160) were indistinguishable from the rate of pair-trained larvae bending to the previously stimulated side (mean = 4.84, sd = 2.40, n = 143) (p>0.5; Figure 4G). However, larvae that received uncorrelated training showed a significantly higher bend rate (mean = 4.80, sd = 2.39, n = 160) compared to pair-trained larvae bending to the previously unstimulated side (mean = 4.10, sd = 2.23, n = 143) (p=0.0037, CLES = 0.58; Figure 4G). This suggests that the pair-trained Ddc>CsChrimson larvae have learnt to avoid the unstimulated side. There is growing evidence from classical conditioning that larvae can learn that an unpaired stimulus predicts the absence of reinforcement (Schleyer et al., 2018; Eschbach et al., 2020). Perhaps larvae are also forming memories of opposite valence in our operant conditioning paradigm, bending less to the unstimulated side because bending to that side predicts the absence of appetitive Ddc activation.

The mushroom body is not sufficient to mediate operant conditioning in larvae

Our experiments showed that fictive activation of Ddc neurons is a sufficient US for operant conditioning. While we did not identify which individual neurons mediate the observed effect, we hypothesised that not all Ddc neurons are involved. Some prior work in adult flies suggests that the MB is involved in operant conditioning (Sun et al., 2020), while other studies in the adult suggest that operant conditioning does not require the MB (Booker and Quinn, 1981; Wolf et al., 1998; Colomb and Brembs, 2010; Colomb and Brembs, 2016) and may instead involve motor neuron plasticity (Colomb and Brembs, 2016). In classical conditioning of both adult and larval Drosophila, the MB has been identified as a convergence site for the external CS and the rewarding or punishing US (Cognigni et al., 2018; Heisenberg et al., 1985; Heisenberg, 2003; Rohwedder et al., 2016; Vogt et al., 2014; Saumweber et al., 2018; Owald and Waddell, 2015). In each larval brain hemisphere, the MB comprises approximately 110 CS-encoding Kenyon cells (KCs) (Aso et al., 2014; Honegger et al., 2011; Berck et al., 2016; Lin et al., 2014; Owald and Waddell, 2015; Campbell et al., 2013; Turner et al., 2008; Eichler et al., 2017) that synapse onto 24 MB output neurons (MBONs) driving approach or avoidance (Aso et al., 2014; Owald and Waddell, 2015; Perisse et al., 2016; Séjourné et al., 2011; Saumweber et al., 2018; Shyu et al., 2017; Plaçais et al., 2013; Eichler et al., 2017). Dopaminergic and octopaminergic neurons that represent the rewarding or punishing US modulate KC to MBON connection strength (Schwaerzel et al., 2003; Schroll et al., 2006; Honjo and Furukubo-Tokunaga, 2009; Vogt et al., 2014; Saumweber et al., 2018; Waddell, 2013; Eschbach et al., 2021). The extent to which the MB is dispensable in larval operant conditioning is, by contrast, unknown.

We investigated whether subsets of Ddc neurons in the brain and SEZ could support memory formation in our bend direction paradigm. Gal80 under control of the tsh promoter suppresses expression in the VNC, but not in the brain or SEZ (Clyne and Miesenböck, 2008; Figure 4—figure supplement 1). We took an intersectional approach by targeting these transgenes with the LexA/LexAop binary system (Simpson, 2016) and expressing CsChrimson in Ddc neurons using Gal4/UAS. Prior to training with our operant conditioning protocol (Figure 4B), Ddc>CsChrimson, tsh >Gal80 larvae showed no directional bias in bend rate (p>0.5; Figure 4E). Observations of larval bend rates during training revealed a persistent, and in some cases statistically significant, direction preference to the unstimulated side (Figure 4—figure supplement 2). In vertebrates, dopamine release is crucial for not only learning but also action selection (Grillner et al., 2013). We wondered whether our targeted activation of only brain and SEZ dopaminergic neurons affected the larval motor program in a functionally analogous manner, causing the observed decrease in bends to the stimulated side. Following training, these larvae were equally likely to bend towards the side where they had previously received the optogenetic stimulus (mean = 3.55, sd = 2.33, n = 175) as they were to bend towards the previously unstimulated side (mean = 3.53, sd = 2.36, n = 175) (p>0.5; Figure 4E). The after training difference in bend rate for these larvae (mean = 0.029, sd = 2.41, n = 175) was significantly lower than that of Ddc>CsChrimson larvae (mean = 0.74, sd = 2.62, n = 143) (p=0.012, CLES = 0.58; Figure 4H). Based on these results, the dopaminergic and serotonergic neurons in the brain are not sufficient for operant conditioning. In contrast, the dopaminergic and serotonergic neurons in the VNC appear critical to the bend direction preference formed following paired optogenetic activation of all Ddc neurons.

We also tested whether exclusively activating the PAM cluster dopaminergic neurons innervating the MB could induce operant conditioning. 58E02-Gal4 drives expression in the majority of these neurons (Rohwedder et al., 2016). In the test period before training, 58E02>CsChrimson larvae did not exhibit a bend direction preference (p>0.5; Figure 4F). During training, however, these larvae showed a significant bend direction preference to the unstimulated side (Figure 4—figure supplement 2). Future work is necessary to assess whether these preference results are partly a consequence of these neurons’ role in motor control. 58E02 neurons have synaptic connections to aversive MBONs (Eichler et al., 2017), though the absence of functional testing in larvae leads to uncertainty about whether these connections are excitatory, inhibitory, or modulatory. Following training, 58E02>CsChrimson larvae did not exhibit a learned direction preference for bends to either the previously stimulated (mean = 4.41, sd = 2.16, n = 145) or unstimulated (mean = 4.55, sd = 2.10, n = 145) side (p>0.5; Figure 4F). Because 58E02 comprises a small subset of Ddc neurons (for which fictive activation yielded an operant learning effect), these negative results also help confirm the absence of leaky UAS-CsChrimson expression. Indeed, these larvae exhibited a significantly lower difference in bend rate after training (mean = -0.14, sd = 2.71, n = 145) compared to Ddc>CsChrimson larvae (mean = 0.74, sd = 2.62, n = 143) (p=0.015, CLES = 0.58; Figure 4H). It remains to be seen whether these PAM cluster neurons contribute to memory formation by interacting with other Ddc neurons, especially those in the VNC. These results do, however, further support the idea that operant conditioning in Drosophila may not be mediated by the MB.

Serotonergic VNC neurons may play role in operant conditioning of bend direction

Pairing an action with activation of numerous dopaminergic and serotonergic neurons across the CNS was sufficient to induce operant conditioning of bend direction. Furthermore, our results indicated that the VNC subset of these neurons was critical to memory formation in the paradigm. It was an open question, however, whether this learning was mediated by dopamine, serotonin, or both. We expressed CsChrimson under the control of two sparse dopaminergic and serotonergic driver lines to investigate whether either neurotransmitter could exclusively induce operant conditioning of bend direction.

TH-Gal4 covers most dopaminergic neurons except the PAM cluster (Rohwedder et al., 2016). Under our high-throughput training protocol (Figure 4B), TH>CsChrimson larvae showed no difference in bend rate between the previously stimulated and unstimulated sides in the 1 min test periods either before (mean = 5.29, sd = 2.03 stimulated versus mean = 5.77, sd = 2.60 unstimulated; n = 75) or after (mean = 4.39, sd = 2.28 stimulated versus mean = 3.98, sd = 1.93 unstimulated; n = 122) training (p>0.5; Figure 5A). Tph-Gal4 targets the majority of serotonergic neurons and no dopaminergic neurons across the CNS of third-instar larvae (Huser et al., 2012). Before training, Tph>CsChrimson larvae showed no difference in bend rate between sides (mean = 5.27, sd = 3.53 stimulated versus mean = 4.86, sd = 2.83 unstimulated; n = 77) (p>0.5; Figure 5B). Paired activation of Tph neurons during bends to one side resulted in a significantly higher bend rate to the stimulated side (mean = 3.62, sd = 2.15, n = 126) relative to the unstimulated side (mean = 3.29, sd = 2.46, n = 126) after training (p=0.019, CLES = 0.58; Figure 5B). Notably, no statistically significant difference was observed when directly comparing the difference in bend rate between TH>CsChrimson (mean = 0.41, sd = 2.42, n = 122) and Tph>CsChrimson (mean = 0.33, sd = 2.51, n = 126) larvae after training (p>0.5; Figure 5D). Together, these results suggest a cautious interpretation. Although activation of Tph serotonergic neurons on their own appears sufficient to form a learned direction preference in our paradigm, we cannot exclude the possibility that TH dopamine neurons also contribute to operant learning, even though they were not sufficient to induce learning.

Figure 5. Serotonergic neurons may mediate operant conditioning.

High-throughput experiments followed the protocol depicted in Figure 4B. Gal4 expression is depicted as color-coded CNS (see legend). UAS-CsChrimson effector abbreviated as CsChr for visual clarity. Bars show medians, as well as upper and lower quartiles of data. Outliers (filled diamonds) are randomly jittered horizontally to aid visualisation. (a–c) top row. Larval bend rate shown as number of bends per minute, grouped by bends to stimulated side (dark red) or unstimulated side (grey). Statistical comparisons calculated using a paired, two-sided Wilcoxon signed-rank test. (a–c) bottom row. Difference in bend rate (black) shown between the stimulated and unstimulated sides. Statistical comparisons calculated using a two-sided Wilcoxon signed-rank test. (a–c). Data shown from the test periods before training round 1 (Before) and after training round 4 (After). n is the number of larvae in each time bin. Exact p-values written above corresponding data. ns p ≥ .05 (not significant), * p < .05. (d) Difference in bend rate after training round 4 (same data as in a–c bottom row). Statistical comparisons against Tph > CsChr calculated with a two-sided Mann-Whitney U test, with Bonferroni correction; ns p ≥ .05/2 (not significant), * p < .05/2. See Figure 5—source data 1.

Figure 5—source data 1. Source data showing that serotonergic neurons may mediate operant conditioning.

Figure 5.

Figure 5—figure supplement 1. Tph-Gal4 expression pattern without and with tsh-Gal80 restriction.

Figure 5—figure supplement 1.

Maximum intensity projections of confocal images obtained after immunohistochemical staining. Plan-Apochromat 20x objective, resolution: 592 x 800 pixels, scale bar: 100 μm. Images courtesy of the HHMI Janelia FlyLight team. (a–d) Tph>CsChrimson larvae, (e–h) Tph>CsChrimson, tsh>Gal80 larvae. (a, e) (green in d and h). Staining against green fluorescent protein (GFP) antibody targeting the mVenus tag of CsChrimson. (b, f) (red in d and h). Staining against BP104. (c, g) (blue in d and h). Staining against N-cadherin.

Based on our finding that operant conditioning failed following restriction of Ddc >CsChrimson expression to the brain and SEZ, we wondered whether serotonergic neurons in the VNC were also critical for operant memory formation in this paradigm. We used tsh-Gal80 to restrict the Tph-Gal4 expression pattern to the brain and SEZ. Tph>CsChrimson, tsh>Gal80 larvae showed no significant direction preference prior to training (mean = 3.46, sd = 2.52 stimulated versus mean = 3.99, sd = 2.97 unstimulated; n = 76) (p>0.5; Figure 5C). Paired optogenetic activation of brain and SEZ Tph neurons with larval bends to one side did not induce a learned direction preference (mean = 1.86, sd = 1.70 stimulated versus mean = 1.98, sd = 1.74 unstimulated; n = 111) (p>0.05; Figure 5C). The difference in bend rate after training for Tph>CsChrimson, tsh>Gal80 larvae (mean = -0.12, sd = 1.83, n = 111) was significantly lower than that of Tph>CsChrimson larvae (mean = 0.33, sd = 2.51, n = 126) (p=0.025, CLES = 0.58; Figure 5D). The Tph-Gal4 expression pattern contains two neurons per VNC hemisegment (with the exception of a single neuron in each A8 abdominal hemisegment) (Huser et al., 2012). Future experiments exclusively targeting a single serotonergic neuron per VNC hemisegment could be valuable in determining whether they are sufficient for operant learning.

Discussion

Automated trace conditioning of Drosophila larvae

Our classical conditioning experiments showed that Drosophila larvae significantly reduce their attraction to Or42b after this fictive odour is repeatedly paired with Basin activation. This reduction in attraction was significantly greater than that observed when Or42b stimulation was repeatedly paired with heating alone. Such results build upon prior work using similar training methods (e.g. Honda et al., 2014), in particular by increasing the temporal precision of larval heating. These results demonstrate the efficacy of our larval tracking system for high-throughput automated classical conditioning, and show that larvae can form associations between purely fictive stimuli (i.e. delivered through independent opto- and thermogenetic stimulation). Most notably, we demonstrate for the first time that Drosophila larvae can perform classical conditioning in the absence of temporal overlap between CS and US (i.e. with more than a 5 s gap from CS offset to US onset). These observations extend the known limits of larval learning, and were made possible only by using a tracker with temporally precise opto- and thermogenetic stimulation.

Future studies may wish to focus on the known ability of Drosophila larvae to perform time-dependent valence reversal learning. In this paradigm, the learned valence of a CS reverses when it is delivered before vs. after the US (Saumweber et al., 2018). While we observed reduced larval attraction to Or42b after forward-paired training, we did not observe increased attraction after backward-paired training. One explanation could be the slow temporal dynamics of larval cooling (Figure 2—figure supplement 1). It is possible that residual larval body heat after IR stimulation caused Basin neurons to remain partially active during the subsequent Or42b stimulation. Future studies could address this limitation by using a backward-paired training protocol with optogenetic activation of Basin neurons and thermogenetic activation of Or42b. Following our novel observation of trace conditioning in larvae, future work could also investigate the maximum temporal gap between sensory stimuli over which larvae can still be conditioned. It will also be important to determine whether conditioning with a fictive odour stimulus changes larval responses to natural odours. For example, larvae showing reduced attraction to Or42b activation may show reduced attraction to natural odours that activate Or42b neurons (e.g. ethyl acetate).

Automated operant conditioning of Drosophila larvae

We have also shown that Drosophila larvae are capable of operant conditioning via optogenetic activation of Ddc neurons. A significant increase in bending towards the previously stimulated side relative to the unstimulated side was only observed after coincident, positive reinforcement of this behaviour during training; a hallmark of operant conditioning. Because Ddc-Gal4 drives expression in dopaminergic and serotonergic neurons (Li et al., 2000; Sitaraman et al., 2008), we investigated which of these neurotransmitters support operant learning in our behavioural paradigm. Fictive activation of dopaminergic TH neurons paired with bends to one side did not yield a significant learned direction preference. In contrast, activation of serotonergic Tph neurons was sufficient to bias more bends towards the previously stimulated side. However, a direct comparison of differences in bend rate between the Tph and TH groups was itself not significant, raising the possibility that TH could weakly contribute to operant learning, even though it was not sufficient to induce significant learning in these experiments.

Of significant contrast to the Tph result was impaired operant conditioning after restricting Tph expression to only the brain and SEZ. These results suggest a novel role of VNC serotonergic neurons in conveying a reward signal for operant conditioning in Drosophila larvae.

It is noteworthy that Nuwal et al., 2012 used optogenetic activation of sugar-sensing neurons to establish a walking direction preference in adult Drosophila. Although we were unsuccessful in using a similar US to condition larval bend direction (data not shown), our Ddc and Tph results suggest that other sensory rewards may mediate operant conditioning if the information retrieval occurs within the VNC itself. Investigating FoxP and protein kinase C (PKC) expression in larval neurons may aid in identifying candidate neuronal populations, given both genes’ involvement in operant self-learning in adult Drosophila (Mendoza et al., 2014; Brembs and Plendl, 2008; Colomb and Brembs, 2016). Furthermore, developing sparser lines that target single serotonergic and dopaminergic neuron types will enable the identification of the smallest subsets of neurons that are sufficient for providing the operant learning signal. Behavioural experiments with these genetic lines may have the added benefit of mitigating conflicting or non-specific reinforcement signalling.

There are limitations to interpreting behaviour following fictive neuronal activation. It will therefore be important to replicate the new paradigms developed with this rig using lower-throughput methods with natural stimuli. For example, one might modify our multi-larva tracker to accommodate closed-loop presentation of real, innately appetitive gustatory stimuli by using closed-loop control of microfluidic devices. One could also try conditioning behaviours or behavioural sequences for which operant self-learning may be more ethologically relevant (e. g. individual or cooperative digging). Importantly, however, the frequency of such behaviour in naïve, freely behaving larvae may affect the amount of US received during paired training, making observable memory formation more difficult. Our multi-larva tracker could potentially address this challenge with probabilistic, thermogenetic activation of associated command neurons and optogenetic reward when performing the desired action.

Multi-larva tracker is a tool with wide applicability

Due to available genetic tools and the emerging connectome, the Drosophila larva is a uniquely advantageous model organism for neuroscience. Knowing this, we built a system that combines FPGA-based real-time tracking of multiple, freely-behaving larvae with independent control of larval illumination and heating. Delivering these external stimuli to larvae expressing opto- and thermosensitive proteins in their CNS allows precise activation of genetically-targeted neuronal populations. We also developed robust online behaviour detection, enabling modulated stimulus presentation as a function of individual larval action. This approach significantly broadens the range of sensory information that can be delivered in laboratory experiments, unconstrained by the need to deliver real odours, tastants, or mechanosensory experiences. A notable limitation of the existing software architecture is an inability to maintain object identity following larval collisions with each other or the plate’s edge. This could be addressed in future software modifications.

In summary, the work we presented here demonstrates the utility of our FPGA-based high-throughput, tracking and training system for developing novel classical and operant conditioning paradigms in Drosophila larvae. This system will enable rapid screening for neurons and circuits that underpin different forms of learning and also has the potential to drive future research in larval taxis (Luo et al., 2010; Gomez-Marin et al., 2011; Kane et al., 2013; Jovanic et al., 2019), decision-making (Eschbach et al., 2021; Krajbich, 2019; DasGupta et al., 2014), and spatial navigation and memory (Neuser et al., 2008; Haberkern et al., 2019).

Materials and methods

Key resources table.

Reagent type (species) or resource Designation Source or reference Identifiers Additional information
Genetic reagent (D. melanogaster) w[1118]; P{y[+t7.7] w[+mC]=
GMR72 F11-Gal4}attP2 (72F11-Gal4)
Bloomington Stock Center RRID:BDSC_39786
Genetic reagent (D. melanogaster) w[1118]; P{y[+t7.7] w[+mC]=
GMR69 F06-GAL4}attP2 (69F06-Gal4)
Bloomington Stock Center RRID:BDSC_39497
Genetic reagent (D. melanogaster) w[1118];; attP2 Pfeiffer et al., 2008
Genetic reagent (D. melanogaster) w[1118] P{y[+t7.7] w[+mC]=
20XUAS-IVS-CsChrimson.
mVenus}attP18 (UAS-CsChrimson)
Bloomington Stock Center RRID:BDSC_55134
Genetic reagent (D. melanogaster) UAS-dTrpA1 Dr Paul Garrity
Genetic reagent (D. melanogaster) 13XLexAop2-CsChrimson-tdTomato
in attP18; Or42b-LexAp65 in
JK22C; + (Or42b>CsChrimson)
Janelia Research Campus
Genetic reagent (D. melanogaster) w; UAS-dTRPA1, 13XLexAop2-
GCAMP6s 50.641 in Su(Hw)attP5
(/Cyo); 72F11-GAL4 in attP2 (72F11>dTrpA1)
Bloomington Stock Center RRID:BDSC_44590
Genetic reagent (D. melanogaster) w[1118];; Ddc-Gal4-HL8-3D (Ddc-Gal4) Li et al., 2000
Genetic reagent (D. melanogaster) w[1118]; P{y[+t7.7] w[+mC]=
GMR58E02-GAL4}attP2 (58E02-Gal4)
Bloomington Stock Center RRID:BDSC_41347
Genetic reagent (D. melanogaster) TH-Gal4 Bloomington Stock Center RRID:BDSC_8848
Genetic reagent (D. melanogaster) +; Tph-Gal4; + Park et al., 2006
Genetic reagent (D. melanogaster) 20xUAS-CsChrimson-mVenus@attP18;
tsh-LexA, pJFRC20-8xLexAop2-IVS-
Gal80-WPRE (su(Hw)attP5)/CyO,
2xTB- RFP; + (UAS-CsChrimson;
tsh-LexA, LexAop-Gal80)
Dr Stefan Pulver, Dr Yoshinori Aso
Genetic reagent (D. melanogaster) 10XUAS-IVS-myr::smGFP-HA@attP18,
13XLexAop2-IVS-myr::smGFP-
V5@su(Hw)attP8 (UAS-GFP)
Nern et al., 2015
Software, algorithm Custom scripts to run closed-loop
multi-larva tracking and
opto-/thermo-genetic stimulation
https://github.com/ZlaticLab/multi-larva-tracker-scripts-public;
Clayton et al., 2022

Multi-larva tracker

Hardware setup

A high-resolution camera (3072x3,200 pixels) (#TEL-G3-CM10-M5105, Teledyne DALSA, Ontario, Canada) positioned above a 23 cm x 23 cm 4% agarose plate captured 8-bit greyscale images at 20 Hz. The agarose plate was illuminated from below by a 30 cm x 30 cm 850 nm LED backlight (#SOBL-300x300–850, Smart Vision Lights, Norton Shores, Michigan) equipped with intensity control (#IVP-C1, Smart Vision Lights, Norton Shores, Michigan). An 800 nm longpass filter (#LP800-40.5, Midwest Optical Systems, Palatine, Illinois) mounted on the camera blocked all visible wavelengths, including those used for optogenetics. When the agarose plate comprised most of the camera image, each pixel corresponded to either 72.92 µm (for proof-of-principle and operant conditioning experiments) or 75.84 µm (for temporal dynamics of larval heating and classical conditioning experiments) (Figure 1).

Each camera image was processed in parallel on both the host computer (#T7920, running Windows 10, Dell Technologies Inc, Round Rock, Texas) and an FPGA device (#PCIe-1473R-LX110, National Instruments, Austin, Texas). LabVIEW 2017 (National Instruments, Austin, Texas) software extracted larval contours and interfaced with C++software that performed real-time behaviour detection. The LabVIEW software controlled closed-loop optogenetic and thermogenetic stimulation in response to these detected behaviours (Figure 1). All relevant experiment parameters and time-series data were output for offline analysis through a custom MATLAB framework (see LABEL:sec:materials_and_methods).

Multi-animal detection and tracking

Raw camera images were read by the FPGA at 20 Hz and then sent to the host computer. The LabVIEW process on the host computer then filtered out non-larval objects by combining background subtraction and binary thresholding. The remaining objects were each enclosed in a rectangular box of minimal size, with edges parallel to the camera image axes (Figure 1D). We defined the following criteria to detect third-instar larvae within these boxes:

  • Pixel intensity range (default 25–170): the minimum and maximum brightness values for pixels selected by binary thresholding (between 0 and 255 for an 8-bit image).

  • Box side length (pixels) (default 6–100): the range of eligible values for width and height of each box.

  • Box width +height (pixels) (default 12–200): the range of eligible values for the sum of each box’s width and height.

  • Box area (pixels) (default 300–900): the range of eligible values for the area of each box.

To track larvae over time, the host computer assigned a numerical identifier to each eligible object. We used distance-based tracking with a hard threshold of 40 pixels to maintain larval ID based on centroid position. Although identity was lost when larvae touched or reached the plate’s edge, new IDs were generated when larvae matched detection criteria. For each of the largest 16 objects, the host computer sent a binary pixel pattern and location (defined as the centre of the box) to the FPGA. Since the host computer required more than 50ms of run time for object detection, this process was not executed in every frame. On average, the FPGA received updated objects and their locations every three frames.

The FPGA extracted object contours in three steps. Within a 2 cm2 region of interest around the object’s centre, the FPGA first applied a user-defined binary threshold, then applied both vertical and a horizontal convolution with a 2x1XOR kernel, and finally generated edge pixels by combining the results of the two convolutions using an OR operation. Contours were extracted from edge images using the Moore boundary tracing algorithm (Gonzalez and Woods, 2018) with three added error capture procedures. First, if the algorithm yielded a contour that ended prematurely or contained small loops, the construction process could be reversed by up to 16 contour points to find an alternative contour. Second, 10,000 FPGA clock cycles (≈ 100 us) was the maximum allotted execution time, with each pixel comparison occurring within one clock cycle. In the rare event that this window was exceeded, the algorithm returned the already constructed contour points. Third, a contour containing fewer than 63 points was rejected and the FPGA returned the last valid contour detected for a given larva ID. The algorithm stopped when none of the remaining neighbours were edge pixels (Figure 1—figure supplement 1).

Contour processing and landmark detection

An undesired result of the FPGA contouring algorithm was the variable number of contour points across larvae and frames. We aimed to detect behaviour based on a smooth contour with a fixed number of 100 contour points. This contour regularization was achieved inside the Behaviour Programme using Fourier decomposition and reconstruction as in Masson et al., 2020.

The initial detection of head and tail was implemented on FPGA. The larva’s head and tail were defined as the contour points with the sharpest and second-sharpest curvature, respectively (Figure 1—figure supplement 2). While correct in most cases, this calculation sometimes led to flipped detection of the two body ends. The Behaviour Programme flagged and corrected these false detection events at run time by calculating the distance head and tail traveled between frames and tracking the number of correct versus flipped detection events. The vote system correction commonly failed when the larva made large angle bends. The resulting contour was nearly-circular and exhibited similar curvature across all points. The solution required resetting the vote tallies when detecting these ball events (Figure 1—figure supplement 2).

We defined the larval spine as 11 points running along the central body axis from head to tail (Figure 1—figure supplement 3; Swierczek et al., 2011). In addition to head and tail, the Behaviour Programme calculated three equally distributed landmark points along the spine (neck_top, neck, and neck_down). A fourth landmark, the centroid, defined the larva’s location. The six landmarks were collectively used to extract features for training behaviour classifiers (Figure 1—figure supplement 3).

The Behaviour Programme transformed the raw contour and spine from camera coordinates (in pixels) to world coordinates (in mm). If stable larval detection criteria were met, all spine points were temporally smoothed using exponential smoothing (Figure 1—figure supplement 3).

Feature extraction

We developed a machine learning approach to address the high deformability of the larva shape, ensure live execution, reduce overfitting, and limit the volume of data tagging. What follows is a brief summary of larval features describing motion direction, body shape, and velocity that were calculated from the contour and spine data inside the Behaviour Programme. Features were designed as in Masson et al., 2020, with notable modifications required to run the inference live:

  1. Motion Direction (Figure 1—figure supplement 4)

    • direction_vector: normalised vector describing the main body axis

    • direction_head_vector: normalised vector describing the head axis

    • direction_tail_vector: normalised vector describing the tail axis

  2. Body Shape (Figure 1—figure supplement 5)

    • skeleton_length: summed distances between consecutive spine points

    • perimeter: summed distances between neighbouring contour points

    • larva_arc_ratio: ratio of contour perimeter to convex hull perimeter (larva_arc_ratio1 and was close to 1 when larva was in either straight or ball-like shape)

    • larva_area_ratio: ratio of the areas enclosed by the contour and its convex hull (0larva_area_ratio1 and was close to 1 when the larva was in either straight, heavily curved, or ball-like shape)

    • eig_reduced: eig_reduced=|λ1-λ2|λ1+λ2 where λ1,λ2 were the eigenvalues of the structure tensor of the larval contour with respect to the neck (0eig_reduced1 and eig_reduced decreased as the bend amplitude of the larva increased)

    • s: normalised angle along the body (-0.5s1, was close to 1 when larva was straight, and decreased with increasing bend amplitude)

    • asymmetry: sine of the angle between direction_vector and direction_head_vector (asymmetry>0 when larva bent left and asymmetry<0 when larva bent right)

    • angle_upper_lower: absolute angle between direction_vector and direction_head_vector (despite similarity to asymmetry, this develops different dynamics following temporal smoothing, which are valuable for stable left and right bend detection)

  3. Velocity (Figure 1—figure supplement 6)

    • Velocity of all six landmark points (head_speed, neck_top_speed, neck_speed, neck_down_speed, tail_speed, and v_centroid) in mm/s over interval dt=0.2s (four frames)

    • v_norm: arithmetic mean of neck_top_speed, neck_speed, and neck_down_speed, passed through a hyperbolic tangent activation function to suppress excessively large values

    • speed_reduced: relative contribution of neck_top_speed to v_norm, passed through a hyperbolic tangent activation function to suppress excessively large values (speed_reduced increased when the anterior larval body moved quickly compared to the posterior, e. g. when a bend was initiated)

    • damped_distance: distance (mm) travelled by neck, giving greater weight to recent over past events

    • crab_speed: lateral velocity (mm/s), defined as the component of neck_speed orthogonal to direction_vector_filtered

    • parallel_speed: forward velocity (mm/s), defined as the component of neck_speed_filtered parallel to direction_vector_filtered

    • parallel_speed_tail_raw: tail’s forward velocity (mm/s), defined as the component of tail_speed_filtered parallel to direction_tail_vector_filtered

    • parallel_speed_tail: similar to parallel_speed_tail_raw, with the difference that tail_speed_filtered was normalised prior to calculating the dot product (i. e. a measure of tail movement direction which took values between –1 (backward) and+1 (forward))

To extract features in real time and address various sources of noise, we implemented exponential smoothing defined as follows for a given feature f (Figure 1—figure supplement 7).

f\_filteredt=(1α)f\_filteredtΔt+αft

where t is unitless, but derived from the experiment time in seconds, α=Δtτ with Δt=0.05s and τ=0.25s. Features that had the potential to exhibit large value deviations (e. g. v_norm) were instead bounded using a hyperbolic tangent function. Additionally, some features were exponentially smoothed over a longer time window (where αlong=Δtτlong with Δt=0.05s and τlong=5s) (Figure 1—figure supplement 7).

Convolution was used to approximate a smoothed squared derivative for each feature (Figure 1—figure supplement 8); useful for integrating information over time without needing to further expand the feature space. The underlying mathematical concepts were motivated by Masson et al., 2012. For a given feature f at time t, f_convolved_squared was calculated as follows:

f1t=(1λΔt).f1tΔt+12Δt.(ftΔt+ft)f2t=λΔt.f1tΔt+(1λΔt).f2tnΔtf \_convolved \_squaredt= k.(f1tf2t)2,

where Δt=0.05s, λ=1τ, τ=0.25s, and n=5s, k values were empirically chosen for each feature.

Behaviour classifiers

Behaviour classifiers were developed using a user interface similar to JAABA (Kabra et al., 2013). The underlying algorithms combined trained neural networks and empirically-determined linear thresholds. We developed a MATLAB (MathWorks, Natick, Massachusetts) user interface with functions for data visualisation, manual annotation, and machine learning using the Neural Network Toolbox, the Deep Learning Toolbox, and the Statistics and Machine Learning Toolbox. Here, we briefly describe the behaviour classifiers and provide performance results based on manual validation (Table 1).

Table 1. Manual quantification of behaviour detection performance.
back (268 events from 24 larvae in 60min of video data)
 Precision 86.5%
 Recall 88.4%
bend (714 events from 24 larvae in 60 min of video data)
 Precision 95.6%
 Recall 96.4%
 Accuracy of left and right detection (true-positive bends) 97.3%
 forward (425 events from 24 larvae in 60 min of video data)
 Precision 97.8%
 Recall 94.1%
forward_peristaltic (2954 events from 24 larvae in 60 min of video data)
 Precision 99.5%
 Recall 93.6%
 Events which are falsely combined with another event 10.7%
 Events which are detected as more than one event 1.2%
roll (240 events from 24 larvae in 60 min of video data)
 Precision (rolls and roll-like events) 96.6%
 Recall (rolls) 86.7%
 Recall (roll-like events) 25.8%

The bend classifier was based on predefined thresholds for temporally smoothed body shape features and was itself exponentially smoothed over time. Independent left and right classifiers were used to initially detect bend direction. To detect left and right bends, these classifiers were combined with the smoothed bend classifier using an AND conjunction.

To improve left and right detection performance, we developed a classifier for circular larval contours. This ball classifier used a feed-forward neural network with a single fully connected hidden layer whose inputs were normalised values of eig_reduced, larva_arc_ratio, and larva_area_ratio. The hidden layer consisted of five neurons with a hyperbolic tangent activation function. The output layer contained a single neuron and used a sigmoid activation function. The neural network was trained in MATLAB on a manually annotated data set for 500 epochs using a cross-entropy loss function and scaled conjugate gradient backpropagation. If a ball was detected within the previous 1.5 s, left and right classifiers were overwritten to match the last detected bend direction prior to the beginning of the ball.

The back classifier detected individual backward peristaltic waves based on thresholds for smoothed tail velocity features combined with no ball detection within the previous 1.5s.

Two different classifiers were used to detect crawling. forward detected longer forward crawl periods based on thresholds for smoothed tail velocity features combined with no ball detection within the previous 1.5 s. forward_peristaltic detected individual forward peristaltic waves based on the forward classifier and a threshold on forward tail velocity.

The roll classifier was based on thresholds for body shape and velocity combined with no ball detection and was exponentially smoothed over time. If a roll was detected within the previous 1.5 s, forward, forward_peristaltic, and back classifier values were reset to reduce false-positive detection for these classifiers. Unusual behaviour patterns such as rapid bending or twitching could be observed in addition to true larval rolling. These behaviours were considered ‘roll-like’ events during manual validation of the roll classifier’s performance.

Optogenetic stimulation

Optogenetic stimulation was achieved using two digital micromirror devices DMDs to project light patterns onto larvae on the agarose plate (Figure 2C). Both DMDs operated like a monochrome red light projector (1920x1080 pixel in classical conditioning experiments, 768x1024 pixel in proof-of-principle and operant conditioning experiments) with numerous rotatable micromirrors used to modulate the intensity of individual pixels. Because each DMD on its own was insufficient for optogenetic stimulation of larvae, we installed both devices on the system with their projections each covering the entire agarose plate (Figure 1B). In this way, the summed light intensities of the two DMDs could be achieved at all locations. For the proof-of-principle and operant conditioning experiments, one DMD contained an integrated 613 nm LED (#CEL-5500-LED, Digital Light Innovations, Austin, Texas) and the other (#CEL-5500-FIBER, Digital Light Innovations, Austin, Texas) received input from an external 625 nm LED (#BLS-GCS-0625–38A0710, Mightex Systems, Ontario, Canada) controlled by a BioLED light source control module (#BLS-13000–1, Mightex Systems, Ontario, Canada) and fed through an optic fibre (#LLG-05-59-420-2000-1, Mightex Systems, Ontario, Canada) (Figure 1C). For the classical conditioning experiments, both DMDs (#DLP4710EVM-LC, Texas Instruments) each received input from an external 625 nm LED source (#LE A P1W-RSSP-23, Osram, Germany).

Accurately aiming light at crawling larvae required spatial calibration of each DMD. Calibration was performed by projecting square spots at fixed DMD pixel locations and linearly fitting the corresponding camera coordinates. We also determined that DMD illumination using the default light output was not uniform at plate level, which could have resulted in variable optogenetic stimulation depending on larval location. We therefore normalised the pixel intensity of the DMD image to the highest intensity uniformly achievable at all plate locations. A look-up table containing the normalisation factor for each DMD pixel was then calculated using bi-linear interpolation with approximately 100 light intensity values measured across the plate. To accommodate for possible differences in non-uniformity between the two DMDs, this intensity calibration was performed for both DMDs simultaneously following spatial calibration.

A user-defined Behaviour Programme protocol operated on the behaviour detection output and sent 8-bit optogenetic stimulation instructions to the LabVIEW application. Because the LabVIEW application updated DMD projections at 20 Hz, the delay between behaviour detection and closed-loop optogenetic stimulation of individual larvae did not exceed 50ms (Figure 1D). Furthermore, if two or more larvae were close enough such that their corresponding stimulation areas overlapped, the light intensity in the overlapping region was set to the smallest of those values to avoid undesired stimulation.

Thermogenetic stimulation

Thermogenetic stimulation for proof-of-principle experiments was achieved by heating up larvae with a custom-built 1490 nm IR laser setup (#2CM-101, SemiNex, Peabody, Massachusetts). An out-of-the-box 1470 nm IR laser was used for temporal dynamics of larval heating and in our classical conditioning experiments (#LRD-1470-PFI-15000–05, Laserglow Technologies, Ontario, Canada). Each laser’s light guide was fed into a two-axis galvanometer system (#GVSM002, Thorlabs, Newton, New Jersey; Figure 2B). Both the laser and its corresponding galvanometer were controlled by an analogue output device (#PCIe-6738, National Instruments, Austin, Texas; Figure 1C). Two mirrors inside the galvanometer were rotated around orthogonal axes to target the laser beam spot to any user-defined location on the agarose plate. Mirror positions were controlled by two integrated motors receiving location-specific voltage inputs. The beam spots for the 1470 nm and 1490 nm lasers measured approximately 2.3 cm and 5 mm in diameter, respectively, depending on each beam’s angle of incidence to the plate.

Spatially calibrating the galvanometer was necessary to obtain a map between larval locations in world coordinates and the mirror motor input voltages. A visible aiming beam was scanned across the agarose plate using a fixed set of voltage pair inputs to the galvanometer. With the optical filter removed from the camera, the aiming beam’s location in camera coordinates was automatically extracted from the image using binary thresholding. Two voltage-to-camera look-up tables were generated through bi-linear interpolation of these measured coordinates. For accurately targeted thermogenetic stimulation, the location of the larval centroid was first converted to camera coordinates using the existing world-to-camera transform and was then mapped to a pair of galvanometer input voltages using the look-up tables.

When designing our tracker’s thermogenetic stimulation system, we were careful to ensure that all larvae received the same stimulation regardless of their position on the agarose plate. A larva’s location changed the laser beam’s angle of incidence, causing the illuminated spot at plate level to take an elliptical shape with variable size. If we were to keep laser beam power constant, the changing spot area would generate inconsistencies in the intensity of IR light projected over each larva. For proof-of-principle experiments, laser intensity calibration was used to normalise the 1490 nm laser intensity to achieve constant power per unit area. Prior to any experimentation, the laser’s visible aiming beam was scanned across the plate and the camera image was used to measure the beam’s spot size at various locations. Bi-linear interpolation was then used to generate a pixel-wise look-up table containing the laser power scaling factors. We also accounted for a nonlinear relationship between the 1490 nm laser source input voltage and the total power output by generating a voltage-to-power map from manual measurements. With these transformations, the system could calculate the laser source input voltage necessary to produce uniform stimulation at any location. For temporal dynamics of larval heating and classical conditioning experiments, we upgraded our tracker with a heat camera (Teledyne FLIR AX8) for real-time measurement and maintenance of larval body temperature. The heat camera captured thermal images of the agarose plate at 10 Hz and sent them to the host computer. The host computer used this information together with behaviour camera data to extract temperature readings at each larval location (Figure 1D). A custom closed-loop software system (LabVIEW and Python) then iteratively updated the 1470 nm IR laser intensity I at each larval location using the following sigmoid function:

I=1001+ex2

in which I is a percentage of the maximum laser output (15 W) and x is the current recorded temperature minus the target temperature in ℃.

A user-defined Behaviour Programme protocol operated on the 20 Hz behaviour detection output and sent thermogenetic stimulation instructions to the LabVIEW application which controlled the galvanometer and laser (Figure 1D). Larval centroid locations were specified on every frame, enabling a single galvanometer to cycle the laser beam between all individual larvae at 20 Hz. All larvae were stimulated within the available 50ms time window (i. e. 11ms per larva with four larvae on the plate, but 5.5ms per larva with eight larvae on the plate). Switching off the laser input for 1.5ms between larvae accounted for small time fluctuations surrounding each new galvanometer position update and helped to avoid undesired stimulation of other plate areas (Figure 2B). If fewer objects were detected in a given frame than expected, the remaining galvanometer target locations were set to the plate’s centre and the corresponding laser intensity was set to zero. This temporal pattern of galvanometer position updates yielded no more than 100ms delay between behaviour detection and closed-loop thermogenetic stimulation.

Single-larva tracker

Hardware setup and software framework

The single-larva tracker (Figure 4—figure supplement 3) electronics and hardware were nearly identical to the tracker described in Schulze et al., 2015, with notable exceptions to the camera and backlight which are detailed here. The behaviour arena comprised a layer of 1% agarose sitting atop a fixed glass plate, prepared daily to maintain moisture. Above and below the arena sat two motorised linear slides (#T-LSR450B, Zaber Technologies), arranged perpendicular to one another so that mounted components could move to any (x,y) location within the 34 cm x 38 cm coverage area. The host computer sent 4 Hz (x,y) position updates to the linear slides. Mounted to the slides above the behaviour arena was a high-resolution camera (2048x2048 pixels) (Grasshopper3 #GS3-U3-41C6NIR-C, Point Grey Research) that captured 20 Hz images and sent them to the host computer for real-time display on a graphical user interface. A long-distance microscope (Model KC/S VideoMax with IF2 objective, Edmund Optics) was c-mounted to the camera. Also mounted to the slides above the behaviour arena was a 617 nm LED (#PLS-0617–030S, Mightex Systems), with a 10 Hz update rate controlled by a universal driver (#SLC-xx04-US, Mightex Systems). The centre of the LED projection on the agarose was aligned with the centre of the camera image to facilitate targeted optogenetic excitation. To maintain the integrity of behaviour detection, stimulus presentation, and optogenetic experimentation, all hardware was housed inside a light-tight enclosure. The agarose plate was illuminated from below by a 2 in x 2 in 880 nm LED backlight (#BL0202-880IC, Advanced Illumination) mounted to the linear slides. The hardware communication and operation software was written under a Robot Operating System (ROS) framework.

Contour processing, behaviour detection, and optogenetic stimulation

The host computer software extracted the larval contour by applying inverse binary thresholding to each raw camera image. As with the multi-larva tracker, contour regularization was achieved using Fourier decomposition and reconstruction. Also the same as the multi-larva tracker, the single-larva tracker software detected the larva’s head and tail using the contour’s sharpest and second-sharpest internal angles, respectively, and corrected errors in real time using proximity measurements and a vote system (for algorithm details, see section above on multi-larva tracker contour processing and also Figure 4—figure supplement 2). The software calculated three other landmarks at equally distributed points along the larval spine. The neck landmark defined the larva’s location and was used to update the linear slide positions, keeping the larva centred in the camera’s field of view (Figure 4—figure supplement 3). As in the multi-larva tracker software, larval features describing motion direction, body shape, and velocity were calculated frame-by-frame from the contour and spine data and processed to remove high-frequency noise.

The left and right bend classifier consisted of a neural network with a single fully connected hidden layer whose inputs were the body shape features s and eig_reduced, along with their exponentially smoothed versions. The network’s hidden layer consisted of five neurons with a hyperbolic tangent activation function. The output layer contained a single neuron and used a sigmoid activation function. The bend classifier also consisted of a linear threshold on the asymmetry feature. The classifier itself was exponentially smoothed over time, as described in the section above on multi-larva tracker feature extraction. Manual quantification of the single-larva tracker’s bend classifier performance was based on 741 events from 10 larvae in 60 min of video data. This classifier has 97.6% precision and 100% recall, with 99.2% accuracy of left and right detection during true-positive bends. The single-larva tracker also employed a ball classifier like that defined for the multi-larva tracker.

A user-defined Python software protocol operated on the behaviour detection output and specified closed-loop stimulus delivery instructions within the ROS framework. On this system, there existed a delay of up to 100ms between behaviour detection and closed-loop optogenetic stimulation.

Larval rearing and handling

Fly stocks were maintained in vials filled with standard molasses food. In preparation for experiments and immunohistochemistry, adults (crosses listed in Table 2) were placed in collection cages with petri dishes containing molasses food and additional dry yeast to increase egg laying. For proof-of-principle and operant conditioning experiments, flies were allowed to lay eggs overnight for approximately 12–18 hr at 25℃. Larvae were reared at 25℃ and experiments were performed 72–96 hr after egg laying. For temporal dynamics of larval heating and classical conditioning experiments, flies were allowed to lay eggs during daytime for approximately 7 hr at 25℃. Larvae were reared at 18℃ and experiments were performed approximately seven days after egg laying. For immunohistochemistry, eggs were collected during daytime for approximately 4 hr. Dissections were performed 118–122 hr after egg laying. During all larval rearing, humidity was provided by placing wet paper towels placed beside the food plates. Specifically for optogenetics experiments, larvae were reared in the dark on molasses food supplemented with all-trans-retinal.

Table 2. Fly crosses for larval experiments.

For strain information, see Key resources table.

Figure Designation Female parent Male parent
2 72F11>CsChrimson UAS-CsChrimson 72F11-Gal4
2 69F06>CsChrimson UAS-CsChrimson 69F06-Gal4
2 attP2 >CsChrimson UAS-CsChrimson attP2
2 72F11>dTrpA1 UAS-dTrpA1 72F11-Gal4
2 69F06>dTrpA1 UAS-dTrpA1 69F06-Gal4
2 attP2 >dTrpA1 UAS-dTrpA1 attP2
2 sf1 assorted genotypes
3 Or42b>CsChrimson, 72F11>dTrpA1 Or42b>CsChrimson 72F11>dTrpA1
3 Or42b>CsChrimson, dTrpA1 Or42b>CsChrimson dTrpA1
4 Ddc>CsChrimson UAS-CsChrimson Ddc-Gal4
4 Ddc >CsChrimson, tsh >Gal80 UAS-CsChrimson; tsh-LexA, LexAop-Gal80 Ddc-Gal4
4 58E02>CsChrimson UAS-CsChrimson 58E02-Gal4
4 sf3 Ddc >CsChrimson UAS-CsChrimson Ddc-Gal4
4 sf3 CsChrimson control UAS-CsChrimson GMR-GAl4-attP2
5 TH >CsChrimson UAS-CsChrimson TH-Gal4
5 Tph >CsChrimson UAS-CsChrimson Tph-Gal4
5 Tph >CsChrimson, tsh >Gal80 UAS-CsChrimson; tsh-LexA, LexAop-Gal80 Tph-Gal4

All larval handling and experiments were performed in the dark to avoid unintended optogenetic stimulation. For each experiment run performed on the high-throughput tracker, we extracted larvae from their food plate and washed them in water. Using a brush, we placed multiple larvae in the centre of the agarose plate. We then placed the agarose plate inside the tracker on top of the backlight and shut the tracker door tightly. For experiments on the low-throughput, single-larva tracker, we extracted larvae from their food plate using a 15% sucrose solution. For a given larva, time outside the food plate did not exceed 30 min prior to the experiment starting. We used a brush to extract a single larva from the sucrose solution and rinse it in water to remove residual sucrose. We then placed the single larva in the centre of the agarose plate and shut the tracker door tightly. Prior to starting all experiment runs, we gave larvae a short period of time to acclimate to their new environment and, in the case of high-throughput experiments, disperse so they were not touching each other.

Verification of optogenetic and thermogenetic stimulation efficiency

Experiment procedures

We assessed the multi-larva tracker’s optogenetic and thermogenetic stimulation efficiency through open-loop proof-of-principle experiments. The 1 min experiment protocol began with a 15 s initialisation period in which larvae acclimated to the agarose plate and behaviour classifiers stabilised. In three subsequent 15 s stimulation rounds, larvae received 5 s of open-loop stimulation followed by 10 s without stimulation (Figure 2C). Optogenetics were performed with a combined red light intensity of 285 µW/cm2 from two DMDs as described above. Thermogenetics were performed with the 1490 nm laser at 40% of its maximum available 5.26 W intensity.

Data analysis

Analysis of these open-loop optogenetic and thermogenetic experiment data (Figure 2D, Figure 2E) was conducted using custom MATLAB software. After equally splitting each 60 s experiment into either 0.5 s or 5 s time bins, we retained objects for analysis that fulfilled strict criteria: (i) for all bins following the 15 s initialisation period, the object’s initial detection must have occurred at least 15s prior to the start of the bin; (ii) the object must have been detected in every frame of the bin (i. e. it retained its identity and did not collide with another object); and (iii) the mean of the smoothed centroid velocity across the object’s detection period in the bin was at least 0.5 mm/s. For each larva, the criterion for rolling, crawling, or bending was detection of the corresponding behaviour at least once during a given bin, irrespective of the behaviour’s duration. The number of larvae performing each behaviour in a given bin was then divided by the total number of larvae in the bin to give the fractions displayed in Figure 2D and Figure 2E.

Temporal dynamics of larval heating

Experiment procedures and data analysis

To quantify the time course of larval heating with our setup (Figure 2—figure supplement 1), we performed additional open-loop stimulation experiments with the 1470 nm laser. The experiment protocol began with a 30 s initialisation period without heat stimulation. Then the IR laser was turned on at 50% intensity for 20 s. During this stimulation period, the heat camera was used to maintain an intended temperature of 30℃at each larval location, as described above. Ten runs of this experiment were performed, with four larvae placed on the agarose plate per run. To analyse these data, recorded temperatures at each larval location for every point in time were collected.

High-throughput classical conditioning

Experiment procedures

Eight larvae were trained during each run of the classical conditioning experiment, with 18 runs for experimental larvae and 14 runs for control larvae. Training began after an initial 30 s initialisation period. Forward-paired training consisted of eight replicate training rounds, yielding a total training period lasting 840 s. Each round began with 20 s of red light illumination (via two 613nm DMDs with combined intensity of 550 µW/cm2, as described above), followed by 5 s without stimulation and then 20 s of IR illumination (via 1470 nm laser). This IR illumination caused larval heating up to 27.5℃, which was maintained using the closed-loop temperature control system described above. Each round ended with 60 s without stimulation. Backward-paired training was identical to forward-paired with the exception that IR illumination occurred first, followed by red light illumination. 60 s without stimulation followed the training period. In the subsequent testing period, larvae were illuminated for 20 s with the same wavelength and intensity of red light as during training. The testing period involve three rounds of this illumination, with 45 s of no stimulation between each replicate (Figure 3A).

Data analysis

For this analysis, we divided each testing round into three time windows: PRE (10–0 s before light onset), ON (0–20 s after light onset), and OFF (0–20 s after light offset). Only larvae that were tracked for all three ON and OFF windows during the testing period were analysed. To account for violated normality and sphericity assumptions, we calculated the difference in percentage bending values between the ON and OFF windows (i. e. ON-OFF) for each individual larva. These percentage bending differences were then compared between training protocols and genotypes to study the effects of training on larval bending behavior during the testing period. Because percentage bending differences were not normally distributed, we used two-sided Mann–Whitney U tests to assess how bending behaviour differed between training protocols and genotypes.

High-throughput operant conditioning

Experiment procedures

Each run of the operant conditioning experiment protocol (Figure 4B) consisted of 10–12 larvae on the plate. The protocol began and ended with a 1 min test period without optogenetic stimulation. Between these test periods were four, 3 min training rounds during which larvae received red light stimulation of 285 µW/cm2 (combined from two DMDs as described above) for the entire duration of the detected bend. Which side received stimulation was randomised across trials such that approximately 50% of larvae were trained to develop a right bend preference and 50%a left bend preference. No stimulus was triggered when the larva was bending right or when its body was straight. The test periods were each separated by 3 min periods without stimulation. After the first minute of this period, a brush was used to gently move all larvae back to the centre of the plate and larvae were given time to recover before the beginning of the next training round. This recentring addresses problems encountered when performing prolonged experiments with freely behaving larvae on a small agarose plate. The longer larvae are left undisturbed, the more likely they are to touch the plate’s edge, causing tracking disruption and temporary loss of valid objects. This shrinks sample size and reduces training efficiency by decreasing the proportion of animals receiving the stimulus.

Control experiments were designed so that valid objects received optogenetic stimulation uncorrelated with behaviour. These control experiments were split into 60 s time bins, during which each valid object was randomly assigned a stimulus train from this same time bin, pulled from a prior experiment where stimulation correlated with behaviour.

Data analysis

Data analysis was conducted using custom MATLAB software. After equally splitting each experiment into 60 s time bins, we retained objects for analysis that fulfilled strict criteria: (i) the object must have been detected in every frame of the bin (i.e. it retained its identity and did not collide with another object); (ii) the object’s initial detection must have occurred at least 20 s prior to the start of the bin; (iii) at no point during the bin did the smoothed velocity of the larval centroid exceed 1.5 mm/s; and (iv) the mean of the smoothed centroid velocity across the object’s detection period in the bin was at least 0.5 mm/s.

To analyse operant conditioning of bend direction preference, it was necessary to further smooth the raw time series of left and right bends post-acquisition: two bends to the same side separated by less than 200ms were combined into a single long bend, and short bends of less than 200ms were removed from analysis. We then counted, for each larva, the numbers of left and right bends initiated within each 60 s time bin. This was defined as the bend rate towards the respective direction. Within each bin, the difference in bend rate was defined, for each larva, as the number of bends towards the side paired with the optogenetic stimulus minus the number of bends towards the unstimulated side. We pooled together all larval data within each bin because bends to the left and right were each paired with the optogenetic stimulus for approximately half of the larvae. For the control condition in which larvae received random stimulation during 50% of bends regardless of direction, bend rates were calculated to the left and right and the difference in bend rate was calculated between left and right. Bend rates to either side were compared to each other using a two-sided Wilcoxon signed-rank test. This statistical choice was driven by the known pairing of these spatial observations for individual larvae and the non-normality exhibited across distributions of differences between these paired bend rates. Similar reasoning guided the usage of a two-sided Wilcoxon signed-rank test to compare the difference in bend rate to 0. The behaviour characteristics of experimental animals were compared to each control group using a two-sided Mann-Whitney U test.

Low-throughput operant conditioning

Experiment procedures

Each run of the operant conditioning experiment protocol (Figure 4—figure supplement 3) consisted of one larva on the plate. The protocol began and ended with a 1 min test period without optogenetic stimulation. Between these test periods were two, 3 min training rounds during which larvae received red light stimulation of 385 µW/cm2 for the entire duration of the detected bend. Which side received stimulation was randomised across trials such that approximately 50% of larvae were trained to develop a right bend preference and 50%a left bend preference. No stimulus was triggered when the larva was bending right or when its body was straight. The two test periods were separated by a 3-min period without stimulation.

Data analysis

Data analysis was conducted using custom MATLAB software. Each experiment was equally split into 60 s time bins. We then counted, for each larva, the numbers of left and right bends initiated within each 60 s bin. This was defined as the bend rate towards the respective direction. Within each bin, the difference in bend rate was defined, for each larva, as the number of bends towards the side paired with the optogenetic stimulus minus the number of bends towards the unstimulated side. We pooled together all larval data within each bin because bends to the left and right were each paired with the optogenetic stimulus for approximately half of the larvae.

Immunohistochemistry and confocal imaging

All dissections, immunohistochemical stainings, and confocal imaging were done using a procedure adapted from Jenett et al., 2012 and Li et al., 2014. Larval CNSs were dissected in cold 1x phosphate buffer saline (PBS, Corning Cellgro, #21–040) and transferred to tubes filled with cold 4% paraformaldehyde (Electron Microscopy Sciences, #15,713S) in 1x PBS. Tubes were incubated for 1 hr at room temperature. The tissue was then washed four times in 1x PBS with 1% Triton X-100 (#X100, Sigma Aldrich St. Louis, Missouri) (PBT) and incubated in 1:20 donkey serum (#017-000-121, Jackson Immuno Research, West Grove, Pennsylvania) in PBT for 2 hr at room temperature.

The tissue was then incubated in the primary antibody solution, first for 4 hr at room temperature and then for two nights at 4℃. This solution contained mouse anti-Neuroglian (1:50, #BP104 anti-Neuroglian, Developmental Studies Hybridoma Bank, Iowa City, Iowa), rabbit anti-GFP (1:500, #A11122, Life Technologies, Waltham, Massachusetts) and rat anti-N-Cadherin (1:50, #DN-Ex #8, Developmental Studies Hybridoma Bank, Iowa City, Iowa) in PBT. This solution was then removed and the tissue washed four times in PBT. The tissue was then incubated in the secondary antibody solution, first for 4 hr at room temperature and then for two nights at 4℃. This solution contained Alexa Fluor 568 donkey anti-mouse (1:500, #A10037, Invitrogen, Waltham, Massachusetts), FITC donkey anti-rabbit (1:500, #711-095-152, Jackson Immuno Research West Grove, Pennsylvania) and Alexa Fluor 647 donkey anti-rat (1:500, #712-605-153, Jackson Immuno Research West Grove, Pennsylvania) in PBT. After removal of the secondary solution, the tissue was washed in PBT four times and mounted on a coverslip coated with poly-L-lysine (#P1524-25MG, Sigma Aldrich, St. Louis, Missouri).

The coverslip with the CNSs was dehydrated by moving it through a series of jars containing ethanol at increasing concentrations (30%, 50%, 75%, 95%, 100%, 100%, 100%) for 10 min each. The tissue was then cleared by soaking the coverslip with xylene (#X5-500, Fisher Scientific, Waltham, Massachusetts) three times for 5 min each. Finally, the coverslips were mounted in dibutyl phthalate in xylene (DPX, #13512, Electron Microscopy Sciences, Hatfield, Pennsylvania) with the tissue facing down on a microscope slide with spacers. The DPX was allowed to dry for at least two nights prior to confocal imaging with an LSM 710 microscope (Zeiss).

Details on the confocal imaging settings are provided in the respective figure captions. Confocal images were analysed using Fiji (ImageJ). Neurons were counted by specifying regions of interest around the cell bodies using raw image stacks.

Acknowledgements

We thank Dr. Chris McRaven for design and technical assistance with the custom-built 1490nm thermogenetic laser light source; Dr. Peter Polidoro for writing the ROS software framework on the single-larva tracker; Howard Hughes Medical Institute (HHMI) Janelia FlyCore and FlyLight teams for assistance with fly crosses, fly food, and confocal imaging; Gates Cambridge Trust, Cambridge Trust, HHMI Janelia Visiting Scientist Program, University of Cambridge Trinity College, HHMI Janelia, European Research Council, Wellcome Trust, and Medical Research Council for funding.

Funding Statement

The funders had no role in study design, data collection and interpretation, or the decision to submit the work for publication. For the purpose of Open Access, the authors have applied a CC BY public copyright license to any Author Accepted Manuscript version arising from this submission.

Contributor Information

Marta Zlatic, Email: mzlatic@mrc-lmb.cam.ac.uk.

Kristina T Klein, Email: kristina.t.klein@gmail.com.

Aravinthan DT Samuel, Harvard University, United States.

K VijayRaghavan, National Centre for Biological Sciences, Tata Institute of Fundamental Research, India.

Funding Information

This paper was supported by the following grants:

  • Gates Cambridge Trust to Kristina T Klein.

  • Cambridge Commonwealth, European & International Trust C T Taylor Cambridge International Scholarship to Elise C Croteau-Chonka.

  • Howard Hughes Medical Institute Janelia Research Campus Visitor Scientist Program to Marta Zlatic, Jean-Baptiste Masson.

  • Trinity College, University of Cambridge to Elise C Croteau-Chonka.

  • Howard Hughes Medical Institute Janelia Research Campus to Marta Zlatic, Michael Winding.

  • European Research Council LeaRNN - 819650 to Marta Zlatic.

  • Wellcome Trust 205050/B/16/Z to Marta Zlatic, Lalanti Venkatasubramanian, Elise C Croteau-Chonka, Michael Winding.

  • Medical Research Council MC_UP_1201/20 to Marta Zlatic, Michael S Clayton, Benjamin MW Jones, Samuel N Harris.

  • Human Frontier Science Program LT00600/2020-L to Lalanti Venkatasubramanian.

Additional information

Competing interests

No competing interests declared.

Author contributions

Data curation, Software, Formal analysis, Validation, Investigation, Visualization, Methodology, Writing – original draft, Writing – review and editing.

Conceptualization, Resources, Data curation, Software, Formal analysis, Supervision, Validation, Investigation, Visualization, Methodology, Writing – original draft, Project administration, Writing – review and editing.

Conceptualization, Resources, Supervision, Validation, Investigation, Methodology, Project administration.

Conceptualization, Methodology.

Conceptualization, Investigation.

Resources, Software, Methodology, Writing – review and editing.

Resources, Software, Methodology, Writing – review and editing.

Resources, Software, Methodology, Writing – review and editing.

Conceptualization, Supervision, Funding acquisition, Project administration, Writing – review and editing.

Conceptualization, Data curation, Software, Formal analysis, Validation, Investigation, Visualization, Methodology, Writing – original draft, Writing – review and editing.

Additional files

Transparent reporting form

Data availability

All data used to generate figures 2-5, as well as all figure supplements, are now submitted as source data files. We also now submit CAD drawings for the multi-larva tracker.

References

  1. Abramson CI, Dinges CW, Wells H, Nieh JC. Operant conditioning in honey bees (Apis mellifera L.): the cap pushing response. PLOS ONE. 2016;11:e0162347. doi: 10.1371/journal.pone.0162347. [DOI] [PMC free article] [PubMed] [Google Scholar]
  2. Aceves-Piña EO, Quinn WG. Learning in normal and mutant Drosophila larvae. Science. 1979;206:93–96. doi: 10.1126/science.206.4414.93. [DOI] [PubMed] [Google Scholar]
  3. Alexander J, Audesirk TE, Audesirk GJ. One-trial reward learning in the snail lymnea stagnalis. Journal of Neurobiology. 1984;15:67–72. doi: 10.1002/neu.480150107. [DOI] [PubMed] [Google Scholar]
  4. Andreatta M, Pauli P. Appetitive vs. aversive conditioning in humans. Frontiers in Behavioral Neuroscience. 2015;9:128. doi: 10.3389/fnbeh.2015.00128. [DOI] [PMC free article] [PubMed] [Google Scholar]
  5. Apostolopoulou AA, Mazija L, Wüst A, Thum AS. The neuronal and molecular basis of quinine-dependent bitter taste signaling in Drosophila larvae. Frontiers in Behavioral Neuroscience. 2014;8:6. doi: 10.3389/fnbeh.2014.00006. [DOI] [PMC free article] [PubMed] [Google Scholar]
  6. Aso Y, Herb A, Ogueta M, Siwanowicz I, Templier T, Friedrich AB, Ito K, Scholz H, Tanimoto H. Three dopamine pathways induce aversive odor memories with different stability. PLOS Genetics. 2012;8:e1002768. doi: 10.1371/journal.pgen.1002768. [DOI] [PMC free article] [PubMed] [Google Scholar]
  7. Aso Y, Sitaraman D, Ichinose T, Kaun KR, Vogt K, Belliart-Guérin G, Plaçais PY, Robie AA, Yamagata N, Schnaitmann C, Rowell WJ, Johnston RM, Ngo TTB, Chen N, Korff W, Nitabach MN, Heberlein U, Preat T, Branson KM, Tanimoto H, Rubin GM. Mushroom body output neurons encode valence and guide memory-based action selection in Drosophila. eLife. 2014;3:e80. doi: 10.7554/eLife.04580. [DOI] [PMC free article] [PubMed] [Google Scholar]
  8. Balleine BW, Liljeholm M, Ostlund SB. The integrative function of the basal ganglia in instrumental conditioning. Behavioural Brain Research. 2009;199:43–52. doi: 10.1016/j.bbr.2008.10.034. [DOI] [PubMed] [Google Scholar]
  9. Bath DE, Stowers JR, Hörmann D, Poehlmann A, Dickson BJ, Straw AD. FlyMAD: rapid thermogenetic control of neuronal activity in freely walking Drosophila. Nature Methods. 2014;11:756–762. doi: 10.1038/nmeth.2973. [DOI] [PubMed] [Google Scholar]
  10. Berck ME, Khandelwal A, Claus L, Hernandez-Nunez L, Si G, Tabone CJ, Li F, Truman JW, Fetter RD, Louis M, Samuel ADT, Cardona A. The wiring diagram of a glomerular olfactory system. eLife. 2016;5:e59. doi: 10.7554/eLife.14859. [DOI] [PMC free article] [PubMed] [Google Scholar]
  11. Booker R, Quinn WG. Conditioning of leg position in normal and mutant Drosophila. PNAS. 1981;78:3940–3944. doi: 10.1073/pnas.78.6.3940. [DOI] [PMC free article] [PubMed] [Google Scholar]
  12. Brand AH, Perrimon N. Targeted gene expression as a means of altering cell fates and generating dominant phenotypes. Development. 1993;118:401–415. doi: 10.1242/dev.118.2.401. [DOI] [PubMed] [Google Scholar]
  13. Braubach OR, Wood HD, Gadbois S, Fine A, Croll RP. Olfactory conditioning in the zebrafish (Danio rerio) Behavioural Brain Research. 2009;198:190–198. doi: 10.1016/j.bbr.2008.10.044. [DOI] [PubMed] [Google Scholar]
  14. Brembs B. Operant conditioning in invertebrates. Current Opinion in Neurobiology. 2003;13:710–717. doi: 10.1016/j.conb.2003.10.002. [DOI] [PubMed] [Google Scholar]
  15. Brembs B, Plendl W. Double dissociation of PKC and AC manipulations on operant and classical learning in Drosophila. Current Biology. 2008;18:1168–1171. doi: 10.1016/j.cub.2008.07.041. [DOI] [PubMed] [Google Scholar]
  16. Brembs B. Spontaneous decisions and operant conditioning in fruit flies. Behavioural Processes. 2011;87:157–164. doi: 10.1016/j.beproc.2011.02.005. [DOI] [PubMed] [Google Scholar]
  17. Brown JS, Kalish HI, Farber IE. Conditioned fear as revealed by magnitude of startle response to an auditory stimulus. Journal of Experimental Psychology. 1951;41:317–328. doi: 10.1037/h0060166. [DOI] [PubMed] [Google Scholar]
  18. Campbell RAA, Honegger KS, Qin H, Li W, Demir E, Turner GC. Imaging a population code for odor identity in the Drosophila mushroom body. The Journal of Neuroscience. 2013;33:10568–10581. doi: 10.1523/JNEUROSCI.0682-12.2013. [DOI] [PMC free article] [PubMed] [Google Scholar]
  19. Chen YJ, Li YC, Huang KN, Young MS. IEEE. The Implementation of a Stand-Alone Video Tracking and Analysis System for Animal Behavior Measurement in Morris Water Maze; 2005. pp. 1766–1769. [DOI] [PubMed] [Google Scholar]
  20. Chiuchisan I. IEEEIASI. E-Health and Bioengineering Conference (EHB; Romania. 2013. [DOI] [Google Scholar]
  21. Clayton MS, Croteau-Chonka E, ZlaticLab Multi-larva-tracker-scripts-public. f4170fdGitHub. 2022 https://github.com/ZlaticLab/multi-larva-tracker-scripts-public
  22. Clyne JD, Miesenböck G. Sex-Specific control and tuning of the pattern generator for courtship song in Drosophila. Cell. 2008;133:354–363. doi: 10.1016/j.cell.2008.01.050. [DOI] [PubMed] [Google Scholar]
  23. Cognigni P, Felsenberg J, Waddell S. Do the right thing: neural network mechanisms of memory formation, expression and update in Drosophila. Current Opinion in Neurobiology. 2018;49:51–58. doi: 10.1016/j.conb.2017.12.002. [DOI] [PMC free article] [PubMed] [Google Scholar]
  24. Colomb J, Brembs B. The biology of psychology. Communicative & Integrative Biology. 2010;3:142–145. doi: 10.4161/cib.3.2.10334. [DOI] [PMC free article] [PubMed] [Google Scholar]
  25. Colomb J, Brembs B. Pkc in motorneurons underlies self-learning, a form of motor learning in Drosophila. PeerJ. 2016;4:e1971. doi: 10.7717/peerj.1971. [DOI] [PMC free article] [PubMed] [Google Scholar]
  26. Cong L, Wang Z, Chai Y, Hang W, Shang C, Yang W, Bai L, Du J, Wang K, Wen Q. Rapid whole brain imaging of neural activity in freely behaving larval zebrafish (Danio rerio) eLife. 2017;6:e28158. doi: 10.7554/eLife.28158. [DOI] [PMC free article] [PubMed] [Google Scholar]
  27. Corbett D, Wise RA. Intracranial self-stimulation in relation to the ascending dopaminergic systems of the midbrain: A moveable electrode mapping study. Brain Research. 1980;185:1–15. doi: 10.1016/0006-8993(80)90666-6. [DOI] [PubMed] [Google Scholar]
  28. Curcio JA, Petty CC. The near infrared absorption spectrum of liquid water. Journal of the Optical Society of America. 1951;41:302. doi: 10.1364/JOSA.41.000302. [DOI] [Google Scholar]
  29. Dankert H, Wang L, Hoopfer ED, Anderson DJ, Perona P. Automated monitoring and analysis of social behavior in Drosophila. Nature Methods. 2009;6:297–303. doi: 10.1038/nmeth.1310. [DOI] [PMC free article] [PubMed] [Google Scholar]
  30. 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]
  31. Davis RL. Olfactory memory formation in Drosophila: from molecular to systems neuroscience. Annual Review of Neuroscience. 2005;28:275–302. doi: 10.1146/annurev.neuro.28.061604.135651. [DOI] [PubMed] [Google Scholar]
  32. Denisov G, Ohyama T, Jovanic T, Zlatic M. Model-based detection and analysis of animal behaviors using signals extracted by automated tracking. eLife. 2013;11:314. doi: 10.7554/eLife.74314. [DOI] [Google Scholar]
  33. Dickinson A. Conditioning and associative learning. British Medical Bulletin. 1981;37:165–168. doi: 10.1093/oxfordjournals.bmb.a071695. [DOI] [PubMed] [Google Scholar]
  34. Dylla KV, Galili DS, Szyszka P, Lüdke A. Trace conditioning in insects-keep the trace! Frontiers in Physiology. 2013;4:67. doi: 10.3389/fphys.2013.00067. [DOI] [PMC free article] [PubMed] [Google Scholar]
  35. Eichler K, Li F, Litwin-Kumar A, Park Y, Andrade I, Schneider-Mizell CM, Saumweber T, Huser A, Eschbach C, Gerber B, Fetter RD, Truman JW, Priebe CE, Abbott LF, Thum AS, Zlatic M, Cardona A. The complete connectome of a learning and memory centre in an insect brain. Nature. 2017;548:175–182. doi: 10.1038/nature23455. [DOI] [PMC free article] [PubMed] [Google Scholar]
  36. Eschbach C, Cano C, Haberkern H, Schraut K, Guan C, Triphan T, Gerber B. Associative learning between odorants and mechanosensory punishment in larval Drosophila. The Journal of Experimental Biology. 2011;214:3897–3905. doi: 10.1242/jeb.060533. [DOI] [PubMed] [Google Scholar]
  37. Eschbach C, Fushiki A, Winding M, Schneider-Mizell CM, Shao M, Arruda R, Eichler K, Valdes-Aleman J, Ohyama T, Thum AS, Gerber B, Fetter RD, Truman JW, Litwin-Kumar A, Cardona A, Zlatic M. Recurrent architecture for adaptive regulation of learning in the insect brain. Nature Neuroscience. 2020;23:544–555. doi: 10.1038/s41593-020-0607-9. [DOI] [PMC free article] [PubMed] [Google Scholar]
  38. Eschbach C, Fushiki A, Winding M, Afonso B, Andrade IV, Cocanougher BT, Eichler K, Gepner R, Si G, Valdes-Aleman J, Fetter RD, Gershow M, Jefferis GSXE, Samuel ADT, Truman JW, Cardona A, Zlatic M. Circuits for integrating learned and innate valences in the insect brain. eLife. 2021;10:e62567. doi: 10.7554/eLife.62567. [DOI] [PMC free article] [PubMed] [Google Scholar]
  39. Fee MS, Goldberg JH. A hypothesis for basal ganglia-dependent reinforcement learning in the songbird. Neuroscience. 2011;198:152–170. doi: 10.1016/j.neuroscience.2011.09.069. [DOI] [PMC free article] [PubMed] [Google Scholar]
  40. Fernando ABP, Mar AC, Urcelay GP, Dickinson A, Robbins TW. Avoidance behavior: a free-operant lever-press avoidance task for the assessment of the effects of safety signals. Current Protocols in Neuroscience. 2015;70:8. doi: 10.1002/0471142301.ns0832s70. [DOI] [PubMed] [Google Scholar]
  41. Fischer JA, Giniger E, Maniatis T, Ptashne M. GAL4 activates transcription in Drosophila. Nature. 1988;332:853–856. doi: 10.1038/332853a0. [DOI] [PubMed] [Google Scholar]
  42. Fry SN, Rohrseitz N, Straw AD, Dickinson MH. TrackFly: virtual reality for a behavioral system analysis in free-flying fruit flies. Journal of Neuroscience Methods. 2008;171:110–117. doi: 10.1016/j.jneumeth.2008.02.016. [DOI] [PubMed] [Google Scholar]
  43. Fushiki A, Zwart MF, Kohsaka H, Fetter RD, Cardona A, Nose A. A circuit mechanism for the propagation of waves of muscle contraction in Drosophila. eLife. 2016;5:e13253. doi: 10.7554/eLife.13253. [DOI] [PMC free article] [PubMed] [Google Scholar]
  44. Galili DS, Lüdke A, Galizia CG, Szyszka P, Tanimoto H. Olfactory trace conditioning in Drosophila. The Journal of Neuroscience. 2011;31:7240–7248. doi: 10.1523/JNEUROSCI.6667-10.2011. [DOI] [PMC free article] [PubMed] [Google Scholar]
  45. Gepner R, Skanata MM, Bernat NM, Kaplow M, Gershow M. Computations underlying Drosophila photo-taxis, odor-taxis, and multi-sensory integration. eLife. 2015;4:e06229. doi: 10.7554/eLife.06229. [DOI] [PMC free article] [PubMed] [Google Scholar]
  46. Gerber B, Scherer S, Neuser K, Michels B, Hendel T, Stocker RF, Heisenberg M. Visual learning in individually assayed Drosophila larvae. The Journal of Experimental Biology. 2004;207:179–188. doi: 10.1242/jeb.00718. [DOI] [PubMed] [Google Scholar]
  47. Gerber B, Hendel T. Outcome expectations drive learned behaviour in larval Drosophila. Proceedings. Biological Sciences. 2006;273:2965–2968. doi: 10.1098/rspb.2006.3673. [DOI] [PMC free article] [PubMed] [Google Scholar]
  48. Gershow M, Berck M, Mathew D, Luo L, Kane EA, Carlson JR, Samuel ADT. Controlling airborne cues to study small animal navigation. Nature Methods. 2012;9:290–296. doi: 10.1038/nmeth.1853. [DOI] [PMC free article] [PubMed] [Google Scholar]
  49. Giurfa M. Associative learning: the instructive function of biogenic amines. Current Biology. 2006;16:R892–R895. doi: 10.1016/j.cub.2006.09.021. [DOI] [PubMed] [Google Scholar]
  50. Gomez-Marin A, Stephens GJ, Louis M. Active sampling and decision making in Drosophila chemotaxis. Nature Communications. 2011;2:441. doi: 10.1038/ncomms1455. [DOI] [PMC free article] [PubMed] [Google Scholar]
  51. Gonzalez RC, Woods RE. Digital Image Processing, Ebook. fourth. Pearson Education, Limited; 2018. [Google Scholar]
  52. Grau JW, Barstow DG, Joynes RL. Instrumental learning within the spinal cord: I. behavioral properties. Behavioral Neuroscience. 1998;112:1366–1386. doi: 10.1037//0735-7044.112.6.1366. [DOI] [PubMed] [Google Scholar]
  53. Grillner S, Robertson B, Stephenson-Jones M. The evolutionary origin of the vertebrate basal ganglia and its role in action selection. The Journal of Physiology. 2013;591:5425–5431. doi: 10.1113/jphysiol.2012.246660. [DOI] [PMC free article] [PubMed] [Google Scholar]
  54. Gupta S, Gomez-Marin A. A Context-Free Grammar for Caenorhabditis elegans Behavior. bioRxiv. 2019 doi: 10.1101/708891. [DOI]
  55. Haberkern H, Basnak MA, Ahanonu B, Schauder D, Cohen JD, Bolstad M, Bruns C, Jayaraman V. Visually guided behavior and optogenetically induced learning in head-fixed flies exploring a virtual landscape. Current Biology. 2019;29:1647–1659. doi: 10.1016/j.cub.2019.04.033. [DOI] [PubMed] [Google Scholar]
  56. Hamada FN, Rosenzweig M, Kang K, Pulver SR, Ghezzi A, Jegla TJ, Garrity PA. An internal thermal sensor controlling temperature preference in Drosophila. Nature. 2008;454:217–220. doi: 10.1038/nature07001. [DOI] [PMC free article] [PubMed] [Google Scholar]
  57. Hawkins RD, Byrne JH. Associative learning in invertebrates. Cold Spring Harbor Perspectives in Biology. 2015;7:a021709. doi: 10.1101/cshperspect.a021709. [DOI] [PMC free article] [PubMed] [Google Scholar]
  58. He J, Wei J, Rizak JD, Chen Y, Wang J, Hu X, Ma Y. An odor detection system based on automatically trained mice by relative go no-go olfactory operant conditioning. Scientific Reports. 2015;5:10019. doi: 10.1038/srep10019. [DOI] [PMC free article] [PubMed] [Google Scholar]
  59. Heckscher ES, Lockery SR, Doe CQ. Characterization of Drosophila larval crawling at the level of organism, segment, and somatic body wall musculature. The Journal of Neuroscience. 2012;32:12460–12471. doi: 10.1523/JNEUROSCI.0222-12.2012. [DOI] [PMC free article] [PubMed] [Google Scholar]
  60. Heisenberg M, Borst A, Wagner S, Byers D. Drosophila mushroom body mutants are deficient in olfactory learning. Journal of Neurogenetics. 1985;2:1–30. doi: 10.3109/01677068509100140. [DOI] [PubMed] [Google Scholar]
  61. Heisenberg M. Mushroom body memoir: from maps to models. Nature Reviews. Neuroscience. 2003;4:266–275. doi: 10.1038/nrn1074. [DOI] [PubMed] [Google Scholar]
  62. Hendel T, Michels B, Neuser K, Schipanski A, Kaun K, Sokolowski MB, Marohn F, Michel R, Heisenberg M, Gerber B. The carrot, not the stick: appetitive rather than aversive gustatory stimuli support associative olfactory learning in individually assayed Drosophila larvae. Journal of Comparative Physiology. A, Neuroethology, Sensory, Neural, and Behavioral Physiology. 2005;191:265–279. doi: 10.1007/s00359-004-0574-8. [DOI] [PubMed] [Google Scholar]
  63. Honda T, Lee CY, Yoshida-Kasikawa M, Honjo K, Furukubo-Tokunaga K. Induction of associative olfactory memory by targeted activation of single olfactory neurons in Drosophila larvae. Scientific Reports. 2014;4:4798. doi: 10.1038/srep04798. [DOI] [PMC free article] [PubMed] [Google Scholar]
  64. Honegger KS, Campbell RAA, Turner GC. Cellular-resolution population imaging reveals robust sparse coding in the Drosophila mushroom body. The Journal of Neuroscience. 2011;31:11772–11785. doi: 10.1523/JNEUROSCI.1099-11.2011. [DOI] [PMC free article] [PubMed] [Google Scholar]
  65. Honjo K, Furukubo-Tokunaga K. Distinctive neuronal networks and biochemical pathways for appetitive and aversive memory in Drosophila larvae. The Journal of Neuroscience. 2009;29:852–862. doi: 10.1523/JNEUROSCI.1315-08.2009. [DOI] [PMC free article] [PubMed] [Google Scholar]
  66. Horridge GA. Learning of leg position by the ventral nerve cord in headless insects. Proceedings of the Royal Society of London. Series B. Biological Sciences. 1962;157:33–52. doi: 10.1098/rspb.1962.0061. [DOI] [Google Scholar]
  67. Hoyle G. Mechanisms of simple motor learning. Trends in Neurosciences. 1979;2:153–155. doi: 10.1016/0166-2236(79)90060-2. [DOI] [Google Scholar]
  68. Huser A, Rohwedder A, Apostolopoulou AA, Widmann A, Pfitzenmaier JE, Maiolo EM, Selcho M, Pauls D, von Essen A, Gupta T, Sprecher SG, Birman S, Riemensperger T, Stocker RF, Thum AS. The serotonergic central nervous system of the Drosophila larva: anatomy and behavioral function. PLOS ONE. 2012;7:e47518. doi: 10.1371/journal.pone.0047518. [DOI] [PMC free article] [PubMed] [Google Scholar]
  69. Hwang RY, Zhong L, Xu Y, Johnson T, Zhang F, Deisseroth K, Tracey WD. Nociceptive neurons protect Drosophila larvae from parasitoid wasps. Current Biology. 2007;17:2105–2116. doi: 10.1016/j.cub.2007.11.029. [DOI] [PMC free article] [PubMed] [Google Scholar]
  70. Jefferis GSXE, Potter CJ, Chan AM, Marin EC, Rohlfing T, Maurer CR, Luo L. Comprehensive maps of Drosophila higher olfactory centers: spatially segregated fruit and pheromone representation. Cell. 2007;128:1187–1203. doi: 10.1016/j.cell.2007.01.040. [DOI] [PMC free article] [PubMed] [Google Scholar]
  71. Jenett A, Rubin GM, Ngo T-TB, Shepherd D, Murphy C, Dionne H, Pfeiffer BD, Cavallaro A, Hall D, Jeter J, Iyer N, Fetter D, Hausenfluck JH, Peng H, Trautman ET, Svirskas RR, Myers EW, Iwinski ZR, Aso Y, DePasquale GM, Enos A, Hulamm P, Lam SCB, Li H-H, Laverty TR, Long F, Qu L, Murphy SD, Rokicki K, Safford T, Shaw K, Simpson JH, Sowell A, Tae S, Yu Y, Zugates CT. A gal4-driver line resource for Drosophila neurobiology. Cell Reports. 2012;2:991–1001. doi: 10.1016/j.celrep.2012.09.011. [DOI] [PMC free article] [PubMed] [Google Scholar]
  72. Jin X, Costa RM. Start/stop signals emerge in nigrostriatal circuits during sequence learning. Nature. 2010;466:457–462. doi: 10.1038/nature09263. [DOI] [PMC free article] [PubMed] [Google Scholar]
  73. Jones SV, Heldt SA, Davis M, Ressler KJ. Olfactory-mediated fear conditioning in mice: simultaneous measurements of fear-potentiated startle and freezing. Behavioral Neuroscience. 2005;119:329–335. doi: 10.1037/0735-7044.119.1.329. [DOI] [PMC free article] [PubMed] [Google Scholar]
  74. Jovanic T, Schneider-Mizell CM, Shao M, Masson JB, Denisov G, Fetter RD, Mensh BD, Truman JW, Cardona A, Zlatic M. Competitive disinhibition mediates behavioral choice and sequences in Drosophila. Cell. 2016;167:858–870. doi: 10.1016/j.cell.2016.09.009. [DOI] [PubMed] [Google Scholar]
  75. Jovanic T, Winding M, Cardona A, Truman JW, Gershow M, Zlatic M, Jovanic T, Winding M, Cardona A, Truman JW, Gershow M. Neural substrates of Drosophila larval anemotaxis article. Current Biology. 2019;29:554–566. doi: 10.1016/j.cub.2019.01.009. [DOI] [PMC free article] [PubMed] [Google Scholar]
  76. Kabra M, Robie AA, Rivera-Alba M, Branson S, Branson K. JAABA: interactive machine learning for automatic annotation of animal behavior. Nature Methods. 2013;10:64–67. doi: 10.1038/nmeth.2281. [DOI] [PubMed] [Google Scholar]
  77. Kane EA, Gershow M, Afonso B, Larderet I, Klein M, Carter AR, de Bivort BL, Sprecher SG, Samuel ADT. Sensorimotor structure of Drosophila larva phototaxis. PNAS. 2013;110:E3868–E3877. doi: 10.1073/pnas.1215295110. [DOI] [PMC free article] [PubMed] [Google Scholar]
  78. Karagyozov D, Mihovilovic Skanata M, Lesar A, Gershow M. Recording neural activity in unrestrained animals with three-dimensional tracking two-photon microscopy. Cell Reports. 2018;25:1371–1383. doi: 10.1016/j.celrep.2018.10.013. [DOI] [PMC free article] [PubMed] [Google Scholar]
  79. Kehtarnavaz N, Shirvaikar M, Bushnaq T, Carlsohn MF. A comparison between DSP and FPGA platforms for real-time imaging applications. IS&T/SPIE Electronic Imaging; San Jose, CA. 2009. [DOI] [Google Scholar]
  80. Khurana S, Robinson BG, Wang Z, Shropshire WC, Zhong AC, Garcia LE, Corpuz J, Chow J, Hatch MM, Precise EF, Cady A, Godinez RM, Pulpanyawong T, Nguyen AT, Li W-K, Seiter M, Jahanian K, Sun JC, Shah R, Rajani S, Chen WY, Ray S, Ryazanova NV, Wakou D, Prabhu RK, Atkinson NS. Olfactory conditioning in the third instar larvae of Drosophila melanogaster using heat shock reinforcement. Behavior Genetics. 2012;42:151–161. doi: 10.1007/s10519-011-9487-9. [DOI] [PubMed] [Google Scholar]
  81. Kitamoto T. Conditional modification of behavior in Drosophila by targeted expression of a temperature-sensitive shibire allele in defined neurons. Journal of Neurobiology. 2001;47:81–92. doi: 10.1002/neu.1018. [DOI] [PubMed] [Google Scholar]
  82. Klapoetke NC, Murata Y, Kim SS, Pulver SR, Birdsey-Benson A, Cho YK, Morimoto TK, Chuong AS, Carpenter EJ, Tian Z, Wang J, Xie Y, Yan Z, Zhang Y, Chow BY, Surek B, Melkonian M, Jayaraman V, Constantine-Paton M, Wong GKS, Boyden ES. Independent optical excitation of distinct neural populations. Nature Methods. 2014;11:338–346. doi: 10.1038/nmeth.2836. [DOI] [PMC free article] [PubMed] [Google Scholar]
  83. Krajbich I. Accounting for attention in sequential sampling models of decision making. Current Opinion in Psychology. 2019;29:6–11. doi: 10.1016/j.copsyc.2018.10.008. [DOI] [PubMed] [Google Scholar]
  84. Krynitsky J, Legaria AA, Pai JJ, Garmendia-Cedillos M, Salem G, Pohida T, Kravitz AV. Rodent arena tracker (rat): a machine vision rodent tracking camera and closed loop control system. Eneuro. 2020;7:ENEURO. doi: 10.1523/ENEURO.0485-19.2020. [DOI] [PMC free article] [PubMed] [Google Scholar]
  85. Kudow N, Miura D, Schleyer M, Toshima N, Gerber B, Tanimura T. Preference for and learning of amino acids in larval Drosophila. Biology Open. 2017;6:365–369. doi: 10.1242/bio.020412. [DOI] [PMC free article] [PubMed] [Google Scholar]
  86. Lahiri S, Shen K, Klein M, Tang A, Kane E, Gershow M, Garrity P, Samuel ADT. Two alternating motor programs drive navigation in Drosophila larva. PLOS ONE. 2011;6:e23180. doi: 10.1371/journal.pone.0023180. [DOI] [PMC free article] [PubMed] [Google Scholar]
  87. Larderet I, Fritsch PMJ, Gendre N, Neagu-Maier GL, Fetter RD, Schneider-Mizell CM, Truman JW, Zlatic M, Cardona A, Sprecher SG. Organization of the Drosophila larval visual circuit. eLife. 2017;6:e28387. doi: 10.7554/eLife.28387. [DOI] [PMC free article] [PubMed] [Google Scholar]
  88. Lee T, Luo L. Mosaic analysis with a repressible cell marker for studies of gene function in neuronal morphogenesis. Neuron. 1999;22:451–461. doi: 10.1016/s0896-6273(00)80701-1. [DOI] [PubMed] [Google Scholar]
  89. Li H, Chaney S, Roberts IJ, Forte M, Hirsh J. Ectopic G-protein expression in dopamine and serotonin neurons blocks cocaine sensitization in Drosophila melanogaster. Current Biology. 2000;10:211–214. doi: 10.1016/s0960-9822(00)00340-7. [DOI] [PubMed] [Google Scholar]
  90. Li Y, Yao Q, Tian B, Xu W. 2011 IEEE International Conference on Vehicular Electronics and Safety (ICVES 2011). IEEE; Beijing, China. 2011. [DOI] [Google Scholar]
  91. Li HH, Kroll JR, Lennox SM, Ogundeyi O, Jeter J, Depasquale G, Truman JW. A GAL4 driver resource for developmental and behavioral studies on the larval CNS of Drosophila. Cell Reports. 2014;8:897–908. doi: 10.1016/j.celrep.2014.06.065. [DOI] [PubMed] [Google Scholar]
  92. Lima SQ, Miesenböck G. Remote control of behavior through genetically targeted photostimulation of neurons. Cell. 2005;121:141–152. doi: 10.1016/j.cell.2005.02.004. [DOI] [PubMed] [Google Scholar]
  93. Lin S, Owald D, Chandra V, Talbot C, Huetteroth W, Waddell S. Neural correlates of water reward in thirsty Drosophila. Nature Neuroscience. 2014;17:1536–1542. doi: 10.1038/nn.3827. [DOI] [PMC free article] [PubMed] [Google Scholar]
  94. Liu C, Plaçais PY, Yamagata N, Pfeiffer BD, Aso Y, Friedrich AB, Siwanowicz I, Rubin GM, Preat T, Tanimoto H. A subset of dopamine neurons signals reward for odour memory in Drosophila. Nature. 2012;488:512–516. doi: 10.1038/nature11304. [DOI] [PubMed] [Google Scholar]
  95. Lovell JM, Mylius J, Scheich H, Brosch M. Stimulation of the dopaminergic midbrain as a behavioral reward in instrumentally conditioned monkeys. Brain Stimulation. 2015;8:868–874. doi: 10.1016/j.brs.2015.04.007. [DOI] [PubMed] [Google Scholar]
  96. Luan H, Peabody NC, Vinson CR, White BH. Refined spatial manipulation of neuronal function by combinatorial restriction of transgene expression. Neuron. 2006;52:425–436. doi: 10.1016/j.neuron.2006.08.028. [DOI] [PMC free article] [PubMed] [Google Scholar]
  97. Lundell MJ, Hirsh J. Temporal and spatial development of serotonin and dopamine neurons in the Drosophila CNS. Developmental Biology. 1994;165:385–396. doi: 10.1006/dbio.1994.1261. [DOI] [PubMed] [Google Scholar]
  98. Luo L, Gershow M, Rosenzweig M, Kang K, Fang-Yen C, Garrity PA, Samuel ADT. Navigational decision making in Drosophila thermotaxis. Journal of Neuroscience. 2010;30:4261–4272. doi: 10.1523/JNEUROSCI.4090-09.2010. [DOI] [PMC free article] [PubMed] [Google Scholar]
  99. Marin EC, Jefferis GSXE, Komiyama T, Zhu H, Luo L. Representation of the glomerular olfactory map in the Drosophila brain. Cell. 2002;109:243–255. doi: 10.1016/s0092-8674(02)00700-6. [DOI] [PubMed] [Google Scholar]
  100. Masson JB, Voisinne G, Wong-Ng J, Celani A, Vergassola M. Noninvasive inference of the molecular chemotactic response using bacterial trajectories. PNAS. 2012;109:1802–1807. doi: 10.1073/pnas.1116772109. [DOI] [PMC free article] [PubMed] [Google Scholar]
  101. Masson J-B, Laurent F, Cardona A, Barré C, Skatchkovsky N, Zlatic M, Jovanic T, Samuel A. Identifying neural substrates of competitive interactions and sequence transitions during mechanosensory responses in Drosophila. PLOS Genetics. 2020;16:e1008589. doi: 10.1371/journal.pgen.1008589. [DOI] [PMC free article] [PubMed] [Google Scholar]
  102. Mathis A, Mamidanna P, Cury KM, Abe T, Murthy VN, Mathis MW, Bethge M. DeepLabCut: markerless pose estimation of user-defined body parts with deep learning. Nature Neuroscience. 2018;21:1281–1289. doi: 10.1038/s41593-018-0209-y. [DOI] [PubMed] [Google Scholar]
  103. Mendoza E, Colomb J, Rybak J, Pflüger HJ, Zars T, Scharff C, Brembs B. Drosophila FOXP mutants are deficient in operant self-learning. PLOS ONE. 2014;9:e100648. doi: 10.1371/journal.pone.0100648. [DOI] [PMC free article] [PubMed] [Google Scholar]
  104. Meneses A, Liy-Salmeron G. Serotonin and emotion, learning and memory. Reviews in the Neurosciences. 2012;23:543–553. doi: 10.1515/revneuro-2012-0060. [DOI] [PubMed] [Google Scholar]
  105. Mirat O, Sternberg JR, Severi KE, Wyart C. ZebraZoom: an automated program for high-throughput behavioral analysis and categorization. Frontiers in Neural Circuits. 2013;7:107. doi: 10.3389/fncir.2013.00107. [DOI] [PMC free article] [PubMed] [Google Scholar]
  106. Mischiati M, Lin HT, Herold P, Imler E, Olberg R, Leonardo A. Internal models direct dragonfly interception steering. Nature. 2015;517:333–338. doi: 10.1038/nature14045. [DOI] [PubMed] [Google Scholar]
  107. Nern A, Pfeiffer BD, Rubin GM. Optimized tools for multicolor stochastic labeling reveal diverse stereotyped cell arrangements in the fly visual system. PNAS. 2015;112:E2967–E2976. doi: 10.1073/pnas.1506763112. [DOI] [PMC free article] [PubMed] [Google Scholar]
  108. Neuser K, Triphan T, Mronz M, Poeck B, Strauss R. Analysis of a spatial orientation memory in Drosophila. Nature. 2008;453:1244–1247. doi: 10.1038/nature07003. [DOI] [PubMed] [Google Scholar]
  109. Niewalda T, Singhal N, Fiala A, Saumweber T, Wegener S, Gerber B. Salt processing in larval Drosophila: choice, feeding, and learning shift from appetitive to aversive in a concentration-dependent way. Chemical Senses. 2008;33:685–692. doi: 10.1093/chemse/bjn037. [DOI] [PMC free article] [PubMed] [Google Scholar]
  110. Nottebohm F. Reassessing the mechanisms and origins of vocal learning in birds. Trends in Neurosciences. 1991;14:206–211. doi: 10.1016/0166-2236(91)90107-6. [DOI] [PubMed] [Google Scholar]
  111. Nuwal N, Stock P, Hiemeyer J, Schmid B, Fiala A, Buchner E. Avoidance of heat and attraction to optogenetically induced sugar sensation as operant behavior in adult Drosophila. Journal of Neurogenetics. 2012;26:298–305. doi: 10.3109/01677063.2012.700266. [DOI] [PubMed] [Google Scholar]
  112. Ohyama T, Jovanic T, Denisov G, Dang TC, Hoffmann D, Kerr RA, Zlatic M. High-Throughput analysis of stimulus-evoked behaviors in Drosophila larva reveals multiple modality-specific escape strategies. PLOS ONE. 2013;8:e71706. doi: 10.1371/journal.pone.0071706. [DOI] [PMC free article] [PubMed] [Google Scholar]
  113. Ohyama T, Schneider-Mizell CM, Fetter RD, Aleman JV, Franconville R, Rivera-Alba M, Mensh BD, Branson KM, Simpson JH, Truman JW, Cardona A, Zlatic M. A multilevel multimodal circuit enhances action selection in Drosophila. Nature. 2015;520:633–639. doi: 10.1038/nature14297. [DOI] [PubMed] [Google Scholar]
  114. Olds J, Milner P. Positive reinforcement produced by electrical stimulation of septal area and other regions of rat brain. Journal of Comparative and Physiological Psychology. 1954;47:419–427. doi: 10.1037/h0058775. [DOI] [PubMed] [Google Scholar]
  115. Owald D, Waddell S. Olfactory learning skews mushroom body output pathways to steer behavioral choice in Drosophila. Current Opinion in Neurobiology. 2015;35:178–184. doi: 10.1016/j.conb.2015.10.002. [DOI] [PMC free article] [PubMed] [Google Scholar]
  116. Park J, Lee SB, Lee S, Kim Y, Song S, Kim S, Bae E, Kim J, Shong M, Kim JM, Chung J. Mitochondrial dysfunction in Drosophila PINK1 mutants is complemented by parkin. Nature. 2006;441:1157–1161. doi: 10.1038/nature04788. [DOI] [PubMed] [Google Scholar]
  117. Pavlov IP. Conditioned Reflexes: An Investigation of the Physiological Activity of the Cerebral Cortex. Oxford University Press; 1927. [DOI] [PMC free article] [PubMed] [Google Scholar]
  118. Perisse E, Owald D, Barnstedt O, Talbot CB, Huetteroth W, Waddell S. Aversive learning and appetitive motivation toggle feed-forward inhibition in the Drosophila mushroom body. Neuron. 2016;90:1086–1099. doi: 10.1016/j.neuron.2016.04.034. [DOI] [PMC free article] [PubMed] [Google Scholar]
  119. Pfeiffer BD, Jenett A, Hammonds AS, Ngo TTB, Misra S, Murphy C, Scully A, Carlson JW, Wan KH, Laverty TR, Mungall C, Svirskas R, Kadonaga JT, Doe CQ, Eisen MB, Celniker SE, Rubin GM. Tools for neuroanatomy and neurogenetics in Drosophila. PNAS. 2008;105:9715–9720. doi: 10.1073/pnas.0803697105. [DOI] [PMC free article] [PubMed] [Google Scholar]
  120. Pfeiffer BD, Ngo TTB, Hibbard KL, Murphy C, Jenett A, Truman JW, Rubin GM. Refinement of tools for targeted gene expression in Drosophila. Genetics. 2010;186:735–755. doi: 10.1534/genetics.110.119917. [DOI] [PMC free article] [PubMed] [Google Scholar]
  121. Plaçais PY, Trannoy S, Friedrich AB, Tanimoto H, Preat T. Two pairs of mushroom body efferent neurons are required for appetitive long-term memory retrieval in Drosophila. Cell Reports. 2013;5:769–780. doi: 10.1016/j.celrep.2013.09.032. [DOI] [PubMed] [Google Scholar]
  122. Pulver SR, Pashkovski SL, Hornstein NJ, Garrity PA, Griffith LC. Temporal dynamics of neuronal activation by channelrhodopsin-2 and TRPA1 determine behavioral output in Drosophila larvae. Journal of Neurophysiology. 2009;101:3075–3088. doi: 10.1152/jn.00071.2009. [DOI] [PMC free article] [PubMed] [Google Scholar]
  123. Reddy G, Desban L, Tanaka H, Roussel J, Mirat O, Wyart C. A lexical approach for identifying behavioral action sequences: animal behavior and cognition. bioRxiv. 2020 doi: 10.1101/2020.08.27.270694. [DOI] [PMC free article] [PubMed]
  124. Redgrave P, Vautrelle N, Reynolds JNJ. Functional properties of the basal ganglia’s re-entrant loop architecture: selection and reinforcement. Neuroscience. 2011;198:138–151. doi: 10.1016/j.neuroscience.2011.07.060. [DOI] [PubMed] [Google Scholar]
  125. Rescorla RA. Behavioral studies of pavlovian conditioning. Annual Review of Neuroscience. 1988;11:329–352. doi: 10.1146/annurev.ne.11.030188.001553. [DOI] [PubMed] [Google Scholar]
  126. Robertson JL, Tsubouchi A, Tracey WD, Skoulakis EMC. Larval defense against attack from parasitoid wasps requires nociceptive neurons. PLOS ONE. 2013;8:e78704. doi: 10.1371/journal.pone.0078704. [DOI] [PMC free article] [PubMed] [Google Scholar]
  127. Robie AA, Hirokawa J, Edwards AW, Umayam LA, Lee A, Phillips ML, Card GM, Korff W, Rubin GM, Simpson JH, Reiser MB, Branson K. Mapping the neural substrates of behavior. Cell. 2017;170:393–406. doi: 10.1016/j.cell.2017.06.032. [DOI] [PubMed] [Google Scholar]
  128. Rohwedder A, Wenz NL, Stehle B, Huser A, Yamagata N, Zlatic M, Truman JW, Tanimoto H, Saumweber T, Gerber B, Thum AS. Four individually identified paired dopamine neurons signal reward in larval Drosophila. Current Biology. 2016;26:661–669. doi: 10.1016/j.cub.2016.01.012. [DOI] [PubMed] [Google Scholar]
  129. Saumweber T, Rohwedder A, Schleyer M, Eichler K, Chen Y-C, Aso Y, Cardona A, Eschbach C, Kobler O, Voigt A, Durairaja A, Mancini N, Zlatic M, Truman JW, Thum AS, Gerber B. Functional architecture of reward learning in mushroom body extrinsic neurons of larval Drosophila. Nature Communications. 2018;9:1104. doi: 10.1038/s41467-018-03130-1. [DOI] [PMC free article] [PubMed] [Google Scholar]
  130. Sawin-McCormack EP, Sokolowski MB, Campos AR. Characterization and genetic analysis of Drosophila melanogaster photobehavior during larval development. Journal of Neurogenetics. 1995;10:119–135. doi: 10.3109/01677069509083459. [DOI] [PubMed] [Google Scholar]
  131. Scherer S, Stocker RF, Gerber B. Olfactory learning in individually assayed Drosophila larvae. Learning & Memory. 2003;10:217–225. doi: 10.1101/lm.57903. [DOI] [PMC free article] [PubMed] [Google Scholar]
  132. Schlegel P, Texada MJ, Miroschnikow A, Schoofs A, Hückesfeld S, Peters M, Schneider-Mizell CM, Lacin H, Li F, Fetter RD, Truman JW, Cardona A, Pankratz MJ. Synaptic transmission parallels neuromodulation in a central food-intake circuit. eLife. 2016;5:e16799. doi: 10.7554/eLife.16799. [DOI] [PMC free article] [PubMed] [Google Scholar]
  133. Schleyer M, Saumweber T, Nahrendorf W, Fischer B, von Alpen D, Pauls D, Thum A, Gerber B. A behavior-based circuit model of how outcome expectations organize learned behavior in larval Drosophila. Learning & Memory. 2011;18:639–653. doi: 10.1101/lm.2163411. [DOI] [PubMed] [Google Scholar]
  134. Schleyer M., Fendt M, Schuller S, Gerber B. Associative learning of stimuli paired and unpaired with reinforcement: evaluating evidence from maggots, flies, bees, and rats. Frontiers in Psychology. 2018;9:1494. doi: 10.3389/fpsyg.2018.01494. [DOI] [PMC free article] [PubMed] [Google Scholar]
  135. Schroll C, Riemensperger T, Bucher D, Ehmer J, Völler T, Erbguth K, Gerber B, Hendel T, Nagel G, Buchner E, Fiala A. Light-Induced activation of distinct modulatory neurons triggers appetitive or aversive learning in Drosophila larvae. Current Biology. 2006;16:1741–1747. doi: 10.1016/j.cub.2006.07.023. [DOI] [PubMed] [Google Scholar]
  136. Schulze A, Gomez-Marin A, Rajendran VG, Lott G, Musy M, Ahammad P, Deogade A, Sharpe J, Riedl J, Jarriault D, Trautman ET, Werner C, Venkadesan M, Druckmann S, Jayaraman V, Louis M. Dynamical feature extraction at the sensory periphery guides chemotaxis. eLife. 2015;4:e694. doi: 10.7554/eLife.06694. [DOI] [PMC free article] [PubMed] [Google Scholar]
  137. Schwaerzel M, Monastirioti M, Scholz H, Friggi-Grelin F, Birman S, Heisenberg M. Dopamine and octopamine differentiate between aversive and appetitive olfactory memories in Drosophila. The Journal of Neuroscience. 2003;23:10495–10502. doi: 10.1523/JNEUROSCI.23-33-10495.2003. [DOI] [PMC free article] [PubMed] [Google Scholar]
  138. Séjourné J, Plaçais PY, Aso Y, Siwanowicz I, Trannoy S, Thoma V, Tedjakumala SR, Rubin GM, Tchénio P, Ito K, Isabel G, Tanimoto H, Preat T. Mushroom body efferent neurons responsible for aversive olfactory memory retrieval in Drosophila. Nature Neuroscience. 2011;14:903–910. doi: 10.1038/nn.2846. [DOI] [PubMed] [Google Scholar]
  139. Shyu WH, Chiu TH, Chiang MH, Cheng YC, Tsai YL, Fu TF, Wu T, Wu CL. Neural circuits for long-term water-reward memory processing in thirsty Drosophila. Nature Communications. 2017;8:15230. doi: 10.1038/ncomms15230. [DOI] [PMC free article] [PubMed] [Google Scholar]
  140. Simpson JH. Rationally subdividing the fly nervous system with versatile expression reagents. Journal of Neurogenetics. 2016;30:185–194. doi: 10.1080/01677063.2016.1248761. [DOI] [PubMed] [Google Scholar]
  141. Sitaraman D, Zars M, Laferriere H, Chen YC, Sable-Smith A, Kitamoto T, Rottinghaus GE, Zars T. Serotonin is necessary for place memory in Drosophila. PNAS. 2008;105:5579–5584. doi: 10.1073/pnas.0710168105. [DOI] [PMC free article] [PubMed] [Google Scholar]
  142. Skeath JB, Thor S. Genetic control of Drosophila nerve cord development. Current Opinion in Neurobiology. 2003;13:8–15. doi: 10.1016/s0959-4388(03)00007-2. [DOI] [PubMed] [Google Scholar]
  143. Skinner BF. The Behavior of Organisms: An Experimental Analysis. NY: Appleton-Century-Crofts; 1938. [Google Scholar]
  144. Soares dos Santos MP, Ferreira JAF. Novel intelligent real-time position tracking system using fpga and fuzzy logic. ISA Transactions. 2014;53:402–414. doi: 10.1016/j.isatra.2013.09.003. [DOI] [PubMed] [Google Scholar]
  145. Stephens GJ, Johnson-Kerner B, Bialek W, Ryu WS. Dimensionality and dynamics in the behavior of C. elegans. PLOS Computational Biology. 2008;4:e1000028. doi: 10.1371/journal.pcbi.1000028. [DOI] [PMC free article] [PubMed] [Google Scholar]
  146. Stowers JR, Hofbauer M, Bastien R, Griessner J, Higgins P, Farooqui S, Fischer RM, Nowikovsky K, Haubensak W, Couzin ID, Tessmar-Raible K, Straw AD. Virtual reality for freely moving animals. Nature Methods. 2017;14:995–1002. doi: 10.1038/nmeth.4399. [DOI] [PMC free article] [PubMed] [Google Scholar]
  147. Straw AD, Branson K, Neumann TR, Dickinson MH. Dimensional tracking of multiple flying animals. Journal of the Royal Society Interface. 2011;8:395–409. doi: 10.1098/rsif.2010.0230. [DOI] [PMC free article] [PubMed] [Google Scholar]
  148. Sun R, Delly J, Sereno E, Wong S, Chen X, Wang Y, Huang Y, Greenspan RJ. Anti-instinctive learning behavior revealed by locomotion-triggered mild heat stress in Drosophila. Frontiers in Behavioral Neuroscience. 2020;14:41. doi: 10.3389/fnbeh.2020.00041. [DOI] [PMC free article] [PubMed] [Google Scholar]
  149. Swierczek NA, Giles AC, Rankin CH, Kerr RA. High-throughput behavioral analysis in C. elegans. Nature Methods. 2011;8:592–598. doi: 10.1038/nmeth.1625. [DOI] [PMC free article] [PubMed] [Google Scholar]
  150. Tadres D, Louis M. PiVR: an affordable and versatile closed-loop platform to study unrestrained sensorimotor behavior. PLOS Biology. 2020;18:e3000712. doi: 10.1371/journal.pbio.3000712. [DOI] [PMC free article] [PubMed] [Google Scholar]
  151. Takeda K. Classical conditioned response in the honey bee. Journal of Insect Physiology. 1961;6:168–179. doi: 10.1016/0022-1910(61)90060-9. [DOI] [Google Scholar]
  152. Thorndike EL. Animal Intelligence; Experimental Studies. New York: The Macmillan company; 1911. [DOI] [Google Scholar]
  153. Tracey WD, Wilson RI, Laurent G, Benzer S. Painless, a Drosophila gene essential for nociception. Cell. 2003;113:261–273. doi: 10.1016/s0092-8674(03)00272-1. [DOI] [PubMed] [Google Scholar]
  154. Tully T, Cambiazo V, Kruse L. Memory through metamorphosis. Journal of Neuroscience. 1994;14:68–74. doi: 10.1523/JNEUROSCI.14-01-00068.1994. [DOI] [PMC free article] [PubMed] [Google Scholar]
  155. Turner GC, Bazhenov M, Laurent G. Olfactory representations by Drosophila mushroom body neurons. Journal of Neurophysiology. 2008;99:734–746. doi: 10.1152/jn.01283.2007. [DOI] [PubMed] [Google Scholar]
  156. Uzun IS, Amira A, Bouridane A. FPGA implementations of fast fourier transforms for real-time signal and image processing. IEE Proceedings - Vision, Image, and Signal Processing; 2005. pp. 283–288. [DOI] [Google Scholar]
  157. Veeraraghavan A, Chellappa R, Srinivasan M. Shape-and-behavior encoded tracking of bee dances. IEEE Transactions on Pattern Analysis and Machine Intelligence. 2008;30:463–476. doi: 10.1109/TPAMI.2007.70707. [DOI] [PubMed] [Google Scholar]
  158. Vierock J, Grimm C, Nitzan N, Hegemann P. Molecular determinants of proton selectivity and gating in the red-light activated channelrhodopsin chrimson. Scientific Reports. 2017;7:9928. doi: 10.1038/s41598-017-09600-8. [DOI] [PMC free article] [PubMed] [Google Scholar]
  159. Vinauger C, Lutz EK, Riffell JA. Olfactory learning and memory in the disease vector mosquito Aedes aegypti. The Journal of Experimental Biology. 2014;217:2321–2330. doi: 10.1242/jeb.101279. [DOI] [PMC free article] [PubMed] [Google Scholar]
  160. Vogelstein JT, Park Y, Ohyama T, Kerr RA, Truman JW, Priebe CE, Zlatic M. Discovery of brainwide neural-behavioral maps via multiscale unsupervised structure learning. Science. 2014;344:386–392. doi: 10.1126/science.1250298. [DOI] [PubMed] [Google Scholar]
  161. Vogt K, Schnaitmann C, Dylla KV, Knapek S, Aso Y, Rubin GM, Tanimoto H. Shared mushroom body circuits underlie visual and olfactory memories in Drosophila. eLife. 2014;3:e02395. doi: 10.7554/eLife.02395. [DOI] [PMC free article] [PubMed] [Google Scholar]
  162. von Essen AMHJ, Pauls D, Thum AS, Sprecher SG. Capacity of visual classical conditioning in Drosophila larvae. Behavioral Neuroscience. 2011;125:921–929. doi: 10.1037/a0025758. [DOI] [PubMed] [Google Scholar]
  163. Waddell S. Reinforcement signalling in Drosophila; dopamine does it all after all. Current Opinion in Neurobiology. 2013;23:324–329. doi: 10.1016/j.conb.2013.01.005. [DOI] [PMC free article] [PubMed] [Google Scholar]
  164. Wen JYM, Kumar N, Morrison G, Rambaldini G, Runciman S, Rousseau J, van der Kooy D. Mutations that prevent associative learning in C. elegans. Behavioral Neuroscience. 1997;111:354–368. doi: 10.1037/0735-7044.111.2.354. [DOI] [PubMed] [Google Scholar]
  165. Wolf R, Heisenberg M. Basic organization of operant behavior as revealed in Drosophila flight orientation. Journal of Comparative Physiology A. 1991;169:699–705. doi: 10.1007/BF00194898. [DOI] [PubMed] [Google Scholar]
  166. Wolf R, Wittig T, Liu L, Wustmann G, Eyding D, Heisenberg M. Drosophila mushroom bodies are dispensable for visual, tactile, and motor learning. Learning & Memory. 1998;5:166–178. doi: 10.1101/lm.5.1.166. [DOI] [PMC free article] [PubMed] [Google Scholar]
  167. Wong AM, Wang JW, Axel R. Spatial representation of the glomerular map in the Drosophila protocerebrum. Cell. 2002;109:229–241. doi: 10.1016/s0092-8674(02)00707-9. [DOI] [PubMed] [Google Scholar]
  168. Wu MC, Chu LA, Hsiao PY, Lin YY, Chi CC, Liu TH, Fu CC, Chiang AS. Optogenetic control of selective neural activity in multiple freely moving Drosophila adults. PNAS. 2014;111:5367–5372. doi: 10.1073/pnas.1400997111. [DOI] [PMC free article] [PubMed] [Google Scholar]
  169. Yasukawa S, Okuno H, Ishii K, Yagi T. Real-Time object tracking based on scale-invariant features employing bio-inspired hardware. Neural Networks. 2016;81:29–38. doi: 10.1016/j.neunet.2016.05.002. [DOI] [PubMed] [Google Scholar]
  170. Zemelman BV, Lee GA, Ng M, Miesenböck G. Selective photostimulation of genetically charged neurons. Neuron. 2002;33:15–22. doi: 10.1016/s0896-6273(01)00574-8. [DOI] [PubMed] [Google Scholar]
  171. Zhang C, Liang T, Mok PKT, Yu W. FPGA implementation of the coupled filtering method and the affine warping method. IEEE Transactions on Nanobioscience. 2017;16:314–325. doi: 10.1109/TNB.2017.2705104. [DOI] [PubMed] [Google Scholar]

Editor's evaluation

Aravinthan DT Samuel 1

Since classic studies by Pavlov and Skinner about learning and memory in laboratory settings, the field has sought solid ways to use observable behaviors to illuminate how positive and negative reinforcement modulates stimulus-evoked behaviors. This valuable study by Croteau-Chonka et al., represents the latest modernization of such technology, judiciously targeting the highly quantifiable, real-time motor behaviors of the Drosophila larva to create a rigorous new paradigm for classical and operant conditioning. The small nervous system of the larva has few parallels for tractability in dissecting various neural mechanisms. What has been lacking, until now, is the technology needed to tackle the neural mechanisms of learning and memory in the maggot with rigorous, high-throughput, and real-time behavioral observations.

Decision letter

Editor: Aravinthan DT Samuel1

Our editorial process produces two outputs: (i) public reviews designed to be posted alongside the preprint for the benefit of readers; (ii) feedback on the manuscript for the authors, including requests for revisions, shown below. We also include an acceptance summary that explains what the editors found interesting or important about the work.

Decision letter after peer review:

Thank you for submitting your article "Serotonergic neurons mediate operant conditioning in Drosophila larvae" for consideration by eLife. Your article has been reviewed by 3 peer reviewers, and the evaluation has been overseen by a Reviewing Editor and K VijayRaghavan as the Senior Editor. The reviewers have opted to remain anonymous.

The reviewers have discussed their reviews with one another, and the Reviewing Editor has drafted this to help you prepare a revised submission.

Essential revisions:

1) Because the optogenetically induced operant learning has a modest effect, the Reviewers would like to see replication of operant conditioning using the thermogenetic paradigm (shown to be effective in Figure 2).

2) More rigorous analyses of the phenotype (e.g., showing pre and postbending behaviors, see Reviewer #1… additional statistical tests, see Reviewer #2… additional controls, see Reviewer #3).

3) All reviewers were concerned about the artificial nature of the US. If operant conditioning can be evoked with nociceptive pain, that would be great. If not, a more careful discussion of the limitations of using artificial stimuli in the interpretation and discussion would suffice.

Reviewer #1 (Recommendations for the authors):

Below I will list the criticism summarized in the previous section

1) To validate the set up the authors induce rolling behavior by thermo- or optogenetically activating two sets of previously described neurons in individual larva. Both approaches show convincing induction of the behavior per se. However, there seems to be an interaction of the different tools used (thermo and opto-genetic) and the targeted neurons: the authors observe different dynamics of the behavior across the three stimulation cycles depending on stimulation method and labeled neurons. These findings make it difficult to understand why the authors choose only the optogenetic activation to investigate operant conditioning. Thus, the authors should repeat key experiments using thermogenetic tools (see below).

2) The strength of the setup is that individual animals can be targeted. Though the presented data show that behavior can be reliably induced in stimulated animals, it lacks the information about the behavior of non-targeted larva during the stimulation. Thus, it would strengthen the work if the authors could show the behavior of the non-targeted larva during the time when targeted larva receive light or heat.

3) The origin of the relative difference between left and right bending in the paired group is not entirely clear. Thus, it will be important to strengthen the work by additional experiments investigating temporal relationship between the CS and US. Ideally the experiments should focus on understanding why the training results in a reduction of the unreinforced behavior.

4) The authors should consider that given the small effects, it has to be ensured that the observed differences originate from training and are not mere pre-training biases. Though they show the pretraining results for one of the experiments (Figure 3b, the trained group), the pretraining bending is very relevant for each of the operant learning experiments. In fact, training induced effects should not only be measured by looking at the left vs right bending in the final test but as a change between pre versus post or between a trained and a mock control group. This is done for one group (Ddc-GAL4) in Figure 3b but will be mandatory for all operant learning experiments.

5) It would improve the accessibility of the learning induced change of behavior if the authors could show the pre vs post training results for each run (10-12 larva in a plate). Further, they should plot the numbers of reinforced behaviors in each of the training protocols and relate it to the test performance.

6) The presented data clearly suggests a decrease of the unstimulated bending rather than a change in the reinforced behavior. Though the authors mention it, they do not explain or discuss it. It will be very important for the logic of the manuscript that the authors explain this phenomenon and how it relates to operant conditioning (see point 3).

7) Though the manuscript discusses most of the data carefully, in my view the authors miss an important issue: it remains to be shown if fly larva are capable of operant learning using external reward or punishment. The presented evidence is based on artificial activation of neurons, which arguably is a hint but not a prove that operant conditioning is withing the repertoire of a fly larva, an issue the authors should mention and discuss.

Reviewer #2 (Recommendations for the authors):

In addition to the points raised in the public review:

– In figure 2, I was surprised to see that the responses elicited by the same Gal4 are so different when stimulated optogenetically or thermogenetically for both lines. Can the authors try to give an explanation?

– I am intrigued by what would be the US under natural conditions. In the discussion the authors say that they did not manage to condition the larvae using sugar sensing neurons, could it be that in Drosophila larvae operant conditioning only works for sensory signals imputing directly to the VNC? Have they tried conditioning the larvae by associating one side bending with optogenetic activation of noxious stimuli (without eliciting rolling)? It might be good to expand in the discussion on the expected sensory nature of US enabling operant conditioning.

Reviewer #3 (Recommendations for the authors):

The introduction is an excellent description of the central question – can Drosophila larvae undergo operant conditioning and if so, what neural circuits enable it? The background for the types of learning, the known and possible circuit mechanisms, and the advantages of the model system, are beautifully described (easily Review-caliber) allowing diverse readers to engage with the paper.

To conduct operant learning experiments, new hardware and software were required. Tracking multiple larva, identifying their behaviors, and applying rewarding or punishing stimuli through optogenetic activation of neurons – all in real-time – is a tour de force. Again, the descriptions of the key hardware innovation (the field-programable gate arrays) and the advances in machine learning enabling rapid behavior detection are very nicely done.

Line 210: Good control showing that the IR laser activates Trp but not pain-induced rolling. (The thermogenetic activation isn't really key to the later experiments, though…)

Recommended Revisions:

The experiments are solid and rigorously done. Most of the issues can be resolved with text clarification or additional discussion.

The best interpretation of the behaviors induced by expression in many dopaminergic and serotoninergic neurons is unclear: different neurons can have local functions – sometimes conflicting ones – so I am surprised that a very broad driver like DDC doesn't set up conflicting or non-specific reinforcement. I am also amazed that the timing works – a reward right after the bend could generate a different association than a potential punishment right before it. The interval between bends and the timing of the optogenetic reinforcement (assumed to be positive) relative to those bends should be discussed.

How many behavioral actions do you miss applying reward or punishment to? There are multiple larvae on the plate, and the bends must be detected and then the larva targeted – when you look at the videos later, what fraction of the bends that occur during the training periods were successfully reinforced?

How was the training regimen selected? What about a longer, continuous period – or shorter breaks? Was there a minimum number of reinforced bends that had to occur to include a larva in the subsequent evaluation? Was the possibility that the un-reinforced epochs in the training regime result in forgetting (or learning that action does not reliably produce reward) considered?

Important missing control: There have been reports that the UAS-Chrimson can have some basal/leak expression. What does the attP2>Chrimson + retinal control look like in the biasing for bend direction experiments (Figure 3B)? Even a low level of expression could serve as a reward and so this control should be tested. (The uncorrelated light control is also good, but does not rule out contribution from activation of non-serotonergic neurons.)

line 289 (and line 395): The use of necessity and sufficiency is a little confusing here. These are all ectopic manipulations. Optogenetic activation of all dopaminergic and serotoneric neurons (expressing DDC-GAL4, UAS-Chrimson) is capable of inducing increased bending. Activation of dopaminergic and serotonergic neurons in the brain alone (DDC-GAL4, UAS-Chrimson, tsh-LexA, LexOp-GAL80) does not. We don't know much about how these neurons contribute to normal operant conditioning, just that the ones in the VNC seem to be the critical ones for the optogenetic effect. It could be said that activation of serotonergic VNC neurons is sufficient to induce the optogenetic effect – but I would avoid any speculation of actual necessity. (line 375 described operant conditioning as "impaired" which is also confusing. The artificial operant conditions failed when VNC serotonergic neurons were not included. That is not the same thing.) line 413: optogenetic activation CAN serve, not DOES serve…. This all may be a difference of word use conventions among research studying learned vs. innate behaviors, but given the discussion about value of these terms (Gomez-Marin 2017, Yoshihara and Yoshihara 2018), it might be good to maximize clarity here.

Operant conditioning is measured as an increase in number of bends per minute or in the probability of bending toward the rewarded side. These are not directly comparable metrics to the performance index used in classical conditioning, but the operant effects, while statistically significant, seem very small (eg. Figure 4b vs. d). Is this an accurate observation and is there a useful contrast proposed?

I found the shifts between dopaminergic and serotonergic neurons, and between classical and operant conditioning experiments, a little challenging to follow. Please consider clarifying how the classical conditioning experiments contribute to the focus of this research that is suggested by the title – serotonergic neurons capable of operant conditioning. (Since it is clear early on that operant and classical conditioning are achieved by different neurons, it is not logical that the classical conditioning screen for subsets of dopaminergic or serotonergic neurons would turn up any useful candidates for dissecting operant circuits.)

The Tsh-LexA, lexOp-GAL80 combination should reference Simpson 2016 J Neurogenetics; only the Tsh-GAL80 was published in Clyne and Miesenbock. The Tsh-LexA, lexOp-flp, UAS>stop>Chrimson combination, the otd-Flp (Asahina et al., 2014), or the Trh-DBD+Tsh-AD (Albin et al., 2015) present possible options for positive intersection with serotonergic neurons in the VNC or the brain.

Suggestions for future experiments (not required):

Line 256: These larvae don't show innate bend direction preference. Out of curiosity, would it be possible to try this on DeBivort's turn preference-prone (handed) animals? Is it easier to train toward an existing bias or totally distinct? would this help identify shared/distinct circuit contributions?

What happens to the larval bend rates and direction preference if you silence serotonergic neurons? Are they learning anything by their normal crawling actions? Is there a paradigm where operant learning might occur in a more natural or beneficial context? The experiments described here show that larvae are capable of it in a highly artificial setting – which is certainly cool – but provide no clues about what larva might be using this capacity for in their normal lives…

What about removing or silencing the MBs altogether and seeing if you can still optogenetically induce operant conditioning? That would be a pretty nice way to show that not all roads lead to MBs!

eLife. 2022 Oct 28;11:e70015. doi: 10.7554/eLife.70015.sa2

Author response


Essential revisions:

1) Because the optogenetically induced operant learning has a modest effect, the Reviewers would like to see replication of operant conditioning using the thermogenetic paradigm (shown to be effective in Figure 2).

In order to address this comment, we first characterised in more detail the temporal profile of heating with the IR laser beam. To verify the speed with which the IR beam heated up individual animals we installed a heat camera on the setup. Using the heat camera, we found that the time to heat up the animal to the desired 30oC is 4s. The heat camera performed closed-loop adjustments of laser intensity to maintain the desired temperature at each larval location.

While larvae were heated to the right temperature relatively quickly and with predictable timing relative to IR light trigger (within 4s), the delay between trigger and thermogenetic stimulation was much slower than for optogenetic stimulation (which is virtually instantaneous). Since the average duration of a larval bend is only a third of that time (mean=1.35s, sd=1.67s, n=4622 bends), thermogenetic activation is too slow to be used in closed-loop during operant conditioning. By the time the fictive reward would be activated, the animal could be performing a completely different action, which could interfere with the formation of an association with the preceding action.

A second important methodological consideration was the risk of establishing conflicting valence signals. We wanted to avoid mixing punishment (via IR-induced tissue heating) with reward (via IR-induced activation of Ddc neurons) during training. With mild heat more aversive (induces more bending in control animals) to larvae than visible red light (compare bending in attp2 control larvae in Figure 2D and 2E), we favoured optogenetics over thermogenetics for the operant conditioning paradigm.

We therefore decided against trying to replicate the operant conditioning experiments using thermogenetic stimulation.

We have added new Figure 2 —figure supplement 1 and the following new sections in the Results explaining these points:

“The methodological choice of optogenetics was informed, in part, by a deeper investigation of larval heating dynamics as they relate to average bend duration. We determined that our IR stimulation hardware takes approximately 4s to heat larval tissue to the nearly 30oC required for dTrpA1 channel activation (Figure 2 —figure supplement 1; see also Materials and methods). Knowing that the average duration of a larval bend is only a third of that time (mean=1.35s, sd=1.67s, n=4622 bends), we concluded that closed-loop heat stimulation would activate neurons of interest only after a noticeable delay relative to behaviour detection, with possibly other behaviours occurring during the delay period. Such a task in which different behaviours are occurring prior to reinforcement could be very difficult to learn. Quicker heating was achievable with increased laser intensity, but such an approach risked overshooting the desired temperature and damaging larval tissue. Any safe thermogenetic approach would therefore be too slow to temporally align the US induced via larval heating with a specific larval action. A second important methodological consideration was the risk of establishing conflicting valence signals. We wanted to avoid mixing punishment (via IR-induced tissue heating) with reward (via IR-induced activation of Ddc neurons) during training. With mild heat more aversive to larvae than visible red light (compare bedning in control larvae in Figure 2D and 2E), we favoured optogenetics over thermogenetics for our operant conditioning paradigm.”

However, we do agree that replicating the operant learning experiments in a different way is important.

To address this point and the point about needing the effector control (from Reviewer 3), we therefore reproduced the operant learning experiment using optogenetic activation, but on a different, low-throughput, single-animal tracker (Schulze et al., 2015).

As before, we found that pairing optogenetic activation of dopaminergic and serotonergic neurons (Ddc-GAL>UAS-CsChrimson larvae) with a specific bend direction resulted in a significant increase in bends/min towards the stimulated side relative to the unstimulated side, after training, but not before. This indicates operant learning has occurred (Figure 4—figure supplement 3d).

In contrast, there was no significant increase in bends/min towards the stimulated side relative to the unstimulated side, neither after, nor before training in the UAS-CsChrimson effector control larvae (Figure 4—figure supplement 3e). These results show that putative leaky CsChrimson expression in some unknown neurons is not sufficient to induce operant learning.

Furthermore, after training, there was a significant difference in Δ bend/min between Ddc-GAL4>UAS-CsChrimson and the UAS-CsChrimson larvae (Figure 4—figure supplement 3f). This confirms that optogenetic activation of Ddc serotonergic and dopaminergic neurons can induce operant learning.

We have added new Figure 4 —figure supplement 3 with these results and a new section in the Results:

“We also used a previously developed low-throughput single-larva closed-loop tracking system to test the reproducibility of this result on a different system (see Materials and methods for more details, Schulze et al., 2015). Fictive Ddc activation with this low-throughput system also yielded a significant bend direction preference to the previously stimulated (mean=5.77, sd=2.71, n=109) versus previously unstimulated (mean=4.73, sd=2.73, n=109) side (p=.0043), after training. These results contrast those of effector control larvae that had the UAS-CsChrimson transgene but not the Ddc-GAL4. The control larvae show no difference in bend rate to either side after training. Based on these control larvae, we concluded that potential basal expression of CsChrimson in neurons outside of the Ddc expression pattern is not causing operant learning (Figure 4 —figure supplement 3).”

Finally, we note that, while thermogenetic activation is not fast enough for closed-loop operant conditioning, it is well suited for open-loop experiments and for combining thermogenetic with optigenetic activation. Since the timing between triggering and heating is constant and predictable (4s) it is possible to design classical conditioning experiments with desired CS-US timing intervals.

Our prior version of the manuscript did not demonstrate the usefulness of our new IR thermogenetic stimulation module for classical conditioning paradigms. We wanted to address this point by combining both fictive thermogenetic and optogenetic activation to demonstrate a previously unknown form of classical conditioning in larvae.

Trace conditioning has been demonstrated in adult Drosophila (Galili et al., 2011) but whether or not larvae can associate a CS with a US when there is a significant temporal gap between CS offset and US onset was previously unknown. We therefore trained larvae using a trace conditioning paradigm in which we combined fictive odour (optogenetic activation of Or42b) with fictive noxious stimulus (thermogenetic activation of the nociceptive and mechanosensory Basin neurons) with a 9s gap between CS offset and US onset. In these experiments, we triggered IR light 5s after the offset of red light for optogenetic stimulation and it took a further 4s to reach the appropriate 30oC for thermogenetic activation of Basins.

In this way, we demonstrate for the first time that larvae are capable of trace conditioning (i.e. associating a CS with a US after a 9s temporal gap between the CS offset and US onset).

We have added a new Figure 3 and a new section entitled “Aversion to fictive Or42b develops after forward-paired trace conditioning” that demonstrate trace-conditioning using optogenetic odour and thermogenetic noxious stimulation.

“Having verified the efficacy of optogenetic and thermogenetic stimulation in our system, we first studied whether these methods could be used to train larvae in a previously unexplored classical conditioning task that requires precise temporal control of both CS and US. […] These results show that our tracker can be used to perform automated, high-throughput classical conditioning in Drosophila larvae. To the best of our knowledge, these results also provide the first evidence that larvae can perform classical conditioning with significant (9s) offset-to-onset gaps between stimuli (i.e. trace conditioning).”

2) More rigorous analyses of the phenotype (e.g., showing pre and postbending behaviors, see Reviewer #1… additional statistical tests, see Reviewer #2… additional controls, see Reviewer #3).

We have expanded Figures 4c-f and 5a-c to show bend/min towards the stimulated and unstimulated side and compute the difference between them and test whether this difference is significant (using two-sided Wilcoxon signed-rank test), both before and after training, for all genotypes and all conditions. We also compare (using a two-sided Mann-Whitney U test, with Bonferroni correction) the difference in bends/min towards the stimulated and unstimulated side (Δ bends/min), after training, between experimental and control groups (Figures 4h and 5d), as suggested by the Reviewers.

Pairing optogenetic activation of dopaminergic and serotonergic (Ddc-GAL>UAS-CsChrimson larvae, Figures 4c) or just serotonergic neurons (Tph-GAL4>UAS-CsChrimson, Figure 5a) with a specific bend direction, resulted in a significant increase in bends/min towards the stimulated side relative to the unstimulated side, after training, but not before. These results suggest that pairing a specific bend direction with the activation of serotonergic and dopaminergic neurons together, or serotonergic neurons alone, induces operant learning.

For all other genotypes there was no significant difference in bends/min to the stimulated, compared to the unstimulated side, neither before, nor after training. Thus, pairing the activation of only brain dopaminergic and sertotonergic (Ddc-GAL4>UAS-CsChrimson, teashirt-GAL80, Figure 4e), only MB dopaminergic neurons (58E02-GAL4>UAS-CsChrimson, Figures 4f), only dopaminergic neurons (TH-GAL4>CsChrimson, Figure 5b), or only brain serotonergic neurons (Tph-GAL4>UAS-CsChrimson, teashirt-GAL80, Figure 5c) with a specific bend direction did not result in a significant difference in bend direction between the stimulated and the unstimulated side, neither before, nor after training. These results indicate that none of these neuronal subsets alone were sufficient to induce operant learning. Since all of these genotypes contained the UAS-CsChrimson transgene, these results further suggest that any putative leaky basal CsChrimson expression in some unknown neurons is not sufficient to induce operant learning.

Similarly, the yoked control larvae (Ddc-GAL4>UAS-CsChrimson, Figure 4d) in which optogenetic activation of dopaminergic and serotonergic neurons was not paired with a specific bend direction did not result in a significant difference in bend direction between the stimulated and the unstimulated side, neither before, nor after training. This shows that simply optogenetic activation of dopaminergic and serotonergic neurons unpaired with bend does not bias bend direction.

We also compared Δ bends/min after training between the experimental and control genotypes conditions and found they were significantly different.

Thus, after training, there was a significant difference in Δ bend/min between

– the Ddc-GAL4>UAS-CsChrimson and the Ddc-GAL4>UAS-CsChrimson, teashirt-GAL80 (Figure4h).

– the Ddc-GAL4>UAS-CsChrimson and the 58E02-GAL4>UAS-CsChrimson (Figure 4h).

– the Ddc-GAL4>UAS-CsChrimson paired larvae and the yoked controls (Figure 4h).

– the Tph-GAL4>UAS-CsChrimson and the Tph-GAL4>UAS-CsChrimson, teashirt-GAL80 (Figure 5d).

These results are consistent with the idea that only the complete set of serotonergic neurons is sufficient to induce operant learning. In the absence of activation of, either all serotonergic, or just nerve cord serotonergic neurons, we did not observe operant learning.

Finally, we also added the additional control, together with demonstrating the reproducibility of operant learning on a different, low-throughput, single-larva tracker (Schulze et al., 2015). We have paired a specific bend direction with red light, either in the Ddc-GAL4>UAS-CsChrimson larvae, or in larvae in which UAS-CsChrimson was present, but Ddc-GAL4 was absent (Figure 4–figure supplement 3).

As before, we found that pairing optogenetic activation of dopaminergic and serotonergic neurons (Ddc-GAL>UAS-CsChrimson larvae) with a specific bend direction resulted in a significant increase in bends/min towards the stimulated, relative to the unstimulated side, after training, but not before, indicating operant learning has occurred (Figure 4–figure supplement 3d).

In contrast, there was no significant increase in bends/min towards the stimulated, relative to the unstimulated side, neither after, nor before training in the UAS-CsChrimson control larvae (Figure 4–figure supplement 3e). These results further support the idea that any putative leaky basal CsChrimson expression in some unknown neurons, is not sufficient to induce operant learning.

Furthermore, after training, there was a significant difference in Δ bend/min between Ddc-GAL4>UAS-CsChrimson and the UAS-CsChrimson larvae (Figure 4–figure supplement 3f). This confirms that optogenetic activation of Ddc serotonergic and dopaminergic neurons can induce operant learning.

These results and quantifications are shown in the new Figure 4–figure supplement 3.

3) All reviewers were concerned about the artificial nature of the US. If operant conditioning can be evoked with nociceptive pain, that would be great. If not, a more careful discussion of the limitations of using artificial stimuli in the interpretation and discussion would suffice.

To address this point, we attempted preliminary experiments, either with noxious heat (data not shown) or with optoegentic activation of MD class IV neurons (targeted by the ppk-Gal4 driver, preliminary data not shown ) during bends to one side to see whether these neurons could evoke aversive operant learning. We were unable to elicit an operant learning effect in these pilot experiments, as evidenced by no significant difference in bend rate between the previously stimulated and unstimulated sides, after training (preliminary data not shown ). We cannot exclude that trying a range of different stimulation and training conditions with nociceptive heat or with optogenetic activation of MD class IV neurons could give operant aversive learning in the future, but it was beyond the scope of this study to explore this.

We have therefore added new sentences in the Discussion stating the limitations of artificial stimuli:“It will also be important to determine whether conditioning with a fictive odour stimulus changes larval responses to natural odours. For example, larvae showing reduced attraction to Or42b activation may show reduced attraction to natural odours that activate Or42b neurons (e. g. ethyl acetate)”

“There are limitations to interpreting behaviour following fictive neuronal activation. It will therefore be important to replicate the new paradigms developed with this rig using lower-throughput methods with natural stimuli. For example, one might modify our multi-larva tracker to accommodate closed-loop presentation of real, innately appetitive gustatory stimuli by using closed-loop control of microfluidic devices”

Reviewer #1 (Recommendations for the authors):

Below I will list the criticism summarized in the previous section

1) To validate the set up the authors induce rolling behavior by thermo- or optogenetically activating two sets of previously described neurons in individual larva. Both approaches show convincing induction of the behavior per se. However, there seems to be an interaction of the different tools used (thermo and opto-genetic) and the targeted neurons: the authors observe different dynamics of the behavior across the three stimulation cycles depending on stimulation method and labeled neurons. These findings make it difficult to understand why the authors choose only the optogenetic activation to investigate operant conditioning. Thus, the authors should repeat key experiments using thermogenetic tools (see below).

In order to address this comment, we first characterised in more detail the temporal profile of heating with the IR laser beam. To verify the speed with which the IR beam heated up individual animals, we installed a heat camera on the setup. Using the camera, we found that the time to heat the animal to the desired 30oC is 4s. The heat camera performed closed-loop adjustments of laser intensity to maintain the desired temperature at each larva.

While larvae were heated to 30oC relatively quickly and with predictable timing relative to IR trigger (within 4s), the delay between trigger and thermogenetic stimulation (which occurs once 30oC is reached) was greater than for optogenetic stimulation (which is virtually instantaneous). Since the average duration of a larval bend is only a third of that time (mean=1.35s, sd=1.67s, n=4622 bends), thermogenetic activation is too slow to be used in closed-loop during operant conditioning. By the time the reward neurons would be activated, the animal could be performing a completely different action, which could interfere with the formation of an association with the preceding action.

A second important methodological consideration was the risk of establishing conflicting valence signals. We wanted to avoid mixing punishment (via IR-induced tissue heating) with reward (via IR-induced activation of Ddc neurons) during training. With mild heat more aversive (induces more bending) to larvae than visible red light (compare bending in attp2 control larvae in Figure 2D and 2E), we favoured optogenetics over thermogenetics for appetitive operant conditioning.

We therefore decided not to replicate the operant conditioning experiments using thermogenetics.

We have added new Figure 2 —figure supplement 1 and the following new sections in the Results explaining these points:

“The methodological choice of optogenetics was informed, in part, by a deeper investigation of larval heating dynamics as they relate to average bend duration. […] With mild heat more aversive to larvae than visible red light (compare bedning in control larvae in Figure 2D and 2E), we favoured optogenetics over thermogenetics for our operant conditioning paradigm.”

However, we agree that replicating the operant learning experiments in a different way is important. To address this point, we reproduced the operant learning experiment using optogenetic activation on a different, low-throughput, single-animal tracker (Schulze et al., 2015). Using this system we paired specific bend direction with red light, either in Ddc-GAL4, UAS-CsChrimson larvae, or in the effector control larvae that had the UAS-CsChrimson transgene but not the Ddc-GAL4. Pairing of Ddc activation with a specific bend direction on this low-throughput system also yielded a significant bend direction preference to the previously stimulated relative to the previously unstimulated side (p=.0043), after training. The effector control larvae showed no difference in bend rate to either side, after training. Based on these control larvae, we concluded that any putative basal expression of CsChrimson in neurons outside of the Ddc expression pattern cannot induce operant learning.

We have added new Figure 4 —figure supplement 3 with these results and a new paragraph in the Results section entitled “Operant conditioning of larval bend direction”:

“We also used a previously developed, low-throughput, single-larva, closed-loop tracking system to test the reproducibility of this result on a different system (see Materials and methods for more details, Schulze et al., 2015). Fictive Ddc activation with this system also yielded a significant bend direction preference to the previously stimulated (mean=5.77, sd=2.71, n=109) versus previously unstimulated (mean=4.73, sd=2.73, n=109) side (p=.0043), after training. These results contrast those of effector control larvae that had the UAS-CsChrimson transgene but not the Ddc-GAL4. The control larvae showed no difference in bend rate to either side after training. Based on these control larvae, we concluded that any potential leaky expression of CsChrimson in neurons outside of the Ddc expression pattern is not causing operant learning (Figure 4 —figure supplement 3).”

Finally, we note that, while thermogenetic activation is not fast enough for closed-loop operant conditioning, it is well suited for open-loop applications in combination with optigenetic activation. Since the timing between triggering and heating is predictable (4s), it is possible to design classical conditioning experiments with desired CS-US timing intervals.

Our prior version of the manuscript did not demonstrate the usefulness of our new IR thermogenetic stimulation module for classical conditioning paradigms. We, therefore, wanted to address this point by combining both fictive thermogenetic and optogenetic activation to demonstrate a previously unknown form of classical conditioning in larvae.

Trace conditioning has been demonstrated in adult Drosophila (Galili et al., 2011), but whether or not larvae can associate a CS with a US when there is a significant temporal gap between CS offset and US onset, was previously unknown. We therefore trained larvae using a trace conditioning paradigm in which we combined fictive odour (optogenetic activation of Or42b) with a fictive noxious stimulus (thermogenetic activation of the nociceptive and mechanosensory Basin neurons) with a 9s gap between CS offset and US onset. In these experiments, we triggered IR light 5s after the offset of red light for optogenetic stimulation and it took a further 4s to reach the appropriate 30oC for thermogenetic activation of Basins.

We found that larvae were capable of trace conditioning (associating a CS with a US after a 9s temporal gap between CS offset and US onset).

We have added the new Figure 3 and the new section entitled “Aversion to fictive Or42b develops after forward-paired trace conditioning” that demonstrate trace-conditioning using optogenetic odour and thermogenetic noxious stimulation.

“Having verified the efficacy of optogenetic and thermogenetic stimulation in our system, we first studied whether these methods could be used to train larvae in a previously unexplored classical conditioning task that requires precise temporal control of both CS and US. […] These results show that our tracker can be used to perform automated, high-throughput classical conditioning in Drosophila larvae. To the best of our knowledge, these results also provide the first evidence that larvae can perform classical conditioning with significant (9s) offset-to-onset gaps between stimuli (i.e. trace conditioning).”

2) The strength of the setup is that individual animals can be targeted. Though the presented data show that behavior can be reliably induced in stimulated animals, it lacks the information about the behavior of non-targeted larva during the stimulation. Thus, it would strengthen the work if the authors could show the behavior of the non-targeted larva during the time when targeted larva receive light or heat.

In the proof-of-principle experiments, all larvae receive light or heat during the 5 sec of open-loop stimulation. In other words, there do not exist non-targeted larvae at the same time as targeted larvae. However, we have expanded the time frame for which we show data in the Figure 2 to include times when the stimulus is off. This highlights baseline larval behaviour in the absence of fictive stimuli. We now show rolling, bending, and crawling before, during and after stimulation.

3) The origin of the relative difference between left and right bending in the paired group is not entirely clear. Thus, it will be important to strengthen the work by additional experiments investigating temporal relationship between the CS and US. Ideally the experiments should focus on understanding why the training results in a reduction of the unreinforced behavior.

It is difficult to perform operant conditioning with a range of temporal gaps between CS and US because many different behaviours can happen during the gap. We think these experiments are beyond the scope of this already large study. However, in classical conditioning it is well established that a significant learning score can result, either from a change in preference for the paired odour, or for the unpaired odour, or both (see e.g. Eschbach et al., Nature neuroscience. 2020, Extended Data Figure 2).

4) The authors should consider that given the small effects, it has to be ensured that the observed differences originate from training and are not mere pre-training biases. Though they show the pretraining results for one of the experiments (Figure 3b, the trained group), the pretraining bending is very relevant for each of the operant learning experiments. In fact, training induced effects should not only be measured by looking at the left vs right bending in the final test but as a change between pre versus post or between a trained and a mock control group. This is done for one group (Ddc-GAL4) in Figure 3b but will be mandatory for all operant learning experiments.

We have expanded Figures 4c-f and 5a-c to show bend/min towards the stimulated and unstimulated side and compute the difference between them and test whether this difference is significant (using two-sided Wilcoxon signed-rank test), both before and after training, for all genotypes and all conditions. We also compare (using a two-sided Mann-Whitney U test, with Bonferroni correction) the difference in bends/min towards the stimulated and unstimulated side (Δ bends/min), after training, between experimental and control groups (Figures 4h and 5d), as suggested by the Reviewer.

Pairing optogenetic activation of dopaminergic and serotonergic (Ddc-GAL>UAS-CsChrimson larvae, Figures 4c) or just serotonergic neurons (Tph-GAL4>UAS-CsChrimson, Figure 5a) with a specific bend direction, resulted in a significant increase in bends/min towards the stimulated side relative to the unstimulated side, after training, but not before. These results suggest that pairing a specific bend direction with the activation of serotonergic and dopaminergic neurons together, or serotonergic neurons alone, induces operant learning.

For all other genotypes there was no significant difference in bends/min to the stimulated, compared to the unstimulated side, neither before, nor after training. Thus, pairing the activation of only brain dopaminergic and sertotonergic (Ddc-GAL4>UAS-CsChrimson, teashirt-GAL80, Figure 4e), only MB dopaminergic neurons (58E02-GAL4>UAS-CsChrimson, Figures 4f), only dopaminergic neurons(TH-GAL4>CsChrimson, Figure 5b), or only brain serotonergic neurons (Tph-GAL4>UAS-CsChrimson, teashirt-GAL80, Figure 5c) with a specific bend direction did not result in a significant difference in bend direction between the stimulated and the unstimulated side, neither before, nor after training. These results indicate that none of these neuronal subsets alone were sufficient to induce operant learning.

Since all of these genotypes contained the UAS-CsChrimson transgene, these results further suggest that any putative leaky basal CsChrimson expression in some unknown neurons is not sufficient to induce operant learning.

Similarly, the yoked control larvae (Ddc-GAL4>UAS-CsChrimson, Figure 4d) in which optogenetic activation of dopaminergic and serotonergic neurons was not paired with a specific bend direction did not result in a significant difference in bend direction between the stimulated and the unstimulated side, neither before, nor after training. This shows that simply optogenetic activation of dopaminergic and serotonergic neurons unpaired with bend does not bias bend direction.

We also compared Δ bends/min after training between the experimental and control genotypes and conditions and found that they were significantly different.

Thus, after training, there was a significant difference in Δ bend/min between

– the Ddc-GAL4>UAS-CsChrimson and the Ddc-GAL4>UAS-CsChrimson, teashirt-GAL80 (Figure 4h).

– the Ddc-GAL4>UAS-CsChrimson and the 58E02-GAL4>UAS-CsChrimson (Figure 4h).

– the Ddc-GAL4>UAS-CsChrimson paired larvae and the yoked controls (Figure 4h).

– the Tph-GAL4>UAS-CsChrimson and the Tph-GAL4>UAS-CsChrimson, teashirt-GAL80 (Figure 5d).

These results are consistent with the idea that only the complete set of serotonergic neurons is sufficient to induce operant learning. In the absence of activation of, either all serotonergic neurons, or just nerve cord serotonergic neurons, we did not observe operant learning.

Finally, to demonstrate the reproducibility of operant learning, we also repeated the learning experiments on a different, low-throughput, single-larva tracker (Schulze et al., 2015) by pairing a specific bend direction with red light, either in the Ddc-GAL4>UAS-CsChrimson larvae, or in larvae in which UAS-CsChrimson was present but Ddc-GAL4 was absent (Figure 4–figure supplement 3).

As before, we found that pairing optogenetic activation of dopaminergic and serotonergic neurons (Ddc-GAL>UAS-CsChrimson larvae) with a specific bend direction, resulted in a significant increase in bends/min towards the stimulated side relative to the unstimulated side, after training, but not before, indicating operant learning has occurred (Figure 4–figure supplement 3d).

In contrast, there was no significant increase in bends/min towards the stimulated side relative to the unstimulated side, neither after, nor before training in the UAS-CsChrimson effector control larvae (Figure 4–figure supplement 3e). These results further support the idea that any putative leaky basal CsChrimson expression in some unknown neurons is not sufficient to induce operant learning.

Furthermore, after training, there was a significant difference in Δ bend/min between Ddc-GAL4>UAS-CsChrimson and the UAS-CsChrimson control larvae (Figure 4–figure supplement 3f). This confirms that optogenetic activation of Ddc serotonergic and dopaminergic neurons can induce operant learning.

These results and quantifications are shown in the new Figure 4–figure supplement 3.

5) It would improve the accessibility of the learning induced change of behavior if the authors could show the pre vs post training results for each run (10-12 larva in a plate). Further, they should plot the numbers of reinforced behaviors in each of the training protocols and relate it to the test performance.

We performed a per-run analysis on the multi-larva Ddc data. Average sample size, per run was 5 animals, so we can’t run statistics on this basis. To address the suggestion of plotting the number of reinforced behaviours in each training protocol and relate it to test performance, we have included the new Figure 4 – Supplement 2 that shows the full experiment data for each genotype in Figure 4. This full data includes all training windows in between the tests.

6) The presented data clearly suggests a decrease of the unstimulated bending rather than a change in the reinforced behavior. Though the authors mention it, they do not explain or discuss it. It will be very important for the logic of the manuscript that the authors explain this phenomenon and how it relates to operant conditioning (see point 3).

In the last paragraph of the Results section titled “Fictive reward can facilitate operant conditioning of larval bend direction”, we further discuss the observed result in the context of existing evidence for absence learning in larval classical conditioning.

“Further dissection of bend rates to each side showed that, after training, bend rates averaged together for larvae that received uncorrelated training (mean=4.80, sd=2.39, n=160) were indistinguishable from the rate of pair-trained larvae bending to the previously stimulated side (mean=4.84, sd=2.40, n=143) (p>.5; Figure 4G). However, larvae that received uncorrelated training showed a significantly higher bend rate (mean=4.80, sd=2.39, n=160) compared to pair-trained larvae bending to the previously unstimulated side (mean=4.10, sd=2.23, n=143) (p=.0037, CLES=.58; Figure 4G). This suggests that the pair-trained Ddc>CsChrimson larvae have learnt to avoid the unstimulated side. There is growing evidence from classical conditioning that larvae can learn that an unpaired CSpredicts the absence of reinforcement (Schleyer et al., 2018; Eschbach et al., 2020). Perhaps larvae are also forming memories of opposite valence in our operant conditioning paradigm, bending less to the unstimulated side because bending to that predicts the absence of appetitive Ddc activation.”

7) Though the manuscript discusses most of the data carefully, in my view the authors miss an important issue: it remains to be shown if fly larva are capable of operant learning using external reward or punishment. The presented evidence is based on artificial activation of neurons, which arguably is a hint but not a prove that operant conditioning is withing the repertoire of a fly larva, an issue the authors should mention and discuss.

We have added new sentences in the Discussion stating the limitations of artificial stimuli:

“It will also be important to determine whether conditioning with a fictive odour stimulus changes larval responses to natural odours. For example, larvae showing reduced attraction to Or42b activation may show reduced attraction to natural odours that activate Or42b neurons (e. g. ethyl acetate)”

“There are limitations to interpreting behaviour following fictive neuronal activation. It will therefore be important to replicate the new paradigms developed with this rig using lower-throughput methods with natural stimuli. For example, one might modify our multi-larva tracker to accommodate closed-loop presentation of real, innately appetitive gustatory stimuli by using closed-loop control of microfluidic devices”

Reviewer #2 (Recommendations for the authors):

In addition to the points raised in the public review:

– In figure 2, I was surprised to see that the responses elicited by the same Gal4 are so different when stimulated optogenetically or thermogenetically for both lines. Can the authors try to give an explanation?

The finding that different activators have different effects on the levels and dynamics of behaviour evoked could, in part, be explained by the different biophysical properties of these channels. The amount of current that enters, saturation kinetics and the duration of channel opening are all likely different. This could influence the probability and duration of each action.

By fitting a heating camera onto our system, we also show that thermogenetic activation is slower than optogenetic and different rates of activation could also influence the behavioural response.

Additionally, the sensory modality used to activate the neurons (light or mild heat) could interact with the pathways that are being activated linearly or non-linearly, resulting in distinct probability and dynamics of behaviour. For example, the increased bending in control animals (attp2>CsChrimson), in response to IR stimulation compared to red light stimulation, suggests that mild heat is more aversive.

We have added a paragraph in the Results section entitled “Proof-of-principle experiments verify multi-larva training rig's stimulation efficiency” discussing some of these possibilities:

“The quantitative difference in these rolling responses compared to optogenetic activation of the same Gal4 drivers (Figure 2D) is not surprising. These effects are likely mediated by differing biophysical properties of CsChrimson and dTrpA1 channels including single channel conductance and open state lifetime (Pulver et al., 2009, Vierock et al., 2017). In further contrast to the proof-of-principle optogenetic experiments, the slower kinetics of tissue heating caused a ca. 4-5s second temporal delay between stimulus onset and behaviour onset (Figure 2E).”

And

“The high bending frequency of attP2>dTrpA1 control larvae during IR-induced stimulation is likely indicative of mild heat aversion.”

– I am intrigued by what would be the US under natural conditions. In the discussion the authors say that they did not manage to condition the larvae using sugar sensing neurons, could it be that in Drosophila larvae operant conditioning only works for sensory signals imputing directly to the VNC? Have they tried conditioning the larvae by associating one side bending with optogenetic activation of noxious stimuli (without eliciting rolling)? It might be good to expand in the discussion on the expected sensory nature of US enabling operant conditioning.

This is a very interesting idea, but the identity of teste-sensing neurons that may project to the VNC (maybe a subset of external sensory neurons) is not known. In order to look for sensory modalities that mediate reward signals in both operant and classical conditioning in Drosophila larvae, further systematic functional characterisation of individual peripheral sensory neurons is required, as well as the development of appropriate GAL4 lines for specific subsets.

We have elaborated on this point in the Discussion section entitled “Automated operant conditioning of Drosophila larvae” and suggested mechanisms by which it can be explored in the future:

“It is noteworthy that Nuwal et al., 2012 used optogenetic activation of sugar-sensing neurons to establish a walking direction preference in adult Drosophila. Although we were unsuccessful in using a similar US to condition larval bend direction (data not shown), our Ddc and Tph results suggest that other sensory rewards may mediate operant conditioning if the information retrieval occurs within the VNC itself. Investigating FoxP and pkc expression in larval neurons may aid in identifying candidate neuronal populations, given both genes' involvement in operant self-learning in adult Drosophila (Mendoza et al., 2014, Brembs and Plnendl 2008, Colomb and Brembs 2016).”

Finally, we had also performed preliminary experiments in which nociceptive MD class IV neurons targeted by the ppk-Gal4 driver were optogenetically activated during bends to one side to see whether these neurons could evoke aversive operant learning. We were unable to elicit an operant learning effect in these pilot experiments, as evidenced by no significant difference in bend rate between the previously stimulated and unstimulated sides after training (preliminary data not shown ). We cannot exclude that trying a range of different stimulation and training conditions with MD class IV neurons could give a positive result in the future, but it was beyond the scope of this study to explore this.

Reviewer #3 (Recommendations for the authors):

Recommended Revisions:

The experiments are solid and rigorously done. Most of the issues can be resolved with text clarification or additional discussion.

The best interpretation of the behaviors induced by expression in many dopaminergic and serotoninergic neurons is unclear: different neurons can have local functions – sometimes conflicting ones – so I am surprised that a very broad driver like DDC doesn't set up conflicting or non-specific reinforcement. I am also amazed that the timing works – a reward right after the bend could generate a different association than a potential punishment right before it. The interval between bends and the timing of the optogenetic reinforcement (assumed to be positive) relative to those bends should be discussed.

Within the Materials and methods section under “High-throughput closed-loop tracker > Optogenetic stimulation”, we had written “Because the LabVIEW application updated DMD projections at 20 Hz, the delay between behaviour detection and closed-loop optogenetic stimulation of individual larvae did not exceed 50 ms.” There was no additional delay added into the protocol. We have now added an additional sentence, below, to clarify this point within the Results section entitled “Operant conditioning of larval bend direction”:

“The time between the tracker detecting a left bend and light onset was no longer than 50ms.”

How many behavioral actions do you miss applying reward or punishment to? There are multiple larvae on the plate, and the bends must be detected and then the larva targeted – when you look at the videos later, what fraction of the bends that occur during the training periods were successfully reinforced?

As part of system development, we manually validated behaviour classifier performance. Within Table 1 (see Materials and methods), we show recall and precision values for several behaviours including bending. Bending recall with our software is 96.4%. We can therefore expect that 96.4% of all bends were detected and 3.6% were false negatives. The precision is 95.6%, i.e. 4.4% of detected bends were false positives. When correct bends were detected (i.e. true positives), the accuracy of left vs. right bending detection was 97.3%. In other words, only 2.7% of correctly identified bends were classified with the incorrect bending direction.

How was the training regimen selected? What about a longer, continuous period – or shorter breaks? Was there a minimum number of reinforced bends that had to occur to include a larva in the subsequent evaluation? Was the possibility that the un-reinforced epochs in the training regime result in forgetting (or learning that action does not reliably produce reward) considered?

This is a very interesting point and worth exploring in the future. We tried very few training regimens and since we obtained promising results, we continued to use the same protocol. We chose 4x3 min training rounds as we expected to get ca. 20 reinforced bends in that time period. There is a lot of scope for trying many different training regimens in the future. In particular, increasing the number of reinforced bends could yield better learning.

We do agree larvae could be extinguishing the memory in between training rounds. We introduced these breaks because we wanted to re-center the larvae that crawled to the edges. If some other method were used to prevent larvae from crawling to the edge, then these breaks could be omitted.

In this study, we did not select larvae for analysis based on a minimum number of reinforced bends during training, although this could be a good idea for future studies.

Important missing control: There have been reports that the UAS-Chrimson can have some basal/leak expression. What does the attP2>Chrimson + retinal control look like in the biasing for bend direction experiments (Figure 3B)? Even a low level of expression could serve as a reward and so this control should be tested. (The uncorrelated light control is also good, but does not rule out contribution from activation of non-serotonergic neurons.)

To address this point and the point about the need to reproduce our results in a different way, we reproduced the operant learning experiment using optogenetic activation on a different, low-throughput, single-animal tracker (Schulze et al., 2015). Using this system we paired specific bend direction with red light, either in Ddc-GAL4, UAS-CsChrimson larvae, or in the effector control larvae that had the UAS-CsChrimson transgene but not the Ddc-GAL4 (Figure 4—figure supplement 3).

As before, we found that pairing optogenetic activation of dopaminergic and serotonergic neurons (Ddc-GAL>UAS-CsChrimson larvae) with a specific bend direction resulted in a significant increase in bends/min towards the stimulated side relative to the unstimulated side, after training, but not before, indicating operant learning has occurred (Figure 4–figure supplement 3d).

In contrast, there was no significant increase in bends/min towards the stimulated side relative to the unstimulated side, neither after, nor before training in the UAS-CsChrimson effector control larvae (Figure 4–figure supplement 3e). These results support the idea that any putative leaky CsChrimson expression in some unknown neurons is not sufficient to induce operant learning.

Furthermore, after training, there was a significant difference in Δ bend/min between Ddc-GAL4>UAS-CsChrimson and the UAS-CsChrimson larvae (Figure 4–figure supplement 3f). This confirms our finding that optogenetic activation of Ddc serotonergic and dopaminergic neurons can induce operant learning.

We have added new Figure 4 – figure supplement 3 with these results and a new section in the Results:

“We also used a previously developed, low-throughput, single-larva, closed-loop tracking system to test the reproducibility of this result on a different system (see Materials and methods for more details, Schulze et al., 2015). Fictive Ddc activation with this system also yielded a significant bend direction preference to the previously stimulated (mean=5.77, sd=2.71, n=109) versus previously unstimulated (mean=4.73, sd=2.73, n=109) side (p=.0043), after training. These results contrast those of control larvae that had the UAS-CsChrimson transgene but not the Ddc-GAL4. The effector control larvae show no bend prefference to either side after training. Based on these control larvae, we concluded that potential basal expression of CsChrimson in neurons outside of the Ddc expression pattern is not causing operant learning (Figure 4 —figure supplement 3).”

Finally, we also note that, only pairing of optogenetic activation of dopaminergic and serotonergic (Ddc-GAL>UAS-CsChrimson larvae, Figure 4c and Figure 4 —figure supplement 3d) or just serotonergic neurons (Tph-GAL4>UAS-CsChrimson, Figure 5a) with a specific bend direction, resulted in a significant increase in bends/min towards the stimulated side relative to the unstimulated side, after training, but not before.

For all other genotypes there was no significant difference in bends/min to the stimulated, compared to the unstimulated side, neither before, nor after training. Thus, pairing the activation of only brain dopaminergic and sertotonergic (Ddc-GAL4>UAS-CsChrimson, teashirt-GAL80, Figure 4e), only MB dopaminergic neurons (58E02-GAL4>UAS-CsChrimson, Figures 4f), only dopaminergic neurons (TH-GAL4>CsChrimson, Figure 5b), or only brain serotonergic neurons (Tph-GAL4>UAS-CsChrimson, teashirt-GAL80, Figure 5c) with a specific bend direction did not result in a significant difference in bend direction between the stimulated and the unstimulated side, neither before, nor after training. These results indicate that none of these neuronal subsets alone were sufficient to induce operant learning. Since all of these genotypes contained the UAS-CsChrimson transgene, these results further suggest that any putative leaky CsChrimson expression in some unknown neurons is not sufficient to induce operant learning.

We also compared Δ bends/min after training between the experimental and control genotypes conditions and found they were significantly different.

Thus, after training, there was a significant difference in Δ bend/min between

– the Ddc-GAL4>UAS-CsChrimson and the Ddc-GAL4>UAS-CsChrimson, teashirt-GAL80 (Figure 4h).

– the Ddc-GAL4>UAS-CsChrimson and the 58E02-GAL4>UAS-CsChrimson (Figure 4h).

– the Ddc-GAL4>UAS-CsChrimson paired larvae and the yoked controls (Figure 4h).

– the Tph-GAL4>UAS-CsChrimson and the Tph-GAL4>UAS-CsChrimson, teashirt-GAL80 (Figure 5d).

These results are consistent with the idea that only the complete set of serotonergic neurons is sufficient to induce operant learning. In the absence of activation of either all serotonergic neurons, or just nerve cord serotonergic neurons, we did not observe operant learning.

line 289 (and line 395): The use of necessity and sufficiency is a little confusing here. These are all ectopic manipulations. Optogenetic activation of all dopaminergic and serotoneric neurons (expressing DDC-GAL4, UAS-Chrimson) is capable of inducing increased bending. Activation of dopaminergic and serotonergic neurons in the brain alone (DDC-GAL4, UAS-Chrimson, tsh-LexA, LexOp-GAL80) does not. We don't know much about how these neurons contribute to normal operant conditioning, just that the ones in the VNC seem to be the critical ones for the optogenetic effect. It could be said that activation of serotonergic VNC neurons is sufficient to induce the optogenetic effect – but I would avoid any speculation of actual necessity. (line 375 described operant conditioning as "impaired" which is also confusing. The artificial operant conditions failed when VNC serotonergic neurons were not included. That is not the same thing.) line 413: optogenetic activation CAN serve, not DOES serve…. This all may be a difference of word use conventions among research studying learned vs. innate behaviors, but given the discussion about value of these terms (Gomez-Marin 2017, Yoshihara and Yoshihara 2018), it might be good to maximize clarity here.

We agree with these suggestions and have rephrased the relevant sections of the paper accordingly.

In response to the comment, we no longer state that our results “highlighted the necessity of dopaminergic or serotonergic neurons in the VNC for the formation of a bend direction preference”.

Instead, we now say that “dopaminergic and serotonergic neurons in the VNC appear critical to the bend direction preference formed following paired optogenetic activation of all Ddc neurons”. This new text can be found on line 425-426 of the new submission.

We have also changed the focus of our discussion of serotonergic neurons in the VNC and operant conditioning. We no longer state that “activation of the brain and SEZ is sufficient for classical conditioning, whereas the VNC is necessary for operant conditioning”.

Instead, we say that “Future experiments exclusively targeting a single serotonerig neuron per VNC hemisegment could be valuable in determining whether they are sufficient for operant learning.” This new text can be found on line 484-485 of the new submission.

Operant conditioning is measured as an increase in number of bends per minute or in the probability of bending toward the rewarded side. These are not directly comparable metrics to the performance index used in classical conditioning, but the operant effects, while statistically significant, seem very small (eg. Figure 4b vs. d). Is this an accurate observation and is there a useful contrast proposed?

We do agree that operant learning seems weaker in this case than classical conditioning. This could be a true limitation of the operant learning circuits compared to classical conditioning ones in the larva. Alternatively, it could be due the vast accumulated experience in the field about the best stimulation protocols and conditions for classical conditioning. It is likely that by exploring many different operant protocols in the future, far stronger learning could be induced.

I found the shifts between dopaminergic and serotonergic neurons, and between classical and operant conditioning experiments, a little challenging to follow. Please consider clarifying how the classical conditioning experiments contribute to the focus of this research that is suggested by the title – serotonergic neurons capable of operant conditioning. (Since it is clear early on that operant and classical conditioning are achieved by different neurons, it is not logical that the classical conditioning screen for subsets of dopaminergic or serotonergic neurons would turn up any useful candidates for dissecting operant circuits.)

We agree with this point. To address it, we have removed the manual classical conditioning screen experiments from the paper to reduce confusion. Instead, we have replaced them with a demonstration of a novel form of classical conditioning using our automated tracking system. This also addresses the flaw in the prior version that no real use was demonstrated for the combination of thermogenetic and optogenetic stimulation modules in learning.

We have adjusted the focus of the manuscript to highlight the advantages of our novel high-throughput multi-larva training system in demonstrating two new subtypes of associative learning in larvae: trace conditioning and operant learning.

We have added the new Figure 3 and the new section entitled: “Aversion to fictive Or42b develops after forward-paired trace conditioning”.

“Having verified the efficacy of optogenetic and thermogenetic stimulation in our system, we first studied whether these methods could be used to train larvae in a previously unexplored classical conditioning task that requires precise temporal control of both CS and US. […] These results show that our tracker can be used to perform automated, high-throughput classical conditioning in Drosophila larvae. To the best of our knowledge, these results also provide the first evidence that larvae can perform classical conditioning with significant (9s) offset-to-onset gaps between stimuli (i.e. trace conditioning).”

The Tsh-LexA, lexOp-GAL80 combination should reference Simpson 2016 J Neurogenetics; only the Tsh-GAL80 was published in Clyne and Miesenbock.

The Simpson 2016 J Neurogenetics reference has now been included in the text. Specifically, we now say that “[we] took an intersectional approach by targeting these transgenes with the LexA/LexAop binary system (Simpson, 2016) and expressing CsChrimson in Ddc neurons using Gal4/UAS”. This text can be found on line 409 of the new submission..

Associated Data

    This section collects any data citations, data availability statements, or supplementary materials included in this article.

    Supplementary Materials

    Figure 2—source data 1. Rolling, bending, and crawling behaviour for each larva over time (separated by genotype) - for data in top row of Figure 2d, e.
    elife-70015-fig2-data1.xlsx (665.3KB, xlsx)
    Figure 2—source data 2. Rolling, bending, and crawling behaviour for each larva over time (separated by genotype) - for data in middle row of Figure 2d, e.
    Figure 2—source data 3. Rolling, bending, and crawling behaviour for each larva over time (separated by genotype) - for data in bottom row of Figure 2d, e.
    Figure 2—source data 4. Recorded temperatures during larval IR heating.
    Figure 3—source data 1. Behavioural data recorded during the testing period of associative conditioning experiments.
    Figure 4—source data 1. Source data showing that operant conditioning of bend direction in Drosophila larvae requires the ventral nerve cord.
    elife-70015-fig4-data1.xlsx (245.7KB, xlsx)
    Figure 4—source data 2. Source data showing that Drosophila larvae exhibit bend direction preference during operant paradigm training.
    Figure 5—source data 1. Source data showing that serotonergic neurons may mediate operant conditioning.
    Transparent reporting form

    Data Availability Statement

    All data used to generate figures 2-5, as well as all figure supplements, are now submitted as source data files. We also now submit CAD drawings for the multi-larva tracker.


    Articles from eLife are provided here courtesy of eLife Sciences Publications, Ltd

    RESOURCES