GGIR sleep duration issue

93 views
Skip to first unread message

Ayan Merchant

unread,
Jun 2, 2021, 7:39:07 AM6/2/21
to R package GGIR
Hello! 

I have been using the GeneActiv to capture sleep data for my research. I have been able to successfully extract the data but the last couple of times it seems that the analysis isn't integrating the manual sleep log properly as it shows the time earlier than stated and the wake time later than stated. 

The code that I am using is the following: 

library(GGIR)
g.shell.GGIR(#=======================================
             # INPUT NEEDED:
             mode=c(1,2,3,4,5),
             datadir="//campus.gla.ac.uk/SSD_Home_Data_D/2488274M/My Documents/Baseline Assessments",
             outputdir="//campus.gla.ac.uk/SSD_Home_Data_D/2488274M/My Documents/Output_019",
             f0=1, f1=2,
             #-------------------------------
             # Part 1:
             #-------------------------------
             # Key functions: reading file, auto-calibration, and extracting features
             do.enmo = TRUE,             do.anglez=TRUE,
             desiredtz="Europe/London",
             chunksize=1,                printsummary=TRUE,
             #-------------------------------
             # Part 2:
             #-------------------------------
             strategy = 2,               ndayswindow=7,
             hrs.del.start = 0,          hrs.del.end = 0,
             maxdur = 9,                 includedaycrit = 16,
             winhr = c(5,10),
             qlevels = c(c(1380/1440),c(1410/1440)),
             qwindow=c(0,24),
             ilevels = c(seq(0,400,by=50),8000),
             mvpathreshold =c(100,120),
             bout.metric = 4,
             closedbout=FALSE,
             #-------------------------------
             # Part 3:
             #-------------------------------
             # Key functions: Sleep detection
             timethreshold= c(5),        anglethreshold=5,
             ignorenonwear = TRUE,
             #-------------------------------
             # Part 4:
             #-------------------------------
             # Key functions: Integrating sleep log (if available) with sleep detection
             # storing day and person specific summaries of sleep
             excludefirstlast = FALSE,
             includenightcrit = 16,
             def.noc.sleep = c(),
             loglocation= "//campus.gla.ac.uk/SSD_Home_Data_D/2488274M/My Documents/Ayan/Sleep Logs/Sleep Study_Sleep Log 019.csv",
             outliers.only = TRUE,
             criterror = 4,
             relyonsleeplog = FALSE,
             sleeplogidnum = FALSE,
             colid=1,
             coln1=2,
             do.visual = TRUE,
             nnights = 7,
             #-------------------------------
             # Part 5:
             # Key functions: Merging physical activity with sleep analyses
             #-------------------------------
             threshold.lig = c(30), threshold.mod = c(100),  threshold.vig = c(400),
             boutcriter = 0.8,      boutcriter.in = 0.9,     boutcriter.lig = 0.8,
             boutcriter.mvpa = 0.8, boutdur.in = c(1,10,30), boutdur.lig = c(1,10),
             boutdur.mvpa = c(1),   timewindow = c("WW"),
             #-----------------------------------
             # Report generation
             #-------------------------------
             # Key functions: Generating reports based on meta-data
             do.report=c(2,4,5),
             visualreport=TRUE,     dofirstpage = TRUE,
             viewingwindow=1)

When I extract the data the average sleep time starts at 9 pm and wake up time as 8 am when the sleep log shows 12am as bedtime and wake up time at 6.30.

I am sure why this issue has come up and I was wondering if anyone had any suggestions?

Cheers!
Ayan

Vincent van Hees

unread,
Jun 11, 2021, 5:30:57 AM6/11/21
to Ayan Merchant, R package GGIR
Hi Ayan,

Can you check the following:

- Use GGIR's g.loadlog() function as documented in https://cran.r-project.org/web/packages/GGIR/GGIR.pdf. This would allow you to check that the sleeplog is correctly loaded.
- Check that sleeplog is used by GGIR, by looking at the 'guider' columns, this should state that sleeplog was used. If not, then maybe something went wrong with specifying the filepath.
- Checkout the part4 reports in the QC folder, which have a column for both the guider (sleeplog in your case) and the estimates based on fuse information from sleeplog and accelerometer.

Best, Vincent

Dr. Vincent van Hees
Independent consultant

ACCELTING.png


‐‐‐‐‐‐‐ 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/822a9b7c-dee8-435b-8eb8-0dc1ca9d697dn%40googlegroups.com.

Ayan Merchant

unread,
Jun 15, 2021, 4:48:40 AM6/15/21
to R package GGIR
Hello!

Thank you so much for your help! I went through your suggestions and they seem to run the code now, I think it might have just been an issue with the sleeplog not loading correctly, but that seems to be resolved now. 

Kind regards
Ayan
Reply all
Reply to author
Forward
0 new messages