diff --git a/NEWS.md b/NEWS.md index c80191741..6e21a38e4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,10 +2,7 @@ - Part 2: - - Fix bug in determining the number of files to be included in the part 2 report. - It may affect the part 2 csv report which may have had less recordings than expected - even though the missing recordings are just processed and visible in the output of - subsequent parts. #1252 + - Fix bug in determining the files to be included in the part 2 report, which only considered the first N files processed by part 2 while using this N when working a file name list produced by part 1 which can be longer #1252 - Speed up activity diary extraction. #1250 @@ -17,7 +14,7 @@ boutcriter.mvpa). #1247 - Part 2 and 4: Both activity diary and sleep diary are now always reloaded if the derived -copy of it (in .RData) is older than the diary itself. #1250 +copy of it (in .RData) is older than the diary itself or if the diary name has changed. #1250 - Visual report: Recently added visual report is now also able to handle epoch sizes not equal to 1 minutes, and now also able to handle recordings diff --git a/R/g.part2.R b/R/g.part2.R index 31736b036..91587b9fe 100644 --- a/R/g.part2.R +++ b/R/g.part2.R @@ -28,7 +28,7 @@ g.part2 = function(datadir = c(), metadatadir = c(), f0 = c(), f1 = c(), # note that this filtering is only use if parameter nonwearFiltermaxHours is specified. use_qwindow_as_diary = FALSE } - tmp_activityDiary_file = paste0(metadatadir, "/meta/activityDiary.RData") + tmp_activityDiary_file = paste0(metadatadir, "/meta/activityDiary_", basename(params_247[["qwindow"]]), ".RData") if (!file.exists(tmp_activityDiary_file) || (file.exists(tmp_activityDiary_file) && file.info(params_247[["qwindow"]])$mtime >= file.info(tmp_activityDiary_file)$mtime)) { diff --git a/R/g.part4.R b/R/g.part4.R index 443c0b43f..74cdf3b97 100644 --- a/R/g.part4.R +++ b/R/g.part4.R @@ -32,7 +32,7 @@ g.part4 = function(datadir = c(), metadatadir = c(), f0 = f0, f1 = f1, dolog = FALSE } if (dolog == TRUE) { - sleeplogRDataFile = paste0(metadatadir,"/meta/sleeplog.RData") + sleeplogRDataFile = paste0(metadatadir,"/meta/sleeplog_", basename(params_sleep[["loglocation"]]), ".RData") # only re-process sleeplog if sleeplog.RData does not exist or if sleeplog # is from a date equal to or after sleeplog.RData if (!file.exists(sleeplogRDataFile) || diff --git a/R/g.part5.R b/R/g.part5.R index 648df9e9a..9f73ba3bb 100644 --- a/R/g.part5.R +++ b/R/g.part5.R @@ -64,7 +64,12 @@ g.part5 = function(datadir = c(), metadatadir = c(), f0=c(), f1=c(), fnames.ms5 = dir(paste(metadatadir, "/meta/ms5.out", sep = "")) # path to sleeplog milestonedata, if it exists: - sleeplogRDA = paste(metadatadir, "/meta/sleeplog.RData", sep = "") + + if (length(params_sleep[["loglocation"]]) > 0) { + sleeplogRDA = paste0(metadatadir,"/meta/sleeplog_", basename(params_sleep[["loglocation"]]), ".RData") + } else { + sleeplogRDA = paste(metadatadir, "/meta/sleeplog.RData", sep = "") + } if (file.exists(sleeplogRDA) == TRUE) { sleeplog = logs_diaries = c() load(sleeplogRDA)