<i>dlmoR</i> : An Open-Source R Package for the Dim-Light Melatonin Onset (DLMO) Hockey-Stick Method

The dim-light melatonin onset (DLMO) is a commonly used circadian marker indicating the start time of evening melatonin synthesis in humans. Several quantitative techniques have been developed to determine DLMO from melatonin time series, including fixed- or variable-threshold techniques and the hockey-stick method developed by Danilenko et al (2014). Here, we introduce <i>dlmoR</i>, an open-source (MIT License) implementation of the hockey-stick method written in R. Our clean-room implementation follows the original algorithm description, supported by iterative validation against the existing binary executable. We benchmarked <i>dlmoR</i> on 112 melatonin time series data sets from two independent studies and found high agreement with the reference implementation: mean discrepancies were <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"><mml:mrow><mml:mo>-</mml:mo><mml:mn>1</mml:mn><mml:mo>.</mml:mo><mml:mn>482</mml:mn><mml:mo>±</mml:mo><mml:mn>21</mml:mn><mml:mo>.</mml:mo><mml:mn>7</mml:mn></mml:mrow></mml:math> min for the Heinrichs and Spitschan (2025) data set and <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"><mml:mrow><mml:mn>1</mml:mn><mml:mo>.</mml:mo><mml:mn>165</mml:mn><mml:mo>±</mml:mo><mml:mn>28</mml:mn><mml:mo>.</mml:mo><mml:mn>5</mml:mn></mml:mrow></mml:math> min for the Blume et al. (2024) data set, with circular correlation coefficients of 0.964 and 0.986, respectively. Paired <i>t</i>-tests (<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"><mml:mrow><mml:mi>p</mml:mi><mml:mo>></mml:mo><mml:mn>0</mml:mn><mml:mo>.</mml:mo><mml:mn>05</mml:mn></mml:mrow></mml:math>) indicated no systematic difference or bias between methods. Beyond reproducing the hockey-stick algorithm, <i>dlmoR</i> adds capabilities absent from the original executable, including interactive visual diagnostics and bootstrapped confidence intervals, offering qualitative and quantitative views of estimation uncertainty. It supports programmatic, reproducible analysis of melatonin profiles, including batch processing and parameter manipulation. Leveraging this flexibility, we evaluated the sensitivity of the hockey-stick algorithm to controlled changes in sampling schedules, threshold levels, data completeness, and noise. Moderate changes, such as small timing jitter, limited data loss, or modest threshold shifts, kept estimates stable within ±10 min, whereas pronounced alterations to sampling schedules, large multi-point deletions, or substantial threshold changes delayed estimates by over 40 min or prevented estimation. This analysis reveals fundamental limitations in the algorithm's internal mechanics, particularly in how it identifies the onset window and models the melatonin rise, and underscores the need for new uncertainty-aware approaches to DLMO estimation.

Authors

Institutions

Publication Details

Journal
Journal of Biological Rhythms
Published
2026-02-12
DOI
https://doi.org/10.1177/07487304251389994
Primary Topic
Circadian rhythm and melatonin
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

dlmoR : An Open-Source R Package for the Dim-Light Melatonin Onset (DLMO) Hockey-Stick Method

Salma M. Thalji, Manuel Spitschan
Journal of Biological Rhythms
Circadian rhythm and melatonin
article

dlmoR : An Open-Source R Package for the Dim-Light Melatonin Onset (DLMO) Hockey-Stick Method

Salma M. Thalji, Manuel Spitschan
article en

Abstract

The dim-light melatonin onset (DLMO) is a commonly used circadian marker indicating the start time of evening melatonin synthesis in humans. Several quantitative techniques have been developed to determine DLMO from melatonin time series, including fixed- or variable-threshold techniques and the hockey-stick method developed by Danilenko et al (2014). Here, we introduce <i>dlmoR</i>, an open-source (MIT License) implementation of the hockey-stick method written in R. Our clean-room implementation follows the original algorithm description, supported by iterative validation against the existing binary executable. We benchmarked <i>dlmoR</i> on 112 melatonin time series data sets from two independent studies and found high agreement with the reference implementation: mean discrepancies were <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"><mml:mrow><mml:mo>-</mml:mo><mml:mn>1</mml:mn><mml:mo>.</mml:mo><mml:mn>482</mml:mn><mml:mo>±</mml:mo><mml:mn>21</mml:mn><mml:mo>.</mml:mo><mml:mn>7</mml:mn></mml:mrow></mml:math> min for the Heinrichs and Spitschan (2025) data set and <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"><mml:mrow><mml:mn>1</mml:mn><mml:mo>.</mml:mo><mml:mn>165</mml:mn><mml:mo>±</mml:mo><mml:mn>28</mml:mn><mml:mo>.</mml:mo><mml:mn>5</mml:mn></mml:mrow></mml:math> min for the Blume et al. (2024) data set, with circular correlation coefficients of 0.964 and 0.986, respectively. Paired <i>t</i>-tests (<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"><mml:mrow><mml:mi>p</mml:mi><mml:mo>></mml:mo><mml:mn>0</mml:mn><mml:mo>.</mml:mo><mml:mn>05</mml:mn></mml:mrow></mml:math>) indicated no systematic difference or bias between methods. Beyond reproducing the hockey-stick algorithm, <i>dlmoR</i> adds capabilities absent from the original executable, including interactive visual diagnostics and bootstrapped confidence intervals, offering qualitative and quantitative views of estimation uncertainty. It supports programmatic, reproducible analysis of melatonin profiles, including batch processing and parameter manipulation. Leveraging this flexibility, we evaluated the sensitivity of the hockey-stick algorithm to controlled changes in sampling schedules, threshold levels, data completeness, and noise. Moderate changes, such as small timing jitter, limited data loss, or modest threshold shifts, kept estimates stable within ±10 min, whereas pronounced alterations to sampling schedules, large multi-point deletions, or substantial threshold changes delayed estimates by over 40 min or prevented estimation. This analysis reveals fundamental limitations in the algorithm's internal mechanics, particularly in how it identifies the onset window and models the melatonin rise, and underscores the need for new uncertainty-aware approaches to DLMO estimation.

Journal of Biological Rhythms
Max Planck Institute for Biological Cybernetics (DE), Institute for Advanced Study (DE), Technical University of Munich (DE)
Openalex Percentile: Top 53%
Circadian rhythm and melatonin
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.