ghammad / pyActigraphy

Python-based open source package for actigraphy data analysis

Home Page:https://ghammad.github.io/pyActigraphy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stop times and dynamic variables

roryos1 opened this issue · comments

Dear @ghammad,

Thank you for making this package, it is really helpful.

I was wondering whether a specific stop time can be selected for individual files? In the tutorials it looks like stop times are selected with the 'period' keyword, although this does not allow you to select a specific stop time. I see this can be done with the start/stop time logs but I only have a small number of files so do not think this is necessary.

Another unrelated question about future features of the package. I think calculating M10/L5 variables with dynamic time parameters (e.g. M1, M30_mins_, L1) would be a helpful addition. These parameters are useful for measuring different patterns of physical activity across 24 hours, whereas the traditional M10/L5 are quite broad. Here's a paper discussing the benefits of this approach - https://sportsmedicine-open.springeropen.com/articles/10.1186/s40798-019-0225-9.

Let me know what you think.

Thanks,
Rory

This study also shows the dynamic M variables in action - https://pubmed.ncbi.nlm.nih.gov/31288983/

Dear @roryos1

Thank you for the feedback. Always appreciated.

Indeed, there is no way to specify the stop time directly (I don't recall why I did not include that possibility from the start...). However, if you know your start time, then it becomes easy to specify a stop time as period=stop-start.
However, I'll include that possibility in the list of changes for next minor release.

A side remark: having a start/stop file is really handy and can be shared along with the data. It is also easier to maintain, modify and store centrally and give access to others working on the same data for example. So I strongly encourage people to use it.

Concerning the MX variables, if I understand correctly what I have read in the reference you provide (and the ref therein, Rowlands et al., 2019), these variables are slightly different from the traditional L5/M10.

L5/M10: average activity counts (or equivalently the average hourly mouvement duration, for binarised data) for the uninterrupted least/most active 5h/10h-period (https://journals.sagepub.com/doi/pdf/10.1177/074873049701200206)

MXacc: magnitude of acceleration above which X most active minutes are accumulated. But if I understand correctly, there is no continuity requirement about these most active minutes.

These variables are anyway interesting but we need to find a new name, in order to avoid the confusion...

Dear @ghammad,

Thank you for your prompt response.

Sorry yes, the MX variables and traditional L5/M10 variables are calculated differently. I believe both continuous/accumulated variables are informative, and definitely provide more specific data about an individual's activity profile when <10 hours. Does this seem like a good idea to you? Not strictly related to circadian rhythm but possibly a good way to diversify the package to measure activity profiles throughout the day.

Dear @roryos1

Indeed, these metrics would be a valuable addition to the package.

I see two ways to proceed further now;

  1. if you can, you can code the variables and submit a PR
  2. I code them for the next release but I cannot promise anything about the timescale...

The choice depends on your agenda.

Anyway, thanks for bringing these variables to my attention and good luck with your analysis.

Dear @ghammad,

I believe you are much better suited to coding these variables than me, do not worry about the timescale. I have a couple of other questions about the package which I'll put into a new thread (to keep the focus of this thread).