CosinorPy: a python package for cosinor-based rhythmometry
- PMID: 33121431
- PMCID: PMC7597035
- DOI: 10.1186/s12859-020-03830-w
CosinorPy: a python package for cosinor-based rhythmometry
Abstract
Background: Even though several computational methods for rhythmicity detection and analysis of biological data have been proposed in recent years, classical trigonometric regression based on cosinor still has several advantages over these methods and is still widely used. Different software packages for cosinor-based rhythmometry exist, but lack certain functionalities and require data in different, non-unified input formats.
Results: We present CosinorPy, a Python implementation of cosinor-based methods for rhythmicity detection and analysis. CosinorPy merges and extends the functionalities of existing cosinor packages. It supports the analysis of rhythmic data using single- or multi-component cosinor models, automatic selection of the best model, population-mean cosinor regression, and differential rhythmicity assessment. Moreover, it implements functions that can be used in a design of experiments, a synthetic data generator, and import and export of data in different formats.
Conclusion: CosinorPy is an easy-to-use Python package for straightforward detection and analysis of rhythmicity requiring minimal statistical knowledge, and produces publication-ready figures. Its code, examples, and documentation are available to download from https://github.com/mmoskon/CosinorPy . CosinorPy can be installed manually or by using pip, the package manager for Python packages. The implementation reported in this paper corresponds to the software release v1.1.
Keywords: Circadian analysis; Cosinor; Python; Regression; Rhythmicity analysis.
Conflict of interest statement
The author declares that he has no competing interests.
Figures



Similar articles
-
NeuroPycon: An open-source python toolbox for fast multi-modal and reproducible brain connectivity pipelines.Neuroimage. 2020 Oct 1;219:117020. doi: 10.1016/j.neuroimage.2020.117020. Epub 2020 Jun 6. Neuroimage. 2020. PMID: 32522662
-
Logomaker: beautiful sequence logos in Python.Bioinformatics. 2020 Apr 1;36(7):2272-2274. doi: 10.1093/bioinformatics/btz921. Bioinformatics. 2020. PMID: 31821414 Free PMC article.
-
DiscoRhythm: an easy-to-use web application and R package for discovering rhythmicity.Bioinformatics. 2019 Nov 8;36(6):1952-4. doi: 10.1093/bioinformatics/btz834. Online ahead of print. Bioinformatics. 2019. PMID: 31702788 Free PMC article.
-
Cosinor-based rhythmometry.Theor Biol Med Model. 2014 Apr 11;11:16. doi: 10.1186/1742-4682-11-16. Theor Biol Med Model. 2014. PMID: 24725531 Free PMC article. Review.
-
Statistics and pitfalls of trend analysis in cancer research: a review focused on statistical packages.J Cancer. 2020 Mar 4;11(10):2957-2961. doi: 10.7150/jca.43521. eCollection 2020. J Cancer. 2020. PMID: 32226510 Free PMC article. Review.
Cited by
-
Integrative Analysis of Rhythmicity: From Biology to Urban Environments and Sustainability.Int J Environ Res Public Health. 2022 Dec 31;20(1):764. doi: 10.3390/ijerph20010764. Int J Environ Res Public Health. 2022. PMID: 36613088 Free PMC article. Review.
-
Combining Time-Restricted Wheel Running and Feeding During the Light Phase Increases Running Intensity Under High-Fat Diet Conditions Without Altering the Total Amount of Daily Running.Int J Mol Sci. 2025 Aug 7;26(15):7658. doi: 10.3390/ijms26157658. Int J Mol Sci. 2025. PMID: 40806786 Free PMC article.
-
Time-of-Day Circadian Modulation of Grape-Seed Procyanidin Extract (GSPE) in Hepatic Mitochondrial Dynamics in Cafeteria-Diet-Induced Obese Rats.Nutrients. 2022 Feb 12;14(4):774. doi: 10.3390/nu14040774. Nutrients. 2022. PMID: 35215423 Free PMC article.
-
Keep It Simple: Using README Files to Advance Standardization in Chronobiology.Clocks Sleep. 2023 Aug 30;5(3):499-506. doi: 10.3390/clockssleep5030033. Clocks Sleep. 2023. PMID: 37754351 Free PMC article.
-
CovidRhythm: A Deep Learning Model for Passive Prediction of Covid-19 Using Biobehavioral Rhythms Derived From Wearable Physiological Data.IEEE Open J Eng Med Biol. 2023 Mar 23;4:21-30. doi: 10.1109/OJEMB.2023.3261223. eCollection 2023. IEEE Open J Eng Med Biol. 2023. PMID: 37143920 Free PMC article.
References
MeSH terms
Grants and funding
LinkOut - more resources
Full Text Sources