mMARCH.AC.maincall {mMARCH.AC}R Documentation

Main Call for Data Processing after Runing GGIR for Accelerometer Data

Description

This R script will generate all necessary R/Rmd/shell files for data processing after running GGIR for accelerometer data.

Usage

mMARCH.AC.maincall(
  mode,
  useIDs.FN = NULL,
  currentdir,
  studyname,
  bindir = NULL,
  outputdir,
  epochIn = 5,
  epochOut = 60,
  log.multiplier = 9250,
  use.cluster = TRUE,
  QCdays.alpha = 7,
  QChours.alpha = 16,
  QCnights.feature.alpha = c(0, 0, 0, 0),
  DoubleHour = c("average", "earlier", "later")[1],
  QC.sleepdur.avg = c(3, 12),
  QC.nblocks.sleep.avg = c(6, 29),
  Rversion = "R",
  filename2id = NULL,
  PA.threshold = c(40, 100, 400),
  PA.threshold2 = c(50, 100, 400),
  desiredtz = "US/Eastern",
  RemoveDaySleeper = FALSE,
  part5FN = "WW_L50M100V400_T5A5",
  NfileEachBundle = 20,
  holidayFN = NULL,
  trace = FALSE
)

Arguments

mode

number Specify which of the five modules need to be run, e.g. mode = 0 makes that all R/Rmd/sh files are generated for other modules. When mode = 1, all csv files in the GGIR output directory were read, transformed and then merged. When mode = 2, the GGIR output files were checked and summarized in one excel sheet. When mode = 3, the merged data was cleaned according to the number of valid hours on each night and the number of valid days for each subject. When mode = 4, the cleaned data was imputed.

useIDs.FN

character Filename with or without directory for sample information in CSV format, which including "filename" and "duplicate" in the headlines at least. If duplicate="remove", the accelerometer files will not be used in the data analysis of module 5-7. Defaut is NULL, which makes all accelerometer files will be used in module 5-7.

currentdir

character Directory where the output needs to be stored. Note that this directory must exist.

studyname

character Specify the study name that used in the output file names

bindir

character Directory where the accelerometer files are stored or list

outputdir

character Directory where the GGIR output was stored.

epochIn

number Epoch size to which acceleration was averaged (seconds) in GGIR output. Defaut is 5 seconds.

epochOut

number Epoch size to which acceleration was averaged (seconds) in module 3. Defaut is 60 seconds.

log.multiplier

number The coefficient used in the log transformation of the ENMO data, i.e. log( log.multiplier * ENMO + 1), which have been used in module 5-7. Defaut is 9250.

use.cluster

logical Specify if module1 will be done by parallel computing. Default is TRUE, and the CSV file in GGIR output will be merged for every 20 files first, and then combined for all.

QCdays.alpha

number Minimum required number of valid days in subject specific analysis as a quality control step in module2. Default is 7 days.

QChours.alpha

number Minimum required number of valid hours in day specific analysis as a quality control step in module2. Default is 16 hours.

QCnights.feature.alpha

number Minimum required number of valid nights in day specific mean, SD, weekday mean and weekend mean analysis as a quality control step in the JIVE analysis. Default is c(0,0,0,0), i.e. no additional data cleaning in this step.

DoubleHour

character Specify the method of processing the double hours for days that daylight saving time starts and ends for example. In detail, DoubleHour = c("average","earlier","later"). The acceleration data was averaged on double hours when DoulbeHour="average". Only the acceleration data in the earlier occurrence was remained for double hours while the other duplicate data were ignored when DoulbeHour="earlier". Only the acceleration data in the later occurrence was remained for double hours while the other duplicate data were ignored when DoulbeHour="later". Default is "average".

QC.sleepdur.avg

number As taking the deault value of QC.sleepdur.avg=c(3,12), individuals were excluded with an average sleep duration <3 hour or >12 hour.

QC.nblocks.sleep.avg

number As taking the deault value of QC.nblocks.sleep.avg=c(6,29), individuals were excluded with an average number of nocturnal sleep episodes < 6 or > 29.

Rversion

character R version, eg. "R/3.6.3". Default is "R".

filename2id

R function User defined function for converting filename to sample IDs. Default is NULL.

PA.threshold

number Threshold for light, moderate and vigorous physical activity. Default is c(40,100,400).

PA.threshold2

number Second threshold for light, moderate and vigorous physical activity. Default is c(50,100,400). The activity features will end with "_C2" for those that were calculated based on PA.threshold2.

desiredtz

charcter desired timezone: see also http://en.wikipedia.org/wiki/Zone.tab. Used in g.inspectfile(). Default is "US/Eastern". Used in g.inspectfile() function to inspect acceleromether file for brand, sample frequency in module 2.

RemoveDaySleeper

logical Specify if the daysleeper nights are removed from the calculation of number of valid days for each subject. Default is FALSE.

part5FN

character Specify which output is used in the GGIR part5 results. Defaut is "WW_L50M100V400_T5A5", which means that part5_daysummary_WW_L50M100V400_T5A5.csv and part5_personsummary_WW_L50M100V400_T5A5.csv are used in the analysis.

NfileEachBundle

number Number of files in each bundle when the csv data were read and processed in a cluster. Default is 20.

holidayFN

character Specify the holiday file including filename (optional), Date (mm/dd/year) and holiday (1/0) columns. When it is available, the holiday will be marked into the "weekends" group in weekday/weekend specific feature calculations in module7d. Defaut is NULL.

trace

logical Specify if the intermediate results is printed when the function was executed. Default is FALSE.

Value

See mMARCH.AC manual for details.


[Package mMARCH.AC version 2.9.2.0 Index]