Skip to main content
NIHPA Author Manuscripts logoLink to NIHPA Author Manuscripts
. Author manuscript; available in PMC: 2012 Dec 3.
Published in final edited form as: Nat Methods. 2012 Jan 15;9(3):290–296. doi: 10.1038/nmeth.1853

Controlling airborne cues to study small animal navigation

Marc Gershow 1, Matthew Berck 1, Dennis Mathew 2, Linjiao Luo 1, Elizabeth A Kane 1, John R Carlson 2, Aravinthan DT Samuel 1,3
PMCID: PMC3513333  NIHMSID: NIHMS421310  PMID: 22245808

Abstract

Small animals like nematodes and insects analyze airborne chemical cues to infer the direction of favorable and noxious locations. In these animals, the study of navigational behavior evoked by airborne cues has been limited by the difficulty of precise stimulus control. We present a system that enables us to deliver gaseous stimuli in defined spatial and temporal patterns to freely moving small animals. We use this apparatus, in combination with machine vision algorithms, to assess and quantify navigational decision-making of Drosophila larvae in response to ethyl acetate (a volatile attractant) and carbon dioxide (a gaseous repellant).

INTRODUCTION

Olfaction is a sophisticated sensory modality. Odor plumes from sources in an animal’s environment are carried and mixed by chaotic air currents before reaching an animal’s olfactory organ. From a complex olfactory signal – the time-varying activity of a panel of olfactory neuronal types – an animal strives to locate and discriminate odor sources13.

Olfactory computation may be dissected using small invertebrates like C. elegans and Drosophila with small circuits, simple behaviors, and amenability to genetic manipulation4,5. Quantitative behavioral analysis, an important step in defining olfactory computations, is complicated by the difficulty of delivering precise airborne stimuli to freely moving animals. Classical behavioral assays for these animals quantify migration towards or away from droplets of odor69. In these assays, it is difficult to reconstruct olfactory stimulation at all points along an animal’s trajectory, control the spatiotemporal properties of the gradient, or use gases like carbon dioxide that are not liquid at room temperature. An alternative is to deliver waterborne stimuli using microfluidic devices engineered to the shape and movements of each animal. Such devices constrain behavior to their specific geometries1012 and do not easily accommodate many animals including insect larvae.

We present a device (Fig. 1a) that allows us to deliver airborne cues in defined spatial and temporal gradients to freely behaving animals. An array of miniature solenoid valves injects odorant cues into a laminar airflow directed across an experimental arena. The amount of airborne cue that is injected at each point can be dynamically regulated during each experiment. Our device, in combination with custom machine-vision software – the Multi-Animal Gait and Track Analyzer (MAGAT Analyzer) – allows us to quantify navigational decision-making of small animals in response to airborne cues with higher precision, thoroughness, and throughput than has been possible with previous methods.8,9 Here, we examine Drosophila larva chemotaxis to an airborne attractant (ethyl acetate, EtAc) and repellant (carbon dioxide, CO2), discovering similarities between the larva’s response to these gaseous cues and its navigation of thermal gradients.

Figure 1. Apparatus design and performance.

Figure 1

(a) Apparatus design. The upper image shows a schematic of the device. Clean airflow is regulated by a mass flow controller (MFC) into the rear of the apparatus. For EtAc experiments as shown, a second MFC controls airflow through a bubbler containing EtAc. Odorized air is injected into points across the laminar airflow within a mixing block using a solenoid valve manifold. The laminar airflow odorized with a spatial gradient of EtAc in the mixing block then passes into an observation chamber containing an experimental arena with transparent ceiling, allowing visualization of animal behavior inside the arena with a CCD camera. (Lower) Semi-transparent isometric projection of custom machined components of the apparatus, including solenoid valve manifold (green), mixing block (purple), experimental arena and observation chamber (grey), and outlet (pink). The direction of air flow (y-axis) is indicated, as is the direction of the gradient (x-axis). The odor gradient arrow points to higher concentration in the experiments described in the text.(b–c) The plots show direct measurement of the precision of linear spatial gradients of EtAc (b) or CO2 (c) within the experimental arena. Gas concentration was measured at specific points in the experimental arena across the airflow (x-axis) at different distances from the inlet to the arena (y-axis). (d) Measurement of CO2 concentration at inlet and outlet during a 10 minute temporal triangle ramp from 0 to 5% concentration.

RESULTS

Gradient Generation

Our device creates airborne gradients in a 25 cm square arena, allowing extended observation of many animals per experiment, surpassing the throughput of single animal methods8,13. A slow laminar airflow (1.2 cm/s) is directed along the y-axis of the arena. A row of miniature solenoid valves spaced 8 mm apart is used to generate gradients along the x-axis. When each valve is open, a dose of gaseous cue is injected at a specific point along the x-axis into the airflow. The opening of the valves and the odor-carrying airflow may be used to generate defined spatial and temporal gradients of any gaseous cue (Online Methods, Supplementary Note 1).

To characterize the gradients within the arena, we substituted its glass lid with an aluminum plate fitted with miniature gas detectors. We imposed a linear gradient by programming the fraction of time each valve was open to be in proportion to its position along the x-axis. With either EtAc (Fig. 1b) or CO2 (Fig. 1c), we found that the deviation from linearity was less than 3% of the mean concentration in the region where the behavioral experiments were performed.

To generate temporal gradients, we mixed odor into the airstream before it entered the device, controlling the odor flow rate into the airstream while monitoring odor concentration at the chamber inlet and outlet (Supplementary Note 2, Supplementary Fig. 2, Fig 1d). The concentration is constant across the x-axis, as the odor is mixed into the airstream prior to entry into the flow tubes that are used to define a spatial gradient. Along the y-axis, the concentration varies as the time-varying odor profile is pushed across the chamber by the moving air flow. We measure a time lag between the detection of an odor change in the inlet and the outlet that corresponds to the flow rate of the gas in the chamber. Thus, the concentration at any point in the chamber is given by the formula: C(y,t)=Cinlet*(ty/vftd ), where vf is the flow speed in the chamber and td is time it takes gas to flow from the inlet to the flow chamber entrance.

Behavioral Analysis

The trajectories of crawling Drosophila larvae are characterized by periods of forward movement (runs) that are interrupted by turns. Recently, we used a high-resolution tracking microscope to follow individual Drosophila larvae on temperature gradients13. We showed that a larva biases the frequency, direction, and size of turns to move towards favorable temperatures. Here, we sought to achieve the same resolution of behavioral analysis in a multi-animal experiment2225. To do this, we developed the MAGAT Analyzer software package to follow many larvae in parallel (Supplementary Video 1, Supplementary Fig. 1, Supplementary Software 1), determining the behavioral state of each larva (running, turning, sweeping the head) at all times (Supplementary Note 3, Fig. 2a–b, Supplementary Video 2–6). The MAGAT Analyzer quantifies the navigational performance of individual animals. By collecting navigational statistics across populations of animals, we can then uncover behavioral strategies.

Figure 2. Response to Spatial Gradients.

Figure 2

(a) Image sequence of a wild-type second instar larva crawling from left to right over 80 seconds (upper). Blue dots represent the midpoint of the larva every 200 ms. Still frames (lower) highlight two turns in which the larva achieves heading changes. Red and yellow lines indicate the contour and midline of the larva. (b) Metrics derived from the track show in (a) and used to determine behavioral state over time. The dotted and dashed boxes outline the times for the corresponding frames shown in (a). Horizontal lines are hysteretic thresholds for run determination (top panel), threshold for run determination (middle panel) and hysteretic thresholds for head sweep determination (bottom panel). (c) Trajectories (40 selected for each condition) of larvae navigating linear gradients of EtAc (top, 2 ppm/cm) and CO2 (bottom, 2500 ppm/cm). Trajectories are displaced to start at the same point (red dot). Single trajectories are highlighted in red. (d) Navigational indices for wild-type and mutant larvae navigating gradients of varying concentrations of EtAc and CO2 as indicated. Error bars represent standard error. +++/−−−, ++/−− reject the hypothesis that the navigation index is closer to 0 than +/−0.1, +/− 0.05 respectively at p < 0.01 using one tailed t-test, * rejects the hypothesis that the navigation index is 0 at p < 0.01 using two tailed t-test.

We characterized the navigational strategies of the Drosophila larva in response to EtAc and CO2 using defined spatial and temporal gradients. First, we examined the response to EtAc, a volatile attractant 15, in linear spatial gradients with defined steepness 6. We placed larvae in the middle of each gradient and quantified the resulting trajectories (Fig. 2c). Throughout this study, we used a compass in which 0° indicates movement up the gradient (+x direction), 180° indicates movement down the gradient (−x direction), +90° indicates movement upwind, orthogonal to the gradient (+y direction), and −90° indicates movement downwind, orthogonal to the gradient (−y direction). To quantify the overall navigational response in each linear spatial gradient, we computed a navigational index by dividing the mean velocity of all larvae in the x-direction, 〈vx by the mean crawling speed, 〈s〉:

index=vxs [1]

Hence, the navigational index was +/−1 if the larvae crawled uniformly straight up/down the gradient and 0 if the movement was unbiased. This index (Fig. 2d) was significantly greater than 0 across three EtAc gradient steepnesses that we studied, showing that chemotaxis towards EtAc persists over two orders of magnitude in EtAc concentration.

We performed two control experiments without odorant, one in which the valves injected clean air into the laminar flow and one in which no laminar flow was provided (Fig. 2d). In both cases, the navigational index in the x-direction was zero. We also tested Orco1 larvae, which lack function in all olfactory neurons14 and failed to navigate EtAc gradients (Fig. 2d).

Next, we examined the response to carbon dioxide, a gaseous repellant15, in linear spatial gradients with different steepnesses. The navigational indices were negative (indicating repulsion) and strongly dependent on steepness (Fig. 2d). Tenfold reduction in steepness essentially abolished navigation away from CO2. We verified that a loss-of-function mutation in Gr63a, a required CO2 chemosensory receptor1517, disrupts CO2 avoidance (Fig. 2d).

To assess whether the larvae responded to the laminar airflow itself (i.e., exhibited rheotaxis), we computed the orthogonal navigational index, the mean velocity of all larvae in the y-direction divided by the mean crawling speed (Fig. 2d). In all cases, orthogonal indexes were nearly zero and uncorrelated with navigational indexes in the gradient direction, indicating that airflow does not disrupt the navigational response to the airborne cue.

Navigation in spatial gradients

What biases in the sequence of runs and turns along each trajectory enable the larvae to ascend EtAc gradients and descend CO2 gradients? The larvae’s heading during runs is an instantaneous measure of the angle of their forward movement. We calculated the fraction of time that larvae spent crawling in different directions on linear spatial gradients by making a histogram of run heading, and found that larvae spent the most time moving up EtAc gradients (Fig. 3b) and down CO2 gradients (Fig. 4b). Larvae also crawled slightly faster when heading up EtAc gradients than down (Fig. 3c) and crawled slightly slower when heading up CO2 gradients than down (Fig. 4c).

Figure 3. Navigation of a 2ppm/cm Ethyl Acetate concentration gradient.

Figure 3

For the data in this figure,10 experiments, 202 animals and 290 hours of behavior were analyzed. (a) The schematic depicts heading angles. 0° is towards higher concentration. (b) Relative probability of headings during runs. (c) Speed vs. heading during runs. (d) Turn rate vs. heading. (e) Durations of runs headed up (red, 1537 runs) or down gradients (blue, 1091 runs) (f) Heading changes during runs sorted by initial run direction: up gradients (red, 1499 runs), down gradients (blue, 1062 runs), orthogonal with higher concentration to the right (gold, 1354 runs), and orthogonal with higher concentration to the left (cyan, 1184 runs) (g) Heading changes achieved by turns, sorted, as in (f), on the basis of heading immediately prior to the turn (0° - 1201 reorientations; 180° - 1105 reorientations; 90° - 1214 reorientations; −90° - 1049 reorientations), (h) mean heading change achieved by runs (black line) and turns (colored line) vs. initial heading/heading prior to turn. (i) RMS turn angle vs. run heading prior to turn. The dashed and dotted lines in (e) and (f) represent the prediction and 95% confidence interval of the model described in methods. (j,k) Statistics of head sweeps during turns after runs headed orthogonal to the concentration gradient. The plots show probability of direction of the first head sweep (j) (1967 head sweeps) and probability that the larva initiates a new run during head sweeps (k) (2341 head sweeps). * rejects the hypothesis that the probabilities are the same at p<0.01 using Welch’s t-test. error bars and regions: (b,c) s.e.m. calculated as described in the methods, (d,e,f,g,j,k) s.e. derived from counting statistics (h,i) s.e.m.

Figure 4. Navigation of a 2500 ppm/cm Carbon dioxide concentration gradient.

Figure 4

For the data in this figure, 21 experiments, 168 animals, 31 hours of behavior were analyzed. (a) The schematic depicts heading angles. 0° is towards higher concentration. (b) Relative probability of headings during runs. (c) Speed vs. heading during runs. (d) Turn rate vs. heading. (e) Durations of runs headed up (red, 1494 runs) or down gradients (blue, 1866 runs) (f) Heading changes during runs sorted by initial run direction: up (red, 1484 runs), down gradients (blue, 1844 runs), orthogonal with higher concentration to the right (gold, 1651 runs), and orthogonal with higher concentration to the left (cyan, 1664 runs) (g) Heading changes achieved by turns, sorted, as in (f), on the basis of heading immediately prior to the turn (0° - 1196 reorientations; 180° - 1336 reorientations; 90° - 1306 reorientations; −90° - 1375 reorientations), (h) mean heading change achieved by runs (black line) and turns (colored line) vs. initial heading/heading prior to turn. (i) RMS turn angle vs. run heading prior to turn. The dashed and dotted lines in (e) and (f) represent the prediction and 95% confidence interval of the model described in methods. (j,k) Statistics of head sweeps during turns after runs headed orthogonal to the concentration gradient. The plots show probability of direction of the first head sweep (j) (2497 head sweeps) and probability that the larva initiates a new run during head sweeps (k) (3254 head sweeps). * rejects the hypothesis that the probabilities are the same at p<0.01 using Welch’s t-test. error bars and regions: (b,c) s.e.m. calculated as described in the methods, (d,e,f,g,j,k) s.e. derived from counting statistics (h,i) s.e.m.

We examined the rate at which larvae initiated turns as a function of heading on linear spatial gradients, and found that the probability of initiating a turn per unit time on linear gradients of EtAc (Fig. 3d) or CO2 (Fig. 4d) was a smoothly varying function of heading with maximum at 180° or 0°, respectively. Thus, larvae extended runs in favorable directions, up gradients of EtAc (Fig. 3e) and down gradients of CO2 (Fig. 4e). This strategy, termed the biased random walk, is also exhibited during E. coli chemotaxis18.

Drosophila larvae have been proposed to directly orient towards higher attractant concentrations during periods of forward movement8. To ask whether larvae steer within runs, we compared headings at the end and beginning of each run. If larvae were orienting during runs, we would expect that, on average, runs would end with more favorable headings than they began. We examined the angle change achieved during runs (final heading minus initial heading) as a function of initial headings (Fig. 3f, 4f). The mean heading change (Fig. 3h, 4h) during runs is nearly zero regardless of initial heading, so larvae do not appear to orient themselves during runs.

To examine whether larvae modulate the size and direction of turns to augment the number of runs in a favorable direction, we examined the heading change effected by each turn (Supplementary Video 5). When the larvae turned after a run up or down either EtAc (Fig. 3g) or CO2 gradients (Fig. 4g), the heading change distributions were bimodal and roughly symmetric but narrower when the larva was initially headed in the favorable direction. When the larvae turned after a run oriented perpendicular to the gradient, they did so with the same distribution of angular sizes to the left or right, but made more turns towards the favorable direction. For any given initial heading, the angular distribution of heading changes after turns could be modeled as the sum of two skew-normal distributions (detailed in Methods).

To further quantify how turns enhance orientation during navigation, we measured the moments of the heading change distributions as functions of initial heading. In contrast to the mean zero heading change achieved during runs, the mean heading change after turns (Fig. 3h,4h) showed significant biases (p < 0.01 using the model described in the methods) to orient the larvae towards higher [EtAc] or lower [CO2] after orthogonal runs. The root mean square heading change (Fig. 3i, 4i) showed larger heading changes in turns after runs pointed towards lower [EtAc] or towards higher [CO2].

During a turn, a larva will sweep its head to one side, after which it will either start a new run or initiate a new head sweep (Fig. 2, Supplementary Video 6). To uncover bias within these detailed head sweeping movements, we analyzed the statistics of all head sweeps initiated by larvae after runs pointed orthogonal to EtAc or CO2 gradients. In contrast to a recent report9, we found that the direction of the initial head sweep within each turn was unbiased by gradient direction (Fig. 3j,4j). However, the larva was more likely to initiate new runs during head sweeps that happened to point in the favorable direction (Fig. 3k, 4k).

Navigation in temporal gradients

The larva detects odors via the dorsal organ and CO2 via the terminal organ20. Since right and left dorsal and terminal organs are only separated by ~10 micrometers, the larva is less likely to detect spatial gradients by comparing the activity of the two sensory organs than by making temporal comparisons during its movements. Indeed, larvae with unilateral olfactory function performed chemotaxis towards volatile attractants8 nearly as well as larvae with bilateral olfactory function.

We used our system to determine whether the patterns of behavior exhibited on spatial gas gradients could be driven with temporal gradients of EtAc or CO2 concentration that were spatially uniform across the x-axis (Supplementary Fig. 2, Fig. 1d). Triangular waveforms with linearly increasing and decreasing gas concentrations over time mimic the temporal stimulus experienced by a larva crawling in a straight line up or down a linear spatial gradient. When subjected to increasing concentration of CO2 over time, larvae reoriented more frequently, crawled slower, and turned with larger angles (Fig. 5a) than when the concentration was decreasing, consistent with our observations of larvae on spatial gradients (Fig. 4c–d).

Figure 5. Temporal CO2 and EtAc gradients.

Figure 5

Statistics of turning decisions of larvae subjected to spatially uniform temporal gradients of CO2 delivered as repeating cycles of triangle waves (a) and steps (b,c) and of EtAc delivered as triangle waves (d) and steps (e). Upper panel in each plot shows one cycle of stimulus waveform. Raster plots indicate periods in which an individual larva was turning during the cycle, each row represents one larva tracked continuously through a cycle (a, n = 65, b n = 100 ea condition, c n = 50 ea condition, d,e n = 100 each condition) Lower panels show the turning rate and s.e. derived from counting statistics, mean crawling speeds and s.e.m. calculated as described in methods, and mean square heading change after turns and one s.e. vs. the time within each cycle. Data from wild-type larvae (Canton-S) are shown in (a,b,d and e). The step response of wild-type larvae and GR63a1 mutant larvae are compared in (c).

We further explored the sensorimotor response to CO2 using step stimuli (Fig. 5b–c). We found that a small temporal upstep or downstep in CO2 concentration produced a transient increase or decrease, respectively, in turning rate. Large steps in CO2 concentration were less adaptive, producing a sustained change in the turning rate. Very small concentration change (to 0.25%) did not affect turning rate but did modulate crawling speed. Crawling speed was slow to adapt for small concentration changes and did not adapt at all for large concentration changes. The fact that turning rate adapted differently than crawling speed might point to differences in the sensorimotor pathways between CO2 detection and the circuits that regulate crawling speed and turn initiation.

To verify lack of adaptation to changes in CO2, we extended the step waveform period to 480 s and still saw no evidence for adaptation in any response parameters (Fig. 5c). Mutants lacking the Gr63a sensor for CO2 showed minimal behavioral modulation to temporal changes in CO2 concentration (Fig. 5c). Thus, CO2 evoked changes in turning behavior and crawling speed were due to active sensorimotor responses and not a metabolic consequence of increased CO2 levels.

We examined larvae’s behavior in temporal gradients of EtAc. When subjected to a continuously increasing concentration of EtAc over time, larvae reoriented less frequently and turned with smaller angles (Fig. 5d), consistent with their behavior on spatial gradients (Fig. 3c, 3d). Changes in crawling speed induced by linear ramps of EtAc were not apparent (Fig. 5d). In contrast to the response to step changes in CO2 (Fig. 5b, c), the response to step changes in EtAc was adaptive across a wide range of concentrations (Fig. 5e). A temporal upstep (downstep) in EtAc concentration produced a transient decrease (increase) in the rate of turn initiation, slightly higher (lower) crawling speeds, and transient decrease (increase) in the size of turns (Fig. 5e).

DISCUSSION

Olfactory strategy

Animals may sense the direction of a local gradient either directly, for example by instantaneously comparing the activity of bilateral sensory organs, or by decoding temporal signals generated by moving their sensory organs through the gradient. Here we found evidence for the latter for both odor and CO2 gradients; larvae initiated turns more often when their forward movement caused an unfavorable change in concentration, and larva based their turning decisions on the favorability of changes encountered during head sweeps, homologous to our results in thermotaxis13. As in our studies of thermotaxis, we were able to use time-varying spatially uniform signals to evoke behaviors seen in spatial gradients. We did not see signs of direct gradient measurement; specifically, larvae did not steer during runs and did not favor the preferred direction in the first head sweep of a turn.

Comparison with other olfactory apparatus

Small animals like C. elegans and Drosophila larvae have become important systems for the study of olfactory and gas-mediated behavioral responses, motivating the need for new methods to precisely deliver airborne cues to behaving animals. Current behavioral assays for Drosophila larval olfaction use droplets containing specific odorants in closed dishes. However, evaporation, convection, and diffusion create spatially varying concentration gradients that change over time during each experiment. Droplet-based assays can be improved by calibrating the odor profile in closed plates using infrared spectroscopy8,9; however, non-liquid sources cannot be used, spatial or temporal gradients cannot be precisely defined, the odor profile cannot be held stable in time, and a relatively small experimental arena must be used, reducing throughput. Our device generates long lasting, stable, and highly reproducible spatiotemporal gradients of any gas, including carbon dioxide, a salient cue for Drosophila and the Anopheles mosquito17,21. The large experimental arena allows many animals to be studied simultaneously for extended periods of time. Our device also complements microfluidic systems 1012 by presenting odors in the gas, not liquid, phase, and by using a larger unstructured behavioral arena.

In any experiment involving odor and agar substrates, some odorant can be absorbed into the gel. Significant odorant absorption into the substrate could affect stimulus presentation during temporal gradients, but, as animals responded consistently to abrupt changes in odor concentration over the course of our experiments, the effect of odorant absorption did not appear to be significant. Our ability to present rapid changes in odor concentration was slightly compromised by the design of the reservoirs in the apparatus, but the 10–90% rise time for a sudden change (20.8 s) was smaller than the bin sizes in Fig. 5 (Supplementary Note 3). The rise time can be decreased by redesigning the reservoirs or increasing the flow rate. In experiments where we suddenly reversed the direction of the gradient (data not shown), larvae followed the new gradient direction, not the old, again indicating that any odorant absorption does not confound airborne navigation.

In any navigation experiment, asymmetry with respect to the arena boundary can confound the results. For example, in the absence of stimulus, larvae placed at the left edge of a plate will show a navigational bias to the right, because they are physically constrained from moving left. For this reason, we began each experiment with the larvae placed roughly in the center of the arena. Otherwise, as the spatial odor gradient in our apparatus is linear in the x-direction, constant in the y-direction, and steady in time, experiments in our apparatus are less sensitive to initial placement of the larvae than droplet-based assays.

The flexibility and accuracy with which our system provides airborne stimulants to freely moving animals, combined with machine-vision analysis that is sensitive to time-varying position and posture of each animal, enabled us to analyze the algorithmic structure of navigational behavior with new levels of precision. We determined the navigational strategies of larvae in response to EtAc and CO2, showed internal consistency between the behavioral response to spatial gradients and temporal gradients, and uncovered a nonadaptive response for temporal changes in CO2. The striking similarities between the algorithmic structure of navigational strategies during chemotaxis and thermotaxis suggest that homologous sensorimotor circuits might be used to encode larval navigation in response to diverse sensory inputs 13.

MATERIALS AND METHODS

Strains

Wild-type larvae were Canton-S. Gr63a1 (stock # 9941) and Orco1 (stock # 23129) flies were obtained from the Bloomington stock center. Note that Orco represents the new gene name for Or83b 19. All behavioral experiments were performed on second instar larvae. Adult flies were allowed to lay eggs on grape-juice agar growth plates with yeast for 3 hours. After egg laying, plates were kept at 22 °C on a 12 hour day/night cycle. Experiments were carried out at 22 °C during the day cycle or early hours of the night cycle. Time since egg laying was used to roughly stage larvae, and actual stage was verified by examining spiracle morphology.

Odor Gradient Apparatus

The odor gradient apparatus, illustrated in Fig. 1A, consists of a controlled clean air source, an odor source, an array of microcontroller activated valves, a mixing flow block, and a laminar flow chamber. Compressed air was regulated to 20 psi and cleaned with a charcoal filter (Agilent HT200-4), prior to delivery to a computer controllable mass-flow-controller (MFC) (Aalborg GFC 17). A second MFC was used to inject airborne chemical stimulants into the laminar airflow. For EtAc experiments, the second MFC injected air into a bubbler, consisting of a 250 mL glass bottle with a stainless steel cap and frit and containing EtAc (Mallinckrodt) either pure or diluted in deionized water. This generated an odorized air stream with the concentration of EtAc in the air determined by the concentration of EtAc in the bubbler. The water-EtAc mixture does not obey Raoult’s Law, so the EtAc vapor pressure of the mixture was measured directly using a photoionization detector (PID) (Baseline-Mocon Pidtech Plus). For CO2 experiments, pure CO2 was metered using an MFC calibrated for CO2.

The carrier air was injected into the rear of the mixing flow block. For temporally varying, spatially uniform stimuli (Fig. 1d, Supplementary Fig. 2), the outlet of the odor source was connected to the inlet of the mixing block at the same location as the carrier air. The total amount of odor in the chamber was set by adjusting the flow rate of odor while holding the carrier flow rate constant (generally 2 L/min). The odor concentration was monitored during each experiment at the inlet using either a PID or a nondispersive infrared (NDIR) CO2 sensor (co2meter.com, GSS C20).

For spatially varying, temporally uniform stimuli (Fig. 1b–c), the outlet of the odor source was connected to the inlet of the valve manifold. Compact solenoid valves (The Lee Co., LHDA1221111H) were used to meter odor through a section of teflon tubing into each flow tube in the mixing block. The valves were controlled by a custom circuit board based on SpokePOV (Adafruit Industries) and programmed to open for linearly increasing amounts of time over a period of approximately 1.5 s (Supplementary Software 2). The valves were operated in a pattern that kept exactly half open at any time, presenting a constant impedance to the MFC (Supplementary Fig. 3). The minimum continuous time a valve was opened or closed was therefore approximately 50 ms, while the valve switching time was 3 ms. The mean concentration of the gradient was set by varying the ratio of odor flow to carrier air flow and monitored at the outlet of the flow chamber by the appropriate gas sensor.

Diffusion smoothes any odor profile generated by the valves. Between the outlet of the mixing block and the start of the experimental arena, diffusion will have smoothed the profile with a length scale of 1.2 cm for ethyl acetate (EtAc) and 1.7 cm for CO2. By the far edge of the experimental arena, the smoothing length scale is 1.8 cm and 2.5 cm. Thus, spatial irregularities due to the discrete injection points are relaxed by the time the laminar airflow enters the arena, but the gradient itself is not dissipated before the airflow exits the arena.

The laminar airflow containing spatial or temporal gradients of EtAc or CO2 passed through an experimental arena made from a solid piece of black anodized aluminum. A glass lid provided a viewing window to observe behavior. A hinged, pneumatic compressor was used to press the glass ring against an O-ring, creating a reliable seal.

The integrity of all O-ring seals (at the inlet, outlet, and glass lid) was continuously verified by monitoring the airflow rate at the outlet.

Video microscopy of larvae within the experimental arena was performed using dark-field illumination with red LEDs (624 nm, outside the range of larval phototaxis) that were mounted at the perimeter of the experimental arena. Video was recorded at 5 frames per second using a 5 megapixel USB camera (Mightex BCE-B050-U) and an 18 mm focal length C-mount lens (Edmund Optics NT54-857). Each pixel in the captured images corresponded to a 0.063 mm × 0.063 mm square of the experimental arena.

Behavior Experiments

Before each experiment, larvae were staged, washed in phosphate buffered saline, and placed on 10 cm Petri dish containing clean 1% Bacto agar medium for at least five minutes to allow the larvae to adapt to the medium used in the experiments and shed any residual odorous contaminants. After each behavioral experiment, all larvae were discarded.

The substrate for the behavioral experiments was a ~4 mm thick Bacto agar gel (1%) on top of square flat black anodized aluminum plates (24 cm × 24 cm). Each plate with the gel on top could be placed in the experimental arena, providing a large uniform substrate for the larvae to navigate without edges to impede or distort airflow. Larvae were transferred from the 10 cm Petri dishes to the experimental arena using a paintbrush, the chamber was pneumatically sealed, and the entire apparatus was enclosed in a light tight box. After the chamber is pneumatically sealed, it takes ~30 seconds for the laminar airflow to fully purge the chamber and establish a defined spatial gradient. We discarded the first 2 minutes of recorded behavior during analysis. We recorded behavior for 25 to 30 minutes per experiment; for experiments involving spatial gradients, we analyzed the first 15 minutes (after the discarded 2) after which larvae started nearing the edges of the gradients.

Behavioral analysis

The MAGAT Analyzer software package is available as Supplementary Software 1 or (with example video recordings) from the Samuel Lab website -worms.physics.harvard.edu.

Larval positions and postures were extracted from video records using custom machine vision software written in C++ and based on OpenCV, an open-source computer vision software suite. With similar features as software that has been written to automatically follow C. elegans behavior 2225, our software tracks each animal throughout the arena and records an image of the animal, as well as the center of mass position, the outline of the body, the position of the head and tail, and of a midline running down the center of the animal (Fig. 2a, Supplementary Fig. 1, Supplementary Note 3). Using data analysis software written in MATLAB, we analyzed navigational statistics such as path curvature, speed, heading, and the angle of the head relative to the body (Fig. 2b). These were used to segment trajectories into an alternating sequence of runs and turns.

To calculate statistics involving center-of-mass movement along larval trajectories (e.g., distributions of instantaneous heading and speed shown in Figs. 3b–c and 4b–c and navigational indices in Fig. 2d) we needed to estimate the number of independent observations of quantities of center-of-mass movement along each larval trajectory. To do this, we calculated the autocorrelation function of the direction of motion, (t) = 〈(t) · (t + τ)〉t, and extracted the time constant, T, of its component of exponential decay, C(τ) ≈ eτ/T. This correlation time constant was typically ~20 s. To calculate the standard error of center-of-mass motion statistics, we estimated the number of independent observations as the total observation time for each measurement divided by twice the correlation time constant23.

To calculate the statistics of decision-making along trajectories, trajectories were segmented into a sequence of alternating runs and turns. Runs (Supplementary Video 4) were defined as continuous periods of forward movement with the head direction aligned with the direction of forward travel (Fig. 2b). A hysteretic threshold for run speed was determined on an individual animal basis by examining the speed near points of high curvature in the path; the speed to begin a run was higher than the speed to end one. The head was considered aligned with the direction of forward motion if the angle between the mid-head vector and the heading was less than 37 degrees. Turns separated successive runs. The initiation of each head sweep (Supplementary Video 6) during a turn was flagged when the body bend angle between the anterior and posterior of the animal exceeded 20° (Fig. 2b). Each head sweep ended when the body bend angle dropped below 10°, changed sign (the head swept to the other side of the body), or a new run began. Each turn ended at the start of a new run. Thus, each turn could involve zero or more head sweeps. Turns with zero head sweeps (i.e. pauses) were excluded from the statistics of reorientation after turns. Rare head sweeps in which the body bend angle was so extreme that the head touched the tail created difficulty during feature extraction because the tracker could no longer effectively distinguish head from tail. These head sweeps were also excluded from statistical analysis.

Video records of each larva along its trajectory could be played back, overlaid by the extracted contour, head tail, and path with annotations noting runs, turns, and head sweeps (Supplementary Videos 2,3). A subset of these videos was examined by eye to verify the performance of automated segmentation and analysis of larval trajectories.

Statistical model for heading change distributions after turns

To describe the distribution of heading changes after turns, we developed a statistical model to represent our observation that heading changes, Δθ, are biased in size and direction by head sweeping movements and contingent on the initial heading on spatial gradients before each turn, θi. In this model, the magnitude of heading change is drawn from skew-normal distributions whose mean and skewness depend on θi, thereby allowing the size of turns to depend on initial heading on spatial gradients as observed. The direction of heading change (to the left (Δθ > 0) or right (Δθ < 0)) is determined by a biased coin-flip distribution whose mean depends on θi, thus biasing the likelihood of initiating new runs to the left or right:

P(Δθ,θi)=(12-Asin(θi-θ0))×SN(Δθ,μ-Bcos(θi-θ0),σ,α-Ccos(θi-θ0))+(12+Asin(θi-θ0))×SN(-Δθ,μ-Bcos(θi-θ0),σ,α-Ccos(θi-θ0)) [2]

where

SN(x,μ,σ,α)=e-(x-μ)22σ22πσErfc(-α(x-μ)2σ2). [3]

We adjusted the parameters of the model (A, B, C, μ, σ, α, θ0) to maximize the likelihood of the observed initial heading – heading change pairs. The solid lines overlaying the histograms in Figs. 3h and 4h and the plots of heading change magnitude and direction in Figs. 3e,f and 4e,f represent predictions of the model fit (Eqs. 2, 3) to the experimental data.

For both EtAc and CO2, we assessed the statistical model represented by Eqs. 2 and 3 by also calculating the maximum likelihood of the observed data given null models that eliminated certain features from the full statistical model by setting one or more parameters to zero. We computed the logarithm of the ratios of maximum likelihood for the null model and full statistical model. These results are summarized in Supplementary Table 1. All null models could be rejected in favor of the full statistical model at p<0.01.

Supplementary Material

Supplemental Data

Acknowledgments

We thank E. Soucy and J. Greenwood for invaluable engineering advice and suggestions. This work was supported by a National Institute of Health (NIH) Pioneer Award to ADTS, NIH grants to JRC, and an NIH NRSA award to EAK.

Footnotes

AUTHOR CONTRIBUTIONS

MG, Designed and constructed LADY GAGA. Designed and wrote MAGAT Analyzer software. Designed and carried out experiments. Analyzed all data. Assembled all figures. Wrote manuscript.

MB, Designed and carried out experiments described in manuscript.

DM, Designed and carried out preliminary experiments.

LL, Designed and carried out preliminary experiments.

EAK, Designed experiments described in manuscript. Wrote manuscript.

JRC, Supervised project and designed experiments.

ADTS, Supervised project and designed experiments. Wrote manuscript.

References

  • 1.Brody CD, Hopfield JJ. Simple networks for spike-timing-based computation, with application to olfactory processing. Neuron. 2003;37:843–852. doi: 10.1016/s0896-6273(03)00120-x. [DOI] [PubMed] [Google Scholar]
  • 2.Cleland TA, Linster C. Computation in the olfactory system. Chem Senses. 2005;30:801–813. doi: 10.1093/chemse/bji072. [DOI] [PubMed] [Google Scholar]
  • 3.Hopfield JJ. Olfactory computation and object perception. Proc Natl Acad Sci U S A. 1991;88:6462–6466. doi: 10.1073/pnas.88.15.6462. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 4.Chalasani SH, et al. Dissecting a circuit for olfactory behaviour in Caenorhabditis elegans. Nature. 2007;450:63–70. doi: 10.1038/nature06292. [DOI] [PubMed] [Google Scholar]
  • 5.Masse NY, Turner GC, Jefferis GS. Olfactory information processing in Drosophila. Curr Biol. 2009;19:R700–13. doi: 10.1016/j.cub.2009.06.026. [DOI] [PubMed] [Google Scholar]
  • 6.Bargmann CI, Hartwieg E, Horvitz HR. Odorant-selective genes and neurons mediate olfaction in C. elegans. Cell. 1993;74:515–527. doi: 10.1016/0092-8674(93)80053-h. [DOI] [PubMed] [Google Scholar]
  • 7.Kreher SA, Mathew D, Kim J, Carlson JR. Translation of sensory input into behavioral output via an olfactory system. Neuron. 2008;59:110–124. doi: 10.1016/j.neuron.2008.06.010. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 8.Louis M, Huber T, Benton R, Sakmar TP, Vosshall LB. Bilateral olfactory sensory input enhances chemotaxis behavior. Nat Neurosci. 2008;11:187–199. doi: 10.1038/nn2031. [DOI] [PubMed] [Google Scholar]
  • 9.Gomez-Marin A, Stephens GJ, Louis M. Active sampling and decision making in Drosophila chemotaxis. Nat Commun. 2011;2:441. doi: 10.1038/ncomms1455. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 10.Chronis N, Zimmer M, Bargmann CI. Microfluidics for in vivo imaging of neuronal and behavioral activity in Caenorhabditis elegans. Nat Methods. 2007;4:727–731. doi: 10.1038/nmeth1075. [DOI] [PubMed] [Google Scholar]
  • 11.Lockery SR, et al. Artificial dirt: microfluidic substrates for nematode neurobiology and behavior. J Neurophysiol. 2008;99:3136–3143. doi: 10.1152/jn.91327.2007. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 12.Albrecht DR, Bargmann CI. High-content behavioral analysis of Caenorhabditis elegans in precise spatiotemporal chemical environments. Nat Methods. 2011;8:599–605. doi: 10.1038/nmeth.1630. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 13.Luo L, et al. Navigational decision making in Drosophila thermotaxis. J Neurosci. 2010;30:4261–4272. doi: 10.1523/JNEUROSCI.4090-09.2010. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 14.Larsson MC, et al. Or83b encodes a broadly expressed odorant receptor essential for Drosophila olfaction. Neuron. 2004;43:703–714. doi: 10.1016/j.neuron.2004.08.019. [DOI] [PubMed] [Google Scholar]
  • 15.Faucher C, Forstreuter M, Hilker M, de Bruyne M. Behavioral responses of Drosophila to biogenic levels of carbon dioxide depend on life-stage, sex and olfactory context. J Exp Biol. 2006;209:2739–2748. doi: 10.1242/jeb.02297. [DOI] [PubMed] [Google Scholar]
  • 16.Kwon JY, Dahanukar A, Weiss LA, Carlson JR. The molecular basis of CO2 reception in Drosophila. Proc Natl Acad Sci U S A. 2007;104:3574–3578. doi: 10.1073/pnas.0700079104. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 17.Jones WD, Cayirlioglu P, Kadow IG, Vosshall LB. Two chemosensory receptors together mediate carbon dioxide detection in Drosophila. Nature. 2007;445:86–90. doi: 10.1038/nature05466. [DOI] [PubMed] [Google Scholar]
  • 18.Berg HC, Brown DA. Chemotaxis in Escherichia coli analysed by three-dimensional tracking. Nature. 1972;239:500–504. doi: 10.1038/239500a0. [DOI] [PubMed] [Google Scholar]
  • 19.Vosshall LB, Hansson BS. A Unified Nomenclature System for the Insect Olfactory Coreceptor. Chem Senses. 2011 doi: 10.1093/chemse/bjr022. [DOI] [PubMed] [Google Scholar]
  • 20.Vosshall LB, Stocker RF. Molecular architecture of smell and taste in Drosophila. Annu Rev Neurosci. 2007;30:505–533. doi: 10.1146/annurev.neuro.30.051606.094306. [DOI] [PubMed] [Google Scholar]
  • 21.Cayirlioglu P, et al. Hybrid neurons in a microRNA mutant are putative evolutionary intermediates in insect CO2 sensory systems. Science. 2008;319:1256–1260. doi: 10.1126/science.1149483. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 22.Baek JH, Cosman P, Feng Z, Silver J, Schafer WR. Using machine vision to analyze and classify Caenorhabditis elegans behavioral phenotypes quantitatively. J Neurosci Methods. 2002;118:9–21. doi: 10.1016/s0165-0270(02)00117-6. [DOI] [PubMed] [Google Scholar]
  • 23.Cronin CJ, Feng Z, Schafer WR. Automated imaging of C. elegans behavior. Methods Mol Biol. 2006;351:241–251. doi: 10.1385/1-59745-151-7:241. [DOI] [PubMed] [Google Scholar]
  • 24.Swierczek NA, Giles AC, Rankin CH, Kerr RA. High-throughput behavioral analysis in C. elegans. Nat Methods. 2011;8:592–598. doi: 10.1038/nmeth.1625. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 25.Ramot D, Johnson BE, Berry TLJ, Carnell L, Goodman MB. The Parallel Worm Tracker: a platform for measuring average speed and drug-induced paralysis in nematodes. PLoS One. 2008;3:e2208. doi: 10.1371/journal.pone.0002208. [DOI] [PMC free article] [PubMed] [Google Scholar]

Associated Data

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

Supplementary Materials

Supplemental Data

RESOURCES