Circadian Dynamics is a web-based tool designed to help you analyze biological and environmental time series data for rhythmic patterns. It is especially useful for studying circadian rhythms (≈24-hour cycles), but it can also be adapted to explore faster (ultradian) or slower (infradian) rhythms by adjusting the analysis parameters.
The app runs entirely in your browser — there is no need to install software or manage dependencies. You can upload your own CSV files, adjust preprocessing and analysis options, and visualize repeating patterns like daily cycles in body temperature, environmental conditions, or other periodic signals.
Please note: Circadian Dynamics is still under development. New features and improvements will be added over time based on feedback. If you find issues or have suggestions, please reach out to the email: jaime.marrero@upr.edu.
Below are the adjustable parameters you can set before running an analysis. These control how your data is preprocessed and how rhythmicity is detected.
Bin Size (minutes): Combines data points into larger time bins (e.g., hourly averages) to lower the sample frequency. Lowering the frequency of observations improves the performance of the application, and hourly samples offer a good temporal resolution for circadian and infradian analysis. For ultradian analysis consider downsampling to shorter bins, if your dataset allows it.
Method: Select how to combine points within each bin — use the mean or sum. Some datasets (trykinetics) involve counts of events rather than a value, so summing the observations as the downsample strategy could make sense.
Align to Midnight: Shifts timestamps so that days align neatly at midnight. If not selected, the analysis will adjust to create windows of the selected duration, starting at the first available downsampled bin or observation.
Window Size (days): Defines the number of days in each rolling window used for local rhythmicity analysis.
Step Size (days): Determines how much each window moves forward; smaller steps create overlapping windows for finer resolution.
Apply Smoothing: Applies a moving average to reduce short-term fluctuations.
Smoothing N: Sets the number of points used for smoothing.
Apply Detrending: Removes long-term trends and slow drifts from the data by fitting a linear model and adjusting the slope, then fitting the values around the new value. This method allows to correct for drifts in the data, to isolate components of seasonality to better compare the oscillation with a cosinor model and analyze different components of behavior separately.
Perform Autocorrelation: Checks how similar the data is to itself over different time lags to detect repeating patterns.
Sampling Interval (hours): Sets the time interval used when calculating the autocorrelation.
Min/Max Period (hours): Defines the period range for rhythmicity detection. For circadian rhythms, set these near 24 hours.
Restrict Period Search: Alternative method to determining the target window to locate the strongest correlation between the 2 copies. Limits the period search range around a target period and tolerance.
Target Period (hours): Sets the expected period of your signal (e.g., 24 for circadian).
Period Tolerance (hours): Allows the period search to vary by this amount above or below the target.
Perform Lomb-Scargle: Alternative and independent strategy to determine period that uses a spectral method to detect dominant frequencies, especially useful for unevenly sampled data.
Oversampling Factor: Improves resolution of the frequency detection by oversampling; set to -1 for default.
To help you get started, Circadian Dynamics includes a small synthetic sample dataset. This lets you test the app's analysis and see the expected CSV format.
The dataset contains five days of measurements at 15-minute intervals. It includes:
Example rows:
datetime,CBT-C,EP-mmHg
2021-07-01T00:00:00,36.51,761.66
2021-07-01T00:15:00,36.51,761.69
2021-07-01T00:30:00,36.63,761.76
...
How to use it: You can either download the file to see the raw CSV or load it directly to test the analysis pipeline.
Sample dataset loaded!This file summarizes your processed time series, including raw, smoothed, and detrended values along with fitted rhythmicity results.
unique_identifier,window,datetime,raw_value,smoothed_value,detrend_shift,preserved_detrended_value,lomb_cosinor,autocorr_cosinor
cbt_mC,1,2021-07-01T00:00:00,36.51,36.60,-0.20,36.40,36.52,36.48
cbt_mC,1,2021-07-01T00:15:00,36.50,36.59,-0.21,36.39,36.51,36.47
...
unique_identifier: ID of the signal or measurement. For files with multiple parameters per timepoint.
window: Rolling window number.
datetime: Timestamp for each observation.
raw_value: Original measurement.
smoothed_value: Value after smoothing.
detrend_shift: Estimated trend removed from the raw value. How far each observation lands from the linear model
preserved_detrended_value: Final detrended value. The oscilation of the detrended values at the corrected range in the y axis.
lomb_cosinor: Value predicted by the Lomb-Scargle cosinor fit.
autocorr_cosinor: Value predicted by the autocorrelation cosinor fit.
This file summarizes rhythmicity detected through autocorrelation analysis.
column,window,period,power,peak_datetime,mesor,amplitude,amplitude_se,acrophase,acrophase_se,phase,phase_se,adj_r_squared,p_value
raw_value,1,24.01,0.465,2021-07-02T00:00:00,36.50,0.40,0.05,3.2,0.2,0.13,0.03,0.92,0.01
...
column: The series analyzed. For original data with multiple columns of observations
window: Rolling window number.
period: Estimated dominant cycle length (hours).
power: Strength of the periodic signal.
peak_datetime: Time of peak detected.
mesor: Mean level around which the rhythm oscillates.
amplitude: Half the difference between peak and trough. (In signal analysis, the difference between peak and trough is called range)
amplitude_se: Standard error of the amplitude estimate.
acrophase: Time of the peak phase.
acrophase_se: Standard error of the acrophase.
phase: Fitted phase shift relative to target period.
phase_se: Standard error of the phase.
adj_r_squared: Goodness of fit of the cosinor model.
p_value: Significance of the rhythm detected.
This file summarizes dominant frequencies found using Lomb-Scargle analysis. The columns are the same as Autocorrelation Results, except the power metric is derived from spectral density instead of time-lag correlation.
column,window,period,power,peak_datetime,mesor,amplitude,amplitude_se,acrophase,acrophase_se,phase,phase_se,adj_r_squared,p_value
raw_value,1,24.05,0.372,2021-07-02T00:00:00,36.50,0.38,0.04,3.5,0.2,0.15,0.03,0.90,0.02
...
Here's how to get up and running in just a few steps:
That's it! You're ready to explore periodic patterns in your data.