JoVE Neuroscience

Olfactory Behaviors Assayed by Computer Tracking Of Drosophila in a Four-quadrant Olfactometer

1, 2, 1

1The Solomon H. Snyder Department of Neuroscience, Center for Sensory Biology, Johns Hopkins University School of Medicine, 2MRC Clinical Sciences Center, Imperial College London

    Downloads Comments Metrics Publish with JoVE

    You must be subscribed to JoVE to access this content.

    Enter your email to receive a free trial:


    Enter your email below to get your free 10 minute trial to JoVE!

    By clicking "Submit", you agree to our policies.

    Admit it, you like to watch.



    We describe here a behavioral setup and data analysis method for assaying olfactory responses of up to 100 vinegar flies (Drosophila melanogaster). This system may be used with single or multiple olfactory stimuli, and adaptable for optogenetic activation or silencing of neuronal subsets.

    Date Published: 8/20/2016, Issue 114; doi: 10.3791/54346

    Cite this Article

    Lin, C. C., Riabinina, O., Potter, C. J. Olfactory Behaviors Assayed by Computer Tracking Of Drosophila in a Four-quadrant Olfactometer. J. Vis. Exp. (114), e54346, doi:10.3791/54346 (2016).


    A key challenge in neurobiology is to understand how neural circuits function to guide appropriate animal behaviors. Drosophila melanogaster is an excellent model system for such investigations due to its complex behaviors, powerful genetic techniques, and compact nervous system. Laboratory behavioral assays have long been used with Drosophila to simulate properties of the natural environment and study the neural mechanisms underlying the corresponding behaviors (e.g. phototaxis, chemotaxis, sensory learning and memory)1-3. With the recent availability of large collections of transgenic Drosophila lines that label specific neural subsets, behavioral assays have taken on a prominent role to link neurons with behaviors4-11. Versatile and reproducible paradigms, together with the underlying computational routines for data analysis, are indispensable for rapid tests of candidate fly lines with various genotypes. Particularly useful are setups that are flexible in the number of animals tested, duration of experiments and nature of presented stimuli. The assay of choice should also generate reproducible data that is easy to acquire and analyze. Here, we present a detailed description of a system and protocol for assaying behavioral responses of Drosophila flies in a large four-field arena. The setup is used here to assay responses of flies to a single olfactory stimulus; however, the same setup may be modified to test multiple olfactory, visual or optogenetic stimuli, or a combination of these. The olfactometer setup records the activity of fly populations responding to odors, and computational analytical methods are applied to quantify fly behaviors. The collected data are analyzed to get a quick read-out of an experimental run, which is essential for efficient data collection and the optimization of experimental conditions.


    The ability to adapt and respond to the external environment is critical for the survival of all animals. An animal needs to avoid dangers, seek out food and find mates, and learn from previous experiences. Sensory systems function to receive a variety of stimuli, such as visual, chemical and mechanosensory, and send these signals to the central nervous system to be interpreted and decoded. The brain then directs appropriate motor behaviors based on the perceived environment, such as foraging for food or escaping from a predator. Understanding how sensory systems detect the external world, and how the brain decodes and directs decisions, is a major challenge in neurobiology.

    Drosophila melanogaster is a powerful model system for investigating how neural circuits guide behaviors. Besides being simple and inexpensive to maintain, Drosophila exhibit many diverse and complex stereotyped behaviors, yet do so with a compact nervous system of about 100,000 neurons. Powerful genetic techniques exist for manipulating the Drosophila genome, and thousands of transgenic lines have been generated that selectively and reproducibly label the same subsets of neurons10-13. These transgenic lines can be used to selectively manipulate the activity of the labeled neurons (activate or inhibit), and these manipulations can be used to investigate how neural functions guide behaviors.

    Multiple behavioral assays have been developed for studying various Drosophila behaviors. Drosophila, like many animals, use their sense of smell for guiding many behavioral choices, such as finding food, finding mates, and avoiding dangers. Olfaction is therefore a good sensory system for investigating how external stimuli are detected and interpreted by an animal's nervous system to guide appropriate choices. As such, a number of assays have been developed for investigating larval and adult olfactory behaviors. Traditionally, olfactory behaviors in Drosophila were assayed by a two-choice T-maze paradigm, which can be used for assaying innate and learned olfactory behaviors3. In this assay, about 50 flies are given a choice between two tubes: one tube contains the odor in question and the other contains a control odorant (usually the odor solvent). The flies are given a set period of time to make a choice, and then the number of flies that are in the different chambers are counted. Although the T-maze is a simple assay for many experiments, there are several limitations. For example, olfactory behaviors are measured at only one time point, and different choices made before this time point are discarded. Similarly, the individual behaviors of the flies within the population are neglected. In addition, the T-maze requires manual counting of flies, which might introduce errors. Finally, since there are only two measured choices, this reduces the statistical power often required to detect subtle behavioral changes. An alternative to a two-choice T-maze is a four-quadrant (four-field) olfactometer14-18. In this assay, animals explore an arena in which each of the four corners of the arena is filled with a potential source of odorized air. The arena has a puckered star shape to maximize the formation of four experimentally defined odor quadrants. If odor is supplied in one of the corners then it is contained only in that one quadrant. The behaviors of the animals can be tracked as they enter and leave the odor quadrant, and easily compared to their behavior in the three control quadrants. The four-quadrant olfactometer assay thus records spatial and temporal behavioral response to the odor stimuli over a large experimental arena.

    The four-quadrant olfactometer was first developed by Pettersson et al.15 and Vet et al.17 to investigate the olfactory behavioral responses of individual parasitic Hymenoptera. Faucher et al.18 and Semmelhack and Wang16 adapted the setup to monitor the olfactory responses of individual Drosophila. The four-quadrant olfactometer is equally sensitive to attractive and repulsive responses, allowing for a wide range of test odorants and conditions. Custom-written fly tracking software, developed by Alex Katsov19 and currently maintained by Julian Brown (detailed in Materials), introduced additional advantages to more recent implementations of the four-quadrant olfactometer14,20-23. It is now possible to assay up to 100 flies simultaneously at high spatial (27.5 pixels/cm) and temporal (30 frames per sec) resolution, which allows extracting various parameters, such as position, speed and acceleration of flies at any time point. This enables investigations into the dynamics of the flies' behavioral responses to odors20. It should be noted, however, that the identity of individual flies within the population during the entire tracking period is not maintained. Instead, each fly track is recorded for as long as two fly tracks do not intersect. At which point, new tracks are assigned after the flies diverge. By incorporating other video-capturing software (detailed in Materials Table), the same configuration allows flexible tracking periods and could be used to track flies for up to 24 hr by taking images at a lower frame rate. This option was used to study egg-laying behaviors of flies and compare their body positions with ovipositional preferences14. The four-field olfactometer may also be used to study responses to multimodal (e.g. olfactory and visual) stimuli, or to combine optogenetic9 or thermogenetic21 stimulation with presentations of sensory stimuli. Furthermore, the high temporal resolution allows the extraction of trajectories for each individual fly in the ensemble data set. Therefore, the method allows investigation into olfactory-guided population behaviors and also individual social interactions. The data generated by this assay are robust and highly reproducible, allowing for the use of the four-field olfactometer for behavioral screens.

    We describe here the setup assembly for a four-quadrant olfactometer. We further demonstrate its use in assaying olfactory attraction in response to apple cider vinegar and repulsion in response to highly concentrated ethyl propionate. Finally, we describe and provide example code for the analysis of the recorded fly tracking data.

    Subscription Required. Please recommend JoVE to your librarian.


    1. Setup Assembly

    1. Manufacture the star-shaped arena (19.5 cm by 19.5 cm by 0.7 cm) out of polytetrafluoroethylene (PTFE) according to the provided drawing (Supplementary Materials, SupplementalSketch_StarShapedArena.pdf). The arena may be manufactured by a commercial or a custom facility.
    2. Acquire two glass plates (20.25 cm by 20.25 cm with thickness of 2 mm), and drill a hole (~0.7 cm in diameter) precisely in the center of one of the glass plates using a diamond-coated drill bit.
    3. Manufacture a light-tight behavior box for the behavioral arena. Also manufacture a light-tight camera box for the infra-red CCD video camera according to the provided drawings (Supplementary Materials, SupplementalSketch_LightTightBox.pdf). The boxes may be manufactured by a commercial or a custom facility.
    4. Mount the air conditioner unit on the posterior wall and the LED arrays on the side walls of the behavior box. Place the temperature probe in the behavior box through a side hole for real time temperature feedback and adjustment (see Figures 1 and 2 for details).
    5. Attach the IR filter and circular polarizer to the camera, and mount the assembly into the camera box. The behavior box and camera box are separated by a glass window for better temperature control of the behavior box (see Figures 1 and 2 for details).
    6. Connect the Infrared CCD camera to a camera adaptor. Connect the camera adaptor to a USB converter. Connect the USB converter to a USB port on the computer for data acquisition.
    7. Install the driver for the video converter on the computer according to the manufacturer's instructions. Optionally, install image processing software provided by the manufacturer of the USB video converter to access a wider range of camera settings and acquisition parameters.
    8. Connect the air conditioner unit (through "output" on the back of temperature controller) and the temperature probe (through "thermocouple" on the back of temperature controller) to the temperature controller. Place the probe into the behavior box.
      Note: The temperature control system in our layout is capable of maintaining the box temperature between 18 °C and 30 °C. Higher or lower ambient temperatures could be useful for thermogenetic (dTrpA1, TrpM8 or shibirets) experiments to manipulate neuronal activity or inhibit synaptic transmission. For most experiments, the temperature is maintained at 25 °C.
    9. Assemble the odor delivery system in the following steps (please see Figure 1B for detailed schematics and connection fittings):
      1. Use the air pressure regulator to control the air input from the central air system. Connect a carbon air filter (filled with charcoal) to the pressure regulator to purify the air from the central air system.
      2. Assemble the flow control system consisting of multiple channels regulated by high-resolution flowmeter tubes.
      3. Connect the output from the carbon air filter to the flowmeter tubes via a manifold as shown in Figure 1B and 2F. Direct the output of the flowmeter tubes through electronically controlled 3-way solenoid valves to regulate if clean air leaving the flowmeters is expelled into the room or entered into custom-made odor chambers24.
      4. Install the solenoid valve controller according to the manufacturer's manual.
    10. Install the electronic air flow meter by connecting it to a data acquisition device (DAQ) and a power supply according to the manufacturer's manual. Install the DAQ interface software to verify equal flow rates in each quadrant of the arena before every experiment.

    2. Olfactory Stimuli Preparation

    1. Prepare 5 odorant chambers24 that consist of a plastic outer container, glass inner container, a custom-made PTFE lid insert, original container lid with central part removed, and two one-way valves.
      Note: An O-ring around the PTFE lid could be used to prevent air leak from the odor chamber during odor perfusion. See Figure 1 for schematic and Figure 2 for photos of the chambers.
    2. Use four odorant chambers for solvent controls, and one chamber for a test odorant. Fill the glass containers with 1,000 µl of solvent or odorant dilution (test odorants + appropriate solvents, mix thoroughly before experiments), place the glass container inside the corresponding plastic chamber (do not spill out the liquid into the plastic chamber) and tighten the lid. Make sure to always use a clean chamber for the test odorant and solvent controls.
      Note: Olfactory attraction may be triggered by 1/16 dilution of apple cider vinegar (5% acidity) in water. In contrast, olfactory repulsion behavior may be studied by using a 10% dilution of ethyl propionate in mineral oil. Control stimuli in these cases are odor chambers with pure mineral oil.

    3. Fly Preparation

    1. Rear flies on standard cornmeal medium. Place 30 male and 30 female parental flies in a standard bottle, and let them lay eggs for 5 days at 25 °C or room temperature.
    2. For each experiment, collect newly eclosed (<1 day old) 25 male and 25 female flies under brief CO2 anesthesia.
    3. Keep flies in a vial with standard fly medium for 2-4 days.
    4. 40-42 hr before the experiment, transfer the flies without CO2 anesthesia to a vial with ~10 ml 1% agarose gel. This will keep the flies humidified without food, which helps to increase their locomotor activity.
      Note: More than 90% of the flies should survive the starvation. Some genotypes are less healthy and may not make it through a 40 hr starvation. In those cases, shorter periods such as 24-28 hr are acceptable but should be kept the same for all experimental conditions and repeats.

    4. Behavioral Responses to Attractive and Repellent Odorants

    1. Switch on the temperature controller and set it to 25 °C.
    2. Connect the odorant chambers (control and test odorants) by inserting the tubing to the outlet of odorant chamber and to the push-to-connect fitting on the behavior box.
    3. Check the flow rate in each quadrant by using the airflow meter to make sure that the control and odorant airstreams are equal to 100 ml/min.
    4. Clean the PTFE fly arena and the glass plates with 70% ethanol 2-3 times and allow them to fully air dry (~3-4 min).
    5. Affix the glass plates to the arena with clamps.
    6. Transfer flies without CO2 anesthesia into the arena through the hole in one of the glass plates. After the transfer, place a circular mesh on the hole to prevent flies from escaping.
      Note: CO2 anesthesia has been shown to affect Drosophila behavior25 and should not be used within 24 hr of a behavioral experiment.
    7. Place the arena with flies into the light-tight chamber, connect the four control air streams by connecting the tubing attached to the push-to-connect fitting on the behavior box to the arena corners, close the door of the chamber and wait 10-15 min to let the flies acclimatize to the new environment. If possible, switch the lights off in the room where the experiments are performed, to avoid possible minimal light leak that may bias the experimental outcome.
    8. Run a 5-10 min control experiment, in which flies are exposed to 4 control air streams.
    9. Analyze the data immediately (see Data analysis section below) to make sure that the flies are distributed uniformly in the arena, and the Attraction Index is close to 0. This step is essential, as it verifies that there are no uncontrolled sources of preference or avoidance within the arena (e.g. light leaking from the outside, uneven temperature distribution, uneven arena, odor contamination, etc.). If the flies are distributed unequally or their locomotor activity is low, discard the flies, clean the arena again (Step 4.4) and use a new batch of flies to repeat the experiment.
    10. Connect the test odorant chamber to the setup by switching on the 3-way valves or re-plugging the connector tubes.
    11. Run test experiment for 5-10 min and analyze the data as discussed in section 5 below (also see Reference 14 and Figure 3). Recordings longer than 20 min can result in data files that may be difficult to computationally process. If longer experimental recordings are desired, rapidly stop and re-start the tracking program. This results in a ~10 sec gap between experimental recordings.
    12. Discard flies.
    13. Clean arena and glass plates with 70% ethanol (Step 4.4), and replace connector tubes within the light-tight enclosure. To expedite experiments, a new clean arena can be used, and the dirty arena cleaned while performing experimental runs.
    14. Run another experiment with a new batch of flies, if required. If several experiments are run on the same day, take extreme care to ensure that no odorant is left in the system from a previous test run. This is normally not a problem with low concentrations of odorants or with CO2, but for highly concentrated stimuli up to a 24 hr gap between experimental runs may be needed. In addition, all tubing after the flow-tubes can be replaced if odorant contamination is suspected during control experiments. Always leave the dry air on between the experiments to continuously flush the system

    5. Data Analysis

    Note: The suggested fly tracking acquisition software (detailed in Materials), tracks flies in real time during acquisition, and saves the time stamp and coordinates of all detected flies in *.dat format. We have developed a custom-made Matlab routine to convert the data into a Matlab format, and to analyze the data. Code examples are provided in Supplementary Materials, but details of implementation will depend on the software used for data acquisition.

    1. Load the raw data. Create a spatial mask that follows the contours of the arena and apply the mask to the raw data to remove all data points that fall outside of the arena as they represent noise (Figure 4A, Supplementary Code MaskSpatialFiltering.m, Score.m, DrawCircularMask.m).
    2. Remove all data points that move at a speed below 0.163 cm/s for longer than 3s, as this data is likely to be noise or generated by non-moving flies (Figure 4B, Supplementary Code TemporalFiltering.m).
    3. Visualize remaining data points by plotting them out all at once or as single trajectories (Figure 3, Supplementary Code SingleTrajectoryViewer.m).
      Note: The location of odor boundaries in the four-field likely depends on a number of factors, such as the characteristics of each odorant and the airflow rates being used. For example, highly volatile odorants will likely fill the odor quadrant more fully than less volatile odorants. Thus it is likely that each odorant may exhibit slightly different odor boundaries. The use of a photoionization detector to measure odor boundaries can be problematic as it uses a vacuum to sample air from a particular spot, and so disrupts the odorant concentration at that spot. Nonetheless, odor boundaries can be quickly estimated based on fly behavioral data. For example, an odor boundary based on cumulated fly tracks in response to different odors can be clearly observed in Figures 3C and 3D.
    4. Calculate an attraction index to determine whether control experiments generate no preference response, and also to access the response to an odorant (or optogenetic9) stimulus. To calculate an Attraction Index (AI), use the last 5 min of a control or test recording. To obtain a measure of attraction that falls between +1 (absolute attraction) and -1 (absolute repulsion), the following formula is used to calculate the AI:
      Equation 1
      where Ntest is the number of data points in the test quadrant, Ncontrol is the average number of data points in the three control quadrants. This measure is intuitive as no preference would be indicated by near-zero values. However, it does not correctly indicate the proportion of the total number of flies that are located in the odorant quadrant. To obtain this measure, a Percentage Index (PI) may be used:
      Equation 2
      where Ntest is the number of data points in the test quadrant, and Ntotal is the total number of data points in all four quadrants. This formula provides a measure that falls between 0 and 1, with 0.25 corresponding to no behavioral preference (Figure 3E and 4C, Supplementary Code AttractionIndex.m).
    5. Run 5-10 repeats of each experimental condition, using a new group of flies for each repeat. Compare the attraction indexes between conditions or against controls by using the Kolmogorov-Smirnov non-parametric test (Figure 3F, kstest2 function in Matlab).

    Subscription Required. Please recommend JoVE to your librarian.

    Representative Results

    The four-quadrant olfactometer assay records and analyzes the walking activities of many flies over a large behavioral space. Odorants can be introduced into the air-streams that enter one, two, three, or all four quadrants. In the absence of odors, the flies will freely move between all four quadrants. This behavior is crucial to observe as it indicates that un-intentional biases have not been introduced into the assay. These biases can include light, temperature fluctuations, differences in air flow, or odor contaminants. Figure 3B shows the behavioral responses in the four-quadrant olfactometer of 25 male and 25 female flies to dry air. A single fly-track from the collected data is also highlighted in Figure 3B, and demonstrates that this fly was exploring the entire behavioral arena. The attraction index score (AI) for all the analyzed tracks over the 5-min test period is close to 0, indicating a lack of attraction to the odor quadrant. Similarly, the percentage index (PI) of the experiment is 0.24, indicating that flies were distributed fairly even in all four quadrants during the 5-min test period.

    The four-field behavioral response to an attractive odorant is shown in Figure 3C. Apple cider vinegar is introduced into the air stream of top-left odor quadrant air-stream by placing a 6.25% dilution of apple cider vinegar into the test odor chamber. The collected fly tracks shown in gray demonstrate that most flies collect in this odor quadrant, and no longer explore all four quadrants. A single colored fly track shows that once a fly enters the apple cider vinegar odor-quadrant, it tends to remain in the attractive odor quadrant. The AI of 0.94 for the experiment is close to 1 indicating strong attraction to this odorant. The PI of 0.92 indicates that 92% of the flies remained in the odor quadrant during the analysis period.

    The four-field behavioral response to a repellant odorant is shown in Figure 3D. A 10% dilution of the odorant ethyl propionate placed in an odor chamber was used as the odor source for the top-left air stream. The massed fly tracks for the analyzed experiment demonstrate avoidance of the odor quadrant, suggestive of odor-guided repulsion. A single colored fly track shows that a fly, when it entered the odor quadrant, quickly turned away to avoid the odor quadrant. The AI of -0.68 is less than 0, which indicates repulsion, and is close to -1, indicative of a strong repulsive odorant response. The PI of 0.06 for the experiment suggests that only 6% (as compared to ~25% in the neutral odor experiments) of the tracked fly data points were found in the odor quadrant over the course of the experiment.

    An attraction index is the most widely used metric for analyzing olfactory data since it allows scores greater than 0 to indicate attraction (positive) and scores less than 0 to indicate repulsion (negative). The closer the score is to +1 or -1, the stronger the attraction or repulsion to that odor, respectively. As described above, this metric may not clearly indicate the percentage or proportion of flies tracked to the odor quadrant over the course of the experiment. In which case, a Percentage Index may be more informative. Figure 3E diagrams the relationship between AI and PI scores, and how these numbers relate to attractive or repulsive behaviors.

    The four-field assay results in robust and reproducible olfactory behaviors. This allows for quantitative comparisons between control and experimental conditions as shown in Figure 3F, and also enables the identification of subtle olfactory responses that deviate from neutrality.

    Furthermore, as the data is obtained at high spatial and temporal resolution, it is possible to study numerous factors of behavioral responses, such as trajectories of single flies (as shown in Figure 3), as well as characterize different activity dynamics of the flies in an odor field (e.g., changes in direction and velocity19,20).

    It can often be difficult to position the four-field arena in the exact same location for each experiment, especially since frequent cleaning of the arena is required. The provided analyses scripts compensate for these slight variations by first fitting the data as shown in Figure 4A. In this case, the shape of the four-field arena is calculated, and data points that lie outside this space are removed. These tracked objects often represent debris or reflections that are erroneously tracked. As they do not lie within the arena and thus represent noise, it is important that these data points are removed to prevent erroneous data analyses. Similarly, it is also important to remove tracked data points that might represent noise or non-moving flies within the arena. To accomplish this, an analysis script is utilized (and provided here) that removes data points that essentially do not move (as shown in Figure 4B). These data points are usually in the minority, yet their retention would lead to errors in analyses.

    Attraction index and preference index scores can be calculated after a set time period (e.g. at the end of a 5 min experiment as shown in Figure 3). It should be noted, however, that since flies are tracked with high spatial and temporal resolution, similar analyses could be performed throughout the experiment. This is shown in Figure 4C in which the Attraction Index and Percentage Index scores are calculated in continuous 10-sec bins over the time period. Such analysis allows better appreciation of olfactory changes that might occur throughout the experiment, such as habituation to an odorant.

    Figure 1
    Figure 1: Schematic of the Four-quadrant Olfactometer. (A) The behavior setup is composed of an odor delivery system, temperature control system (not diagrammed), image acquisition system (IR LED lights and IR CCD camera connected to a computer), four-quadrant arena and light-tight behavior and arena boxes. The red circles designate the corresponding components shown in Figure 2. (B) Detailed design of the odor delivery system. The green characters represent the connection/conversion sizes of fittings. Tubes of 1/16 I.D. and 1/8 O.D. are labeled in yellow whereas those of 1/8 I.D. and 1/4 O.D. are labeled in pink. Abbreviations: IR, infrared; CF, Compression Fitting; BF, Barbed Fitting, MNPT, Male National Pipe Thread. Please click here to view a larger version of this figure.

    Figure 2
    Figure 2: Photos of the Olfactory Assay Setup. (A) Wide-field view of camera box and behavior box. (B) View inside the behavior box. The temperature probe, connector tubes, and IR LED arrays are labeled. (C) Four-quadrant arena. (D) Wide-field view of the odor delivery system connected to the behavior box. The camera box has been removed to reveal the CCD camera. (E) Central air is passed first through a pressure regulator and then through a carbon filter. (F) Example of the odor tubes connected to the manifold. (G) High-resolution flow tubes regulate the airflow. (H) The odor delivery tubing and connectors downstream of the flowtube regulators. (I) The solenoid valves regulate if clean air is passed through an odor chamber or expelled to the room. (J) The odor chambers are connected to one-way valves, and contain an inner glass container for the odorant. (K) The behavior box contains outside push-to-connect fittings that connect to the odor delivery tubing. Please click here to view a larger version of this figure.

    Figure 3
    Figure 3: Example Data Generated using a Four-field Olfactory Assay. (A) Schematic of the four-field arena. (B) Neutral responses are observed when all four quadrants contain only dry air perfusion. (C) Attraction responses to a 6.25% dilution of apple cider vinegar perfused from the left upper quadrant. (D) Repulsion behaviors triggered by 10% ethyl propionate. In Figure 2B-2D, a single trajectory from the acquired data is plotted. A color gradient is used to signify the time course of recording, with blue and red colors being the start and end of recordings, respectively. (E) Comparison of the Attraction Index (AI) and the Percentage Index (PI). (F) Average AI's of 3- 6 experiments with no odor (Control), Apple Cider Vinegar (ACV) and 10% Ethyl Propionate (EP). Error bars indicate SEM. Statistical difference was evaluated by the Kolmogorov-Smirnov test. Please click here to view a larger version of this figure.

    Figure 4
    Figure 4: Example Data Generated by the Data Analysis Steps. (A) Spatial filtering of the data, performed by MaskSpatialFiltering.m to remove data points that fall outside of the arena. Red circles show initial positions of the circles that are used to define the borders of the arena. Black circles are the final positions, acquired by fitting the circle outlines to the data (grey shaded area inside the four-field). Red dots and black arrowheads indicate data points that will be removed from the dataset after this filtering step. (B) Temporal filtering of data, performed by TemporalFiltering.m. This filtering step removes data points that move very slowly or not at all, as they are likely to be generated by non-moving flies or by dirt/reflections from the arena. A red dot surrounded by a dashed red box indicates positions of ~6,000 data points with identical coordinates that will be removed by this filtering step. (C) Attraction Index (AI) and Percentage Index (PI), calculated in 10-sec bins over the last 5 min of an experiment by AttractionIndex.m. Temporal profiles of these indexes contain information about the dynamics of behavioral responses and may be used for detailed analysis of behaviors. Please click here to view a larger version of this figure.

    Subscription Required. Please recommend JoVE to your librarian.


    The four-field olfactometer described here is a versatile behavioral system for studying the olfactory responses of large populations of wild-type and mutant Drosophila flies. Each experiment takes ~1 hr (including setup, experimental runs, and cleaning), and 4-6 experiments can be routinely performed each day. A typical assay using 40-50 flies for 5 minutes generates approximately 450,000 tracked data points for analysis. The described configuration may also be used, with minor modifications, to monitor movements of other insects or insect larvae in response to olfactory or other sensory stimuli over a time period, ranging from min to days. The four-quadrant assay is sensitive to the effects of both attractive and repulsive stimuli. Most odorants generate attraction indexes (AI) between -0.9 and +0.9 (Equation 1). An AI in the range of +0.5 to +1 signifies strong attraction behavior of the flies to the stimuli, whereas AI in the range of -0.5 to -1 is triggered by strong repellents. Generally speaking, a neutral response by control odors (dry air, humidified air, mineral oil) should fall between +0.1 and -0.1. The AI often changes throughout the course of the test experiment, reflecting the time flies require to walk into the odorant plumes, initial attraction and increase of locomotor activity towards a novel stimulus, and the eventual desensitization in response to the stimulus. Pre-test control runs are essential, and must be performed carefully to ensure that flies were distributed uniformly in the arena in the absence of the desired stimulus.

    Most frequent causes of spatial bias of flies in the arena are: uneven air streams, possibly due to disconnected tubing or inadequately clamped glass plates of the star-shaped arena (in our experience, flies are able to detect differences of airflow of as little as 15 ml/min); uneven temperature distribution across the arena, that may be improved by setting the air conditioner unit to generate weaker and more diffuse air flow and/or longer pre-acquisition period (~20 min) to ensure even temperature of the arena; minimal light leakage through the temperature probe opening, that may be reduced by sealing the opening with black tape; residual odor in the arena or in the air delivery system, in which case the setup (arena, flowtubes, fittings of the light-tight enclosure, etc) need to be cleaned thoroughly and allowed to dry for several days or replaced where possible.

    Maintenance of the olfactory equipment is important for reliable and consistent results. Push-to-connect fittings on the behavior box and air inlets and inner walls of the arena should be cleaned with ethanol after every experiment if strong odors are used, and allowed to dry fully. The glass plates should be washed three times with a 70% ethanol, which is usually sufficient to remove residual odor and dirt from the plates, but hexane is useful in removing organic compound deposited by flies (e.g., pheromones consisting of long hydrocarbon chains). Soap is generally not recommended because it usually contains aromatic components, which would affect olfactory behaviors. The behavior box should remain connected to the dry air inlets between experiments (e.g. overnight) to facilitate removal of the residual odors from the system.

    If the locomotor activity of the flies is low, they may generate too few data points, which often results in a noisy and variable Attraction Index. Longer starvation and recording times may help to solve this problem. In contrast, if the flies are sick, 24-28 hr of starvation would generally be sufficient for enhancing locomotion activity as long as it is consistent throughout experiments. There is a fine balance between maintaining a healthy state of the flies and increasing locomotion. 40 hr starvation may be used as a starting point, and later modified as needed based on the experimental results. Attraction Indexes will be somewhat affected by the duration of starvation, thus it is essential to starve all experimental animals for the same period of time in order to avoid confounding effects of starvation time. Longer starvation times usually make repulsive responses weaker (closer to 0), and attractive responses stronger. Dry air control air streams tend to desiccate the flies, and should not be used for longer than 40 min.

    The four-quadrant olfactometer may be used to study responses of single16,18 or multiple flies to a single stimulus or to study choice preference between stimuli. For example, different odors could be used in each of the four-quadrants. This could also be used to determine the responses to odor-mixtures by examining the boundaries of the odor-quadrants. It should be noted that even though the tracking system allows individual tracks to be isolated from the collected data, it is possible that individual flies may behave differently when assayed as part of a group than when they are tested alone. For example, groups of flies exhibit increased odor-guided repulsion due to physical interactions between flies26. The tracking system and layout can also be adapted for use in non-olfactory assays. The assay framework may easily accommodate an LED array9 for optogenetic stimulation, or a thermal plate27 for thermogenetics. The system may also be adapted to study behavioral choices of a time scale of many hr, for example to study egg-laying behaviour14. In this case, the acquisition frame rate needs to be adjusted to avoid the generation of large data files, and a source of humidity and substrate (1% agarose gel) need to be provided as egg-laying substrate.

    A limitation of this setup is that the flies are tracked as IR-reflecting objects in and below the arena- if any element of an optogenetic or thermogenetic experiment reflects IR, the irrelevant data points will need to be removed during post-processing. Currently it is also not possible to film flies at a spatial resolution that allows different flies to be continuously distinguishable, but this may be improved in the future by using more advanced video cameras. Another limitation of the current system is that the movement of flies is constrained to two dimensions to promote walking behaviors, and will prevent olfactory-induced flight responses.

    It should be noted that additional automated assays have also been developed to investigate the olfactory behaviors of single or groups of flies. The most similar design to the assay described here is a method developed by Beshel and Zhong28. In this assay, the responses of ~30 flies are monitored in a small circular arena (roughly a quarter the area of the four-field arena) in which odors are delivered from 1 of 4 odor ports along the arena wall, and removed through a hole in the center of the circular arena. Besides a smaller arena, other design differences include behaviors being performed under light conditions, and odorants mainly concentrating close to the odor ports (instead of throughout the odorant quadrant as directed by the puckered walls of the four-field arena). Nonetheless, the circular arena is a suitable method for screening olfactory responses of flies, and could be adapted to the fly tracking design described here.

    An alternative approach is to simultaneously monitor the activity of many single flies in response to odors. In the Flywalk assay, individual flies are placed in small tubes, and their responses tracked when odorants are perfused through the tube29,30. Changes in forward or reverse direction, or changes in velocities, can be utilized to gauge if an odorant is generally attractive or repulsive. This assay, like the four-field assay, automatically tracks fly movements, and so can be used to quickly measure olfactory responses to a wide-range of odors. However, unlike the four-field, complex motor dynamics, such as trajectory turning angles and potential social interactions, maybe missed in the Flywalk assay recording.

    Automatic tracking of single walking flies has also been adapted to a T-maze type assay31,32. In this assay, flies are placed in small chambers in which odors are perfused from either end of the chamber, and exit via a port in the middle of the chamber. The positions of the flies are also automatically tracked. This mimics, on a single fly scale, a T-maze framework. In combination with optogenetics, this assay has been particularly well suited for assaying neural circuits mediating olfactory learning and memory, and can also be used to gauge the olfactory preferences of single flies. Similar to Flywalk, it cannot monitor complex activity dynamics that might occur over larger spatial areas, such as those that occur during food-seeking14, or behaviors that occur only in fly populations.

    Subscription Required. Please recommend JoVE to your librarian.


    The authors declare that they have no competing financial interests.


    We thank Terry Shelley for manufacturing the fly arena and the light-tight enclosure, Liz Marr for help with fly stock maintenance, and Xiaojing Gao and Junjie Luo for help with the Matlab code used for data analysis. We thank Johan Lundström at the Monell Chemical Senses Center for demonstrating his odor delivery setup. This work was supported by grants from the Whitehall Foundation (CJP) and NIH NIDCD (R01DC013070, CJP).


    Name Company Catalog Number Comments
    Air delivery system  (Quantity needed)
    Tubing and connectors
    Thermoplastic NPT(F) Manifolds Cole-Parmer, IL, USA R-31522-31 1
    Hex reducing  nipple (1/4MNPT->1/8MNPT) McMaster-Carr, IL, USA 5232T314 1
    Tubing (ID:1/8) McMaster-Carr, IL, USA 5108K43 50 Ft
    Tubing (ID:1/16) McMaster-Carr, IL, USA 52355K41 100 Ft
    Barbed tube fittings McMaster-Carr, IL, USA 5117K71 1 pack
    Push-to-connect tube fittings McMaster-Carr, IL, USA 5779K102 4
    Barbed Tube Fittings (1/4MNPT->1/8BF) McMaster-Carr, IL, USA 5463K439 1 pack (10)
    Barbed Tube Fittings (1/8MNPT->1/8BF) McMaster-Carr, IL, USA 5463K438 2 pack (10) 
    Barbed Tube Fittings (1/8MNPT->1/16BF) McMaster-Carr, IL, USA 5463K4 2 pack (10) 
    Barbed Tube Fittings (1/4MNPT->1/4BF) McMaster-Carr, IL, USA   5670K84 1
    Hex head plug McMaster-Carr, IL, USA 48335K152 1
    Air pressure regulator, air filter and flowmeters (Quantity needed)
    Labatory gas drying unit W A HAMMOND DRIERITE CO LTD, OH, USA Model: L68-NP-303; stock #26840 1
    Multitube frames for 150 mm flowtubes Cole-Parmer, IL, USA R03215-30 1
    Multitube frames for 150 mm flowtubes Cole-Parmer, IL, USA R03215-76 1
    150 mm flowtubes Cole-Parmer, IL, USA R-03217-15 9
    Valve Cartridge Cole-Parmer, IL, USA R-03218-72 9
    Precision Air regulator McMaster-Carr, IL, USA 6162K13 1
    Soleniod valves Automate Scientific, Berkeley, CA 02-10i 4
    Solenoid valve controller ValveLink 8.2, Automate Scientific, Berkeley, CA 01-18 1
    Electronic flow meter Honeywell AWM3100V 1
    DAQ (NI USB-6009, National Instruments) and a  National Instruments NI USB-6009 1
    Power supply Extech Instruments 382200 1
    Odor chambers
    Polypropylene Wide Mouth jar 2 oz; 60 ml Nalgene 562118-0002 At least 5 are required per experiment, but a separate chamber is required for each dillution of each odorant. Available at Container Store, part #635114)
    Glass odor chamber, 0.25 oz Sunburst Bottle LB4B At least 5 are required per experiment 
    "In" valve for odor chamber Smart Products, Inc., CA, USA 214224PB-0011S000-4074 1 of these parts is used per odor chamber but they need to be replaced frequently
    "Out" valve for odor chamber Smart Products, Inc., CA, USA 224214PB-0011S000-4074 1 of these parts is used per odor chamber but they need to be replaced frequently
    O ring RT Dygert International, MN, USA AS568-029 Buna-N O-R 1 pack (100)
    Fly arena, camera and behavior boxes (Quantity needed)
    Behavior and camera box material Interstate plastics, CA, USA ABS black extruded ( 1803 sq inch
    Teflon for fly arena and odor chamber inserts, 3/8" thick, 12" x 12" McMaster-Carr, IL, USA 8545K27  1
    Glass plates, 1/8" Thick, 9" x 9" McMaster-Carr, IL, USA 8476K191  2
    Dual action thermoelectric controller WAtronix Inc, CA, USA DA12V-K-0 1
    IR LED array Advanced Illumination, Rochester, VT, USA AL4554-88024, PS24-TL 2 LED arrays and one power supply
    Air conditioner Unit Melcor Store  MAA280T-12 1
    Imaging system (Quantity needed)
    Cosmicar/Pentax C21211TH (12.5 mm F/1.4) C-mount Lens B AND H PHOTO AND ELECTRONICS CORP, NY, USA PEC21211 KP 1
    B+W 40,5 093 IR filter B AND H PHOTO AND ELECTRONICS CORP, NY, USA 65-072442 1
    TiFFEN 40.5 mm Circular polarizer Amazon 1
    IR Videocamera Industrial Vision Source, FL, USA Sony XC-EI50 (SY-XC-E150) 1
    USB video converter The Imagingsource, NC, USA DFG/USB2-It 1
    iFlySpy2 (fly tracking software) Julian Brown, Stanford, Calfornia: iFlySpy2 1
    IC Capture 2.2 software The Imagingsource, NC, USA (
    Miscellaneous (Quantity needed)
    Dremel rotary tool Dremel, Racine, WI, USA Dremel 8000-03  1
    Diamond-coated drill bits for glass cutting Available from various suppliers; MSC industrial Supply Co, Melville, NY 90606328 1


    1. Benzer, S. Behavioral mutants of Drosophila isolated by countercurrent distribution. Proc Natl Acad Sci U S A. 58, (3), 1112-1119 (1967).
    2. Thorpe, W. H. Further studies on pre-imaginal olfactory conditioning in insects. Proc R Soc B. 127, (848), 424-433 (1939).
    3. Tully, T., Quinn, W. G. Classical conditioning and retention in normal and mutant Drosophila melanogaster. J Comp Physiol A. 157, (2), 263-277 (1985).
    4. Anholt, R. R., Mackay, T. F. Quantitative genetic analyses of complex behaviours in Drosophila. Nat Rev Genet. 5, (11), 838-849 (2004).
    5. Vosshall, L. B. Into the mind of a fly. Nature. 450, (7167), 193-197 (2007).
    6. Wu, M. N., Koh, K., Yue, Z., Joiner, W. J., Sehgal, A. A genetic screen for sleep and circadian mutants reveals mechanisms underlying regulation of sleep in Drosophila. Sleep. 31, (4), 465-472 (2008).
    7. Dankert, H., Wang, L., Hoopfer, E. D., Anderson, D. J., Perona, P. Automated monitoring and analysis of social behavior in Drosophila. Nat Methods. 6, (4), 297-303 (2009).
    8. Branson, K., Robie, A. A., Bender, J., Perona, P., Dickinson, M. H. High-throughput ethomics in large groups of Drosophila. Nat Methods. 6, (6), 451-457 (2009).
    9. Aso, Y., et al. Mushroom body output neurons encode valence and guide memory-based action selection in Drosophila. Elife. 3, e04580 (2014).
    10. Pfeiffer, B. D., et al. Tools for neuroanatomy and neurogenetics in Drosophila. Proc Natl Acad Sci U S A. 105, (28), 9715-9720 (2008).
    11. Pfeiffer, B. D., et al. Refinement of tools for targeted gene expression in Drosophila. Genetics. 186, (2), 735-755 (2010).
    12. Venken, K. J., et al. Genome engineering: Drosophila melanogaster and beyond. Wiley Interdiscip Rev Dev Biol. (2015).
    13. Diao, F., et al. Plug-and-play genetic access to drosophila cell types using exchangeable exon cassettes. Cell Rep. 10, (8), 1410-1421 (2015).
    14. Lin, C. C., Prokop-Prigge, K. A., Preti, G., Potter, C. J. Food odors trigger Drosophila males to deposit a pheromone that guides aggregation and female oviposition decisions. Elife. 4, (2015).
    15. Pettersson, J. An aphid sex attractant. Insect Systematics & Evolution. 1, (1), 63-73 (1970).
    16. Semmelhack, J. L., Wang, J. W. Select Drosophila glomeruli mediate innate olfactory attraction and aversion. Nature. 459, (7244), 218-223 (2009).
    17. Vet, L. E. M., Lenteren, J. C. V., Heymans, M., Meelis, E. An airflow olfactometer for measuring olfactory responses of hymenopterous parasitoids and other small insects. Physiological Entomology. 8, (1), 97-106 (1983).
    18. 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. 209, (Pt 14), 2739-2748 (2006).
    19. Katsov, A. Y., Clandinin, T. R. Motion processing streams in Drosophila are behaviorally specialized. Neuron. 59, (2), 322-335 (2008).
    20. Gao, X. J., et al. Specific kinematics and motor-related neurons for aversive chemotaxis in Drosophila. Curr Biol. 23, (13), 1163-1172 (2013).
    21. Gao, X. J., Clandinin, T. R., Luo, L. Extremely sparse olfactory inputs are sufficient to mediate innate aversion in Drosophila. PLoS One. 10, (4), e0125986 (2015).
    22. Ronderos, D. S., Lin, C. C., Potter, C. J., Smith, D. P. Farnesol-detecting olfactory neurons in Drosophila. J Neurosci. 34, (11), 3959-3968 (2014).
    23. Riabinina, O., et al. Improved and expanded Q-system reagents for genetic manipulations. Nat Methods. 12, (3), 219-222 (2015).
    24. Lundstrom, J. N., Gordon, A. R., Alden, E. C., Boesveldt, S., Albrecht, J. Methods for building an inexpensive computer-controlled olfactometer for temporally-precise experiments. Int J Psychophysiol. 78, (2), 179-189 (2010).
    25. Colinet, H., Renault, D. Metabolic effects of CO2 anaesthesia in Drosophila melanogaster. Biology Letters. 8, (6), 1050-1054 (2012).
    26. Ramdya, P., et al. Mechanosensory interactions drive collective behaviour in Drosophila. Nature. 519, (7542), 233-236 (2015).
    27. Ofstad, T. A., Zuker, C. S., Reiser, M. B. Visual place learning in Drosophila melanogaster. Nature. 474, (7350), 204-207 (2011).
    28. Beshel, J., Zhong, Y. Graded encoding of food odor value in the Drosophila brain. J Neurosci. 33, (40), 15693-15704 (2013).
    29. Steck, K., et al. A high-throughput behavioral paradigm for Drosophila olfaction - The Flywalk. Sci Rep. 2, 361 (2012).
    30. Thoma, M., Hansson, B. S., Knaden, M. High-resolution Quantification of Odor-guided Behavior in Drosophila melanogaster Using the Flywalk Paradigm. J. Vis. Exp. (106), (2015).
    31. Claridge-Chang, A., et al. Writing memories with light-addressable reinforcement circuitry. Cell. 139, (2), 405-415 (2009).
    32. Parnas, M., Lin, A. C., Huetteroth, W., Miesenbock, G. Odor discrimination in Drosophila: from neural population codes to behavior. Neuron. 79, (5), 932-944 (2013).



    Post a Question / Comment / Request

    You must be signed in to post a comment. Please or create an account.


    simple hit counter