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

Allow for specifying desiredtz and configtz when working with gt3x files #557

Closed
wants to merge 42 commits into from

Conversation

vincentvanhees
Copy link
Member

fixes #551

For .gt3x data files we did not account for arguments desiredtz or configtz, and it defaulted to the local timezone where GGIR was run. With this PR this should be addressed.

I have tested the new functionality with example files from a study in the USA where we know in which timezone the files were configured and in which timezone the accelerometer was worn.

Checklist before merging:

  • Existing tests still work (check by running the test suite, e.g. from RStudio).
  • Added tests (if you added functionality) or fixed existing test (if you fixed a bug).
  • Updated or expanded the documentation.
  • Updated release notes in inst/NEWS.Rd with a user-readable summary. Please, include references to relevant issues or PR discussions.
  • Added your name to the contributors lists in the DESCRIPTION and CITATION.cff files.

@codecov-commenter
Copy link

codecov-commenter commented May 7, 2022

Codecov Report

Merging #557 (03bc69a) into master (e7ac860) will increase coverage by 0.02%.
The diff coverage is 88.63%.

@@            Coverage Diff             @@
##           master     #557      +/-   ##
==========================================
+ Coverage   72.11%   72.13%   +0.02%     
==========================================
  Files          96       96              
  Lines       11310    11322      +12     
==========================================
+ Hits         8156     8167      +11     
- Misses       3154     3155       +1     
Impacted Files Coverage Δ
R/g.readaccfile.R 39.76% <60.00%> (+0.58%) ⬆️
R/get_starttime_weekday_meantemp_truncdata.R 61.17% <91.66%> (ø)
R/g.dotorcomma.R 66.66% <100.00%> (ø)
R/g.getmeta.R 68.53% <100.00%> (-0.11%) ⬇️
R/g.imputeTimegaps.R 100.00% <100.00%> (ø)
R/g.inspectfile.R 60.40% <100.00%> (ø)
R/read.gt3x_ggir.R 70.25% <100.00%> (+1.43%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@vincentvanhees
Copy link
Member Author

@jhmigueles Do you have time in the upcoming week to review and test this PR? I think it does the job, but given that this is an important update for gt3x users it may be good if you could also check it out.

@vincentvanhees vincentvanhees requested a review from jhmigueles May 7, 2022 16:13
…of decimal places. In timegap imputation code an error is now produced when data has timegaps larger than 36 hours #522
Copy link
Collaborator

@jhmigueles jhmigueles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have had some fun testing this branch and it all looks good to me. I have made some tests using different actigraph files, both in gt3x and csv, and the configtz and desiredtz work as expected. My only comment is on the g.shell.GGIR documentation where it is specified that desiredtz and configtz is only functional for AX3 cwa and Actigraph gt3x (it is also working, at least with Actigraph csv files).

Edit on previous - just realized I have much more non-wear time detected in the reports with this branch compared to the previous reports, I am investigating this now.

@vincentvanhees
Copy link
Member Author

thanks Jairo, I am also looking into the timegaps/timeleaking behaviour reported by Youngdeok.
I suspect that the changes to the timestamp format impact on the behaviour of the g.imputeTimegaps.R function.
I am now experimenting with changing the minimum timegap to be impute (k)... will let you know when I have results.

@vincentvanhees
Copy link
Member Author

... I think I fixed it, will commit fix in a couple of minutes. Now updating unit-tests.

@vincentvanhees
Copy link
Member Author

My only comment is on the g.shell.GGIR documentation where it is specified that desiredtz and configtz is only functional for AX3 cwa and Actigraph gt3x (it is also working, at least with Actigraph csv files).

Thanks, this is now addressed.

@jhmigueles
Copy link
Collaborator

I just re-run the script with your latest commit and the problem imputing the time gaps is still there (sorry I couldn't run this before). See report after using the lastest version of this branch:

image

@vincentvanhees
Copy link
Member Author

vincentvanhees commented May 12, 2022

I was working in Linux where the problem does not occur. In Windows I am able to reproduce your issue.

In summary, we need correct timestamps to be able to account for timezone, but by correcting the timestamps it seems we are introducing other issues.

I have already spent a substantial amount of time on this. I am happy to continue the work if we can find funding for my time. Alternatively, I welcome outside contributions to resolve the issue #551 .

Therefore, I will not merge the pull request yet. It means that .gt3x data can only be analysed in the timezone it is collected in.

@vincentvanhees vincentvanhees marked this pull request as draft May 12, 2022 12:14
@vincentvanhees
Copy link
Member Author

I will close this PR now, because I think I fixed the issues in a separate branch and will create a new PR for that later today.

@vincentvanhees vincentvanhees mentioned this pull request Aug 10, 2022
5 tasks
@vincentvanhees vincentvanhees deleted the issue551_tz_gt3x branch August 10, 2022 10:39
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

Successfully merging this pull request may close these issues.

Argument configtz and desiredtz not used for .gt3x data
3 participants