(A) Sketch of the mathematical model that uses four exponential terms to describe temporal patterns of a fly activity. Horizontal white/black bars represent alternating light/dark conditions. (B, C) Example fits (red) of (B) temporal pattern and (C) power spectrum of grooming activity (green) of an individual fly during 3 days in LD environment. The activity data are binned in 1 hr for visual clarity. (D, E) Example fits (red) of (D) temporal pattern and (E) power spectrum of locomotion activity (gray) of an individual fly during 3 days in LD environment. The activity data are binned in 1 hr for visual clarity. To quantitatively compare the temporal patterns of grooming and locomotion (Figure 4—figure supplement 2), we applied a previously developed mathematical method that allows quantification of the main features in fly locomotion pattern. (Lazopulo and Syed, 2016). The quantification is achieved by fitting activity data with a model that consists of four exponential terms:
The model has nine independent parameters that describe activity pattern. Parameters , , , define rates of morning decay (MD), morning rise (MR), evening decay (ED) and evening rise (ER), respectively. Parameter T0 defines circadian period, and define widths of M and E peaks, and and define heights of M and E peaks, as shown in sketch in panel (A). The white and black horizontal bars represent lights-on and -off phases of the external light-dark cycle. Values of the parameters are obtained from the activity data in a few steps. First, the circadian period is estimated from the power spectrum of activity data. Then, preliminary parameter values are estimated by fitting the locomotion recording with the function . These values serve as initial guess for fitting the data power spectrum with an analytical expression derived by calculating the Fourier transform of :
where = , with and is the circadian period. By using the spectral fit, we extract model parameters without filtering or binning. Fitting of the power spectrum produces final values for the model parameters, which are then used to construct the final form of , our model of fly activity rhythms. Examples of fits of grooming and locomotion activities and their respective power spectra are provided in panels (B–E). Parameter values and least squares fitting errors of fitting locomotion and grooming spectrum of nine representative individual flies are shown in Table 1 and Table 2. Here the fitting error is calculated from.
where and are the actual spectral power and fitted spectral power at the th spectral frequency, respectively. is the averaged spectral power from randomly shuffled data at the th frequency. To get , we first randomly shuffle activity data 100 times and compute power spectrum for each of them. Then is the average of 100 individual spectral power at the ith frequency.