Content uploaded by Lubos Molcan
Author content
All content in this area was uploaded by Lubos Molcan on Nov 05, 2019
Content may be subject to copyright.
Available via license: CC BY-NC-ND 4.0
Content may be subject to copyright.
Title
Time distributed data analysis by Cosinor.Online application
Running head
Cosinor.Online application
Author
Lubos Molcan
Affiliation
Department of Animal Physiology and Ethology, Faculty of Natural Sciences, Comenius
University, Bratislava, Slovakia
Correspondence
Department of Animal Physiology and Ethology, Faculty of Natural Sciences, Comenius
University in Bratislava, Ilkovicova 6, Bratislava, Slovakia, Phone: +421 260296 413, E-mail:
lubos.molcan@uniba.sk
Page 1 of 11
.CC-BY-NC-ND 4.0 International licenseIt is made available under a
(which was not peer-reviewed) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity.
The copyright holder for this preprint. http://dx.doi.org/10.1101/805960doi: bioRxiv preprint first posted online Oct. 18, 2019;
Abstract
Physiological processes oscillate in time. Circadian oscillations, over approximately 24-h, are
very important and among the most studied. To evaluate the presence and significance of
24-h oscillations, physiological time distributed data (TDD) are often set to a cosinor model
using a wide range of irregularly updated native apps. If users are familiar with MATLAB, R
or other programming languages, users can adjust the parameters of the cosinor model
setting based on their needs. Nowadays, many software applications are hosted on remote
servers running 24/7. Server-based software applications enable quick analysis of big data
sets and run on a wide range of terminal devices using standard web browsers. We created
a simple web-based cosinor application, Cosinor.Online. The application code is written in
PHP. TDD is handled using a MySQL database and can be copied directly from an Excel file
to the webform. Analysis results contain information about setting the 24-h oscillation and a
unique ID identifier. The identifier allows users to reopen data and results repeatedly over
one month or remove their data from the MySQL database. Our web-based application can
be used for a quick and simple inspection of 24-h oscillations of various biological and
physiological TDD.
Keywords
cosinor analysis, web application, PHP, MySQL, time distributed data
Page 2 of 11
.CC-BY-NC-ND 4.0 International licenseIt is made available under a
(which was not peer-reviewed) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity.
The copyright holder for this preprint. http://dx.doi.org/10.1101/805960doi: bioRxiv preprint first posted online Oct. 18, 2019;
1 Introduction
In living systems, processes vary over time because of the integration of biological and
environmental interactions. Among the most important and most studied are circadian
processes, which are oscillations that occur approximately 24-h. During regular light/dark
conditions, 24-h oscillations are very prominent in physiological systems. Physiological
changes [1], responses to stress [2], behavioural activities [3]and pathophysiological events
are characterised by circadian changes [4]. Removal of the main circadian pacemaker, the
suprachiasmatic nucleus [5], or shifts in the regular light/dark environment [4] diminish
circadian amplitude [6], which can lead to loss of stress predictability [7] in the short term
manner. Over the long term, disturbing the circadian oscillations can change system-level set
points and may lead to pathological processes [8–10] including cancer development [11].
The presence and significance of 24-h oscillations in measured time distributed data
(TDD) can be done using cosinor analysis and the cosinor model. From a simple cosine
function, we can estimate mesor, amplitude, and acrophase. In general, physiological
functions can be better described by a complex series of harmonic functions [12].
The simple cosine function can be evaluated with a wide range of locally installed
native applications [13,14]. Skilled users can use the MATLAB or R programming languages,
which allow users to adjust the cosinor code, change the input form of the time series
(radians, degrees, hours or decimal) or adjust estimated period lengths and other parts of the
cosinor model [14,15].
With or without programming skills, evaluation of 24-h oscillations must be often done
on the same computer. On the other hand, at present, many software applications are hosted
on servers running 24/7. Besides that, server-based software applications enable quick
analysis of big data sets and run on a wide range of terminal devices using a standard web
browser only.
Therefore, we created a web-based cosinor application, Cosinor.Online. Application
code is written in PHP (hypertext preprocessor), a server-side scripting and general-purpose
programming language designed for web development. Input data are handled by MySQL
and can be copied directly from an Excel file to the webform.
Page 3 of 11
.CC-BY-NC-ND 4.0 International licenseIt is made available under a
(which was not peer-reviewed) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity.
The copyright holder for this preprint. http://dx.doi.org/10.1101/805960doi: bioRxiv preprint first posted online Oct. 18, 2019;
2 Mathematical modelling and code writing
We wrote our code in PHP in line with the MATLAB code [15], which implements a standard
cosinor method [14,16]. In the beginning, we solved a system of linear equations (Equation
1). Because of PHP implementation, we used matrix inversion instead of Gauss-Jordan
elimination. In extreme cases, if the matrix is badly conditioned, this approach can provide
false results.
From the Equation 1, where x
i= cos(ωt
i
)
,z
i= sin(ωt
i
)and nis a number of input
values, we obtained mesor (M
), Acosφ and Asinφ from which we calculated amplitude (A
)
(Equation 2). Using inverse tangent in radians and the signum function [15] we estimated
acrophase (φ
).
Mesor, amplitude and acrophase were entered into Equation 3 and we did cosine fit
to original TDD.
The significance of model fitting was done using the p-value as the F probability
density function [15].
Input and output cosinor data are handled and temporarily stored in the MySQL
database. Using a unique ID string, users can delete input and output data immediately after
the analysis is complete. If the user does not delete their data, all data is automatically
deleted one month from the beginning of the analysis. Any other data (e.g. operating system,
browser, country, etc.) are not stored in our database. Temporarily stored input and output
data are not used for any other analyses. Storing data in a MySQL database is only a
technical implementation to allow users to reload older analyses on different devices at
various times.
Page 4 of 11
.CC-BY-NC-ND 4.0 International licenseIt is made available under a
(which was not peer-reviewed) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity.
The copyright holder for this preprint. http://dx.doi.org/10.1101/805960doi: bioRxiv preprint first posted online Oct. 18, 2019;
From the MySQL database, data are loaded using a randomly generated unique ID
string. Original input data are visualized as a scatter plot with a cosine fit as a line plot. Due
to online usage, cross-platform and cross-browser compatibility, we used Google Charts [17],
which are very easy to use for online visualization of a wide range of data.
3 Software usage
Software codes are hosted on the encrypted domain and the application is available at
https://cosinor.online address.
3.1 Input data
Cosinor.Online application consists of several pages. On the input page, users can enter
time and experimental values in decimal form, thus, 8:00 am is 8.00, 8:15 am is 8.25, 8:00
pm is 20.00, 8:15 pm is 20.25 and so forth (Figure 1).
Time and data columns must be the same size; if data is missing from a certain time
point, the relevant time-row must be removed.
Figure 1: Loading data is very easy: users can simply copy and paste columns from an
Excel file to the webform. Time and data columns must be the same size; if data is missing
from a certain time point, the relevant time-row must be removed.
Page 5 of 11
.CC-BY-NC-ND 4.0 International licenseIt is made available under a
(which was not peer-reviewed) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity.
The copyright holder for this preprint. http://dx.doi.org/10.1101/805960doi: bioRxiv preprint first posted online Oct. 18, 2019;
3.2 Output data
After the submission of the input TDD, users can see results and outputs from the model
describing 24-h oscillations in the loaded data. Original and calculated data are shown in a
table and visualized in the chart (Figure 2). Mesor is the average value around which the
variable oscillates. Amplitude is the difference between the peak (or trough) and the mean
value of a wave. Acrophase is the time of peak activity [12,13,16]. The application produces
mesor and amplitude in the units of user's input data; acrophase is provided in hours,
decimal form. Chart’s title, as well as vertical and horizontal axes, are adjustable and charts
are downloadable.
A
Page 6 of 11
.CC-BY-NC-ND 4.0 International licenseIt is made available under a
(which was not peer-reviewed) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity.
The copyright holder for this preprint. http://dx.doi.org/10.1101/805960doi: bioRxiv preprint first posted online Oct. 18, 2019;
B
Figure 2: (A) On the output page users can find information about the date and time when
the analysis was done as well as the unique ID string. Mesor and amplitude are in the units
of the user's input data; acrophase is provided in hours, decimal form. (B) Original and
cosinor data are plotted on the chart.
3.3 Reload analysis
On the output page, users can find information about the date and time when the analysis
was done as well as the unique ID string, which can be inserted into the field on the Reload
analysis page. Using the unique ID string, users can repeatedly reopen their data and results
for up to one month. After this period, TDD and results are automatically removed from the
database without the possibility to recover them.
3.4 Remove data
Using the unique ID string, users can remove their data immediately and permanently from
the database; this function is available in the tab Remove data
.
3.5 Suggestions, questions
We believe, Cosinor.Online is very intuitive web-based application intended primarily for
Page 7 of 11
.CC-BY-NC-ND 4.0 International licenseIt is made available under a
(which was not peer-reviewed) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity.
The copyright holder for this preprint. http://dx.doi.org/10.1101/805960doi: bioRxiv preprint first posted online Oct. 18, 2019;
quick analysis of periodic data, but we are open to any suggestions for how to improve the
application based on user experiences and this information can be shared in the tab
Suggestions, questions
.
4 Cosinor.Online versus other applications
A lot of different applications evaluate cosinor analysis, but a lot of them require installation
on a local drive, a specific type/version of the operating system, and/or the presence of
various add-ons. We were unable to install many of them on our hardware. Therefore we
compared Cosinor.Online application to scripts/packages, which run in software
environments, namely one script written for MATLAB [15] and two R packages, cosinor
(written by Michael Sachs; [18]) and cosinor2 (written by Augustin Mutak; [14]).
Mesor, amplitude, acrophase and the significance of the estimated model were the
same using different applications and Cosinor.Online (Table 1). Tested input data and results
from a comparison of Cosinor.Online versus other applications are freely available through
Google Sheets (https://bit.ly/CosinorOnlineExamples). R scripts and tested input data in text
files are downloadable at https://bit.ly/CosinorOnlineRData.
Table 1: Outputs of cosinor analysis did not differ between Cosinor.Online, MATLAB code
and R packages, cosinor and cosinor2. Details of the analyzes are available at
https://bit.ly/CosinorOnlineExamples. Amp – amplitude; Acr – acrophase (peak or trough;
hours, decimal form).
Data
Set 1
Data
Set 2
Data
Set 3
Data
Set 4
Data
Set 5
Data
Set 6
Data
Set 7
Data
Set 8
Mesor
7.58
7.86
8.04
7.73
8.43
4.67
34.28
23.08
Amp
3.96
3.98
3.95
4.03
1.28
n.s.
7.92
6.82
Acr
11.37
or
23.37
11.62
or
23.61
11.84
or
23.84
12.44
or
24.44
9.75
or
21.75
n.s.
20.35
15.76
or
27.76
5 Discussion
Biological data vary in time and reveal significant 24-h oscillations [13]. This variability should
be considered and only data from similar time points between days should be compared.
Evaluation and comparison of TDD measured over the course of a day require cosinor
Page 8 of 11
.CC-BY-NC-ND 4.0 International licenseIt is made available under a
(which was not peer-reviewed) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity.
The copyright holder for this preprint. http://dx.doi.org/10.1101/805960doi: bioRxiv preprint first posted online Oct. 18, 2019;
analysis, which can detect significant 24-h variability.
Cosinor analysis can be done with locally installed native applications or using the
MATLAB [15] or R [14] programming languages. Anyway, evaluation of 24-h oscillations is
often limited to the same computer. We found online available applications, but there are
using outdated VBScript and ActiveX components that many modern web browsers do not
support. Thus, server-side software applications, in which software is hosted on servers
running 24/7, could be a solution. End users only need a personal computer, tablet or just a
phone with a standard web browser, so the user's low power devices can serve as terminals
to connect to a specific server with a specific request.
To take advantage of these changes, we created Cosinor.Online applications using
PHP and MySQL in line with the MATLAB code [15]. Input and output data are visualised
using Google Charts. Cosinor.Online application thus provides cross-platform and
cross-browser compatibility as well as the availability of data 24/7.
Some advanced and sophisticated chronomics online available analysis toolkits exist.
However, they do not allow to store data and are a bit complicated, mostly for beginners and
students. On the other hand, Cosinor.Online application is a very simple web-based
application. Loading TDD is easy: users can simply copy and paste columns from an Excel
file to the webform. Input and output data are processed in the background using PHP and
MySQL on the servers. Input and output data are stored on the servers. Users can adjust
titles in charts and download charts.
Individual analyses are given an original, randomly generated unique ID string, which
allows users to reopen or remove their data from the software's database. If users do not
remove their data, they are stored for up to one month. However, after this period, stored
data are automatically and permanently removed from the MySQL database.
Our purpose was to create a very simple and intuitive web-based application
especially for students, who have limited skills with data analysis or importing TDD into
different software applications but are skilled in using a wide range of modern and
permanently connected devices. We believe that our web-based application will also help
experienced researchers, particularly when they simply need to do a quick inspection of their
data: just copy, run and check.
However, there are some limitations to our application. Its current version fits only
24-h periods. Because of PHP implementation, Cosinor.Online application can provide false
results in very extreme cases. Our web-based application does not provide confidence
Page 9 of 11
.CC-BY-NC-ND 4.0 International licenseIt is made available under a
(which was not peer-reviewed) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity.
The copyright holder for this preprint. http://dx.doi.org/10.1101/805960doi: bioRxiv preprint first posted online Oct. 18, 2019;
intervals of mesor and amplitude.
Cosinor.Online application is available 24/7 at https://cosinor.online address. The
developers are open to any suggestions for how to improve the Cosinor.Online application on
the basis of user feedback.
6 Conclusion
We created the web-based server-side application Cosinor.Online using PHP, MySQL and
Google Charts. Cosinor.Online application can be used for a quick and simple inspection of
the 24-h oscillations of various biological and physiological time distributed data. Users are
able to reopen the analysis on a wide range of devices for free up to one month.
7 Competing interest
None declared.
8 Acknowledgement
We would like to thank Dr Richard Kollár and Dr Katarína Boďová for their mathematical
advice.
References
[1] A. Kurtz, Nobel Prizes 2017 and their impact for physiology, Pflüg. Arch. - Eur. J.
Physiol. 470 (2018) 211–212. doi:10.1007/s00424-018-2110-7.
[2] L. Molcan, A. Vesela, M. Zeman, Repeated phase shifts in the lighting regimen change
the blood pressure response to norepinephrine stimulation in rats, Physiol Res. 63
(2014) 567–575.
[3] M. Okuliarova, L. Molcan, M. Zeman, Decreased emotional reactivity of rats exposed to
repeated phase shifts of light–dark cycle, Physiol. Behav. 156 (2016) 16–23.
doi:10.1016/j.physbeh.2016.01.003.
[4] M. Zeman, L. Molcan, I. Herichova, M. Okuliarova, Endocrine and cardiovascular
rhythms differentially adapt to chronic phase-delay shifts in rats, Chronobiol. Int. 33
(2016) 1148–1160. doi:10.1080/07420528.2016.1203332.
[5] K. Witte, A. Schnecko, R.M. Buijs, J. van der Vliet, E. Scalbert, P. Delagrange, B.
Guardiola-Lemaitre, B. Lemmer, Effects of SCN lesions on orcadian blood pressure
rhythm in normotensive and transgenic hypertensive rats, Chronobiol. Int. 15 (1998)
135–145.
[6] L. Molcan, M. Teplan, A. Vesela, M. Zeman, The long-term effects of phase advance
shifts of photoperiod on cardiovascular parameters as measured by radiotelemetry in
rats, Physiol. Meas. 34 (2013) 1623.
[7] L. Molcan, M. Zeman, Shifts in the light-dark cycle increase unpredictability of the
Page 10 of 11
.CC-BY-NC-ND 4.0 International licenseIt is made available under a
(which was not peer-reviewed) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity.
The copyright holder for this preprint. http://dx.doi.org/10.1101/805960doi: bioRxiv preprint first posted online Oct. 18, 2019;
cardiovascular system, Auton. Neurosci. 206 (2017) 51–59.
[8] R.C. Hermida, D.E. Ayala, A. Mojón, J.R. Fernández, Influence of circadian time of
hypertension treatment on cardiovascular risk: results of the MAPEC study, Chronobiol.
Int. 27 (2010) 1629–1651. doi:10.3109/07420528.2010.510230.
[9] G. Asher, P. Sassone-Corsi, Time for food: the intimate interplay between nutrition,
metabolism, and the circadian clock, Cell. 161 (2015) 84–92.
doi:10.1016/j.cell.2015.03.015.
[10] C. Scheiermann, Y. Kunisaki, P.S. Frenette, Circadian control of the immune system,
Nat. Rev. Immunol. 13 (2013) 190–198. doi:10.1038/nri3386.
[11] K.I. Block, The Circadian System and Cancer: It’s About Time!, Integr. Cancer Ther. 17
(2018) 3–4. doi:10.1177/1534735418755916.
[12] M.H. Teicher, N.I. Barber, COSIFIT: an interactive program for simultaneous
multioscillator cosinor analysis of time-series data, Comput. Biomed. Res. Int. J. 23
(1990) 283–295.
[13] R. Refinetti, Circadian Physiology, CRC Press, 2019. doi:10.1201/9780429128639.
[14] A. Mutak, Extended Tools for Cosinor Analysis of Rhythms, (2019).
https://cran.r-project.org/web/packages/cosinor2/index.html (accessed May 23, 2019).
[15] C. Heart, Cosinor Analysis - File Exchange - MATLAB Central, (2019).
https://www.mathworks.com/matlabcentral/fileexchange/20329 (accessed May 23,
2019).
[16] Y.L. Tong, Parameter estimation in studying circadian rhythms, Biometrics. 32 (1976)
85–94.
[17] Google, Charts, Google Dev. (2019). https://developers.google.com/chart/ (accessed
May 23, 2019).
[18] M. Sachs, cosinor: Tools for estimating and predicting the cosinor model version 1.1
from CRAN, (2019). https://rdrr.io/cran/cosinor/ (accessed May 23, 2019).
Page 11 of 11
.CC-BY-NC-ND 4.0 International licenseIt is made available under a
(which was not peer-reviewed) is the author/funder, who has granted bioRxiv a license to display the preprint in perpetuity.
The copyright holder for this preprint. http://dx.doi.org/10.1101/805960doi: bioRxiv preprint first posted online Oct. 18, 2019;