1,286
Views
3
CrossRef citations to date
0
Altmetric
Methods and Technical Advances

Estimating the speed of Drosophila locomotion using an automated behavior detection and analysis system

, , &
Pages 205-210 | Published online: 01 Jul 2012

Abstract

A fundamental phenotypic trait in Drosophila melanogaster is the speed of movement. Its quantification in response to environmental and experimental factors is highly useful for behavioral and neurological studies. Quantifying this behavioral characteristic in freely moving flies is difficult, and many current systems are limited to evaluating the speed of movement of one fly at a time or rely on expensive, time-consuming methods. Here, we present a novel signal processing method of quantifying the speed of multiple flies using a system with automatic behavior detection and analysis that we previously developed to quantify general activity. By evaluating the shape of the signal wave from recordings of a live and simulated single fly, a metric for speed of movement was found. The feasibility of using this metric to estimate the speed of movement in a population of flies was then confirmed by evaluating recordings taken from populations of flies maintained at two different temperatures. The results were consistent with those reported in the literature. This method provides an automated way of measuring speed of locomotion in a fly population, which will further quantify fly behavioral responses to the environment.

Introduction

Quantifying fruit fly activity can be used to estimate behavior changes due to environmental factors or experimental manipulation. The normal behavior of the flies includes flying, locomotion, mating and courtship, escape, negative geotaxis and rest associated with circadian rhythm periodicity.

Negative geotaxis (for a review see ref. Citation1) and rapid iterative negative geotaxis (RING) assaysCitation2 have been used to determine the behavioral aging of flies. Metrics of the jump response to odor,Citation3 of the escape response,Citation4 of locomotor activity,Citation5,Citation6 of freeCitation7 and tethered flightCitation8 and of courtship and mating behaviorCitation9 have been developed to screen for genes and uncover sensory networks responsible for these behaviors.

The speed of movement is one important measure that, if accurately estimated, can assist in quantifying behavior. The flight speed in Drosophila has been estimated based on experimental stimulation and modelingCitation10,Citation11 using the TrackFly behavior system,Citation7 to serve as a procedure to determine behavioral inputs from the CNS. Walking speed is a trait influenced by many environmental factors and can be used to assess the role of genes in response to environmental changes and the evolution potential of a population.Citation12,Citation13 Many of these techniques are based on imaging, tracking and processing of the analog signal.

We have previously developed a miniaturized system that can quantify the locomotor activity of a population of flies in an automated fashion, based on the change in light intensity in the field of view of a camera, which is recorded as a digital signal.Citation14,Citation15 This system measures the changes in light intensity caused by flies entering or exiting the field of view, and records the processed signal for further analysis. In these previous studies we demonstrated that this approach can be used to quantify the frequency of locomotor events. In contrast, here we present a method for quantifying the speed of each of these events, as well as the overall statistical distribution describing the average speed of a population.

Results

The speed of locomotion is reflected by the rise time of the recorded signal

Upon visual observation of the signal output for a single live fly moving in and out of the field of view (example of image in , corresponding signal in ), we estimated that the corresponding peaks were “sharper” as the fly moved quicker. In order to quantify this “sharpness” and provide accurate information about the speed of the walking behavior, we used a virtual simulation of a fly (). The recordings from simulated flies were extremely consistent and repeatable () and thus facilitated the tuning of the methods for quantifying speed.

Figure 1. A simulated fly provides periodic events for accurate signal analysis. A wild-type fly in a Petri dish illuminated from below (1A) is simulated by the black rectangle on an LCD screen (1B). The live flies move predominantly along the edge of the Petri dish. The virtual simulated fly, used to evaluate the effect of controlled speed on signal shape, imitated such behavior (1C and D).

Figure 1. A simulated fly provides periodic events for accurate signal analysis. A wild-type fly in a Petri dish illuminated from below (1A) is simulated by the black rectangle on an LCD screen (1B). The live flies move predominantly along the edge of the Petri dish. The virtual simulated fly, used to evaluate the effect of controlled speed on signal shape, imitated such behavior (1C and D).

At steady-state, the signal remains constant at zero volts until the field of view either lightens or darkens as a result of a perturbation. For example, as a fly (dark body) moves into the field of view (white background), the signal begins to decrease until the full body of the fly is in the field of view. At that point, the recovery properties of the circuit relax the signal back to zero slowly, where it remains until the next event. In the corresponding recorded signals in the positive peaks represent a single fly exiting, while the negative peaks represent a single fly entering the field of view.

shows an example of recorded traces of the simulated fly moving in and out of the field of view. We calculated the time it took for the signal to rise to each peak value, by determining the start and end points of the rising edge (). The difference between these points was considered the rise time for the event (see markers in ). The rise time was inversely proportional to the speed of movement: the slower a fly entered the field of view, the longer the rise time; the faster the movement, the shorter the rise time. As illustrated in (a magnified illustration comparing a single event at different speeds), increasing the speed of simulated single fly movement by increments of 0.25 units from 0.5 units to 1.5 units resulted in monotonically decreasing rise times. Consequently, the rise time can be used to quantify the speed of movement.

Figure 2. Rise Time Decreases with Increasing Speed in a Simulated Environment. (A) Recorded signal from one simulated fly moving at a slow speed. Each positive peak indicates the fly moving out, and each negative peak is the fly moving into the field of view. (B) The ensemble averaged peak showing how rise time is calculated from the fly event peaks. (C) Rising edge portion of normalized ensemble averaged peaks from simulated flies moving at five different speeds—as speed increases, the rise time decreases.

Figure 2. Rise Time Decreases with Increasing Speed in a Simulated Environment. (A) Recorded signal from one simulated fly moving at a slow speed. Each positive peak indicates the fly moving out, and each negative peak is the fly moving into the field of view. (B) The ensemble averaged peak showing how rise time is calculated from the fly event peaks. (C) Rising edge portion of normalized ensemble averaged peaks from simulated flies moving at five different speeds—as speed increases, the rise time decreases.

Speed estimation of single fly events from live flies

In order to use the estimate of rise time from simulated flies to quantify the speed of real live flies, isolated single-fly events (SFEs) were analyzed. SFEs are only a subset of all fly movement events that the software automatically detects and uses for measuring activity (number of events) vs. inactivity (inter-event durations).Citation14,Citation15 An ideal SFE was a single fly entering or leaving the field of view seamlessly without hesitating or hitching, which corresponded to a constant speed of entry/exit. Since the goal of this study was to accurately estimate the average speed of the flies while entering or leaving the field of view, only SFEs were included in the analysis.

A total number of 25 entering and leaving single-fly events (SFEs) were evaluated from recording of live flies by counting the video frames (seconds) it took for the entire body of the fly to enter/exit the field of view. These times provided a manual estimation of speed and were compared with the automatically determined rise times (). A line was fitted to the data showed that the correlation between the manually counted time of entry and the rise time calculated from the signal processing method was strong (the coefficient of determination R2 was 0.927). This validated that the automated method of using rise times was appropriate for estimating speed, and confirmed that the rise times were indeed negatively correlated with fly speed.

Figure 3. Rise times closely match manually counted entry times in recordings of single fly events (SFEs). The scatter plot of the automatically detected rise times vs. their corresponding manually counted entry times in the video recordings of one live fly (n = 25), show a strong correlation between the two parameters (correlation coefficient R2 = 0.927).

Figure 3. Rise times closely match manually counted entry times in recordings of single fly events (SFEs). The scatter plot of the automatically detected rise times vs. their corresponding manually counted entry times in the video recordings of one live fly (n = 25), show a strong correlation between the two parameters (correlation coefficient R2 = 0.927).

Speed estimation of a live fly population

Since the rise time was inversely proportional to the speed with which the fly enters or leaves the field of view, this was used to compare the average speed of movement of two populations, using the probability distribution of the SFE rise times of the two groups.

We made the assumption that no population would have the same rise time for every event within a recording, but rather the event rise times are more likely to span a range. In fact, for each unique population of flies, a probability density function (PDF) describes the probability that any event will occur at a given rise time. Some populations may have the same, or similar PDFs, while others may have very different event rise time PDFs. By comparing the statistics of the estimated rise times between two groups expected to have different speeds, we aimed to quantify differences in their behavioral traits.

Five recordings of 7 min each in length and eight recordings of 35 min each were taken from unique groups of three flies from two distinct populations maintained at 23°C and 29.5°C respectively. Each recording provided a vector of SFE rise times.

Histogram comparison () was used to analyze the data in discrete bins, in order to determine whether significant differences can be found at particular rise time durations. As shown in , the flies developing at 23°C had significantly higher number of events with rise time of 0.3–0.4 sec (p < 0.01), and the flies developing at 29.5°C flies had significantly higher number of events with rise time of 0.2–0.3 sec (p < 0.01). This indicated that the flies maintained at the higher temperature were moving faster into/out of the field of view as would be expected, and that the rise time estimation can therefore be used to assess the behavior of a population.

Figure 4. The walking speed of distinct fly population can be quantified by discrete and overall estimates of the rise time. The histogram comparison (A) shows that the differences between flies maintained at 23°C and 29.5°C segregate at particular rise times (0.2–0.3 sec). The cumulative distribution function (B) shows overall differences in rise time between the two populations, by comparing the fraction of events in each group against the total number of events. 29.5°C flies move faster (shorter rise time) than 23°C flies (longer rise time).

Figure 4. The walking speed of distinct fly population can be quantified by discrete and overall estimates of the rise time. The histogram comparison (A) shows that the differences between flies maintained at 23°C and 29.5°C segregate at particular rise times (0.2–0.3 sec). The cumulative distribution function (B) shows overall differences in rise time between the two populations, by comparing the fraction of events in each group against the total number of events. 29.5°C flies move faster (shorter rise time) than 23°C flies (longer rise time).

CDF (cumulative distribution function) comparison () was used to determine whether the overall distribution of rise time is significantly different between the two groups. The K-S test determined that the two sets of SFE rise times differed significantly (p < 0.01). Furthermore, the CDF showed that the majority of SFE rise times for the flies maintained at 29.5°C were shorter (faster speed) than the corresponding rise time for the flies maintained at 23°C (slower speed).

Discussion

We have identified rise time as a signal feature that can be used to estimate the speed of fly movement. This can be done for both single flies moving in and out of the field of view, as well as for estimating the overall speed of a population. The method is completely automated, absolving the need for an operator spending hours manually annotating video images, and avoiding subjective bias of measurements.

The method described here for quantifying the speed of movement of multiple flies poses many advantages over current methods by eliminating the need for video-based tracking. As described in reference Citation15, the camera system we use is based on automatic behavior detection and analysis. Behavior features described previously are interevent duration to estimate the frequency of locomotor movement and shaking index to quantify fine resolution movements such as wing and body shaking movements.

Here we show the use of rise time to quantify the speed of movement. While interevent duration and shaking estimates make use of the signal between events, rise time is a characteristic of the events per se. All these features can be evaluated from signal recordings and used side-by-side to quantify behavior in a population.

We note that the speed estimation described here is based on analyzing single events. Some examples of fly movements that were not considered single events included: multiple flies entering or leaving the field of view simultaneously; a fly entering partially, stopping, then continuing into the field of view; a fly body changing its shape by pulling in the wings or angling itself away from the plane of focus; and a fly moving on top of another fly; all of these can be quantified by other parameters extracted from the data but are not discussed within the scope of this work. Furthermore, the movement of flies within the field of view is not detectable by this method since single fly events corresponded only to flies entering or exiting the field of view. We found that sufficient single events are typically available within a 30 min population recording to allow for an estimation of speed of locomotion.

Moreover, this feature is stringent enough to discriminate between dynamics of two different populations: quantification of the rise times from the population experiments after the removal of extraneous events elucidated a significant increase in the speed of movement from the population experiments at 29.5°C vs. 23°C. This increase in speed match the results found in literatureCitation12 and demonstrate the viability of assessing the rise time of SFEs to estimate the speed of movement of a small population of flies. Future work will focus on extending the method shown here to large populations. Other applications of this method are behavioral genetics experiments (for a review see ref. Citation16) such as quantifying locomotion after genetic manipulation; quantifying the response to stimuli, drugs, and environmental stress; as well as screening for behavioral genes.

Materials and Methods

Animals and media

Two-day old adult females from w1118;P{GawB}easalaP and w1118; P{GawB}DJ695 (Bloomington Drosophila Stock Center, Indiana) were grown at 23°C for a day then either left at that temperature or transferred to 29.5°C to develop for another day. All strains were grown in a 12-h light/dark cycle on standard dextrose medium.

Simulation

We initially developed our signal processing methods based on visual observations of how the fly activity signal changed based on the speed of movement of flies entering or exiting the field of view. The first quantitative test we designed for the algorithm used a simulated fly moving in and out of the image, whose speed we could directly control. We used PsychoPy, a program for creating psychology and neuroscience stimuli using the Python programming language to generate a simulated fly in the image.Citation17,Citation18 The simulated flies, displayed as a black rectangle on a white LCD background, mimicked live flies in a Petri dish illuminated from below. The simulated fly entered the image at a 90° angle, stopped for one second and then exited the image at a 90° angle to a line tangent to the circular field of view, stopped for one second and then exited the image at a 90° angle repeating periodically in a clockwise fashion. We took recordings at fly movement speeds of 1.48, 2.12, 2.76, 3.50 and 4.11 cm/s, to cover a range of speeds for Drosophila described in the literature,Citation12,Citation19 and monitored changes in the duration of the rise time.

Measurement setup

A monochrome CMOS video camera imaged the live flies in a Petri dish, illuminated from below by a uniform white light source, or the simulated fly on an LCD screen. The output from the video camera was inputted to an analog circuit that band-pass filtered and amplified the video signal to extract only the low-frequency components related to the movement of the flies in the field of view. The band-pass filtered camera signal represents the average changes in light level detected by the camera as a function of time.

Speed estimation of single fly events from live flies

Changes in the rise times found from the simulations were verified by taking video and signal recordings of single flies, and matching changes in the rise time in the signal trace with the speed of the fly in the video at each event. Estimates of the speed of individual flies were determined by counting the number of frames (1/30 sec each) in the video it took for the entire head and body of the fly to enter the field of view. These times of entry or exit estimated from the visual inspection of the video were then compared with the rise times estimated by the signal processing methods and a correlation coefficient was computed.

Speed estimation of a live fly population

To evaluate the feasibility of implementing this method in recordings with multiple flies, several recordings with separate populations of three flies each were taken from flies raised at 23 vs. 29.5°C. The difference in rise times between the two populations was then evaluated and quantified (see signal processing).

Signal processing

The fly signal output from the circuit was processed to reduce recording noise and isolate single-fly events (SFEs) for speed analysis. The signal processing procedure comprised the following three steps: (1) detection of all fly movement events, (2) event sorting to isolate SFEs and (3) event rise-time estimation. Below we describe the signal processing methods used for estimating SFE rise times from a given fly signal recording.

Detection of fly movement events

The fly signal was filtered using a Finite Impulse Response (FIR) digital filter (n = 1674) with a cutoff frequency of 2 Hz to remove out-of-band noise. Fly movement peaks were then detected from this filtered signal using a simple peak detection algorithm described in previous work.Citation14,Citation15 Only peaks with amplitude greater than twice the measured peak-to-peak voltage noise of the circuit were used. An array of fly movement events was then assembled from the fly movement signal using the peaks by windowing from 1 sec prior to each peak to 2 sec following each peak.

Event sorting to isolate single fly events (SFEs)

The events denoted by these peaks were sorted using amplitude and first-derivative based tests to facilitate direct analysis of the waveform rise time for SFEs. These tests were developed based on observations made during real recordings, and on pragmatic expectations for how the waveform shape would be different for SFEs and non-SFEs. For example, if a fly movement event corresponded to a fly hesitating on its way out of the field of view, the amplitude of the event was be much lower than if the whole fly body entered at once. This is because the fly signal would first increase to a small peak as the fly partially left the field of view; then start recovering back to baseline as the fly paused; then increase again to another small peak as the rest of the fly body left. Furthermore, for a smooth peak where the fly either entered or exited the field of view without hesitation, the first derivative averaged over half a second to both the left and right of the peak would be positive, since the trend of the curve would remain upward through the peak location.

Event rise time estimation

After the SFEs were isolated from all events, the start and end points of the rising edge were automatically determined: the end point was the same as the peak value determined as described above; the start point was calculated as the time at which the rising edge had passed its maximum inflection point and crossed a threshold of 30% of the peak value. The difference between these points was considered the rise time estimate for the event. By considering both an amplitude threshold and the maximum inflection point, the automatic rise time detection was robust and was confirmed by visual inspection to be accurate.

Statistical analysis

Individual recordings taken from the two populations of flies (described at Speed estimation of a live fly population) were used to estimate the vector of SFE rise. Two methods described below were used to determine discrete points at which the speed was statistically different between two fly populations (Histogram Comparison), and the overall differences in speed between the two groups (Cumulative Distribution Function).

Histogram comparison for multiple-trial analysis

Rise times from recordings of live fly populations were organized into eight bins corresponding to values from 0.1–0.8 sec. Thus, a set of five recordings taken from one population of flies yielded five different eight-element vectors. For example, vector 2, element 3 would correspond to the number of events for the second recording that had a rise time between 0.3 and 0.4 sec. For each population, the number of event rise times occurring at each value was averaged across all recordings, and the standard deviation (σ) was computed. The resulting histograms showing mean (± σ) for both populations were visually compared. The differences between the two populations were also compared quantitatively using Student’s t-test to determine statistical significance.

Cumulative distribution function (CDF) comparison for pooled data

The rise time data from multiple recordings was pooled, independently for each population, to compare the CDF between the groups. The CDF for a set of events describes the probability that an event will have occurred at or below a certain value - in this case, the probability at each rise time value that a fly movement event will have occurred at or below that rise time value. If one population had more events occurring at shorter rise times, the CDF would rise from zero to one earlier than for another population with longer rise times. A Kolmogorov-Smirnov (K-S) test was used to determine the statistical probability that the data came from the same continuous distribution and, thus, reflected the statistical significance of any differences. The K-S test was used here rather than Student’s t-test since the event rise time distribution was not necessarily normal.

Acknowledgments

K.L.C. was supported through the Achieving Competence in Computing, Engineering, and Space Science Program, funded by the American Association for the Advancement of Science (AAAS). The work was funded by a NASA Fundamental Space Biology grant 09-FSB09PROP-0022 to S.B. and O.M.

Disclosure of Potential Conflicts of Interest

No potential conflicts of interest were disclosed.

Notes

† These authors contributed equally to this work.

References

  • Inagaki HK, Kamikouchi A, Ito K. Methods for quantifying simple gravity sensing in Drosophila melanogaster. Nat Protoc 2010; 5:20 - 5; http://dx.doi.org/10.1038/nprot.2009.196; PMID: 20010724
  • Gargano JW, Martin I, Bhandari P, Grotewiel MS. Rapid iterative negative geotaxis (RING): a new method for assessing age-related locomotor decline in Drosophila. Exp Gerontol 2005; 40:386 - 95; http://dx.doi.org/10.1016/j.exger.2005.02.005; PMID: 15919590
  • Sharma P, Keane J, O’Kane CJ, Asztalos Z. Automated measurement of Drosophila jump reflex habituation and its use for mutant screening. J Neurosci Methods 2009; 182:43 - 8; http://dx.doi.org/10.1016/j.jneumeth.2009.05.024; PMID: 19520114
  • Card G, Dickinson MH. Visually mediated motor planning in the escape response of Drosophila. Curr Biol 2008; 18:1300 - 7; http://dx.doi.org/10.1016/j.cub.2008.07.094; PMID: 18760606
  • Martin I, Grotewiel MS. Distinct genetic influences on locomotor senescence in Drosophila revealed by a series of metrical analyses. Exp Gerontol 2006; 41:877 - 81; http://dx.doi.org/10.1016/j.exger.2006.06.052; PMID: 16891076
  • Martin JR. A portrait of locomotor behaviour in Drosophila determined by a video-tracking paradigm. Behav Processes 2004; 67:207 - 19; http://dx.doi.org/10.1016/j.beproc.2004.04.003; PMID: 15240058
  • Fry SN, Rohrseitz N, Straw AD, Dickinson MH. TrackFly: virtual reality for a behavioral system analysis in free-flying fruit flies. J Neurosci Methods 2008; 171:110 - 7; http://dx.doi.org/10.1016/j.jneumeth.2008.02.016; PMID: 18405978
  • Reiser MB, Dickinson MH. A modular display system for insect behavioral neuroscience. J Neurosci Methods 2008; 167:127 - 39; http://dx.doi.org/10.1016/j.jneumeth.2007.07.019; PMID: 17854905
  • Ejima A, Griffith LC. Measurement of courtship behavior in Drosophila melanogaster. CSH Protoc 2007; 2007:t4847; PMID: 21356948
  • Fry SN, Rohrseitz N, Straw AD, Dickinson MH. Visual control of flight speed in Drosophila melanogaster. J Exp Biol 2009; 212:1120 - 30; http://dx.doi.org/10.1242/jeb.020768; PMID: 19329746
  • Rohrseitz N, Fry SN. Behavioural system identification of visual flight speed control in Drosophila melanogaster. J R Soc Interface 2011; 8:171 - 85; http://dx.doi.org/10.1098/rsif.2010.0225; PMID: 20525744
  • Gibert P, Huey RB, Gilchrist GW. Locomotor performance of Drosophila melanogaster: interactions among developmental and adult temperatures, age, and geography. Evolution 2001; 55:205 - 9; PMID: 11263741
  • Roberts SP, Marden JH, Feder ME. Dropping like flies: environmentally induced impairment and protection of locomotor performance in adult Drosophila melanogaster. Physiol Biochem Zool 2003; 76:615 - 21; http://dx.doi.org/10.1086/376922; PMID: 14671709
  • Inan OT, Etemadi M, Sanchez ME, Marcu O, Bhattacharya S, Kovacs GT. A miniaturized video system for monitoring the locomotor activity of walking Drosophila melanogaster in space and terrestrial settings. IEEE Trans Biomed Eng 2009; 56:522 - 4; http://dx.doi.org/10.1109/TBME.2008.2006018; PMID: 19272912
  • Inan OT, Marcu O, Sanchez ME, Bhattacharya S, Kovacs GT. A portable system for monitoring the behavioral activity of Drosophila. J Neurosci Methods 2011; 202:45 - 52; http://dx.doi.org/10.1016/j.jneumeth.2011.08.039; PMID: 21907735
  • Sokolowski MB. Drosophila: genetics meets behaviour. Nat Rev Genet 2001; 2:879 - 90; http://dx.doi.org/10.1038/35098592; PMID: 11715043
  • Peirce JW. PsychoPy–Psychophysics software in Python. J Neurosci Methods 2007; 162:8 - 13; http://dx.doi.org/10.1016/j.jneumeth.2006.11.017; PMID: 17254636
  • Peirce JW. Generating Stimuli for Neuroscience Using PsychoPy. Front Neuroinform 2008; 2:10; http://dx.doi.org/10.3389/neuro.11.010.2008; PMID: 19198666
  • Strauss R, Heisenberg M. A higher control center of locomotor behavior in the Drosophila brain. J Neurosci 1993; 13:1852 - 61; PMID: 8478679

Reprints and Corporate Permissions

Please note: Selecting permissions does not provide access to the full text of the article, please see our help page How do I view content?

To request a reprint or corporate permissions for this article, please click on the relevant link below:

Academic Permissions

Please note: Selecting permissions does not provide access to the full text of the article, please see our help page How do I view content?

Obtain permissions instantly via Rightslink by clicking on the button below:

If you are unable to obtain permissions via Rightslink, please complete and submit this Permissions form. For more information, please visit our Permissions help page.