The present protocol assesses the locomotor activity of Drosophila by tracking and analyzing the movement of flies in a hand-made arena using open-source software Fiji, compatible with plugins to segment pixels of each frame based on high-definition video recording to calculate parameters of speed, distance, etc.
Drosophila melanogaster is an ideal model organism for studying various diseases due to its abundance of advanced genetic manipulation techniques and diverse behavioral features. Identifying behavioral deficiency in animal models is a crucial measure of disease severity, for example, in neurodegenerative diseases where patients often experience impairments in motor function. However, with the availability of various systems to track and assess motor deficits in fly models, such as drug-treated or transgenic individuals, an economical and user-friendly system for precise evaluation from multiple angles is still lacking. A method based on the AnimalTracker application programming interface (API) is developed here, which is compatible with the Fiji image processing program, to systematically evaluate the movement activities of both adult and larval individuals from recorded video, thus allowing for the analysis of their tracking behavior. This method requires only a high-definition camera and a computer peripheral hardware integration to record and analyze behavior, making it an affordable and effective approach for screening fly models with transgenic or environmental behavioral deficiencies. Examples of behavioral tests using pharmacologically treated flies are given to show how the techniques can detect behavioral changes in both adult flies and larvae in a highly repeatable manner.
Drosophila melanogaster provides an excellent model organism for investigating cellular and molecular functions in neuronal disease models created by gene modification1, drug treatment2, and senescence3. The high conservation of biological pathways, physical properties, and disease-associated homolog genes between humans and Drosophila makes the fruit fly an ideal mimic from the molecular to the behavioral level4. In many disease models, behavioral deficiency is an important index, providing a helpful model for various human neuropathies5,6. Drosophila is now used to study multiple human diseases, neurodevelopment, and neurodegenerative diseases such as Parkinson's disease and amyotrophic lateral sclerosis7,8. Detecting the motor ability of the disease models is crucial for understanding the pathogenic progress and may provide a phenotypic correlation to the molecular mechanisms underlying the disease process.
Recently, commercially available software tools and cost-effective programs have been developed for Drosophila locomotor detection strategies, such as high-throughput testing in grouped flies9,10 and measuring locomotion in real-time11,12. One such conventional approach is rapid interactive negative geotaxis (RING), also called the climbing assay, which includes multiple channels that allow for a large fly population with the same gender and age to be contained, reducing variation while data collecting9,13. Another pre-testing method for analyzing locomotor behavior is TriKinetics Drosophila activity monitor (DAM), a device that uses multiple beams to detect fly activity movement within a thin glass tube14. The device records position continuously, which represents automated locomotion by calculating the beam-crossings to study the activity and circadian rhythm of flies over a longer period of time15. Although these methods have been widely used in analyzing behavioral defects in fruit flies to determine changes in behavioral locomotion, they always require special testing equipment or complex analysis processes, and restrict their application in some models with a limited, simple device. Animal-tracing group-based strategies for testing the adult Drosophila, such as FlyGrAM11 and the Drosophila island assay10, implement social recruitment and individual tracking in a predefined area. Nevertheless, social individual restriction in defied areas might have a negative effect on identifications in the images, caused by the collision or overlapping of flies. Even though some open-source materials-based methods, such as TRex16, MARGO12, and FlyPi17, have an emergency, they can fast-track trace the flies with flexible usage in behavioral testing. These testing approaches are associated with elaborate experimental apparatus installations, special software requirements, or professional computer languages. For larvae, measuring the total distance traveled across the number of grid border lines per unit of time18, or rough counting the body wall contractions for individuals manually19, are the predominant methods for assessing their locomotor ability. Due to the lack of precision in equipment or devices and analysis methods, some behavioral locomotion of larvae might escape detection, making it difficult to accurately assess behavioral movement, especially fine movement15.
The present developed method utilizes the AnimalTracker application programming interface (API), compatible with the Fiji (ImageJ) image processing program, to systematically evaluate the locomotor activity of both adult and larval flies by analyzing their tracking behavior from high-definition (HD) videos. Fiji is an open-source software ImageJ distribution that can combine robust software libraries with numerous scripting languages, resulting in rapid prototyping of image processing algorithms, making it popular among biologists for its image analysis capabilities20. In the current approach, Fiji's integration into the AnimalTracker API is exploited to develop a unique Drosophila behavioral assay with personalized algorithm insertion, and provides a useful step for detailed documentation and tutorials to support robust analytical capabilities of locomotor behavior (Figure 1). To circumvent the complication of objective identifications in the images caused by the collision or overlapping of flies, each arena is restricted to hosting only one fly. Upon assessing the tracking precision of the approach, it was implemented to trace and quantify the locomotor movements of Drosophila that were administered with the toxic drug rotenone, which is generally used for animal models of Parkinson's disease, ultimately discovering locomotion impairment in the drug treatment21. This methodology, which employs open-source and free software, does not necessitate high-cost instrumentation, and can precisely and reproducibly analyze Drosophila behavioral locomotion.
W1118 adult flies and third instar larvae were used for the present study.
1. Experimental preparation
NOTE: An open-field arena for Drosophila locomotion tracking is made withacolorless and odorless silica gel.
2. Video recording and preprocessing
3. Video analysis
4. Tracking file analysis
5. Analysis per frame
In the present study, locomotor deficits in adult flies and third instar larvae treated with rotenone were examined and compared in their motor activity to that of a control fly fed with the drug solvent dimethyl sulfoxide (DMSO). Treatment with rotenone in Drosophila has been shown to cause dopaminergic neuron loss in the brain22 and lead to significant locomotor deficits23. As shown in Figure 11 and Figure 12, adult flies and third instar larvae treated with rotenone have significant locomotor deficits compared to those of control flies fed with DMSO. Figure 11 and Figure 12B–E illustrate the relative changes in the distance, velocity, and immobility time for movement parameters between flies treated with or without rotenone. Figure 11 and Figure 12F–K illustrate a representative analysis of the parameters of speed, immobility time, and direction selection, with or without rotenone treatment in adults and larvae. Quantitative analysis of the parameters of distance, immobility time, and velocity using Fiji software in adult flies (Figure 11) and third instar larvae (Figure 12) of the drug-feeding groups further validates that treatment with rotenone can be used to investigate locomotor deficits in human diseases, including neurodegenerative conditions, and replicate some of the behavioral characteristics observed in humans and mammals.
Figure 1: Flow chart outlining the equipment setup and experimental procedure for Drosophila movement tracking analysis. The locomotor tracking arena is imaged with an overhead HD camera that is incorporated into and controlled by a computer. The procedure for analyzing the locomotion of Drosophila consists of video recording, movement tracking, tracking file analysis, data processing, and parametric analysis. Please click here to view a larger version of this figure.
Figure 2: Background homogenization of the first frame. (A) Check the "convert to grayscale" option while opening the transformed video, to transform the video to grayscale and avoid the interference of color. (B) Outline Drosophila using the "freehand selection" tool, shown in the red box. (C) As the analysis selection, a yellow line was utilized to delineate the outlines of the flies. Keeping the yellow line close to the contours of the fly reduces the likelihood of selecting a region that is not occupied by the fly. Scale bar = 1 cm. (D) Adjust the brightness and contrast for the first frame until the area boxed in yellow changes to the same grayscale as the background. (E) Complete the brightness and contrast adjustment for the first frame, but not for all frames, by clicking on "No" in the "stack" window. (F) Ultimately, the first frame is adjusted to create a uniform and unblemished background. Scale bar = 1 cm. Please click here to view a larger version of this figure.
Figure 3: Tracking window and tracking zone settings. (A) Complete the tracking analysis by clicking the tracker plugins in the order marked in the Animal tracking window. (B) After setting the active image in Figure A,1, a processing window that only shows the current frame is presented. The primary video window and the processing window are clearly distinguished and are used in different situations. For changing the current frame, make sure the alteration is executed in the primary video window; the alteration will be visible in both windows. Scale bar = 1 cm. (C) Create a tracking area that circles the arena, using the "oval" tool for computer recognition. The tracking zone selection must be in a circled arena in an open video window, rather than in a processing window. (D) Outline a tracking area with the yellow lines to fit the arena to the greatest extent, in order to minimize the disturbance of external light. Scale bar = 1 cm. (E) For setting the region of interest (ROI) in the tracking area, click the buttons following the order marked with the numbers shown in the "zone designer" window. In this step, the entire operation must be completed after the chosen video window opens. Please click here to view a larger version of this figure.
Figure 4: Filter setting for the first frame. (A) By completing the setting of the ROI for the tracking area, the yellow line encircling the arena changes to green in both the opened video window and the processing window. Scale bar = 1 cm. (B) Adding the purpose of filters sets a black background to make the target object more obvious for the first frame in the processing window. The entire operation should be conducted within a processing window, rather than an open video window. (C,D) Adding the "background subtractor" and "Gaussian blur" filters to the "filter settings" window makes the first frame in the processing window black. The whole filter setting process must be completed in the first frame. (E) The parameters are set step-by-step by clicking buttons marked with a number and a red rectangle in the "background subtractor" window. The "set image" step must be operated after the processing window is selected. (F) Scale bar = 1 cm. The "median image" window will be presented after clicking the "show filter" button in "E4" and directly closing the window without any operation. (G) The parameter of the Gaussian blur is set with a default sigma value of 2.0. Please click here to view a larger version of this figure.
Figure 5: Threshold settings of the second frame. (A) By clicking the lower progress bar, make the video window advance to the second frame. The fly recurs in the middle of the screen and is identified by Fiji. Scale bar = 1 cm. (B,C) Display the processing window before and after filtering. (B) Show the filtered processing window by selecting the mode that is marked with a red rectangle. (C) An example of a processing window with a red rectangle after the "filtered" mode was selected. Scale bar = 1 cm. (D) Set the threshold by selecting the default threshold method, "grayscale thresholder", shown in the "thresholders" window, after choosing the "set threshold" tool in Figure 3A,4. (E) Adjust the parameters by sliding the progress bar box in the middle until the tracking fly is seen and covered by the red profile. It is not recommended to alter the default settings for the parameters boxed in the red rectangle below. Please click here to view a larger version of this figure.
Figure 6: Blob detector, last frame setting, and animal tracking selection. (A) Upon reaching the threshold stated in Figure 5E, the processing window reveals a sizable red profile following the fly in the second frame. Make the red profile covering the fly fit to track the fly. Scale bar = 1 cm. (B) Define the red profile-covered fly as the target for tracking by selecting the default blob detector method, "base blob detector". (C) Set frame 901 as the last frame using the "set last frame" tool in Figure 3A,6. The total frame number is calculated by the formula "frame number = fps * recording time". (D) The tracking flies with a yellow rectangle boxed after show blobs in the opened video window (left panel section). In the enlarged left panel, fruit flies are attached in red (right panel section). Scale bar = 1 cm. (E) The tracking fly with a red rectangle boxed after clicking to select the red rectangle in "D" (upper panel section). In the upper panel enlargement, fruit flies are attached in red (bottom panel section). Ensure the selection of a yellow rectangle around a tracking fly is completed in the opened video window. Complete the selection in the opened video window, and the fly will be identified by Fiji in all frames. Scale bar = 1 cm. Please click here to view a larger version of this figure.
Figure 7: Results of tracking trace. The tracking trace is shown separately in the opened video window (A) and the processing window (B). To get the tracking trace profile, click on the progress bar in the original video window and slide the progress bar to check the continuity of the trace. The tracking trace presents the crawling distance of the flies intuitively. Scale bar = 1 cm. Please click here to view a larger version of this figure.
Figure 8: Tracking file analysis using the AnimalTracker plugins. (A) The tracking analyzer facilitates a detailed analysis of the tracking file; each step marked with a red rectangle is denoted by a number. (B) Set the "zone settings" parameters in A,4. Four parameters, time, distance, immobility time, and velocity vector, are shown in the red rectangle. The parameter is selected based on the desired outcome. (C–G) Set the config parameters individually in the "set parameters" window of A,5. (C) Four adjustable parameters are illustrated in the "config parameters settings" window, (D–G) exhibiting the "time settings", "immobility time setting", "distance settings", and "velocity vector setting" windows, respectively. Modifying the default value for the parameter settings is not recommended. However, for the "frame interval", the parameter should be calculated using the formula "frame interval = 1/fps" when the fps of the video is altered. In addition, it is possible to employ a known scale to ascertain the actual distance and velocity by correlating the pixels recorded with the tracking of a fly to a tangible value. Please click here to view a larger version of this figure.
Figure 9: Result displaying tracking file analysis. (A) The setting of Figure 8A,6. Two modes of displaying the data are available: "grouped by zones" and "grouped by parameters". (B) The results of the tracking file analysis are shown as "grouped by zones" in "A,6.1". (C–F) The results of tracking file analysis are shown as "grouped by parameters" in A,6.2, exhibiting "immobility time" (C), "velocity vector" (D), "time" (E), and "distance" (F) separately. The outcomes of the immobility time and distance are quantified as "s" and "pixels". The unit of the velocity vector should be defined as "pixel/s", and output with the annotation "length". Please click here to view a larger version of this figure.
Figure 10: Results of the data analysis for speed per fps. (A, C, and E) The export data contains coordinates of pixels in horizontal (column "C") and vertical (column "D") partitions, as well as the movement of pixels, immobility, and direction change angle between two-frame intervals (column "E" in A, C, and E respectively), which is automatically calculated by the formula that is described in the context. As the results exported from Fiji are text documents, it is recommended to open the file with Microsoft Office Excel and split the data into three columns by adding spaces between them. (B, D, and F) A line chart displays the calculated results from the data set of the movement of pixels (B). The global peak value represents the velocity, indicative of the motion detection capabilities; the column chart displays the calculated results from the data set of immobility (D). The degree of sparsity in the column chart represents the immobility, that exhibits the motor ability defect of flies; a scatter diagram displays the calculated results from the data set of the direction change angle (F). The enrichment of splashes shown in the scatter diagram represents the direction chosen by the fly. Please click here to view a larger version of this figure.
Figure 11: A comparative analysis of movement between flies treated with or without rotenone. (A) Representative graphs of the tracking trace of W1118 adult flies fed with standard food containing 500 µM rotenone, or DMSO for control, are shown. W1118 flies were collected and then placed in a controlled environment consisting of standard food with 500 µM rotenone or DMSO, 25°C, and 60% humidity. Six flies were used for analysis from each group after 48 h. The result reveals that the movement distance of tracking flies fed with rotenone is significantly decreased compared to that of the control. The result displayed a defective motor ability in flies fed with rotenone. (B–E) Quantitative analysis of the rotenone treatment on the average distance traveled, immobility time, mean velocity, and maximum velocity is conducted using Fiji. The results of the rotenone treatment showed a significant decrease in the distance traveled and the mean velocity, and a significant increase in the immobility time. (F–K) Analysis of pixels per frame (F,G), immobility time per frame (H,I), and angle of direction changes (J,K) between flies treated with rotenone (G,I,K) or DMSO (F,H,J). Example graphs illustrating the effects of rotenone on the movement speed show fewer peaks representing the movement speed per frame interval in flies fed with rotenone (G) compared to those in the control (F), indicating the severity of the locomotor activity defect (F,G). The intuitionistic immobility column of moved pixels per frame is lower, showing significantly less movement within 1 min for rotenone-fed flies (I) compared to the control flies (H). Example graphs of the moving angle of direction changes in rotenone-fed (K) and control (J) animals reveal alterations in the direction chosen by flies. Data are the mean ± SEM of six male flies monitored for 1 min. Asterisks indicate significant differences among groups (***p < 0.001; unpaired t-test, p = 0.05). Please click here to view a larger version of this figure.
Figure 12: A comparative analysis of the movement between larvae treated with or without rotenone. (A) Representative results of the comparison of locomotor activity by tracking the trace of W1118 third instar larvae fed with rotenone or DMSO. Briefly, W1118 third instar larvae were collected and cultured in 10% sucrose, or 10% sucrose containing 500 µM rotenone, in a 25 °C environment with 60% humidity. Six larvae per group were used for analysis. Taking into account the slow movement of larvae, the data recording over a span of 5 min has been quantified and analyzed to evaluate the effects of rotenone on locomotion. (B–E) The average distance, immobility time, mean velocity, and maximum velocity of the two groups analyzed in Fiji is quantitatively analyzed. The quantitative results show that the movement distance, mean velocity, and maximum velocity significantly decrease in larvae fed with rotenone, and the immobility time significantly increases in larvae fed with rotenone. (F–K) Similar to adult flies, analysis of pixels per frame, immobility time, and the angle of direction changes between flies treated with rotenone (G,I,K) and without rotenone (F,H,J) showed that larvae treated with rotenone had lower movement speed, more immobility time, and alternated their directions. The results reveal that the behavioral movement of tracking larvae fed with rotenone is significantly impaired compared to the control. The results display a defective locomotor activity of flies fed with rotenone. Data are the mean ± SEM of six 3-day-old larvae monitored for 5 min. Asterisks indicate a significant difference among groups (*p < 0.05; **p < 0.01; ***p < 0.001; unpaired t-test, p = 0.05). Please click here to view a larger version of this figure.
Table 1: Comparison of animal-tracking-based methodologies for quantification of the locomotor activity in Drosophila. Please click here to download this Table.
We have designed a method, based on the open-source material AnimalTracker API compatible with the Fiji image processing program, that can enable researchers to systematically evaluate locomotor activity by tracking both adult and individual larval flies. AnimalTracke is a tool written in Java that can be easily integrated into existing databases or other tools to facilitate the analysis of application-designed animal-tracking behavior24. Upon a frame-by-frame analysis by a software calculation formula that quantifies the locomotor activity of the adults and larvae, several parameters, including movement speed, distance traveled, immobility, and angle of direction changes can be flexibly analyzed. These parameters, which represent different aspects of behavioral locomotion, can be plotted to illustrate locomotor changes over time. Additionally, by creating a graphical user interface, providing detailed documentation on its usage, and an application programming interface, we aim to make this method accessible to researchers who lack programming experience and experienced users creating custom experimental paradigms.
To verify that the method can accurately monitor behavior, locomotor testing of adult flies and larvae treated with rotenone, as well as a comparison of their motor activity to that of control flies fed with the drug's solvent, has been carried out. The Fiji software, with its plugins, is used to analyze the pixel coordinates of each frame in the video recording of the movement, allowing for calculation of the speed, distance, and other parameters of the experimental flies. We observed a significant decrease in distance traveled over time in rotenone administration (Figure 11), which is consistent with reported results23. Meanwhile, the ascending movement speed and abnormal direction chosen have been observed in drug-fed groups, to help illustrate more details of the behavioral deficiency in flies. Given the success in detecting adult flies' locomotor activity, we then sought to evaluate the mobility of larvae (Figure 12). Compared to the control, the results of the tracking larvae fed with rotenone were significantly impaired, paralleling those of adult flies fed with drugs. Experiments with the adults and larvae fed with rotenone suggest that this method can accurately record the reduction of flies that produced locomotor deficits compared to controls. This report has successfully demonstrated applications of the current method in quantifying and analyzing locomotor ability and other facets of behavior defects of fruit flies in testing models or pharmacological research in animals.
To ensure that the video and tracking analysis yields successful and reproducible results, it is recommended to adhere to the following guidelines. First, for the choice of video frame rate, we recommend converting the recorded video to a format of 15 frames per second (fps). This can not only maintain good motion tracking, but also avoid the slowness of computer analysis caused by vast amounts of data. By improving the video frame rate, the motion trajectory analysis gets more detailed. Secondly, the parameters in the formula can also be adjusted to suit the corresponding experimental scheme when analyzing the static motion between every two frames. For larvae locomotor monitoring, it is essential to use silica gel rather than agar, as the solidified silica gel is tight and the larvae cannot get into it. Moreover, silica gel is transparent and can be dyed by adding color substance to produce optimal background, facilitating desired optical effects that enhance the image quality.
Animal tracking systems are being advanced to provide comprehensive solutions for the etiology, neuroscience, and behavioral genetics communities. Table 1 provides a comparison of the features of multiple tracking programs currently available10,11,12,16,17,25,26. This approach is extremely cost-effective, straightforward to learn, and precise in measuring locomotor behavior, without requiring costly software and equipment. There is no doubt that this method can be conveniently extended to other Drosophila-like animal models, and even to larger animals such as rats and mice. The structure of the AnimalTracker API can be extended with ease through independent ImageJ applications or plugins, offering a broad array of useful toolkits for custom behavior research and analysis24. Nevertheless, this study has certain restrictions. Since a single fly is placed in an open-field arena for image recording and video tracking is conducted individually, this method is inefficient and time-consuming. We have attempted to expand the capacity for recording multiple arenas simultaneously, allowing for up to six individual recordings. It is theoretically possible to record a greater number of Drosophila simultaneously; this depends on the size of the arena and the configuration of the camera. Alternatively, if users wish to extend to recording grouped Drosophila, it is recommended to consider the limited number of single records and a configuration of sufficient quality to identify collisions and overlaps between the flies. Improvements in the testing efficiency by machine learning were not considered in the study, since an affordable and compatible approach has not been figured out that can be integrated with the current system to visually distinguish identities and track models accurately.
In summary, the method described here develops and validates an efficient and straightforward approach based on free, open-source software, designed to reduce time consumption and refine experimental techniques for quantitatively indicating and analyzing Drosophila locomotion in the larvae and adult stages. Through systematic analysis, this method can help us understand how the animal's velocity changes over time during movement, as well as the characteristics of directional selection. Thus, the incorporation of open-source software into commonly used digital devices provides a reliable way to test locomotor activity in various fly models. This might be useful for evaluating physiological and pathological locomotor outputs in testing neurodegenerative disease models derived from pharmacological treatment and transgenic modification in Drosophila as well as other animals.
The authors have nothing to disclose.
This work was supported by a special launch fund from Soochow University and the National Science Foundation of China (NSFC) (82171414). We thank Prof. Chunfeng Liu's lab members for their discussion and comments.
Animal tracker | Hungarian Brain Research Program | version: 1.7 | pfficial website: http://animaltracker.elte.hu/main/downloads |
Camera software | Microsoft | version: 2021.105.10.0 | built-in windows 10 system |
Computer | DELL | Vostro-14-5480 | a comupter running win 10 system is available |
Drosophila carbon dioxide anesthesia workstation | Wu han Yihong technology | #YHDFPCO2-018 | official website: http://www.yhkjwh.com/ |
Fiji software | Fiji team | version: 1.53v | official website: https://fiji.sc/ |
Format factory software | Pcfreetime | version: X64 5.4.5 | official website: http://www.pcfreetime.com/formatfactory/CN/index.html |
Graph pad prism | GraphPad Software | version: 8.0.2 | official website: https://www.graphpad-prism.cn |
Hight definition camera | TTQ | Jingwang2 (HD1080P F1.6 6-60mm) | official website: http://www.ttq100.com/product_show.php?id=35 |
Office software | Microsoft | version: office 2019 | official website: https://www.microsoftstore.com.cn/software/office |
Petri dish | Bkman | 110301003 | size: 60 mm |
Silica gel | DOW | SYLGARD 184 Silicone Elastomer Kit | Mix well according to the instructions |
Sodium bicarbonate | Macklin | #144-55-8 | Mix well with silica gel |