ArticlePDF Available

Abstract and Figures

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 behaviors(4-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.
Content may be subject to copyright.
Journal of Visualized Experiments
Copyright © 2016 Journal of Visualized Experiments August 2016 | 114 | e54346 | Page 1 of 10
Video Article
Olfactory Behaviors Assayed by Computer Tracking Of Drosophila in a Four-
quadrant Olfactometer
Chun-Chieh Lin1, Olena Riabinina2, Christopher J. Potter1
1The Solomon H. Snyder Department of Neuroscience, Center for Sensory Biology, Johns Hopkins University School of Medicine
2MRC Clinical Sciences Center, Imperial College London
Correspondence to: Christopher J. Potter at
DOI: doi:10.3791/54346
Keywords: Neuroscience, Issue 114, neurobiology, sensory biology, odorants, pheromones, olfactory behavior assay, Matlab, data analysis, vinegar
fly, motion tracking, four-field olfactometer
Date Published: 8/20/2016
Citation: 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.
Video Link
The video component of this article can be found at
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
Journal of Visualized Experiments
Copyright © 2016 Journal of Visualized Experiments August 2016 | 114 | e54346 | Page 2 of 10
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.
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
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.
Journal of Visualized Experiments
Copyright © 2016 Journal of Visualized Experiments August 2016 | 114 | e54346 | Page 3 of 10
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
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
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,
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).
Journal of Visualized Experiments
Copyright © 2016 Journal of Visualized Experiments August 2016 | 114 | e54346 | Page 4 of 10
3. Visualize remaining data points by plotting them out all at once or as single trajectories (Figure 3, Supplementary Code
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:
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:
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).
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).
Journal of Visualized Experiments
Copyright © 2016 Journal of Visualized Experiments August 2016 | 114 | e54346 | Page 5 of 10
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: 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.
Journal of Visualized Experiments
Copyright © 2016 Journal of Visualized Experiments August 2016 | 114 | e54346 | Page 6 of 10
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.
Journal of Visualized Experiments
Copyright © 2016 Journal of Visualized Experiments August 2016 | 114 | e54346 | Page 7 of 10
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.
Journal of Visualized Experiments
Copyright © 2016 Journal of Visualized Experiments August 2016 | 114 | e54346 | Page 8 of 10
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.
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
Journal of Visualized Experiments
Copyright © 2016 Journal of Visualized Experiments August 2016 | 114 | e54346 | Page 9 of 10
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
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.
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,
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).
Journal of Visualized Experiments
Copyright © 2016 Journal of Visualized Experiments August 2016 | 114 | e54346 | Page 10 of 10
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
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
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
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), e53394 (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).
ResearchGate has not been able to resolve any citations for this publication.
Full-text available
Animals discriminate stimuli, learn their predictive value and use this knowledge to modify their behavior. In Drosophila, the mushroom body (MB) plays a key role in these processes. Sensory stimuli are sparsely represented by ∼2000 Kenyon cells, which converge onto 34 output neurons (MBONs) of 21 types. We studied the role of MBONs in several associative learning tasks and in sleep regulation, revealing the extent to which information flow is segregated into distinct channels and suggesting possible roles for the multi-layered MBON network. We also show that optogenetic activation of MBONs can, depending on cell type, induce repulsion or attraction in flies. The behavioral effects of MBON perturbation are combinatorial, suggesting that the MBON ensemble collectively represents valence. We propose that local, stimulus-specific dopaminergic modulation selectively alters the balance within the MBON network for those stimuli. Our results suggest that valence encoded by the MBON ensemble biases memory-ba
Full-text available
A central challenge in investigating biological phenomena is the development of techniques to modify genomic DNA with nucleotide precision that can be transmitted through the germ line. Recent years have brought a boon in these technologies, now collectively known as genome engineering. Defined genomic manipulations at the nucleotide level enable a variety of reverse engineering paradigms, providing new opportunities to interrogate diverse biological functions. These genetic modifications include controlled removal, insertion, and substitution of genetic fragments, both small and large. Small fragments up to a few kilobases (e.g., single nucleotide mutations, small deletions, or gene tagging at single or multiple gene loci) to large fragments up to megabase resolution can be manipulated at single loci to create deletions, duplications, inversions, or translocations of substantial sections of whole chromosome arms. A specialized substitution of chromosomal portions that presumably are functionally orthologous between different organisms through syntenic replacement, can provide proof of evolutionary conservation between regulatory sequences. Large transgenes containing endogenous or synthetic DNA can be integrated at defined genomic locations, permitting an alternative proof of evolutionary conservation, and sophisticated transgenes can be used to interrogate biological phenomena. Precision engineering can additionally be used to manipulate the genomes of organelles (e.g., mitochondria). Novel genome engineering paradigms are often accelerated in existing, easily genetically tractable model organisms, primarily because these paradigms can be integrated in a rigorous, existing technology foundation. The Drosophila melanogaster fly model is ideal for these types of studies. Due to its small genome size, having just four chromosomes, the vast amount of cutting-edge genetic technologies, and its short life-cycle and inexpensive maintenance requirements, the fly is exceptionally amenable to complex genetic analysis using advanced genome engineering. Thus, highly sophisticated methods developed in the fly model can be used in nearly any sequenced organism. Here, we summarize different ways to perform precise inheritable genome engineering using integrases, recombinases, and DNA nucleases in the D. melanogaster. For further resources related to this article, please visit the WIREs website.
Full-text available
Innate attraction and aversion to odorants are observed throughout the animal kingdom, but how olfactory circuits encode such valences is not well understood, despite extensive anatomical and functional knowledge. In Drosophila melanogaster, ~50 types of olfactory receptor neurons (ORNs) each express a unique receptor gene, and relay information to a cognate type of projection neurons (PNs). To examine the extent to which the population activity of ORNs is required for olfactory behavior, we developed a genetic strategy to block all ORN outputs, and then to restore output in specific types. Unlike attraction, aversion was unaffected by simultaneous silencing of many ORNs, and even single ORN types previously shown to convey neutral valence sufficed to mediate aversion. Thus, aversion may rely on specific activity patterns in individual ORNs rather than the number or identity of activated ORNs. ORN activity is relayed into the brain by downstream circuits, with excitatory PNs (ePN) representing a major output. We found that silencing the majority of ePNs did not affect aversion, even when ePNs directly downstream of single restored ORN types were silenced. Our data demonstrate the robustness of olfactory aversion, and suggest that its circuit mechanism is qualitatively different from attraction.
Full-text available
Genetically encoded effectors are important tools for probing cellular function in living animals, but improved methods for directing their expression to specific cell types are required. Here, we introduce a simple, versatile method for achieving cell-type-specific expression of transgenes that leverages the untapped potential of "coding introns" (i.e., introns between coding exons). Our method couples the expression of a transgene to that of a native gene expressed in the cells of interest using intronically inserted "plug-and-play" cassettes (called "Trojan exons") that carry a splice acceptor site followed by the coding sequences of T2A peptide and an effector transgene. We demonstrate the efficacy of this approach in Drosophila using lines containing suitable MiMIC (Minos-mediated integration cassette) transposons and a palette of Trojan exons capable of expressing a range of commonly used transcription factors. We also introduce an exchangeable, MiMIC-like Trojan exon construct that can be targeted to coding introns using the Crispr/Cas system. Copyright © 2015 The Authors. Published by Elsevier Inc. All rights reserved.
Full-text available
The Q-system is a repressible binary expression system for transgenic manipulations in living organisms. Through protein engineering and in vivo functional tests, we report here new variants of the Q-system transcriptional activator, including QF2, that allows the Q-system to drive strong and ubiquitous expression for the first time in all tissues. Our new QF2, GAL4QF and LexAQF chimeric transcriptional activators substantially enrich the toolkit available for transgenic regulation in Drosophila.
Full-text available
We set out to deorphanize a subset of putative Drosophila odorant receptors expressed in trichoid sensilla using a transgenic in vivo misexpression approach. We identified farnesol as a potent and specific activator for the orphan odorant receptor Or83c. Farnesol is an intermediate in juvenile hormone biosynthesis, but is also produced by ripe citrus fruit peels. Here, we show that farnesol stimulates robust activation of Or83c-expressing olfactory neurons, even at high dilutions. The CD36 homolog Snmp1 is required for normal farnesol response kinetics. The neurons expressing Or83c are found in a subset of poorly characterized intermediate sensilla. We show that these neurons mediate attraction behavior to low concentrations of farnesol and that Or83c receptor mutants are defective for this behavior. Or83c neurons innervate the DC3 glomerulus in the antennal lobe and projection neurons relaying information from this glomerulus to higher brain centers target a region of the lateral horn previously implicated in pheromone perception. Our findings identify a sensitive, narrowly tuned receptor that mediates attraction behavior to farnesol and demonstrates an effective approach to deorphanizing odorant receptors expressed in neurons located in intermediate and trichoid sensilla that may not function in the classical "empty basiconic neuron" system.
Complex as it is, much of the vast network of cellular functions has been successfully dissected, on a microscopic scale, by the use of mutants in which one element is altered at a time. A similar approach may be fruitful in tackling the complex structures and events underlying behavior, using behavioral mutations to indicate modifications of the nervous system. Drosophila offers the same advantages to such a study as it did to classical genetics, namely, large numbers and short generation time, to which may now be added an enormous store of accumulated knowledge concerning the organism. Containing about 105 neurons, the fly's nervous system is roughly halfway, on a logarithmic scale, between a single neuron and the human brain, and the fly is possessed of a rich repertoire of behavior. The considerable literature on Drosophila behavior since Carpenter's 1905 paper [1] has recently been reviewed by Manning.[2]
In their natural environment, insects such as the vinegar fly Drosophila melanogaster are bombarded with a huge amount of chemically distinct odorants. To complicate matters even further, the odors detected by the insect nervous system usually are not single compounds but mixtures whose composition and concentration ratios vary. This leads to an almost infinite amount of different olfactory stimuli which have to be evaluated by the nervous system. To understand which aspects of an odor stimulus determine its evaluation by the fly, it is therefore desirable to efficiently examine odor-guided behavior towards many odorants and odor mixtures. To directly correlate behavior to neuronal activity, behavior should be quantified in a comparable time frame and under identical stimulus conditions as in neurophysiological experiments. However, many currently used olfactory bioassays in Drosophila neuroethology are rather specialized either towards efficiency or towards resolution. Flywalk, an automated odor delivery and tracking system, bridges the gap between efficiency and resolution. It allows the determination of exactly when an odor packet stimulated a freely walking fly, and to determine the animal´s dynamic behavioral reaction.
Collective behaviour enhances environmental sensing and decision-making in groups of animals. Experimental and theoretical investigations of schooling fish, flocking birds and human crowds have demonstrated that simple interactions between individuals can explain emergent group dynamics. These findings indicate the existence of neural circuits that support distributed behaviours, but the molecular and cellular identities of relevant sensory pathways are unknown. Here we show that Drosophila melanogaster exhibits collective responses to an aversive odour: individual flies weakly avoid the stimulus, but groups show enhanced escape reactions. Using high-resolution behavioural tracking, computational simulations, genetic perturbations, neural silencing and optogenetic activation we demonstrate that this collective odour avoidance arises from cascades of appendage touch interactions between pairs of flies. Inter-fly touch sensing and collective behaviour require the activity of distal leg mechanosensory sensilla neurons and the mechanosensory channel NOMPC. Remarkably, through these inter-fly encounters, wild-type flies can elicit avoidance behaviour in mutant animals that cannot sense the odour-a basic form of communication. Our data highlight the unexpected importance of social context in the sensory responses of a solitary species and open the door to a neural-circuit-level understanding of collective behaviour in animal groups.