output part 4- how to get summary based on filenames similar to output part2

52 views
Skip to first unread message

rui zhang

unread,
Aug 27, 2022, 9:25:53 AM8/27/22
to R package GGIR
Hi all,
i have dataset in which some subjects had repeated measures at multiple timepoints  i,e., same ID, different filenames indicate measures at different time points.

I would like to have summary report based on filenames rather than ID. Output part 2 (Part2_summary) did gave me the desired output. However output part4 for sleep (part4_summary_sleep_cleaned) summarized the results based on ID. 

I am wondering whether i would be able to create a new sleep summary based on filenames without rerun the whole script? e.g., create from ms4.out? Should i use g.report. part4?

I haven't figured out how to do it.  
I would greatly appreciate for suggestions.

Thank you very much!
Rui

ben_m...@hotmail.com

unread,
Aug 27, 2022, 2:11:56 PM8/27/22
to R package GGIR
Hi Rui,

If the meta/basic files contain separate meta files for each time point, I would suggest just moving the meta files and recreating the folder structure for each time point, then run just those files for parts 2:5. These are very quick steps in comparison to part 1 which takes about 90% of the overall processing time. Unless you are doing this for thousands of files I don't see the additional processing time being an issue? 

A more desirable solution may be to change idloc in your script. Depending on the way your file's are named, changing this to detect a fuller/longer ID from the filename may work. Suggest you read here for an idea of how you can change the delimiter to make GGIR carry a longer ID name that might enable you to split by additional file info: https://github.com/wadpac/GGIR/blob/master/R/g.part4_extractid.R 

Another alternative for future reference prior to running part 1 is to either run in batches per time point, or denote the differences in the actual raw data filenames for each time point e.g. A001, B001, C001, A002, B002 etc.....

Hope that helps in some way,
Ben

rui zhang

unread,
Aug 27, 2022, 2:26:05 PM8/27/22
to R package GGIR
Hi Ben,
Thank you for the detailed responses and solutions.
I am using UK biobank so it is indeed a large dataset.

meta/basic files did contain separate meta files for each time point and so is meta/ms4.out. 
So it seems that GGIR provides sleep output for each time point and the issue raises at the step of creating CSV summary files. 
I am wondering if it's possible to create new csv summary by directly using RData files from meta/ms4.out?

best
Rui

Vincent van Hees

unread,
Sep 5, 2022, 10:14:12 AM9/5/22
to ben_m...@hotmail.com, zhang...@gmail.com, R package GGIR
Hi both,

In the latest GGIR release on GitHub 2.7-5 this has been addressed. GGIR part 4 output is now split based on recording name and not based on participant ID. For cross-sectional studies this should make not difference, but for longitudinal studies you should be able to study each recording separately in the results.

Best, 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/886f64b9-b715-43f7-8331-997bd2782271n%40googlegroups.com.

Vincent van Hees

unread,
Sep 5, 2022, 10:17:10 AM9/5/22
to rui zhang, R package GGIR
For exporting time series with detected sleep included see documentation for GGIR arguments "save_ms5rawlevels", "save_ms5raw_without_invalid" and "save_ms5raw_format".

This happens in GGIR part 5 because that is where GGIR constructs time series of the detection, in contrast to GGIR part 4 where the focus is only on start- and end- times.

Cheers, 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.
Reply all
Reply to author
Forward
0 new messages