Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running GGIR on the UK Biobank Research Analysis Platform #1248

Open
Gavaguy opened this issue Jan 16, 2025 · 3 comments
Open

Running GGIR on the UK Biobank Research Analysis Platform #1248

Gavaguy opened this issue Jan 16, 2025 · 3 comments

Comments

@Gavaguy
Copy link

Gavaguy commented Jan 16, 2025

Hello everyone,

I am trying to run the GGIR command on the UKB-Rep using Jupyter Lab.
I am trying to calculate the sleep regularity index.

I am using those accelerometer files, all in .csv format

file_list <- system("dx ls Bulk/Activity/Epoch/10/", intern = TRUE)

I am using the command

For externally derived UK Biobank data in .CSV format:

   GGIR(datadir = "/opt/notebooks",
       outputdir = "/opt/myoutput",
       dataFormat = "ukbiobank_csv",
       extEpochData_timeformat = "%m/%d/%Y %H:%M:%S",
       mode = c(1:2),
       do.report = c(2),
       windowsizes = c(5, 900, 3600), # We know that data was stored in 5 second epoch
       desiredtz = "Europe/London", # We know that data was collected in the UK
       visualreport = FALSE,
       overwrite = TRUE)

I seems that the part 1 output is generated, the output is

Checking that user has write access permission for directory specified by argument outputdir: Yes

GGIR version: 3.1.5

Do not forget to cite GGIR in your publications via a version number and
Migueles et al. 2019 JMPB. doi: 10.1123/jmpb.2018-0063.
See also: https://cran.r-project.org/package=GGIR/vignettes/GGIR.html#citing-ggir

To make your research reproducible and interpretable always report:
(1) Accelerometer brand and product name
(2) How you configured the accelerometer
(3) Study protocol and wear instructions given to the participants
(4) GGIR version
(5) How GGIR was used: Share the config.csv file or your R script.
(6) How you post-processed / cleaned GGIR output
(7) How reported outcomes relate to the specific variable names in GGIR


Part 1

P1 file: 1 2 3 4 5 6 7 8 9 10 11 12 …

However, then an error message occurs:

Error in seq.default(quartlystart, quartlystart + ((nrow(D) - 1) * epSizeShort), : 'from' must be a finite number
Traceback:

  1. GGIR(datadir = "/opt/notebooks", outputdir = "/opt/myoutput",
    . dataFormat = "ukbiobank_csv", extEpochData_timeformat = "%m/%d/%Y %H:%M:%S",
    . mode = c(1:2), do.report = c(2), windowsizes = c(5, 900,
    . 3600), desiredtz = "Europe/London", visualreport = FALSE,
    . overwrite = TRUE)
  2. convertEpochData(datadir = datadir, metadatadir = metadatadir,
    . params_general = params_general, verbose = verbose)
  3. seq(quartlystart, quartlystart + ((nrow(D) - 1) * epSizeShort),
    . by = epSizeShort)
  4. seq.default(quartlystart, quartlystart + ((nrow(D) - 1) * epSizeShort),
    . by = epSizeShort)
  5. stop("'from' must be a finite number")

Do you have an idea what the issue is?

Do you perhaps have a complete code how the calculate the SRI in the UKB-Rep from beginning to end?

Thank you for your help in advance.

Kind regards

@j262byuu

This comment was marked as off-topic.

@vincentvanhees
Copy link
Member

vincentvanhees commented Jan 16, 2025

@Gavaguy

For externally derived UK Biobank data in .CSV format:

Please confirm that you are working with the UK Biobank csv file in 5 second resolution, because that is what this functionality is intended for.

If yes, then with this data you will not be able to derive SRI because it only includes ENMO values and no other signal features, which makes it impossible to do anything related to sleep.

@vincentvanhees
Copy link
Member

vincentvanhees commented Jan 17, 2025

Action point for me:

  • Emphasize with big capitals in https://wadpac.github.io/GGIR/articles/Cookbook.html that those examples are specific to EXTERNALLY derived data, meaning epoch aggregates by external software or hardware. All of it does NOT relate to processing RAW accelerometer data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants