Locomotor Assay in Drosophila melanogaster   

Edited by
Xi Feng
Reviewed by
Anonymous reviewer
Download PDF How to cite Favorites Q&A Share your feedback Cited by

In this protocol

Original research article

A brief version of this protocol appeared in:
Jun 2016


This protocol describes a simple locomotor assay in Drosophila melanogaster. In brief, the locomotor of each single fly in the culture dish is recorded by a web camera. The moving time, walking length, speed and the locomotor trails of the single fly could be quantitatively analyzed.

Keywords: Locomotor, Drosophila, Video analysis, Motion detection, Motion trail, Behavior


This protocol was implemented in the previously published study (Liu et al., 2016). In that study, this assay was combined with the optogenetic system by simply providing the proper excitation light.

Materials and Reagents

  1. 3.5 cm culture dishes with black paper inside
  2. Drosophila strains to be analyzed
  3. Ice for anesthesia


  1. Empty vial for cold anesthesia
  2. Fluorescent lamp (Bannet T5 8 W, China)
  3. Infrared LEDs (TUOENS, model: TS-6036A )
  4. Web camera (Omiky, model: CEL USB 2.0 50.0M PC Camera , catalog number: CEL9002255) with the IR filter removed; Replacing the IR filter with the floppy disk (the black floppy disk contained in the hard shell) to filter the visible light
  5. Behavior room with the temperature and humidity controlled


  1. MATLAB (MathWorks, R2013a)


  1. Set the environmental illuminance (provided by the fluorescent lamp) to be 1,000-1,300 Lux, the temperature to be 24 ± 1 °C and the humidity to be 40-60%.
  2. Transfer the flies into the empty vial and anesthetize them on ice for 10 min.
  3. Transfer one fly to each culture dish, and let the flies recover from the anesthesia for at least 10 min.
  4. Record the locomotion of the flies for 2 min with the web camera equipped with a visible light filter (Figures 1A and 1D; Video1). The fly is light up and the background is dark (Figure 1B). The angle of the infrared LEDs should be adjusted before recording to reduce the reflection on the dish.

    Figure 1. Locomotor assay in Drosophila melanogaster. A. The schematic diagram of the locomotor assay; B. A photo of the dish with a fly inside; C. The motion trial of a recorded fly; D. A photo of the setup.

    Video 1. Recording of the locomotor behavior of the flies

    Data analysis

    1. Analyze the photos with MATLAB (MathWorks, R2013a; For MATLAB code for video analysis, see Supplemental file 1) (Figure 1C). Figure out the coordinate of the fly on each photo, and then calculate the moving time, walking length and speed of the fly, and analyze the locomotor trail of the fly.
    2. Individuals with the walk length less than half of the fly body length during recording should be excluded.
    3. The Wilcoxon signed rank test should be applied to evaluate differences between matched samples.


    We would like to thank Jingwu Hou for assistance with experimental setup. This protocol was designed by Q. L. and was implemented in the previously published study (Liu et al., 2016). This study was supported by the ‘Strategic Priority Research Program’ of the CAS (XDB02040004), by grants from the 973 Program (2011CBA00400), as well as by the National Science Foundation of China (91232000, 91132709, 31130027, and 31070956). The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.


    1. Liu, Q., Yang, X., Tian, J., Gao, Z., Wang, M., Li, Y. and Guo, A. (2016). Gap junction networks in mushroom bodies participate in visual learning and memory in Drosophila. Elife 5.
Copyright Liu et al. This article is distributed under the terms of the Creative Commons Attribution License (CC BY 4.0).
How to cite:  Readers should cite both the Bio-protocol article and the original research article where this protocol was used:
  1. Liu, Q., Tian, J., Yang, X., Li, Y. and Guo, A. (2017). Locomotor Assay in Drosophila melanogaster. Bio-protocol 7(10): e2283. DOI: 10.21769/BioProtoc.2283.
  2. Liu, Q., Yang, X., Tian, J., Gao, Z., Wang, M., Li, Y. and Guo, A. (2016). Gap junction networks in mushroom bodies participate in visual learning and memory in Drosophila. Elife 5.

Please login to post your questions/comments. Your questions will be directed to the authors of the protocol. The authors will be requested to answer your questions at their earliest convenience. Once your questions are answered, you will be informed using the email address that you register with bio-protocol.
You are highly recommended to post your data including images for the troubleshooting.

You are highly recommended to post your data (images or even videos) for the troubleshooting. For uploading videos, you may need a Google account because Bio-protocol uses YouTube to host videos.