Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2020 Oct 29;21(1):485.
doi: 10.1186/s12859-020-03830-w.

CosinorPy: a python package for cosinor-based rhythmometry

Affiliations

CosinorPy: a python package for cosinor-based rhythmometry

Miha Moškon. BMC Bioinformatics. .

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.

PubMed Disclaimer

Conflict of interest statement

The author declares that he has no competing interests.

Figures

Fig. 1
Fig. 1
Multi-component cosinor models obtained with the automatic identification of the best fitting models. 1-component models are selected for test1 and test2 and 3-component models for test3 and test4. P values correspond to the statistical significance of each cosinor model. CosinorPy is able to produce publication-ready figures illustrating the fit of a cosinor model to time series data
Fig. 2
Fig. 2
Differential rhythmicity analysis performed with the 1-component cosinor analysis. While the amplitudes are not changed significantly, acrophases differ significantly in both tests (see Table 3). CosinorPy is able to produce publication-ready figures illustrating a comparative analysis of time series data (upper part of the figure), as well as an analysis of acrophase shifts (the lower part of the figure)
Fig. 3
Fig. 3
Multi-component population-mean cosinor models obtained with the automatic identification of the best fitting models. 1-component models are selected for test1 and test2 and 3-component models for test3 and test4. P values correspond to the statistical significance of each cosinor model. Black lines represent the cosinor models of each individual and red lines population-mean cosinor models

Similar articles

Cited by

References

    1. Ramsey KM, Affinati AH, Peek CB, Marcheva B, Hong HK, Bass J. Circadian measurements of sirtuin biology. In: Sirtuins. Berlin: Springer; 2013. p. 285–302. - PMC - PubMed
    1. Zhang R, Lahens NF, Ballance HI, Hughes ME, Hogenesch JB. A circadian gene expression atlas in mammals: implications for biology and medicine. Proc Nat Acad Sci. 2014;111(45):16219–16224. doi: 10.1073/pnas.1408886111. - DOI - PMC - PubMed
    1. Andreani TS, Itoh TQ, Yildirim E, Hwangbo DS, Allada R. Genetics of circadian rhythms. Sleep Med Clin. 2015;10(4):413–421. doi: 10.1016/j.jsmc.2015.08.007. - DOI - PMC - PubMed
    1. Brainard J, Gobel M, Scott B, Koeppen M, Eckle T. Health implications of disrupted circadian rhythms and the potential for daylight as therapy. Anesthesiol. 2015;122(5):1170–1175. doi: 10.1097/ALN.0000000000000596. - DOI - PMC - PubMed
    1. Xie Y, Tang Q, Chen G, Xie M, Yu S, Zhao J, et al. New insights into the circadian rhythm and its related diseases. Frontin Physiol. 2019;10:682. doi: 10.3389/fphys.2019.00682. - DOI - PMC - PubMed

LinkOut - more resources