<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Development of tools for processing and analysis of observational data on the activity of laboratory animals</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Dmitriy Borisov</string-name>
          <email>dimaborisov290699@yandex.ru</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Aleksandr Blagov</string-name>
          <email>alexander.blagov@gmail.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Aleksey Inyushkin</string-name>
          <email>ainyushkin@mail.ru</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Samara National Research University</institution>
          ,
          <addr-line>Samara</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2020</year>
      </pub-date>
      <fpage>171</fpage>
      <lpage>174</lpage>
      <abstract>
        <p>-The work is devoted to the analysis of observational data on the activity of laboratory animals. The activity cycles obtained by measuring sensors installed in the laboratory are considered. The software tool has been developed that provides processing, visualization and analysis of the obtained data.</p>
      </abstract>
      <kwd-group>
        <kwd>data processing data analysis</kwd>
        <kwd>python</kwd>
        <kwd>circadian rhythms</kwd>
        <kwd>locomotor activity</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>I. INTRODUCTION</title>
      <p>
        The article considers the need to develop tools for
processing, analysis and visualization of data obtained by
observing laboratory rats and reading their activity on a
running wheel using a sensor. According to [
        <xref ref-type="bibr" rid="ref1 ref2 ref3 ref4 ref5">1-5</xref>
        ], the
development of such a toolkit is an important task for
researchers in the field of data analysis. The results of the
analysis are necessary to study the motor activity of
laboratory animals.
      </p>
      <p>At the Department of Animal and Human Physiology of
the Samara National Research University named after
Academician S.P. Korolev many different experiments and
observations are carried out to study the behavior of
laboratory animals. However, for high-quality and
convenient conclusion about the experiment there are not
enough tools that would provide detailed analysis in
addition to processing and visualization of the obtained data.</p>
      <p>The software package developed by the authors was
implemented in the Python language. This high-level
programming language is designed to analyze various data.
In addition, the Python contains a huge number of libraries
required for simple and convenient implementation of
software solutions that include visualization of various
graphs.</p>
    </sec>
    <sec id="sec-2">
      <title>II. THE LOCOMOTOR ACTIVITY RESEARCHING</title>
      <p>
        Circadian rhythms are one of the most important
biological rhythms of living beings. They are manifested in
rhythmic changes in many behavioral, biochemical and
physiological parameters for a period close to twenty-four
hours [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. Circadian rhythms, or as they are also called "daily
rhythms" or "internal clock" can have a strong influence on
the metabolic energy balance during the day [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. This means
that this rhythm can be used to control and analyze the
appetite of various living beings, depending on their "internal
clock". This discovery can be extremely useful in animal
husbandry.
      </p>
      <p>
        The mammals circadian rhythm is controlled by the
suprachiasmatic nucleus of the hypothalamus, which
contains the main oscillator of the organism [8]. Researches
have shown that many different influencing factors cause
changes in circadian rhythms [
        <xref ref-type="bibr" rid="ref6">6, 8</xref>
        ]. Various environmental
events influence the recovery and formation of the rhythm:
cyclic afferentation about the light level, eating regimen, and
metabolic signals [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ].
      </p>
      <p>
        Research of the circadian biological rhythms is actual
problem of modern biology and medicine. The increased
interest to this problem is related to the facts that the
functional characteristics of organs and systems of the body
is impossible without their circadian physiological and
biochemical rhythms. Disruption of the rhythms leads to the
pathological conditions [
        <xref ref-type="bibr" rid="ref10">9</xref>
        ]. Among behavioural rhythms,
sleep/wake rhythm is the most representative, and in the
laboratory conditions, rodents are the most convenient object
for the investigation of this rhythm. When the cage where
laboratory animal is contained, is equipped with the running
wheel, monitoring of the wheel revolutions gives a rich
information on daily profile of the output drive from the
suprachiasmatic nucleus circadian oscillator. Thereby the
developing of software for the data obtained from the
running wheel sensor processing is of practical importance
for modern experimental chronobiology.
      </p>
      <p>Observations of rats are made using a special sensor
installed on each running wheel. Each one-eighth of a
wheel's turn represents one conventional unit, called a bin.
For every five seconds of observation, the computer records
the number of bins that a particular rat makes during this
period of time. Thus, the locomotor activity of a laboratory
rat can be represented as a set of numbers.</p>
      <p>It may notice that the rat has periods of decreasing
activity when the rat is asleep, and periods of increasing
when the rat is awake. These events are clearly described
using the quantitative calculation of the partial revolutions of
the running wheel. Based on the data obtained, it is possible
to determine the period of locomotor activity of the rat. Thus,
changes in the circadian rhythm are monitored over a long
period of time, including before and after the influence of
various factors.</p>
    </sec>
    <sec id="sec-3">
      <title>III. SENSOR DATA PROCESSING</title>
      <p>The initial data received from the sensors is presented in
the form of a table with six columns in a text document of
the “.TXT” format (fig. 1).</p>
      <p>Each column contains the following information: time
since the start of observation, the number of bins made by
five rats with a time interval of five seconds. For
informational purposes, the name of each file is mainly the
period of the experiment on rats indicating the beginning and
end of observation with an accuracy of up to a minute.</p>
      <p>Obviously, for a better analysis it is necessary to conduct
long-term observations. However, this affects the number of
rows in the resulting data document. This may result in a
very long table. Therefore, for convenience, using the
developed software tool, all rows in the table are grouped
with a time interval (step) that the user sets himself (rows are
initially grouped in 5 second increments). In this case, the
bins of each rat in the table will display the number of partial
revolutions of the running wheel in the required period of
time. The data processor asks for the necessary interval at
which the grouping will be performed. It also warns about
errors and whether ungrouped lines remained due to the
multiplicity of the total time to the entered step. Finally the
user gets the resulting set of bins for each rat, as in the
example in Figure 2.</p>
      <p>
        In addition to the output of the processed data to the
console, it is possible to enter them into separate text
documents individually for each rat with a breakdown by the
number of days passed (Figures 3-4). The resulting files are
entered in a specially created directory with a unique name,
depending on the processing step and the name of the file
being processed. For this action to create a directory, the OS
library is used, which is an interface for portable use of the
operating system functionality [
        <xref ref-type="bibr" rid="ref11 ref9">10</xref>
        ].
      </p>
      <p>
        An important feature of the developed software is the
visualization of the processed data. To implement this
functionality, the matplotlib package is used. Matplotlib is a
library for building various kinds of two-dimensional graphs,
histograms, diagrams in the Python with just a few lines of
code [
        <xref ref-type="bibr" rid="ref12">11</xref>
        ].
      </p>
      <p>In the developed application, a pop-up window is
implemented for viewing, editing and scaling of five graphs
on the behavior of each rat based on the processed data with
a user-selected step as shown in Figure 5.</p>
      <p>
        A comparative analysis of the behavior of a laboratory rat
before and after exposure to any external facts consists in
determining changes in the following indicators: the period
of its circadian rhythm, acrophase and mesor, which describe
the motor activity of the rat [
        <xref ref-type="bibr" rid="ref13">12</xref>
        ].
      </p>
      <p>Finding a period of circadian rhythm is a rather
nontrivial task. The difficulty is as follows. The period is
calculated from the usual sequence of numbers (bins for a
certain period of time), the distribution of which is rather
approximately described by a sinusoid. The authors offer a
fairly simple way to determine the period. It is based on the
logic of the distribution of numbers and on one of the
methods for finding the period of a sinusoid by a graphical
method.</p>
      <p>This method describes the time intervals between the
maximum achieved values of the number of bins
(amplitudes) over time periods equal to 24 hours, that is,
equal to the approximate value of the circadian rhythm in the
laboratory animal. The feature of the software
implementation of the approach is as follows. The user can
enter the start time of the day for each laboratory animal (for
the subsequent discarding of excess data obtained on the first
day before a given point in time).</p>
      <p>This procedure is necessary in order for the general
locomotor activity of the test subject to be described by a
cosine sine. This is necessary because the peak of activity in
the rat is achieved at night. The algorithm for finding the
biorhythm period is as follows.</p>
      <p>The data is divided into equal time periods of 24 hours.
At each interval, the amplitude is calculated. Then the time
intervals between the nearest amplitudes are calculated,
which are approximate values of the period of activity of the
laboratory animal.</p>
      <p>For a more accurate determination of the period, the
arithmetic average of the obtained preliminary periods is
calculated. According to the proposed method, the first value
from the processed data can be taken as the first amplitude,
since this is where the peak of activity is theoretically
achieved. In addition, the first time period considered is
usually 12 hours. A schematic representation of the
algorithm is shown in Figure 6.</p>
      <p>It should be noted that during the operation of the
algorithm abnormal preliminary periods can be thrown.</p>
      <p>For example, this happens when one amplitude was
found close to the end of the considered segment, and the
other amplitude was calculated at the beginning of the next
segment. This means that the junction of the segments is at
the peak of the locomotor activity of the rat. As a result, the
algorithm receives a critically small period value due to the
two resulting maxima.</p>
      <p>As a rule, such an anomaly in the algorithm provokes the
opposite anomaly. With this anomaly, the resulting sample of
periods will contain a critically large gap between the
amplitudes. This is because the first amplitude is calculated
at the beginning of the interval, and the next at the end of the
other. As a result, a huge period of circadian rhythm for the
laboratory rat enters the algorithm. Two opposite anomalies
when calculating the average period value from the sample
cancel each other out. In this case, a value close to true is
obtained.</p>
      <p>The next characteristic – an acrophase is determined by
the moments of time when the rat's activity amplitude is
reached. The method of finding the acrophase of circadian
rhythm was chosen to find the arithmetic mean value among
the moments of time when the amplitudes were reached. In
other words, for each amplitude, its deviation from midnight
in real time was calculated, then the average value among the
received deviations was determined, which was taken as the
acrophase of the circadian rhythm of the rat in question.</p>
      <p>
        The mesor is the value of the average level of a sinusoid
[
        <xref ref-type="bibr" rid="ref14">13</xref>
        ] or the average value of bins relative to each rat, so to
calculate it, just use the mean() function of the NumPy
library.
      </p>
      <p>
        Next, cosinor analysis is carried out - the method for
approximating daily curves by harmonics (sinusoids) with a
certain period, based on the least squares method [
        <xref ref-type="bibr" rid="ref13">12</xref>
        ].
      </p>
      <p>To construct a sinusoid (Figure 7), in addition to the
period and acrophase, a mesor and amplitude are required.</p>
      <p>The calculated function for the sinusoid is represented by
the formula (1), where M is the mesor, А – amplitude, "φ" –
acrophase, "τ" – period, е(t) – random component describing
other factors not included in the function.</p>
      <p>Y(t)=M+A* cos (2πt + φ) +e(t)
τ
(1)</p>
      <p>Each of the obtained indicators is compared with the
corresponding indicator before and after the influence of
various influencing factors. Based on the comparison of
indicators, the results and patterns of the influence of a factor
on the behavior of a laboratory rat are formed.</p>
      <p>
        To conduct a comprehensive analysis using the
developed software, we used data from observations of
laboratory rats obtained for the periods from November 24,
2009 to December 3, 2009 and from February 27, 2010 to
March 8, 2010 at the Department of human and animal
physiology at Samara University. Based on these data, the
Department conducted a research of the effect of insulin on
the circadian rhythm of arbitrary locomotor activity in rats.
The result of the reseacrh was the most pronounced shift of
locomotor activity in the direction of phase advance at the
time of injection of the medicine equal to ZT = 13 (analysis
of the acrophase shift revealed a significant advance of 5.48
± 1.98 hours), a slight change in the total daily activity [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ].
      </p>
      <p>The results of data visualization by the software package
are shown in Figure 8. The data obtained as a result of the
analysis, shown in Table 1, generally correspond to the
previously obtained results of the research on the effect of
insulin on the locomotor activity of rats. In the future, the
authors plan to refine the algorithms and methods for finding
the main characteristics.
101.5 160.5 113.5 162
42
89.5
153
61</p>
      <p>The software tool designed to conduct a comprehensive
analysis of the effect of various drugs on locomotor activity
allows you to process rat observation data, present them in a
visual form, and also determine the main characteristics of
the circadian rhythm: activity period, acrophase, mesor. In
addition, a function is constructed that describes the activity
of laboratory animals in time. The software tool allows to
analyze changes in the relevant characteristics before and
after the influence of various influencing factors. The authors
plan to expand the functionality of the developed software.
In its final form, the software tool will allow more efficient
and faster research of circadian biological rhythms and
contribute to the emergence of new scientific discoveries.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>E.A.</given-names>
            <surname>Shalimova</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.V.</given-names>
            <surname>Shalnov</surname>
          </string-name>
          and
          <string-name>
            <given-names>A.S.</given-names>
            <surname>Konushin</surname>
          </string-name>
          , “
          <article-title>Camera parameters estimation from pose detections</article-title>
          ,”
          <source>Computer Optics</source>
          , vol.
          <volume>44</volume>
          , no.
          <issue>3</issue>
          , pp.
          <fpage>385</fpage>
          -
          <lpage>392</lpage>
          ,
          <year>2020</year>
          . DOI:
          <volume>10</volume>
          .18287/
          <fpage>2412</fpage>
          -6179-CO-
          <volume>600</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>R.A.</given-names>
            <surname>Shatalin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.R.</given-names>
            <surname>Fidelman</surname>
          </string-name>
          and
          <string-name>
            <given-names>P.E.</given-names>
            <surname>Ovchinnikov</surname>
          </string-name>
          , “
          <article-title>Incremental learning for abnormal behaviour detection algorithm based on principal components,” Computer Optics</article-title>
          , vol.
          <volume>44</volume>
          , no.
          <issue>3</issue>
          , pp.
          <fpage>476</fpage>
          -
          <lpage>481</lpage>
          ,
          <year>2020</year>
          . DOI:
          <volume>10</volume>
          .18287/
          <fpage>2412</fpage>
          -6179-CO-
          <volume>624</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>R.P.</given-names>
            <surname>Bohush</surname>
          </string-name>
          and
          <string-name>
            <given-names>I.Y.</given-names>
            <surname>Zakharava</surname>
          </string-name>
          , “
          <article-title>Person tracking algorithm based on convolutional neural network for indoor video surveillance</article-title>
          ,”
          <source>Computer Optics</source>
          , vol.
          <volume>40</volume>
          , no.
          <issue>1</issue>
          , pp.
          <fpage>109</fpage>
          -
          <lpage>116</lpage>
          ,
          <year>2020</year>
          . DOI:
          <volume>10</volume>
          .18287/
          <fpage>2412</fpage>
          -6179-CO-
          <volume>565</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>J.</given-names>
            <surname>Cheng</surname>
          </string-name>
          and W. Dai, “
          <article-title>A framework of reading timestamps for surveillance video</article-title>
          ,”
          <source>Computer Optics</source>
          , vol.
          <volume>43</volume>
          , no 1, pp.
          <fpage>72</fpage>
          -
          <lpage>77</lpage>
          ,
          <year>2019</year>
          . DOI:
          <volume>10</volume>
          .18287/
          <fpage>2412</fpage>
          -6179-2019-43-1-
          <fpage>72</fpage>
          -77.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>N.A.</given-names>
            <surname>Smelkina</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.N.</given-names>
            <surname>Kosarev</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.V.</given-names>
            <surname>Nikonorov</surname>
          </string-name>
          ,
          <string-name>
            <given-names>I.M.</given-names>
            <surname>Bairikov</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.N.</given-names>
            <surname>Ryabov</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.V.</given-names>
            <surname>Avdeev</surname>
          </string-name>
          and
          <string-name>
            <given-names>N.L.</given-names>
            <surname>Kazanskiy</surname>
          </string-name>
          , “
          <article-title>Reconstruction of anatomical structures using statistical shape modeling</article-title>
          ,”
          <source>Computer Optics</source>
          , vol.
          <volume>41</volume>
          , no.
          <issue>6</issue>
          , pp.
          <fpage>897</fpage>
          -
          <lpage>904</lpage>
          ,
          <year>2017</year>
          . DOI:
          <volume>10</volume>
          .18287/
          <fpage>2412</fpage>
          -6179- 2017-41-6-
          <fpage>897</fpage>
          -904.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>A.N.</given-names>
            <surname>Inyushkin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.A.</given-names>
            <surname>Mistryugov</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.S.</given-names>
            <surname>Gromova</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.I.</given-names>
            <surname>Pugachev</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.I.</given-names>
            <surname>Belyakov</surname>
          </string-name>
          and
          <string-name>
            <given-names>E.M.</given-names>
            <surname>Inyushkina</surname>
          </string-name>
          , “
          <article-title>Influence of insulin on circadian rhythm of arbitrary locomotor activity of rats,”</article-title>
          <source>Russian journal of physiology</source>
          , vol.
          <volume>97</volume>
          , no.
          <issue>7</issue>
          , pp.
          <fpage>678</fpage>
          -
          <lpage>689</lpage>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>I.</given-names>
            <surname>Boumans</surname>
          </string-name>
          , E. Bokkers,
          <string-name>
            <given-names>G.J.</given-names>
            <surname>Hofstede</surname>
          </string-name>
          and
          <string-name>
            <surname>I. Boer</surname>
          </string-name>
          , “
          <article-title>Explaining daily feeding patterns in pigs: modelling interaction between metabolic processes and circadian rhythm</article-title>
          ,
          <source>” Proceedings of the 50th Congress of the International Society for Applied Ethology</source>
          , pp.
          <fpage>344</fpage>
          -
          <lpage>344</lpage>
          ,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          <string-name>
            <surname>M.H. Hastings</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Brancaccio</surname>
            and
            <given-names>E.S.</given-names>
          </string-name>
          <string-name>
            <surname>Maywood</surname>
          </string-name>
          , “
          <article-title>Circadian pacemaking in cells and circuits of the suprachiasmatic nucleus</article-title>
          ,
          <source>” Journal of neuroendocrinology</source>
          , vol.
          <volume>26</volume>
          , no.
          <issue>1</issue>
          ,
          <year>2014</year>
          . DOI: 2-
          <fpage>10</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>10.1111/jne.12125.</mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>J.A.</given-names>
            <surname>Evans</surname>
          </string-name>
          and
          <string-name>
            <given-names>A.J.</given-names>
            <surname>Davidson</surname>
          </string-name>
          , “
          <article-title>Health consequences of circadian disruption in humans and animal models,” Progress in molecular biology and translational science</article-title>
          ,” Academic Press, vol.
          <volume>119</volume>
          , no.
          <issue>1</issue>
          , pp.
          <fpage>283</fpage>
          -
          <lpage>323</lpage>
          ,
          <year>2013</year>
          . DOI:
          <volume>10</volume>
          .1016/B978-0
          <source>-12-396971-2</source>
          .
          <fpage>00010</fpage>
          -
          <lpage>5</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>W.H.</given-names>
            <surname>Walker</surname>
          </string-name>
          , “
          <article-title>Circadian rhythm disruption and mental health,” Translational Psychiatry</article-title>
          , vol.
          <volume>10</volume>
          , no.
          <issue>1</issue>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>13</lpage>
          ,
          <year>2020</year>
          . DOI:
          <volume>10</volume>
          .1038/s41398-020-0694-0.
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          <source>[11] Matplotlib: Python plotting - Matplotlib 3.1</source>
          .3. documentation [Online]. URL: https://matplotlib.org/.
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>D.E.</given-names>
            <surname>Pastukhov</surname>
          </string-name>
          , “
          <article-title>Application of the kosinor-analysis method in chronobiological studies of microbial properties</article-title>
          ,” Tyumen state University,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>L.A.</given-names>
            <surname>Omelyanchik</surname>
          </string-name>
          and
          <string-name>
            <given-names>N.B.</given-names>
            <surname>Kolesnik</surname>
          </string-name>
          , “
          <article-title>Kosinor analysis of daily activity of pentose phosphate pathway dehydrogenases in the liver of mongrel rats,” Topical issues of biology, ecology and chemistry</article-title>
          . Zaporozhye national University , vol.
          <volume>3</volume>
          , no.
          <issue>2</issue>
          , pp.
          <fpage>28</fpage>
          -
          <lpage>34</lpage>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>