Days in sleep log csv files

52 views
Skip to first unread message

奥田昌之

unread,
Jun 21, 2025, 6:40:11 AMJun 21
to R package GGIR

Dear colleagues,

I appreciate developers’ dedication. I am working with Actigraph data for children using GGIR 3.2-6 and R 4.40. Nap periods are not detected. I decided to visually determine nap periods using CSV sib_reports and PDF visual reports and modify metafiles in ms5.outraw. I have concerns about potential mistakes from my manual work.

1.      Sib_repots use UTC timezone, but other POSIXct variables use our local JST (+09:00), as seen in output timestamps.

2.      Outbed and inbed times must be put on the day before in a CSV file. For example, the first inbed and outbed time was recorded in the day-1 evening and day-2 morning, respectively, hand-written by parent, which should be transferred to day 0 and day 1 of sleep-log CSV files. It is possible that sleep detection is based on a noon-noon window. Is it a time-zone problem?

Can I address these concerns by adjusting parameters, other than setting cofigtz = “” as default? Both of PCs, and devices were set with a local timezone.

 Masayuki Okuda, Japan



Actigraphs were set to record acceleration from AM12:00 of day 1 and attached to participants in the day-1 morning.

Input Sleep-log.csv

ID          DI_date D1_outbed          D1_inbed            D2_date D2_outbed

ID001    2024/1/29        (blank)                 22:10     2024/1/30           7:40


Results in sib_report_ID001.csv

ID          type       start       end        duration

ID001    bedlog   2024-01-30T13:10:00Z     2024-01-30T22:40:00Z     570

at JST +0900            2024-01-30 22:10:00         2024-01-31 07:40:00         

Vincent van Hees

unread,
Jun 23, 2025, 11:22:23 AMJun 23
to 奥田昌之, R package GGIR
Dear Masayuki Okuda,

Sorry, the nap detection is relatively new and has not been well documented yet because it is still subject to evaluation. Confusingly, there is also an old sleep detection method in GGIR for which there is some documentation. One of my clients in Australia is currently drafting a manuscript about the new algorithm. My plan is to update and expand the documentation later this year when that paper has been finalised.

I am not sure which specific functionality you are hoping to use. Would you mind sharing your R script or just the code to help me understand what you are trying to do. Also, it would help if you could share:
  • One RData file from your meta/basic output folder.
  • The csv file with the sleep log you used as input to GGIR.
In that way I can try to reproduce your problem.

I am not aware of timezone problems: We successfully tested in data from Australia, which is many time zones away from UTC by which timezone mistakes would be easy to spot. Hopefully your example data will help clarify the problem.

Best wishes,

Vincent

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

--
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, visit https://groups.google.com/d/msgid/RpackageGGIR/019c56b1-99bc-47e2-a5ea-434422382831n%40googlegroups.com.

奥田昌之

unread,
Jun 23, 2025, 8:44:29 PMJun 23
to Vincent van Hees, R package GGIR
Dear Vincent,

Thank you for your kind response.
My files are attached here.
 I have tried several combinations of parameters and days of a sleeplog, which makes me confused. 
The advice from the developer is very helpful.

Best regards,
Masayuki

2025年6月24日(火) 0:22 Vincent van Hees <v.va...@accelting.com>:
meta_JP63001 (2024-01-30).gt3x.RData
Diary.csv
report_JP63001 (2024-01-30)_T5A5.pdf
RscriptGGIR.r
sib_report_JP63001 (2024-01-30)gt3x_T5A5.csv

奥田昌之

unread,
Jun 23, 2025, 8:50:01 PMJun 23
to Vincent van Hees, R package GGIR
P.S.

We also collaborate with Australian researchers.
They send summary report of Actigraphs.
 But some nap periods are too long during spending in child-care centers, 3-4 hours in weekdays.
 Nonwear periods may not detected.
So, we need data analysis ourselves.

Is Australian team the same?

Masayuki

2025年6月24日(火) 9:44 奥田昌之 <okudama...@gmail.com>:
SummaryDataFromAustralia_JP63.xlsx

Vincent van Hees

unread,
Jun 30, 2025, 5:33:38 AMJun 30
to 奥田昌之, R package GGIR
Hi Masayuki,

You are right, the timezones are not saved in the local timezone. I am now preparing a fix which will be part of the next release. However, it seems that this does not affect the actual classification in the rest of the output.

Note that the sleep detection algorithm has been designed and evaluated for 5 second epochs. Your choice for 15 seconds may work but there is less literature to support the decision.

The visualreport is probably the easiest way to evaluate the classification. See screenshot attached, which to me gives the impression that it is working well as naps are detect and non-wear periods are correctly skipped.

I have been developing this for Simone Verswijveren (Deakin University), and I now understand that she successfully presented it at the ISBNPA conference recently.

Kind regards,

Vincent
image.png

Vincent van Hees

unread,
Jun 30, 2025, 5:50:29 AMJun 30
to Vincent van Hees, 奥田昌之, R package GGIR
Dear Masayuki,

To follow up on my previous message. Note that the problem is specific to the non-default option save_ms5raw_format = "csv" please use the default save_ms5raw_format = "RData" for which this probably does not exist. 

Also note that parameter possible_nap_duration no longer exists, please use possible_nap_dur instead.

Best,

Vincent

奥田昌之

unread,
Jun 30, 2025, 11:31:01 PMJun 30
to Vincent van Hees, R package GGIR

Hi, Vincent,

 

Thank you for your valuable information.

I have read the abstract of ISBNPA 2025 and seen a visual report screenshot attached. It represents excellent work. Unfortunately, a member of our collaborating team from Wollongong University was not involved.

I am looking forward to the next release using local timezone.

 

I also appreciate your advice. The parameter “possible_nap_dur” instead of “possible_nap_duration” worked to detect nap. I will utilize a 5-second epoch, which seems better in comparison.

 

Sincerely,

Masayuki


2025年6月30日(月) 18:50 Vincent van Hees <v.va...@accelting.com>:
Reply all
Reply to author
Forward
0 new messages