Sleep Log as Guider

598 views
Skip to first unread message

Sidney Donzella

unread,
Oct 3, 2022, 1:55:59 PM10/3/22
to R package GGIR
Hi Vincent, 

Thank you for your work on GGIR and providing a platform to score accelerometer data. I am a doctoral student studying sleep and chronic diseases sleep and hope to use GGIR to score Actigraph devices for my research. I have worn an Actigraph GT9X device to practice scoring my own data in GGIR. I am able to successfully score the data, however, the Part 4 report is missing in the output. Additionally, when looking at the Part 5 day summary report, the guider is listed as HDCZA. In the code I am using, I am providing a sleep log and would like that to be the guider. Below is the code I am using, the message in the Console after scoring, and a screenshot of the .csv sleep log. My question is: how do I get the code to use my sleep log as the guider instead of the HDCZA algorithm?

I am using GGIR Version 2.8-1. Thank you for your help. I look forward to your response!

Code
GGIR::g.shell.GGIR(
  datadir=("C:/Users .... /Data"),
  outputdir=("C:/Users/ .... /Scored"),
  mode=c(1,2,3,4,5),
  do.cal = TRUE, # added
  do.enmo = TRUE, # added
  do.anglez = TRUE, # added
  do.report=c(2,4,5),
  #=====================
  # Part 2
  #=====================
  strategy = 1,
  hrs.del.start = 0,
  hrs.del.end = 0,
  maxdur = 9,
  includedaycrit = 16,
  qwindow=c(0,24),
  mvpathreshold =c(100, 120),
  bout.metric = 4,
  excludefirstlast = FALSE,
  includenightcrit = 16,
  #=====================
  # Part 3 + 4
  #=====================
  ignorenonwear = TRUE, # added
  def.noc.sleep = 1,
  outliers.only = TRUE,
  criterror = 4,
  do.visual = FALSE,
  loglocation=("C:/Users/.... /Log/Practice_log.csv"), #added
  relyonguider=FALSE, # added
  sleeplogidnum=FALSE, #added
  colid=1, #added
  coln1=2, #added
  nnights=7, #added
  #=====================
  # Part 5
  #=====================
  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),
  includedaycrit.part5 = 2/3,
  #=====================
  # Visual report
  #=====================
  timewindow = c("WW"),
  visualreport=TRUE)

Console
   GGIR version: 2.8.1

   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

Checking that user has read access permission for all files in data directory: Yes
Checking that user has write access permission for directory specified by argument outputdir: Yes
1
P1 file 1

Investigate calibration of the sensors with function g.calibrate:

Loading chunk: 1 2 3 4 5 6 7
Extract signal features (metrics) with the g.getmeta function:

Loading chunk: 1 2 3 4 5 6 7 8
Save .RData-file with: calibration report, file inspection report and all signal features...

__________________________________________________________________________________________________________________________________________________________________________
 Part 2
1
__________________________________________________________________________________________________________________________________________________________________________
 Part 3
1
__________________________________________________________________________________________________________________________________________________________________________
 Part 4
 1
__________________________________________________________________________________________________________________________________________________________________________
 Part 5
1
__________________________________________________________________________________________________________________________________________________________________________
 Report part 2
 1
__________________________________________________________________________________________________________________________________________________________________________
 Report part 4
 loading all the milestone data from part 4 this can take a few minutes
[1] "report not stored, because no results available"

__________________________________________________________________________________________________________________________________________________________________________
 Report part 5
 loading all the milestone data from part 5 this can take a few minutes
 generating csv report for every parameter configurations...
 WW-30-100-400-T5A5
__________________________________________________________________________________________________________________________________________________________________________
 Generate visual reports
[1] "File TAS1H45211403_2022-10-03___09-25-12RAW.csv"

Sleep Log 
Sleep Log.png

Vincent van Hees

unread,
Oct 17, 2022, 2:17:39 AM10/17/22
to Sidney Donzella, R package GGIR
Hi Sidney,

It might be that GGIR struggles to match participant ID from sleeplog and accelerometer recording. You seem to be using the filename as ID. Can you try extracting the ID from the filename with argument idloc = 2? To do this, first do run GGIR with mode = 1:2, overwrite = TRUE, and do.report = 2. Next, check that IDs are correctly extracted and stored in the part 2 output. If yes, then update the first column in your sleeplog to match the IDs in part 2 output, and then re-rerun part 3 and 4 with mode =3:4, overwrite =TRUE, and do.report = 4.

Best wishes,

Vincent

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

------- 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/2a633467-8093-49b9-b362-2586cd79c71cn%40googlegroups.com.

Message has been deleted

Sidney Donzella

unread,
Oct 17, 2022, 12:40:14 PM10/17/22
to Vincent van Hees, R package GGIR
Hi Vincent, 

Thank you for the help! I really appreciate it. 

I tried to run parts 1 and 2 with idloc=2 but received an error. See code and error message below. Might this be because I am using GENEActiv files and not Actigraph files? I also noticed that idloc=2 is for "_" in the id name. My files have a "-" (dash) in the file name. So, I tried running idloc=7 and received the same error message.


CODE

GGIR::g.shell.GGIR(
  datadir=("C:/Users/.../FollowUp/COMPLETE"),
  outputdir=("C:/Users/.../FollowUp/COMPLETE4"),
  mode=c(1,2),
  overwrite= TRUE,
  idloc= 2,

  do.cal = TRUE, # added
  do.enmo = TRUE, # added
  do.anglez = TRUE, # added
  do.report=c(2),

  #=====================
  # Part 2
  #=====================
  strategy = 1,
  hrs.del.start = 0,
  hrs.del.end = 0,
  maxdur = 9,
  includedaycrit = 16,
  qwindow=c(0,24),
  mvpathreshold =c(100, 120),
  bout.metric = 4,
  excludefirstlast = FALSE,
  includenightcrit = 16,
  #=====================
  # Part 3 + 4
  #=====================
  ignorenonwear = TRUE, # added
  def.noc.sleep = 1,
  outliers.only = TRUE,
  criterror = 4,
  do.visual = FALSE,
  loglocation=("C:/Users/.../Sleep Log/SleepLogFollowUpCOMPLETE.csv"), 

  relyonguider=FALSE, # added
  sleeplogidnum=FALSE, #added
  colid=1, #added
  coln1=2, #added
  nnights=7, #added
  #=====================
  # Part 5
  #=====================
  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),
  includedaycrit.part5 = 2/3,
  #=====================
  # Visual report
  #=====================
  timewindow = c("WW"),
  visualreport=TRUE)

CONSOLE

   GGIR version: 2.8.1

   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

Checking that user has read access permission for all files in data directory: Yes
Checking that user has write access permission for directory specified by argument outputdir: Yes

 Busy processing ... see C:/Users/.../FollowUp/COMPLETE4/output_COMPLETE/meta/basic for progress
Error in e$fun(obj, substitute(ex), parent.frame(), e$data) :
  unable to find variable "parseGT3Xggir"

Vincent van Hees

unread,
Oct 17, 2022, 1:38:14 PM10/17/22
to Sidney Donzella, R package GGIR
Are you processing GENEActiv .bin files?  If you are processing GENEActiv .csv files can you try to see whether changing to .bin files addresses the issue? Using .bin files is recommended. If yes, then start in a new output folder to avoid old and new analyses to overlap with each other.

When changing argument 'idloc' you will have to reprocessing the data with GGIR part 1 onward for the change to become effective.

Best wishes,
Vincent
------- Original Message -------

On Monday, October 17th, 2022 at 6:24 PM, Sidney Donzella <sid.do...@gmail.com> wrote:

Hi Vincent,

Thank you for the help! I really appreciate it.

I tried to run parts 1 and 2 with idloc=2 but received an error. See code and error message below. Might this be because I am using GENEActiv files and not Actigraph files? I also noticed that idloc=2 is for "_" in the id name. My files have a "-" (dash) in the file name. So, I tried running idloc=7 and received a different error message (below).


CODE

GGIR::g.shell.GGIR(
datadir=("C:/Users/.../FollowUp/COMPLETE"),
outputdir=("C:/Users/.../FollowUp/COMPLETE4"),
mode=c(1,2),
overwrite= TRUE,
idloc= 2,
do.cal = TRUE, # added
do.enmo = TRUE, # added
do.anglez = TRUE, # added
do.report=c(2),

#=====================
# Part 2
#=====================
strategy = 1,
hrs.del.start = 0,
hrs.del.end = 0,
maxdur = 9,
includedaycrit = 16,
qwindow=c(0,24),
mvpathreshold =c(100, 120),
bout.metric = 4,
excludefirstlast = FALSE,
includenightcrit = 16,
#=====================
# Part 3 + 4
#=====================
ignorenonwear = TRUE, # added
def.noc.sleep = 1,
outliers.only = TRUE,
criterror = 4,
do.visual = FALSE,
loglocation=("C:/Users/.../Sleep Log/SleepLogFollowUpCOMPLETE.csv"),
relyonguider=FALSE, # added
sleeplogidnum=FALSE, #added
colid=1, #added
coln1=2, #added
nnights=7, #added
#=====================
# Part 5
#=====================
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),
includedaycrit.part5 = 2/3,
#=====================
# Visual report
#=====================
timewindow = c("WW"),
visualreport=TRUE)

CONSOLE

GGIR version: 2.8.1

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

Checking that user has read access permission for all files in data directory: Yes
Checking that user has write access permission for directory specified by argument outputdir: Yes

Busy processing ... see C:/Users/sdonzell/Documents/UA Projects/Survivor Caregiver Supp/Scored/FollowUp/COMPLETE4/output_COMPLETE/meta/basic for progress

Error in e$fun(obj, substitute(ex), parent.frame(), e$data) :
unable to find variable "parseGT3Xggir"


CONSOLE (idloc=7)

GGIR version: 2.8.1

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

Checking that user has read access permission for all files in data directory: Yes
Checking that user has write access permission for directory specified by argument outputdir: Yes

Busy processing ... see C:/Users/sdonzell/Documents/UA Projects/Survivor Caregiver Supp/Scored/FollowUp/COMPLETE4/output_COMPLETE/meta/basic for progress

Error in e$fun(obj, substitute(ex), parent.frame(), e$data) :
unable to find variable "parseGT3Xggir"
In addition: Warning messages:
1: In is.factor(x) :
closing unused connection 8 (<-CP-11327.fhcrc.org:11180)
2: In is.factor(x) :
closing unused connection 7 (<-CP-11327.fhcrc.org:11180)
3: In is.factor(x) :
closing unused connection 6 (<-CP-11327.fhcrc.org:11180)



On Sun, Oct 16, 2022 at 11:17 PM Vincent van Hees <v.va...@accelting.com> wrote:

Sidney Donzella

unread,
Oct 17, 2022, 2:32:49 PM10/17/22
to Vincent van Hees, R package GGIR
I am using GENEActiv .bin files and am processing in a new output folder ("C:/Users/.../FollowUp/COMPLETE4"). Despite the new output file, I still received the error from the previous message. Any suggestions?

Antonella Arrieta

unread,
Aug 23, 2024, 9:39:21 PM8/23/24
to R package GGIR
Hi Sidney,

I was wondering if you could reach a solution to your error

Reply all
Reply to author
Forward
0 new messages