Detection of the temporal structure of stimuli is crucial for prediction. While perception of interval timing is relevant for immediate behavioral adaptations, it has scarcely been investigated, especially in invertebrates. Here, we examined whether the fruit fly, Drosophila melanogaster, can acquire rhythmic behavior in the range of seconds. To this end, we developed a novel temporal conditioning paradigm utilizing repeated electric shocks. Combined automatic behavioral annotation and time–frequency analysis revealed that behavioral rhythms continued after cessation of the shocks. Furthermore, we found that aging impaired interval timing. This study thus not only demonstrates the ability of insects to acquire behavioral rhythms of a few seconds, but highlights a life-course decline of temporal coordination, which is also common in mammals.

Information of time in the environment is crucial to optimize physiology and behavior of organisms from amoebae to humans (Buhusi and Meck, 2005; Saigusa et al., 2008). Insects, for example, change their behavior according to a wide range of time scales, from sub-second to a day, such as in the generation of courtship songs and in circadian rhythm (Chouhan et al., 2015; Dubowy and Sehgal, 2017; Konopka and Benzer, 1971; Kyriacou and Hall, 1982; Shirangi et al., 2013; von Philipsborn et al., 2011). Perception of interval timing in the seconds range has scarcely been investigated, especially in invertebrates, despite its relevance to immediate behavioral adaptations (Buhusi and Meck, 2005; Gallistel and Gibbon, 2000).

Temporal conditioning is a direct experimental procedure which can behaviorally demonstrate the perception of interval timing (Lockhart, 1966; Pavlov, 1927). It was first developed more than a century ago and has been applied to multiple different species (Lockhart, 1966; Pavlov, 1927; Saigusa et al., 2008; Sumbre et al., 2008; Toda et al., 2017). In temporal conditioning, animals receive repeated stimuli that induce behavioral responses (unconditioned stimulus, US) at a regular interval. After a given number of US presentations, the subject is tested to see whether it retains its behavior responses at the trained interval (Pavlov, 1927). Dogs and amoeba acquire a rhythmic conditioned response (CR) at minutes-range intervals (Pavlov, 1927; Saigusa et al., 2008). Fish and mammals can remember seconds-range intervals after dozens to hundreds or even thousands of training stimulations (Lockhart, 1966; Sumbre et al., 2008; Toda et al., 2017). While it is known that insects use temporal information for associative learning (Boisvert and Sherry, 2006; Galili et al., 2011; Ito et al., 2008; Shuai et al., 2011; Szyszka et al., 2011; Tanimoto et al., 2004; Vogt et al., 2015; Yarali and Gerber, 2010), it is still unclear whether they can measure precise time intervals.

Electric shock is a powerful US, given the accurate temporal control and strong punitive effects on behavior. As a result, it has been employed for associative learning of Drosophila for decades (Aso et al., 2014; Chadha and Cook, 2014; Quinn et al., 1974; Vogt et al., 2016). Electric shocks induce a wide range of behavioral responses in flies (Chadha and Cook, 2014), although avoidance of the shock has been most widely measured (Appel et al., 2015; Hu et al., 2018). The difficulty of measuring shock responses, especially in freely moving flies, lies in their fast and diverse locomotor changes (i.e. jumping, flying, etc.).

By establishing a novel experimental system for temporal conditioning using repeated electric shocks, we report here that Drosophila melanogaster can remember seconds-range time intervals. By devising an image-based behavioral classification method, we efficiently detected shock responses. To quantify rhythmic behaviors, we applied time–frequency analysis, revealing that CRs continued after cessation of the shocks. We also examined variables critical for the acquisition of rhythmic behavior, such as inter-stimulus interval (ISI) and aging.

Flies

Male wild-type Drosophila melanogaster strain Canton S were used for the entire study. Flies were reared in a mass culture at 24°C under a 12 h:12 h light:dark cycle on a standard cornmeal-based food. The male flies were transferred to the conditioning arenas right before the experiment. All flies were handled without anesthesia throughout the study. We used 2–7 day old flies unless otherwise specified.

Conditioning apparatus

To enable simultaneous video recording and the presentation of electric shocks, a transparent shock grid was used, similar to Vogt et al. (2014) (Fig. 1A). Briefly, laser-structured indium tin oxide on a glass plate delivered a foot shock (9×9 cm; Diamond Coatings Ltd). Delivery of the shocks was controlled by a custom-written program via a PCI-interface and a custom device.

Fig. 1.

Video recording of behavioral responses to electric shocks. (A) Setup for video recording and image-based classification of behavior. Single flies were placed in the circular arenas, sandwiched between a glass lid and the transparent shock grid, and were backlit using an LED light box. Eight arenas were video recorded from above at a frame rate of 60 frames s−1. Using the fly tracking software TPro, basic information on individual flies, such as the position of the centroid and the body axis, was extracted from time series image data. Behavioral classification (resting, small movements, jumping, walking) was performed mainly based on the time course of linear velocity (see Materials and Methods for details). t, time at position i and position i+1; θ, body angle. (B) The four types of behavioral responses to a 50 V (AC) electric shock pulse lasting 100 ms. The upper row shows representative time courses of distinct locomotor behaviors, where each frame is presented in a unique color (scale bar: 2 mm). The bottom row shows histograms of shock responses (n=31). Vertical dashed lines indicate the onset of the shock.

Fig. 1.

Video recording of behavioral responses to electric shocks. (A) Setup for video recording and image-based classification of behavior. Single flies were placed in the circular arenas, sandwiched between a glass lid and the transparent shock grid, and were backlit using an LED light box. Eight arenas were video recorded from above at a frame rate of 60 frames s−1. Using the fly tracking software TPro, basic information on individual flies, such as the position of the centroid and the body axis, was extracted from time series image data. Behavioral classification (resting, small movements, jumping, walking) was performed mainly based on the time course of linear velocity (see Materials and Methods for details). t, time at position i and position i+1; θ, body angle. (B) The four types of behavioral responses to a 50 V (AC) electric shock pulse lasting 100 ms. The upper row shows representative time courses of distinct locomotor behaviors, where each frame is presented in a unique color (scale bar: 2 mm). The bottom row shows histograms of shock responses (n=31). Vertical dashed lines indicate the onset of the shock.

A single fly was introduced into a spatially confined arena using a plastic ring (diameter 26 mm, height 8 mm) and a glass lid (30 mm×30 mm) placed on the shock grid. The inner surface of the plastic ring and the glass lid were coated with Fluon and Sigmacote, respectively, to prevent climbing (Insect-a-Slip PTFE30, BioQuip Products, Sigma-Aldrich). Typically, 8 arenas were used simultaneously for one measurement.

The behavior of the individual fly in the arena was video recorded from above via a camera with a frame rate of 60 frames s−1 (Nikon 1 J5, Nikon). Flies were illuminated from beneath the shock grid using an LED light box (400-TBL003, SANWA supply).

Behavioral classification

Behavior was classified as jumping, walking, small movements, righting and resting, based on linear velocity, which was measured using open-source tracking software, TPro (Fig. 1A,B; Okuno et al., 2019; Sirigrivatanawong et al., 2017). Consecutive frames from each local minimum to the next local minimum of linear velocity were defined as a single unit and each unit was classified into a behavior based on the local maximum. Except for jumping, we set the minimal duration of behavior to 83 ms (5 frames). Jumping and walking were defined as showing a local maximum of the linear velocity at more than 63 mm s−1 and between 8 and 63 mm s−1, respectively. Climbing attempts with a local maximum of the linear velocity above 11 mm s−1 were excluded from the walk behavior based on the circularity of the elipse fitted to the fly. To distinguish walking from righting responses, which are often induced by electric shocks, those bouts above 21 mm s−1 in a local maximum of the sideways velocity were excluded from walking. We checked the accuracy of these filters with manual annotation and the accuracy was 92% and 99% for jumping and walking, respectively. Movement with a local maximum of the linear velocity below 10 mm s−1 was classified into small movements or rest, by applying the 1.5 mm s−1 threshold. The whole behavioral analysis was performed with R version 3. 5. 2 (http://www.R-project.org/).

Temporal conditioning

A single male fly was directly transferred from a food vial into each arena by using an aspirator, 15 min prior to conditioning. Ten pulses (each 0.1 s) of 50 V (50 Hz AC) electric shocks were presented at regular or variable intervals (Fig. 2). We chose 9 different intervals and shuffled those intervals randomly in order to make variable ISI protocols. The 9 intervals were evenly distributed between 0.4 s and twice ISI (e.g. from 0.4 to 4 s for an ISI of 2 s). We used 19–30 different variable ISI protocols for each condition. The test phase of experimental and control groups started at the same time (Fig. 2). We excluded flies that did not receive an electric shock even once, as a result of sticking on the wall or ceiling, from subsequent analysis.

Fig. 2.

Experimental design and data processing to detect periodicity oftheconditioned response. Flies of the experimental and control groups were both presented with 10 pulses of electric shocks at regular and random interstimulus intervals (ISIs), respectively. For each behavior, power spectral density was calculated by wavelet transformation. Power (a.u., arbitrary units) at the trained frequency was extracted from the experimental (Exp.) and control (Con.) groups, and values for the first expected shock after conditioning (dashed rectangle) were compared by permutation test. Vertical dashed lines indicate the onset of the first (left) and last (right) electric shocks.

Fig. 2.

Experimental design and data processing to detect periodicity oftheconditioned response. Flies of the experimental and control groups were both presented with 10 pulses of electric shocks at regular and random interstimulus intervals (ISIs), respectively. For each behavior, power spectral density was calculated by wavelet transformation. Power (a.u., arbitrary units) at the trained frequency was extracted from the experimental (Exp.) and control (Con.) groups, and values for the first expected shock after conditioning (dashed rectangle) were compared by permutation test. Vertical dashed lines indicate the onset of the first (left) and last (right) electric shocks.

Time–frequency analysis

Behavioral time series data were expanded into time–frequency space in order to quantify the periodicity, which is equal to the trained interval, of the flies' behavior by using wavelet transformation (Carmona et al., 1998; Cohen, 2014). Specifically, we used a complex Morlet wavelet function, which is created by multiplying a complex-valued sine wave by a Gaussian. The wavelet function (ψ) is defined as follows:
formula
(1)
with
formula
(2)
where t is time, σ is standard deviation of the Gaussian, f is frequency from 0.06 to 30 Hz in 135 logarithmically spaced steps, and n represents the number of cycles within the width of the Gaussian (set to 6 here). The parameter n controls the trade-off between temporal precision and frequency precision; higher values provide lower temporal precision and higher frequency precision, and vice versa.

We compared the power of the experimental and control groups at the trained frequency in the time window of 0.5 s, centered on the time of the first expected shock after training. Generally, lower frequency components have lower temporal precision. Therefore, periodicity in training can be detected in adjacent time points, thus potentially confounding the CR. We controlled this ‘leakage’ by confirming no significant power differences before training (see also Results).

Permutation test

We performed a permutation test to assess the statistical significance of the trained periodicity of the flies' behavior (Fig. 2). For the test, experimental and control animals were pooled and then randomly classified into simulated datasets of the same size as in the original data. The power of the trained periodicity was calculated for each of 1000 randomly permutated datasets, and the normal distribution was fitted to describe the histogram of the differences between the permutated ‘experimental’ and ‘control’ groups. The P-value was defined as twice the area fraction from the tail at the observed difference in the fitted distribution. The bootstrap estimate of the standard error was calculated as the standard deviation of the bootstrap distribution. The bootstrap distribution of trained periodicity was created by random resampling (1000 times) of data points with replacement from the raw data pool. Other datasets (Fig. 6C,F) were analyzed by the Kruskal–Wallis test followed by the Mann–Whitney test with Bonferroni correction. The significance level of all statistical tests was set to 0.05 (two-sided test). All statistical analyses were performed with R version 3.5.2 (http://www.R-project.org/).

Diverse behavioral responses to electric shocks

The temporal precision of US presentations is a critical factor in temporal conditioning with short ISIs. Flies show an array of electric shock responses, some of which are too fast for manual scoring. To systematically characterize the shock responses, we developed a system for high-speed image acquisition and behavioral classification (Fig. 1A). We video recorded an individual fly in a circular arena on transparent shock grids at 60 frames s−1 (Fig. 1A). Intense LED backlight allowed high-contrast capturing of the fly shape at the shutter speed of 0.5 ms (Vogt et al., 2016). The positions and angles of flies in each frame were determined using TPro open-source tracking software (Okuno et al., 2019; Sirigrivatanawong et al., 2017). We categorized the behavioral state of the fly into four classes: jumping, walking, small movements and resting (Fig. 1A,B).

In response to a single 50 V shock lasting 100 ms, flies sharply increased movements, such as jumping and walking, with short latency: 70 and 220 ms of the peak time of jumping and walking, respectively (Fig. 1B). These immediate locomotor responses ceased within 1 s (Fig. 1B). In contrast, a single electric shock induced a longer-lasting decrement in resting, perhaps shifting behavioral states (Fig. 1B). Therefore, ISI in temporal conditioning should be longer than 1 s in order to detect rhythmic jumps and walks.

Time–frequency analysis reveals the acquisition of rhythmic behavior in temporal conditioning

To examine whether flies can perceive time intervals in the range of seconds, we sought to establish temporal conditioning by presenting the experimental group with repeated electric shocks at regular intervals (Fig. 2). Subsequently, we measured whether the subject retained behavioral responses at the trained interval (Lockhart, 1966; Pavlov, 1927). We presented the same number of electric shocks over the same total duration to the control group but with variable ISIs (Fig. 2). The CR was defined by the post-training difference in periodic behavior of the experimental and control groups (Fig. 2).

To quantify whether flies acquired behavioral periodicity, we applied time–frequency decomposition using a complex Morlet wavelet to the time course of behavioral rate (Fig. 2). Wavelet analysis detects the periodicity characteristics of data over time (Berman et al., 2014). The time course of the data series for each behavioral component was converted into a spectrogram by wavelet transformation. To measure the CR, we analyzed the power of the trained frequency at the time of the first expected shock after training (Fig. 2). Finally, we quantitatively compared the power of the experimental and control groups using a permutation test (for further details, see Materials and Methods).

We subjected flies to a repetition of 10 electric shocks at a 2 s ISI. First, we applied wavelet analysis to velocity data of each fly, and averaged spectrograms for the experimental and control groups. The trained frequency component of the experimental group was clearly increased during the training phase, although a significant post-training power difference was not detected (Fig. S1). This result motivated us to analyze the time course of each behavioral component, because various responses were represented in the velocity data and these behavioral responses contributed differently to the power.

The time course of jumps in the experimental group showed clear regularity in response to each shock (Fig. 3A). However, the histogram data do not distinguish individuals with variable behavioral responses. Analysis of selected flies that consistently jumped during conditioning revealed clear post-training anticipated jumps peaked at the expected timing of shock (Fig. S2). In the time–frequency representation of jump data of the entire population, the regularity of jumps was notable during the training phase, and lasted even after termination of the shock (Fig. 3B). This post-training periodicity in jumping was much reduced in the variable ISI control group (P<0.05; Fig. 3B,C). While wavelet transformation is suited to localizing dynamic frequency structures in time, power at a given time point is also influenced by neighboring time points (Cohen, 2014). To control the carry-over of large power during training, we artificially created a ‘pseudo-control’ with the hybrid time series of the experimental (until the last shock) and control (post-training) jump rates. Wavelet transformation of the pseudo-control showed decreased post-training periodicity compared with the experimental group (Fig. S3). Furthermore, we analyzed pre-training periodicity at equal timing, where frequency information during training has a similar influence, and found no significant difference between the experimental and control groups (Fig. 3D). We thus conclude that the post-training power at the expected shock represents sustained rhythmic jumping.

Fig. 3.

Behavioral rhythm lasts after temporal conditioning. (A) The time course of jumping in the experimental (2 s ISI) and control (variable ISI) groups. Vertical dashed lines indicate the onset of the first (left) and last (right) electric shocks. (B) Spectrograms of jumping in the experimental and the control groups (shown below at higher magnification). Arrowheads indicate the trained frequency (0.5 Hz). Conditioning induced periodic jumping at the trained frequency selectively in the experimental group. (C) Comparison of the power of the experimental and control groups (post-training) in response to 0.5 Hz stimulation at the time of the expected shock for the different behaviors. (D) Power of the experimental and control groups (pre-training) in response to 0.5 Hz stimulation, 2 s before the first shock (−2.25 to −1.75 s). Error bars represent the bootstrap estimate of the standard errors. *P<0.05; n=233 and 214 for the control and experimental groups, respectively.

Fig. 3.

Behavioral rhythm lasts after temporal conditioning. (A) The time course of jumping in the experimental (2 s ISI) and control (variable ISI) groups. Vertical dashed lines indicate the onset of the first (left) and last (right) electric shocks. (B) Spectrograms of jumping in the experimental and the control groups (shown below at higher magnification). Arrowheads indicate the trained frequency (0.5 Hz). Conditioning induced periodic jumping at the trained frequency selectively in the experimental group. (C) Comparison of the power of the experimental and control groups (post-training) in response to 0.5 Hz stimulation at the time of the expected shock for the different behaviors. (D) Power of the experimental and control groups (pre-training) in response to 0.5 Hz stimulation, 2 s before the first shock (−2.25 to −1.75 s). Error bars represent the bootstrap estimate of the standard errors. *P<0.05; n=233 and 214 for the control and experimental groups, respectively.

For the other types of behavior, post-training power differences were not statistically significant, despite a strong tendency for small movements (Fig. 3C). These results indicate that flies acquired 2 s rhythmic behavior following the presentation of repeated electric shocks.

Critical factors influencing acquired rhythmic behavior

Effective numbers of stimulus presentations in temporal conditioning are different among species (Saigusa et al., 2008; Sumbre et al., 2008; Toda et al., 2017). Mice, for example, need to be trained with hundreds of repeats to acquire a robust CR (Toda et al., 2017). To examine whether higher numbers of stimulus presentations improve the CR in the fly, we conditioned flies with 4, 10, 20 and 40 regular shocks (Fig. 4A). We found that post-training periodicity in jumping peaked at conditioning with 10 shocks, and extended training did not improve performance (Fig. 4B,C). This may be due to fatigue upon repeated shock responses. We indeed observed a delay in shock-induced jumps after many trials (data not shown). Other than jumping, we did not detect statistically significant post-training power differences in any stimulus repetitions (data not shown). Thus, flies acquire rhythmic jumps optimally with around 10 shocks.

Fig. 4.

Effect of stimulus repetition ontheconditioned response. (A) Schematic diagram of temporal conditioning with different numbers of electric shocks. (B) Spectrogram of jumping by the experimental group in the last phase of temporal conditioning and post-training when trained with 4, 10, 20 and 40 shocks. Vertical dashed lines represent the onset of the 9th and last electric shocks. Arrowheads indicate the trained frequency (0.5 Hz). (C) Comparison of the power in control and experimental groups in response to 0.5 Hz stimulation at the time of the expected shock for jumping. Error bars represent the bootstrap estimate of the standard errors. *P<0.05, **P<0.01; 4 shocks: n=41 and 46, 10 shocks: n=42 and 31, 20 shocks: n=38 and 24, and 40 shocks: n=28 and 27 for the control and experimental groups, respectively.

Fig. 4.

Effect of stimulus repetition ontheconditioned response. (A) Schematic diagram of temporal conditioning with different numbers of electric shocks. (B) Spectrogram of jumping by the experimental group in the last phase of temporal conditioning and post-training when trained with 4, 10, 20 and 40 shocks. Vertical dashed lines represent the onset of the 9th and last electric shocks. Arrowheads indicate the trained frequency (0.5 Hz). (C) Comparison of the power in control and experimental groups in response to 0.5 Hz stimulation at the time of the expected shock for jumping. Error bars represent the bootstrap estimate of the standard errors. *P<0.05, **P<0.01; 4 shocks: n=41 and 46, 10 shocks: n=42 and 31, 20 shocks: n=38 and 24, and 40 shocks: n=28 and 27 for the control and experimental groups, respectively.

To characterize the time range over which flies can acquire behavioral rhythms, we trained them with four different ISIs: 1.4, 2, 3 and 5 s. For all tested ISIs, periodic jumping in the experimental groups tended to be higher than that of the corresponding control groups, while a statistically significant difference was only detected for the group with the 2 s ISI (Fig. 5A,B). We examined other types of CRs, and identified an increase of periodicity in small movements (Fig. 5C,D). The periodic small movements were significant for the 1.4 s ISI group, but not for ISIs of 2 s or longer (Fig. 5D). It is intriguing that the optimal CR changes depending on the ISI. These results suggest that flies can acquire behavioral rhythms up to an ISI of 2 s.

Fig. 5.

Flies acquire significant rhythmic behaviorup to an ISI ofat least 2 s. (A) Spectrogram of jumping of the experimental group in the last phase of temporal conditioning and post-training when trained with an ISI of 1.4, 2, 3 and 5 s. Arrowheads indicate the trained frequency. Periodic jumping was stronger with shorter ISIs. Vertical dashed lines represent the onset of the 9th and last electric shocks. (B) Comparison of the post-training power for jumping at the trained frequencies. For all ISIs, the experimental groups showed higher performance, although statistical significance was only detected for the 2 s group. (C) Spectrograms of small movements in the last phase of temporal conditioning and post-training when trained with an ISI of 1.4 s. The robust periodic small movements acquired during temporal conditioning lasted after training, whereas the control group showed much weaker power. (D) Comparison of post-training power for small movements at the trained frequencies. Error bars represent the bootstrap estimate of the standard errors. *P<0.05; 1.4 s: n=207 and 200, 2 s: n=213 and 202, 3 s: n=204 and 209, and 5 s: n=211 and 197 for the control and experimental groups, respectively.

Fig. 5.

Flies acquire significant rhythmic behaviorup to an ISI ofat least 2 s. (A) Spectrogram of jumping of the experimental group in the last phase of temporal conditioning and post-training when trained with an ISI of 1.4, 2, 3 and 5 s. Arrowheads indicate the trained frequency. Periodic jumping was stronger with shorter ISIs. Vertical dashed lines represent the onset of the 9th and last electric shocks. (B) Comparison of the post-training power for jumping at the trained frequencies. For all ISIs, the experimental groups showed higher performance, although statistical significance was only detected for the 2 s group. (C) Spectrograms of small movements in the last phase of temporal conditioning and post-training when trained with an ISI of 1.4 s. The robust periodic small movements acquired during temporal conditioning lasted after training, whereas the control group showed much weaker power. (D) Comparison of post-training power for small movements at the trained frequencies. Error bars represent the bootstrap estimate of the standard errors. *P<0.05; 1.4 s: n=207 and 200, 2 s: n=213 and 202, 3 s: n=204 and 209, and 5 s: n=211 and 197 for the control and experimental groups, respectively.

Past studies in mammals have suggested an association between age and the accuracy of interval timing (Rannie and Russell, 2017; Wild-Wall et al., 2008). To address this in the fly, we examined standard temporal conditioning of flies in four different age groups ranging from 1 to 4 weeks old. We found that shock-induced jump bouts declined with age (Fig. 6C). Post-conditioning periodic jumping in 1 and 2 week old flies persisted strongly (Fig. 6A,B), but was dramatically decreased in 3 and 4 week old flies (Fig. 6A,B). Interestingly, the period of jumping right after conditioning became shorter than the trained frequency in the older flies (Fig. 6A). An age-dependent decline in jumping and a post-training shift of periodicity can thus explain the decreased power of periodic jumps in the older flies.

Fig. 6.

Aging changes acquired behavioral rhythms. (A,D) Spectrograms of jumping (A) and walking (D) in the last phase and after temporal conditioning in the experimental group. Arrowheads indicate the trained frequency (0.5 Hz). Vertical dashed lines represent the onset of the 9th and last electric shocks. The age-associated decline in periodic jumping was noticeable, whereas periodic walking peaked around 3 weeks after eclosion. (B,E) Comparison of the 0.5 Hz power at the time of the expected shock for jumping (B) and walking (E) of flies at different ages. Error bars represent the bootstrap estimate of the standard errors. *P<0.05. (C,F) Fraction of time for jumping (C) and walking (F) responses to electric shocks during temporal conditioning. Horizontal bars represent the median, vertical lines indicate the range of the 1st to 3rd quartiles. Different lettering indicates pairwise significance; 1 week old: n=114 and 124, 2 weeks old: n=142 and 129, 3 weeks old: n=147 and 139, and 4 weeks old: n=150 and 151 for the control and experimental groups, respectively.

Fig. 6.

Aging changes acquired behavioral rhythms. (A,D) Spectrograms of jumping (A) and walking (D) in the last phase and after temporal conditioning in the experimental group. Arrowheads indicate the trained frequency (0.5 Hz). Vertical dashed lines represent the onset of the 9th and last electric shocks. The age-associated decline in periodic jumping was noticeable, whereas periodic walking peaked around 3 weeks after eclosion. (B,E) Comparison of the 0.5 Hz power at the time of the expected shock for jumping (B) and walking (E) of flies at different ages. Error bars represent the bootstrap estimate of the standard errors. *P<0.05. (C,F) Fraction of time for jumping (C) and walking (F) responses to electric shocks during temporal conditioning. Horizontal bars represent the median, vertical lines indicate the range of the 1st to 3rd quartiles. Different lettering indicates pairwise significance; 1 week old: n=114 and 124, 2 weeks old: n=142 and 129, 3 weeks old: n=147 and 139, and 4 weeks old: n=150 and 151 for the control and experimental groups, respectively.

As jumping may be a demanding locomotor behavior for aged flies, we examined the periodicity of walking in the same age groups during and after temporal conditioning. Shock-induced walking bouts indeed did not decrease with age (Fig. 6F). Interestingly, there was robust post-training periodic walking in the older groups, whereas younger flies performed much less (Fig. 6D,E). Periodic walking at the trained frequency between the experimental and control groups was significantly different in the 3 week old flies (P<0.05, Fig. 6E). Although the 3 week old flies did not show significant conditioned jumping (Fig. 6A,B), they still can acquire interval timing, but they perhaps shift the behavioral expression to the less demanding walking behavior.

New temporal conditioning paradigm in fruit flies

To study seconds-range interval timing in D. melanogaster, we developed a new temporal conditioning task and established an analysis pipeline to characterize acquired rhythmic behavior. After presenting repeated electric shocks at regular intervals to the flies, we showed that they can acquire rhythms of various behaviors up to an ISI of at least 2 s.

While studies on time perception of animals with fixed interval tasks have a history of more than 100 years (Pavlov, 1927), our new behavioral paradigm has several advantages over existing ones. First, our control group with the US presentations at variable ISIs is critical to precisely interpret conditioning-dependent rhythms (Fig. 2). The US is known to induce late-onset behavioral changes in addition to immediate responses (Lockhart, 1966). In our case, the resting behavior was decreased more than 5 s following the electric shock application (Fig. 1B). Baseline jumping also increased during repetitive shock delivery via conditioning (Fig. 3A). These timing-irrelevant behavioral changes can confound the CR, especially if these changes emerge at the same time as the trained interval.

Thus far, the most widely used evaluation method of interval timing is the peak procedure (Roberts, 1981). This is useful when the time course of behavioral counts has a bell shape (Roberts, 1981). In contrast, the time–frequency analysis we applied here can detect periodicity in time–series data of complex dynamics as well as simpler peaks (Fig. 3; Fig. S2). This versatility is powerful as the time courses of shock responses are distinct among different behavioral measures (Fig. 1B).

Understanding the control of time perception and locomotion

Time perception is a delicate cognitive faculty influenced by many internal and external variables (Buhusi and Meck, 2005; Matthews and Meck, 2014). Flies acquired interval timing with much less repetition than mice (Fig. 4; Toda et al., 2017); however, many studies with mice used an appetitive stimulus as the US (Balci et al., 2008; Narayanan et al., 2012; Toda et al., 2017). Acquisition speed of temporal conditioning might thus depend on the valence of the US (Saigusa et al., 2008; Sumbre et al., 2008).

Aging is a widely known factor that can affect time perception (Turgeon et al., 2016). Our evaluation of the CR with multiple behavioral metrics indeed identified age-dependent changes in shock responses and CRs (Fig. 6). Post-training rhythms of jumping in older flies became shorter than the trained interval, as shown by the upward frequency shift of the power spectrogram (Fig. 6A). Similarly, aged human subjects were reported to reproduce shorter intervals than the trained interval when they were asked to reproduce intervals in the supra-second range, such as 1.5 s (Bangert and Balota, 2012; McAuley et al., 2006). Interestingly, 3 week old flies are indeed capable of perceiving interval timing as expressed by periodic walking (Fig. 6D,E). This behavior-selective impairment implies that jumping and walking may be controlled by different interval timing systems. Alternatively, aging can simply alter sensory thresholds of shocks, such that the same intensity of shocks does not induce jumping in older flies (Simon et al., 2006).

As in Parkinson's disease, the dopaminergic system is known to deteriorate with aging in different species including Drosophila, although the pathology of dopamine neurons is species dependent (Naoi and Maruyama, 1999; Navarro et al., 2014; Riemensperger et al., 2013; Rodriguez et al., 2015). Intriguingly, dopamine circuits in mammalian brains are proposed to play a central role in seconds-range time perception (Buhusi and Meck, 2005; Narayanan et al., 2012; Soares et al., 2016; Turgeon et al., 2016). Dopamine neurons in the fly are known to convey electric shock reinforcement (Aso et al., 2012; Claridge-Chang et al., 2009; Schwaerzel et al., 2003) and are amenable to aging (Riemensperger et al., 2013). It would therefore be exciting to examine the commonality in circuit usage between time perception and other associative learning tasks (Vogt et al., 2014).

Beyond aging, future studies can examine critical factors for interval timing, such as feeding state, temperature and genetic mutations, as they drastically affect locomotion (Aggarwal et al., 2019; Lee and Park, 2004; Ostrowski et al., 2018). Combined with precise genetic manipulation, temporal conditioning in Drosophila will provide a useful experimental platform to tackle the neuronal mechanism of seconds-range time perception.

We thank Toshiharu Ichinose, Pavel Masek and Vladimiros Thoma for discussions and suggestions; Takuto Okuno and Pudith Sirigrivatanawong for constructing the behavioral analysis method; Yasumasa Matsuda and Ajayrama Kumaraswarmy for the implementation of time–frequency analysis; and Katrina Lynn for reviewing the manuscript.

Author contributions

Conceptualization: M.I., H.T.; Methodology: M.I., H.T.; Software: M.I.; Validation: M.I., H.T.; Formal analysis: M.I.; Investigation: M.I.; Resources: H.T.; Data curation: M.I.; Writing - original draft: M.I., H.T.; Writing - review & editing: M.I., H.T.; Visualization: M.I.; Supervision: H.T.; Project administration: H.T.; Funding acquisition: H.T.

Funding

This study was supported by the Ministry of Education, Culture, Sports, Science and Technology – Japan/JSPS KAKENHI (16H01496, 19K22577 to H.T.).

Data availability

Raw tracking data and R scripts used in this study are available from the GIN repository: https://gin.g-node.org/Tanimoto_lab/Tracking_data_and_Analysis_codes_in_Ikarashi_2021

Aggarwal
,
A.
,
Reichert
,
H.
and
VijayRaghavan
,
K.
(
2019
).
A locomotor assay reveals deficits in heterozygous Parkinson's disease model and proprioceptive mutants in adult Drosophila
.
Proc. Natl Acad. Sci. USA
116
,
24830
-
24839
.
Appel
,
M.
,
Scholz
,
C.-J.
,
Müller
,
T.
,
Dittrich
,
M.
,
König
,
C.
,
Bockstaller
,
M.
,
Oguz
,
T.
,
Khalili
,
A.
,
Antwi-Adjei
,
E.
,
Schauer
,
T.
et al. 
(
2015
).
Genome-wide association analyses point to candidate genes for electric shock avoidance in Drosophila melanogaster
.
PLoS ONE
10
,
e0126986
.
Aso
,
Y.
,
Herb
,
A.
,
Ogueta
,
M.
,
Siwanowicz
,
I.
,
Templier
,
T.
,
Friedrich
,
A. B.
,
Ito
,
K.
,
Scholz
,
H.
Tanimoto
,
H.
(
2012
).
Three dopamine pathways induce aversive odor memories with different stability
.
PLoS Genet.
8
,
e1002768
.
Aso
,
Y.
,
Sitaraman
,
D.
,
Ichinose
,
T.
,
Kaun
,
K. R.
,
Vogt
,
K.
,
Belliart-Guérin
,
G.
,
Plaçais
,
P.-Y.
,
Robie
,
A. A.
,
Yamagata
,
N.
,
Schnaitmann
,
C.
et al. 
(
2014
).
Mushroom body output neurons encode valence and guide memory-based action selection in Drosophila
.
eLife
3
,
e04580
.
Balci
,
F.
,
Ludvig
,
E. A.
,
Gibson
,
J. M.
,
Allen
,
B. D.
,
Frank
,
K. M.
,
Kapustinski
,
B. J.
,
Fedolak
,
T. E.
and
Brunner
,
D.
(
2008
).
Pharmacological manipulations of interval timing using the peak procedure in male C3H mice
.
Psychopharmacology
201
,
67
-
80
.
Bangert
,
A. S.
and
Balota
,
D. A.
(
2012
).
Keep up the pace: declines in simple repetitive timing differentiate healthy aging from the earliest stages of Alzheimer's disease
.
J. Intl. Neuropsychol. Soc.
18
,
1052
-
1063
.
Berman
,
G. J.
,
Choi
,
D. M.
,
Bialek
,
W.
and
Shaevitz
,
J. W.
(
2014
).
Mapping the stereotyped behaviour of freely moving fruit flies
.
J. R Soc. Interface
11
,
20140672
.
Boisvert
,
M. J.
and
Sherry
,
D. F.
(
2006
).
Interval timing by an invertebrate, the bumble bee Bombus impatiens
.
Curr. Biol.
16
,
1636
-
1640
.
Buhusi
,
C. V.
and
Meck
,
W. H.
(
2005
).
What makes us tick? Functional and neural mechanisms of interval timing
.
Nat. Rev. Neurosci.
6
,
755
-
765
.
Carmona
,
R.
,
Hwang
,
W.-L.
and
Torrésani
,
B.
(
1998
).
Practical Time-Frequency Analysis: Gabor And Wavelet Transforms With An Implementation In S
.
Academic Press
.
Chadha
,
A.
and
Cook
,
B.
(
2014
).
The effect of stress on motor function in Drosophila
.
PLoS ONE
9
,
e112076
.
Chouhan
,
N. S.
,
Wolf
,
R.
,
Helfrich-Förster
,
C.
and
Heisenberg
,
M.
(
2015
).
Flies remember the time of day
.
Curr. Biol.
25
,
1619
-
1624
.
Claridge-Chang
,
A.
,
Roorda
,
R. D.
,
Vrontou
,
E.
,
Sjulson
,
L.
,
Li
,
H.
,
Hirsh
,
J.
and
Miesenböck
,
G.
(
2009
).
Writing memories with light-addressable reinforcement circuitry
.
Cell
139
,
405
-
415
.
Cohen
,
M. X.
(
2014
).
Analyzing Neural Time Series Data Theory And Practice
.
MIT Press
.
Dubowy
,
C.
and
Sehgal
,
A.
(
2017
).
Circadian rhythms and sleep in Drosophila melanogaster
.
Genetics
205
,
1373
-
1397
.
Galili
,
D. S.
,
Lüdke
,
A.
,
Galizia
,
C. G.
,
Szyszka
,
P.
and
Tanimoto
,
H.
(
2011
).
Olfactory trace conditioning in Drosophila
.
J. Neurosci.
31
,
7240
.
Gallistel
,
C. R.
and
Gibbon
,
J.
(
2000
).
Time, rate, and conditioning
.
Psychol. Rev.
107
,
289
-
344
.
Hu
,
W.
,
Peng
,
Y.
,
Sun
,
J.
,
Zhang
,
F.
,
Zhang
,
X.
,
Wang
,
L.
,
Li
,
Q.
and
Zhong
,
Y.
(
2018
).
Fan-shaped body neurons in the Drosophila brain regulate both innate and conditioned nociceptive avoidance
.
Cell Rep
24
,
1573
-
1584
.
Ito
,
I.
,
Ong
,
R. C.-y.
,
Raman
,
B.
and
Stopfer
,
M.
(
2008
).
Sparse odor representation and olfactory learning
.
Nat. Neurosci.
11
,
1177
-
1184
.
Konopka
,
R. J.
and
Benzer
,
S.
(
1971
).
Clock mutants of Drosophila melanogaster
.
Proc. Natl Acad. Sci. USA
68
,
2112
-
2116
.
Kyriacou
,
C. P.
and
Hall
,
J. C.
(
1982
).
The function of courtship song rhythms in Drosophila
.
Anim. Behav.
30
,
794
-
801
.
Lee
,
G.
and
Park
,
J. H.
(
2004
).
Hemolymph sugar homeostasis and starvation-induced hyperactivity affected by genetic manipulations of the Adipokinetic hormone-encoding gene in Drosophila melanogaster
.
Genetics
167
,
311
-
323
.
Lockhart
,
R. A.
(
1966
).
Temporal conditioning of GSR
.
J. Exp. Psychol.
71
,
438
-
446
.
Matthews
,
W. J.
and
Meck
,
W. H.
(
2014
).
Time perception: the bad news and the good
.
WIREs Cogn. Sci.
5
,
429
-
446
.
McAuley
,
J. D.
,
Jones
,
M. R.
,
Holub
,
S.
,
Johnston
,
H. M.
and
Miller
,
N. S.
(
2006
).
The time of our lives: life span development of timing and event tracking
.
J. Exp. Psychol. Gen.
135
,
348
-
367
.
Naoi
,
M.
and
Maruyama
,
W.
(
1999
).
Cell death of dopamine neurons in aging and Parkinson's disease
.
Mech. Ageing Dev.
111
,
175
-
188
.
Narayanan
,
N. S.
,
Land
,
B. B.
,
Solder
,
J. E.
,
Deisseroth
,
K.
and
DiLeone
,
R. J.
(
2012
).
Prefrontal D1 dopamine signaling is required for temporal control
.
Proc. Natl. Acad. Sci. USA
109
,
20726
-
20731
.
Navarro
,
J. A.
,
Heßner
,
S.
,
Yenisetti
,
S. C.
,
Bayersdorfer
,
F.
,
Zhang
,
L.
,
Voigt
,
A.
,
Schneuwly
,
S.
and
Botella
,
J. A.
(
2014
).
Analysis of dopaminergic neuronal dysfunction in genetic and toxin-induced models of Parkinson's disease in Drosophila
.
J. Neurochem.
131
,
369
-
382
.
Okuno
,
T.
,
Hashimoto
,
K.
and
Tanimoto
,
H.
(
2019
).
Quantification of Aggregation and Associated Brain Areas in Drosophila melanogaster
. In
2019 IEEE International Conference on Pervasive Computing and Communications Workshops (PerCom Workshops)
, pp.
759
-
764
.
Ostrowski
,
D.
,
Salari
,
A.
,
Zars
,
M.
and
Zars
,
T.
(
2018
).
A biphasic locomotor response to acute unsignaled high temperature exposure in Drosophila
.
PLoS ONE
13
,
e0198702
.
Pavlov
,
I. P.
(
1927
).
Conditioned Reflexes: an Investigation of the Physiological Activity of the Cerebral Cortex
.
Oxford University Press
.
Quinn
,
W. G.
,
Harris
,
W. A.
and
Benzer
,
S.
(
1974
).
Conditioned behavior in Drosophila melanogaster
.
Proc. Natl Acad. Sci. USA
71
,
708
-
712
.
Rannie
,
X.
and
Russell
,
M. C.
(
2017
).
Age-related changes in human and nonhuman timing
.
Timing & Time Perception
5
,
261
-
279
.
Riemensperger
,
T.
,
Issa
,
A.-R.
,
Pech
,
U.
,
Coulom
,
H.
,
Nguyễn
,
M.-V.
,
Cassar
,
M.
,
Jacquet
,
M.
,
Fiala
,
A.
and
Birman
,
S.
(
2013
).
A single dopamine pathway underlies progressive locomotor deficits in a Drosophila model of parkinson disease
.
Cell Reports
5
,
952
-
960
.
Roberts
,
S.
(
1981
).
Isolation of an internal clock
.
J. Exp. Psychol. Anim. Behav. Process.
7
,
242
-
268
.
Rodriguez
,
M.
,
Rodriguez-Sabate
,
C.
,
Morales
,
I.
,
Sanchez
,
A.
and
Sabate
,
M.
(
2015
).
Parkinson's disease as a result of aging
.
Aging Cell
14
,
293
-
308
.
Saigusa
,
T.
,
Tero
,
A.
,
Nakagaki
,
T.
and
Kuramoto
,
Y.
(
2008
).
Amoebae anticipate periodic events
.
Phys. Rev. Lett.
100
,
018101
.
Schwaerzel
,
M.
,
Monastirioti
,
M.
,
Scholz
,
H.
,
Friggi-Grelin
,
F.
,
Birman
,
S.
and
Heisenberg
,
M.
(
2003
).
Dopamine and octopamine differentiate between aversive and appetitive olfactory memories in Drosophila
.
J. Neurosci.
23
,
10495
-
10502
.
Shirangi
,
T. R.
,
Stern
,
D. L.
and
Truman
,
J. W.
(
2013
).
Motor control of Drosophila courtship song
.
Cell Reports
5
,
678
-
686
.
Shuai
,
Y.
,
Hu
,
Y.
,
Qin
,
H.
,
Campbell
,
R. A. A.
and
Zhong
,
Y.
(
2011
).
Distinct molecular underpinnings of Drosophila olfactory trace conditioning
.
Proc. Natl. Acad. Sci. USA
108
,
20201
-
20206
.
Simon
,
A. F.
,
Liang
,
D. T.
and
Krantz
,
D. E.
(
2006
).
Differential decline in behavioral performance of Drosophila melanogaster with age
.
Mech. Ageing Dev.
127
,
647
-
651
.
Sirigrivatanawong
,
P.
,
Arai
,
S.
,
Thoma
,
V.
and
Hashimoto
,
K.
(
2017
).
Multiple Drosophila tracking system with heading direction
.
Sensors (Basel, Switzerland)
17
.
Soares
,
S.
,
Atallah
,
B. V.
and
Paton
,
J. J.
(
2016
).
Midbrain dopamine neurons control judgment of time
.
Science
354
,
1273
-
1277
.
Sumbre
,
G.
,
Muto
,
A.
,
Baier
,
H.
and
Poo
,
M.-m.
(
2008
).
Entrained rhythmic activities of neuronal ensembles as perceptual memory of time interval
.
Nature
456
,
102
-
106
.
Szyszka
,
P.
,
Demmler
,
C.
,
Oemisch
,
M.
,
Sommer
,
L.
,
Biergans
,
S.
,
Birnbach
,
B.
,
Silbering
,
A. F.
and
Galizia
,
C. G.
(
2011
).
Mind the Gap: olfactory trace conditioning in honeybees
.
J. Neurosci.
31
,
7229
-
7239
.
Tanimoto
,
H.
,
Heisenberg
,
M.
and
Gerber
,
B.
(
2004
).
Event timing turns punishment to reward
.
Nature
430
,
983-983
.
Toda
,
K.
,
Lusk
,
N. A.
,
Watson
,
G. D. R.
,
Kim
,
N.
,
Lu
,
D.
,
Li
,
H. E.
,
Meck
,
W. H.
and
Yin
,
H. H.
(
2017
).
Nigrotectal stimulation stops interval timing in mice
.
Curr. Biol.
27
,
3763
-
3770.e3
.
Turgeon
,
M.
,
Lustig
,
C.
and
Meck
,
W. H.
(
2016
).
Cognitive aging and time perception: roles of bayesian optimization and degeneracy
.
Front. Aging Neurosci.
8
,
102-102
.
Vogt
,
K.
,
Schnaitmann
,
C.
,
Dylla
,
K. V.
,
Knapek
,
S.
,
Aso
,
Y.
,
Rubin
,
G. M.
and
Tanimoto
,
H.
(
2014
).
Shared mushroom body circuits underlie visual and olfactory memories in Drosophila
.
eLife
3
,
e02395
.
Vogt
,
K.
,
Yarali
,
A.
and
Tanimoto
,
H.
(
2015
).
Reversing stimulus timing in visual conditioning leads to memories with opposite valence in Drosophila
.
PLoS ONE
10
,
e0139797
.
Vogt
,
K.
,
Aso
,
Y.
,
Hige
,
T.
,
Knapek
,
S.
,
Ichinose
,
T.
,
Friedrich
,
A. B.
,
Turner
,
G. C.
,
Rubin
,
G. M.
and
Tanimoto
,
H.
(
2016
).
Direct neural pathways convey distinct visual information to Drosophila mushroom bodies
.
eLife
5
,
e14009
.
von Philipsborn
,
A. C.
,
Liu
,
T.
,
Yu
,
J. Y.
,
Masser
,
C.
,
Bidaye
,
S. S.
and
Dickson
,
B. J.
(
2011
).
Neuronal control of Drosophila courtship song
.
Neuron
69
,
509
-
522
.
Wild-Wall
,
N.
,
Willemssen
,
R.
,
Falkenstein
,
M.
and
Beste
,
C.
(
2008
).
Time estimation in healthy ageing and neurodegenerative basal ganglia disorders
.
Neurosci. Lett.
442
,
34
-
38
.
Yarali
,
A.
and
Gerber
,
B.
(
2010
).
A neurogenetic dissociation between punishment-, reward-, and relief-learning in Drosophila
.
Front. Behav. Neurosci.
4
,
189
.

Competing interests

The authors declare no competing or financial interests.

Supplementary information