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

Support for .gt3x files?

cosmicnet opened this issue · comments

Hello Grégory,

I have a number of .gt3x files that I'm working with. I can see from your API and documentation that this package requires .agd files. Are there any plans to add .gt3x file support? Or is there something missing from these files that makes them unsuitable?

Hello Lyle,

yes, there is a plan but it is mid/long-term one unfortunately. But indeed, that would a great addition to the package.

For now, I see two options;

  1. you export all your .gt3x files to .agd by batch (.agd files with 30s epochs are not really big...) so that you can read with pyActigraphy.
  2. you use another package like gt3x for instance that contains functions to read .gt3x files directly.

If you go for option 2. be aware that you will get raw acceleration data. So the rest of your analysis will have to be carried out accordingly (ie. use algorithms developed for raw acceleration and not counts like in most of the metrics/algos implemented in pyActigraphy). For completeness, there is also a way to produce counts from raw acceleration data (https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3624832/) if you want.

Actually, I assumed that you are looking for a python package but if you are fine with R, there is also the GGIR package.

Hope that helps.

If you find additional resources to deal with .gt3x files, do not hesitate to let me know. Thank you.

Greg

Thanks for the fast reply.

I'd come across the gt3x module and got it working after fixing this issue:
muschellij2/gt3x#2

I'm looking to extract the users circadian rhythm from the data, so I thought I could start with the Cosinor analysis that your package provides. I'll chat with my PI and see if I can get the files translated to agd. Otherwise I'll just plug though with the raw acceleration data.

I'll take look through those links. If I go the route of writing code to convert to counts I might write it up as a new io library for pyActigraphy.

Lyle

Hi Lyle,

add-ons to pyActigraphy are very much welcome and the one that provides backward-compatibility for accelerometers to algorithms developed for count-based devices would be a lovely extension.

In parallel, I see another way out:

  • use gt3x to extract time and acceleration from .gt3x files and create a BaseRaw object manually like in this tutorial

One last remark; the Cosinor analysis is straightforward, both in its implementation and in its interpretation but there are some caveats, briefly discussed in this tutorial (and see ref therein). If you are ready to try a slightly more complex tool, I'd recommend the SSA.

Hope that helps.

Greg

Hello @cosmicnet,

closing this issue now but feel free to re-open it if necessary and/or get in touch if you have code contributions to pyActigraphy.

Cheers,

Greg