Actigraph GGIR csv question - CentrePoint vs Actilife

316 views
Skip to first unread message

Grant Handrigan

unread,
Nov 15, 2021, 10:10:28 PM11/15/21
to R package GGIR
Hello,

I am working with GGIR to try to process some csv data from actigraph monitors (ActiGraph GT9X). The data I have were exported from the cloud service 'CentrePoint' and have the following structure as a header:

#-----Data File Created By CP3 Data Retrieval------
#Serial Number: TAS1H19200026
#Start Date: 2021-09-22 16:05:00 UTC
#Download Date: 2021-09-22 16:45:09 UTC
#Sample Rate: 30
#--------------------------------------------------
Timestamp UTC,Accelerometer X,Accelerometer Y,Accelerometer Z
2021-09-22 16:24:02,0.08203125000000,-0.95703125000000,-0.04687500000000
2021-09-22 16:24:02,0.00000000000000,-1.00390625000000,0.00000000000000
2021-09-22 16:24:02,0.00781250000000,-1.01562500000000,0.00390625000000
2021-09-22 16:24:02,0.01562500000000,-1.01562500000000,0.00781250000000
2021-09-22 16:24:02,0.00781250000000,-1.01171875000000,0.00390625000000
2021-09-22 16:24:02,0.00390625000000,-1.01171875000000,0.00000000000000
2021-09-22 16:24:02,0.00000000000000,-1.01171875000000,-0.00781250000000
2021-09-22 16:24:02,0.00781250000000,-1.01562500000000,0.00781250000000
2021-09-22 16:24:02,0.00390625000000,-1.01562500000000,0.00781250000000
2021-09-22 16:24:02,0.00781250000000,-1.01953125000000,0.00390625000000
2021-09-22 16:24:02,0.00781250000000,-1.01562500000000,0.00781250000000
2021-09-22 16:24:02,0.00390625000000,-1.01953125000000,0.00781250000000
2021-09-22 16:24:02,0.00781250000000,-1.02343750000000,0.00781250000000
2021-09-22 16:24:02,0.00781250000000,-1.01562500000000,0.00000000000000
2021-09-22 16:24:02,0.00781250000000,-1.01562500000000,0.00781250000000
2021-09-22 16:24:02,0.00390625000000,-1.01562500000000,0.01171875000000
2021-09-22 16:24:02,0.00781250000000,-1.01953125000000,0.01171875000000
2021-09-22 16:24:02,0.00781250000000,-1.01171875000000,0.00000000000000
2021-09-22 16:24:02,0.00781250000000,-1.01562500000000,0.00390625000000
2021-09-22 16:24:02,0.01171875000000,-1.01562500000000,0.00781250000000
2021-09-22 16:24:02,0.00781250000000,-1.01562500000000,0.01171875000000
2021-09-22 16:24:02,0.00390625000000,-1.01562500000000,0.00781250000000
2021-09-22 16:24:02,0.00390625000000,-1.01171875000000,0.01171875000000

I believe this header is different than what is provided by the actilife software, but do not have access to the software to check. When I try to process the file in GGIR I get confirmation that the file is the one I want processed (File name: SYNH006.csv), but immediately get the error:

File name: SYNH006.csv
Errors and warnings for SYNH006.csv$message
[1] "duplicate row.names:  "

$call
data.frame(value = H[RowsWithData, 2], row.names = H[RowsWithData,
    1], stringsAsFactors = TRUE)

Parts 2, 3 & 4 fail due to 'cannot open the connection'.

Could someone please confirm if the header is different on an actilife csv file than the CentrePoint csv file? If so, I assume that this is what is causing the error that I am receiving. I understand that GGIR is configured to automatically detect csv from Actigraph, but perhaps not with the CentrePoint header.

Any insight or feedback would be appreciated.

Thanks in advance for considering my request.

Grant

Vincent van Hees

unread,
Nov 16, 2021, 11:50:56 AM11/16/21
to Grant Handrigan, R package GGIR
Hi Grant,

It looks like this data format is different from the normal ActiGraph csv-format, which is probably why GGIR struggles to make sense of it.

The short term solution would be to make use of the "read.myacc.csv" functionality in GGIR:
- Look up documentation for read.myacc.csv in the GGIR documentation: https://cran.r-project.org/web/packages/GGIR/GGIR.pdf
- Try configure this function such that it can read the first 100 lines of accelerometer data.
- Copy all arguments used, except rmc.file, rmc.nrow, rmc.skip to your g.shell.GGIR function call.

The more time consuming solution for which you probably need my help is to update GGIR such that it can automatically recognise this new ActiGraph csv format. If you want me to work on this then happy to discuss via pm.

Do you also have access to the original .gt3x files? I am working on a solution for those, which I hope to be ready in couple of months.

Best wishes,

Vincent

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
--
You received this message because you are subscribed to the Google Groups "R package GGIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to RpackageGGIR...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/RpackageGGIR/67f72f92-b46d-49ef-b845-5c3337090069n%40googlegroups.com.

Grant Handrigan

unread,
Nov 16, 2021, 12:28:30 PM11/16/21
to R package GGIR
Hello Vincent,

Many thanks for the response. I did go down the "read.myacc.csv" route and was able to batch process the files in the format that they were exported in. I don't have immediate access to the .gt3x files but I can get them, along with actilife. I suspect this will clear up the issue for running with the ggir shell function.

Upon inspecting the results I noticed that the sleep detection seems to be off. There are only short periods of sleep detected for each of the participants. Is this something that you've previously encountered? I've attached a couple of screenshots of the output from the summary pdf of one participant for reference. All of the participants have the same features.

Thanks,
Grant
Screen Shot 2021-11-16 at 1.25.37 PM.png
Screen Shot 2021-11-16 at 1.26.16 PM.png

Vincent van Hees

unread,
Nov 24, 2021, 10:51:26 AM11/24/21
to Grant Handrigan, R package GGIR
Hi Grant,

Could it be that you use ActiGraph's sleep.mode functionality?

If yes, then that would explain short amount of sleep because GGIR does not impute time gaps by default as none of the accelerometer brands used to generate data with time gaps. GGIR currently assumes that time continues regularly relative to the start of the measurement. I am currently working on detecting and imputing these time gaps. This should then make your plots look more logical. However, the imputed time will just be a non-movement episode, by which no meaningful sleep analysis will be possible.

If you did not use the sleep.mode then I think I would have to investigate the file directly.

Best, Vincent

Dr. Vincent van Hees | Independent consultant | https://accelting.com/
image

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

Grant Handrigan

unread,
Nov 26, 2021, 7:18:36 AM11/26/21
to R package GGIR
Hello Vincent,

Thanks for the follow-up. I was not previously aware of this function. I appreciate you bringing it to my attention. I have contacted ActiGraph to see how to check for this feature because the option was not specified in our configuration settings. I'll post a follow-up when I receive a response.

Grant

Grant Handrigan

unread,
Dec 14, 2021, 3:48:31 PM12/14/21
to R package GGIR
For the benefit of others, I am following up on the issue that I highlighted. The 'idle.sleep' mode was/is in fact enabled on the GT9X device. For information on this setting see here: https://actigraphcorp.my.site.com/support/s/article/Idle-Sleep-Mode-Explained

However, I can't confirm that this is what is causing the issue with the low sleep time detection with GGIR.

Thanks,
Grant

Samuel LaMunion

unread,
Jan 26, 2022, 11:33:11 AM1/26/22
to R package GGIR
Hi Grant,

Thanks for sharing this issue here. I have also had difficulty with data from CentrePoint. One workaround I found to work was to download the .gt3x file from CentrePoint and convert it to a .csv in Actilife which results in a .csv formatted in a way GGIR expects. But as you can imagine, that workflow is a bit cumbersome. Might you be willing to share your modified read.myacc.csv function or modified g.shell.GGIR call that you got to work? 

Thanks,

Sam

Vincent van Hees

unread,
Jan 27, 2022, 3:00:43 AM1/27/22
to Samuel LaMunion, R package GGIR
Just to let you know that from the next GGIR release onward (somewhere in the upcoming weeks) you will be able to work with .gt3x files directly. So, the .csv conversion route will not be needed any longer, although I will not remote the functionality from GGIR such that those who converted their data can continue to use it. 

You can already try this out with the GGIR development version on GitHub. Install via:
install.packages("remotes")
remotes::install_github("wadpac/GGIR")
Please let me know if you encounter issues such that I can try to resolve them before the official release.

Best, Vincent

Dr. Vincent van Hees | Independent consultant | https://accelting.com/
image








------- Original Message -------
Reply all
Reply to author
Forward
0 new messages