ezActi—A Software Application for Actigraphy Analysis

 1 words
 1 min read

ezActi2

Credit © Peng Li, Ph.D.

An investor? A donor? Interested in this research and development? Please contact me. Let’s chat!

Though algorithm details and mathematical formulas are readily available for analyzing rest-activity patterns using actigraphy, we realize that it would be challenging for researchers without strong programming backgrounds to conveniently implement them.

Actigraphy allows a non-invasive and cost-effective assessment of the functional manifestation of the circadian control under naturalistic settings in terms of rest-activity patterns, which enables scalable applications in population and large cohort study settings.

We developed a software application, ezActi, in the MATLAB© platform (R2022a and later versions, The MathWorks Inc., Natick, MA) that implements a number of algorithms for rest-activity rhythms analysis. We hope that such an application will ease and facilitate these analyses in a wider community within and beyond the network of sleep and circadian biologists, physiologists, and clinicians.

The current release represents the second major updates, and thus the software application is formally named “ezActi2.”

  1. C Gao, et al. Approaches for assessing circadian rest-activity patterns using actigraphy for cohort and population-based studies. Current Sleep Medicine Reports 2023. Link to the article
  2. P Li. pliphd/Actigraphy. Zenodo 2023. DOI
  3. P Li. The actigraphy project. GitHub

Please me with any questions.

I kindly ask that you cite the above-referenced article(s) if you use ezActi2 in your research and publications.

If you want to skip the reading below, please download ezActi2 here .

About ezActi2

The ezActi2 was programmed in an object-oriented style and was constructed with a graphical user interface.

interface of ezActi2

The user interace of ezActi2. Credit © Peng Li, Ph.D.

The ezActi2 is easy to operate through its compact graphical interface, allowing researchers without knowledge of programming to perform various kinds of analysis. The ezActi2 is quite easy to operate with only few clicks to perform widely-used rest-activity rhythms analysis. And it comes with a couple of different calculation options so as to adjust input parameters, to batch process multiple signal recordings, to visualize results, and so on. Analysis results are automatically stored to comma-separated ASCII files, thus being compatible to and easily imported into the common statistical analysis software.

What can ezActi2 do?

Visualize actigraphy

actigraphy window actogram window

Visualization of actigraphy. Upper panel: The Actigraphy time series; Lower panel: The Actogram plot. Credit © Peng Li, Ph.D.

Quality control

actigraphy window actogram window

Quality control for actigraphy. Gaps are highlighed in both ways of actigraphy visualization. Credit © Peng Li, Ph.D.

Circadian rhythmicity analysis

actigraphy window superimposed with 24-h components extracted from cosinor analysis cosinor analysis results actigraphy window superimposed with 24-h components extracted from EMD

Circadain rest-activity rhythms analysis. Upper panel: the extracted 24-h component is from cosinor analysis. Middle panel: the results of cosinor analysis shown on a 24-h clock. Lower panel: the extracted ~24-h component is from empirical mode decomposition. Credit © Peng Li, Ph.D.

Sleep detection

actigraphy window superimposed with sleep episodes

Sleep epoch identification from actigraphy. Credit © Peng Li, Ph.D.

Detrended fluctuation analysis

detrended fluctuation analysis of actigraphy

Detrended fluctuation analysis. Credit © Peng Li, Ph.D.


Fun facts—The history of ezActi2

History of ezActi2

Fun facts—How ezActi2 evolves from its original version. Credit © Peng Li, Ph.D.

I have been thinking of streamlining the actigraphy analysis since early 2016 when he started working on a project that invovled more than 6,000 actigraphy recordings.

Initially, two research assistants were working with me helping with the quality control of these recordings. To facilitate a “semi-automatic” process, a MATLAB©-based simple App called DefineGap was born.

interface of DefineGap

The user interace of DefineGap. Credit © Peng Li, Ph.D. 2016

The App simply helps the research assistants and myself visualize the signal and document the “gap” if we ever identify any. Some user friendly tools have been implemented in order to zoom in specific areas and to show the data points using tooltips.

Almost at the same time, the research group started performing detrended fluctuation analysis (check this publication and this article for some results from this project). The two research assistants clearly preferred a small tool with a user interface instead of running through command lines. A DFATool App paired with a DFAFit App were thus developed to facilitate this process.

interface of DFATool interface of DFAFit

The user interaces of the paired App—DFATool and DFAFit. Credit © Peng Li, Ph.D. 2016-2019

Similarly, to facilitate the process of performing some nonparametric circadian rest-activity rhythms analysis, I also wrote a small tool called MISIVTool. As it was named, the tool performs IS (stards for interdaily stability) and IV (stands for intradaily variability) analysis on a multiscale (the “M” in the name) basis. Also, to better estimate the actual period (especially for example in animal studies without 12:12 light-dark cycles), a variant of the MISIVTool was made to implement the $\chi$2 periodogram—the PeriodTool.

interface of DFATool interface of DFAFit

The user interaces of the MISIVTool and PeriodTool. Credit © Peng Li, Ph.D. 2016-

All of these small tools continue to evolve and being updated separately.

To simplify the story, let’s focus on the timeline of the DefineGap, which soon evolved into its updated version—ConfirmGap. It came with a tabular-formated gap visualizer and also highlights the identified gap areas in the actigraphy. It was also featured with an “advanced option” that facilitate the display of the actual time of the signal (in addition to data points).

interface of ConfirmGap

The user interace of ConfirmGap. Credit © Peng Li, Ph.D. 2016-2018

Code-wise, both DefineGap and ConfirmGap were developed based on the classical approach for developing user interfaces in MATLAB©–the GUIDE©. It quickly became complicated to maintain and manage the code as new functions were being added. In early 2018, the object-oriented (OO) structure of MATLAB© became more and more mature, and I started migrating this App to a more managable programming style based on OO. At the beginning of this attempt, a temporal workaround was being used that relied on the GUIDE© to offer an interface while all functions (i.e., “call-backs of all buttons etc.) were coded through a class. This led to the new release called Gapp.

interface of Gapp

The user interace of Gapp. Credit © Peng Li, Ph.D. 2018-2019

Until the end of 2019, Gapp has been continuely updated including the addition of a pilot automatic process for sensing gaps and later a function to identify napping episodes with a user-customizable time window for daytime. This nap detection algorithm was pretty pilot and mainly based on activity counts.

With the continuing effort in streamlining different calculations (including cosinor analysis, detrended fluctuation analysis, etc.), the temporal turnaround by using the GUIDE© to provide an interface became not efficient eventually. In the end of 2019, I finally launced the ezActi project and started refining all of these processes using the morden OO and the AppDesigner© in MATLAB©. This led to the born of the first release of ezActi.

The ezActi started to separate the control panel and the actigraphy display window. It also introduced several different running modes such as the gap detection, sleep and nap detection, as well as circadian analysis. It inherited the process by using a list file to perform batch analysis. It introduced a knob for facilitating the identification of time.

interface of ezActi

The user interace of ezActi. Credit © Peng Li, Ph.D. 2019-2022

The DFATool and DFAFit were merged into the ezActi with a newly introduced mydfa class, which significantly improved the computational speed (more than 10x faster by a conservatively estimation).

The ezActi2 was first launched in November 2022. The idea of this new release was to feature a brandnew and easily-managable import wizard and a newly updated actigraphy display window. New functions have been added since then, including structured visualizations and the additions of nonparametric analysis as well as empirical mode decomposition based circadian analysis. The new version also came with several newly introduced classes, including the cosinor class (which was initially implemented in ezActi based on the traditional procedural programming style), the ImportWizard, the new display window actigraphy2, and actogram. The empirical mode decomposition process was currently still based on the procedural sytle (which calls the built-in emd function).