### Execute mMARCH.AC Module 0 Source: https://github.com/weiguonimh/mmarch.ac/blob/main/mMARCH.AC.html This command initiates Module 0 of the mMARCH.AC package, which handles initial data processing and setup. The module's output will be stored in the current working directory. ```R mMARCH.AC.shell(mode=0) ``` -------------------------------- ### Create mMARCH.AC Template Shell Script Source: https://github.com/weiguonimh/mmarch.ac/blob/main/mMARCH.AC.html The `create.shell()` function, part of the mMARCH.AC package, generates a template R script in the current directory. This script, typically named `_STUDYNAME_module0.maincall.R`, serves as a customizable starting point for running mMARCH.AC analyses. ```R library(mMARCH.AC) create.shell() ``` -------------------------------- ### Install mMARCH.AC R Package Source: https://github.com/weiguonimh/mmarch.ac/blob/main/mMARCH.AC.html This R command installs the mMARCH.AC package from CRAN, automatically resolving and installing all its necessary dependencies. This ensures the package is fully functional and ready for use in your R environment. ```R install.packages("mMARCH.AC", dependencies = TRUE) ``` -------------------------------- ### Configure mMARCH.AC Parameters Source: https://github.com/weiguonimh/mmarch.ac/blob/main/inst/doc/quickguide.mMARCH.AC.txt This R-like snippet shows the essential parameters that need to be filled in the 'Example_part0.maincall.R' file. These parameters define the current directory, study name, binary paths, output directory, and quality control thresholds. ```R currentdir = studyname = bindir = NULL binfile.list = NULL outputdir = QCdays.alpha = 0 QChours.alpha = 0 part5FN = ...... ``` -------------------------------- ### Create mMARCH.AC Template File in R Source: https://github.com/weiguonimh/mmarch.ac/blob/main/inst/doc/quickguide.mMARCH.AC.txt This R code snippet demonstrates how to load the mMARCH.AC library and create the initial shell template file required for the analysis. This file serves as the base for further configuration. ```R library(mMARCH.AC) create.shell() ``` -------------------------------- ### Copy mMARCH.AC Template File Source: https://github.com/weiguonimh/mmarch.ac/blob/main/inst/doc/quickguide.mMARCH.AC.txt This shell command copies the generated template file to a new study-specific file named 'Example_part0.maincall.R'. This new file will then be configured with study-specific parameters. ```Shell cat STUDYNAME_part0.maincall.R > Example_part0.maincall.R ``` -------------------------------- ### Execute mMARCH.AC Main Call Script Source: https://github.com/weiguonimh/mmarch.ac/blob/main/inst/doc/quickguide.mMARCH.AC.txt These commands show how to execute the 'Example_part0.maincall.R' script from the R console or command line. Running this script generates all necessary template files for the mMARCH.AC analysis, preparing for subsequent steps. ```R R> call.afterggir(mode=0) ``` ```R R --no-save --no-restore --args < Example_part0.maincall.R 0 ``` -------------------------------- ### mMARCH.AC Module 3: Input, Command, and Output Source: https://github.com/weiguonimh/mmarch.ac/blob/main/mMARCH.AC.html Outlines the main input file, the command to run Module 3, and the output files which include flagged raw ANGLEZ and ENMO data for cleaning, and an ID matrix. ```APIDOC Main Input File: ./data/All_studyname_ENMO.data.csv Command: mMARCH.AC.shell(mode=3) Output Folder: ./data Output Files: flag_All_studyname_ANGLEZ.data.Xs.csv: Adding flags for data cleaning of the raw ANGLEZ data flag_All_studyname_ENMO.data.Xs.csv: Adding flags for data cleaning of the raw ENMO data IDMatrix.flag_All_studyname_ENMO.data.60s.csv: ID matrix *Xs is the epoch size to which acceleration was averaged (seconds) in GGIR output ``` -------------------------------- ### mMARCH.AC Module 2: Input, Command, and Output Source: https://github.com/weiguonimh/mmarch.ac/blob/main/mMARCH.AC.html Describes the required input files, the command to execute Module 2, and the various output files generated, including a comprehensive GGIR output summary, intermediate results, plots, and a template for sample removal. ```APIDOC Main Input Files: + ./data/All_studyname_ENMO.data.csv + GGIR results: part2, part4 and part5 (please specify \(part5FN\) in the main function) + GGIR raw data when bindir was specified Command: mMARCH.AC.shell(mode=2) Output Folder: ./summary Output Files: studyname_ggir_output_summary.xlsx: Description of all accelerometer files in the GGIR output. This excel file includs 9 pages as follows, (1) List of files in the GGIR output (2) Summary of files (3) List of duplicate IDs (4) ID errors (5) Number of valid days (6) Table of number of valid/missing days (7) Missing patten (8) Frequency of the missing pattern (9) Description of all accelerometer files. part2daysummary.info.csv: Intermediate results for description of each accelerometer file. studyname_ggir_output_summary_plot.pdf: Some plots such as the number of valid days, which were included in the module5_studyname_Data_process_report.htm file as well. studyname_samples_remove_temp.csv: Create studyname_samples_remove.csv file by filling "remove" in the "duplicate" column in this template. If duplicate="remove", the accelerometer files will not be used in the data analysis of module5. ``` -------------------------------- ### Initialize Bootstrap Tooltips and Popovers with jQuery Source: https://github.com/weiguonimh/mmarch.ac/blob/main/mMARCH.AC.html This jQuery snippet initializes Bootstrap tooltips and popovers on elements with `data-toggle="tooltip"` and `data-toggle="popover"` attributes, respectively. It checks for the existence of the `tooltip` and `popover` functions before attempting to call them, ensuring graceful degradation if Bootstrap's JavaScript components are not loaded. ```javascript $(document).ready(function(){ if (typeof $('\[data-toggle="tooltip"\]').tooltip === 'function') { $('\[data-toggle="tooltip"\]').tooltip(); } if ($('\[data-toggle="popover"\]').popover === 'function') { $('\[data-toggle="popover"\]').popover(); } }); ``` -------------------------------- ### Submit mMARCH.AC Jobs to Cluster Source: https://github.com/weiguonimh/mmarch.ac/blob/main/inst/doc/quickguide.mMARCH.AC.txt This Slurm command demonstrates how to submit the 'part9_swarm.sh' script to a high-performance computing cluster. It allocates specific time and memory resources for the job, enabling parallel execution of mMARCH.AC tasks. ```Shell sbatch --time=100:00:00 --mem=120g part9_swarm.sh ``` -------------------------------- ### GGIR Basic Data Files Source: https://github.com/weiguonimh/mmarch.ac/blob/main/mMARCH.AC.html Details the raw data files for ANGLEZ and ENMO, along with nonwear score, light, temperature, clipping, and EN data matrices, and associated plots. ```APIDOC All_studyname_ANGLEZ.data.csv Raw data of ANGLEZ after merge All_studyname_ENMO.data.csv Raw data of ENMO after merge nonwearscore_studyname_f0_f1_Xs.csv Data matrix of nonwearscore nonwearscore_studyname_f0_f1_Xs.pdf Plots for nonwearscore plot.nonwearVSnvalidhours.csv Nonwear data for plot plot.nonwearVSnvalidhours.pdf Nonwear plots lightmean_studyname_f0_f1_Xs.csv Data matrix of lightmean lightpeak_studyname_f0_f1_Xs.csv Data matrix of lightpeak temperaturemean_studyname_f0_f1_Xs.csv Data matrix of temperaturemean clippingscore_studyname_f0_f1_Xs.csv Raw data of clippingscore EN_studyname_f0_f1_Xs.csv Data matrix of EN _f0 and f1 are the file index to start and finish with _Xs is the epoch size to which acceleration was averaged (seconds) in GGIR output ``` -------------------------------- ### Run mMARCH.AC Analysis Steps in R Source: https://github.com/weiguonimh/mmarch.ac/blob/main/inst/doc/quickguide.mMARCH.AC.txt These R commands execute various stages of the mMARCH.AC analysis within the R environment. This includes generating different types of reports and running JIVE modules, processing the data based on the configured parameters. ```R call.afterggir(mode=1) call.afterggir(mode=2) call.afterggir(mode=3) call.afterggir(mode=4) run part5_Example_mMARCH.AC.report.Rmd run part6_Example_mMARCH.AC.nonwear.report.Rmd run part7a_Example_mMARCH.AC_JIVE_1_somefeatures.Rmd run part7b_Example_mMARCH.AC_JIVE_2_allfeatures.Rmd run part7c_Example_mMARCH.AC_JIVE_3_runJIVE.Rmd run part7d_Example_mMARCH.AC_JIVE_4_somefeatures_weekday.Rmd ``` -------------------------------- ### Running mMARCH.AC Modules on a Cluster Source: https://github.com/weiguonimh/mmarch.ac/blob/main/mMARCH.AC.html This Bash script demonstrates how to execute various mMARCH.AC modules and R Markdown reports in a cluster environment. It sets up the environment by sourcing bash profile and loading the R module, then sequentially runs different 'studyname_module0.maincall.R' scripts with varying 'mode' arguments, followed by rendering several R Markdown reports. ```Bash #!/bin/bash # #$ -cwd #$ -j y #$ -S /bin/bash source ~/.bash_profile module load R ; R --no-save --no-restore --args < studyname_module0.maincall.R 0 R --no-save --no-restore --args < studyname_module0.maincall.R 1 R --no-save --no-restore --args < studyname_module0.maincall.R 2 R --no-save --no-restore --args < studyname_module0.maincall.R 3 R --no-save --no-restore --args < studyname_module0.maincall.R 4 R -e "rmarkdown::render('module5_studyname_Data_process_report.Rmd' )" R -e "rmarkdown::render('module6_studyname_NonWear.report.Rmd' )" R -e "rmarkdown::render('module7a_studyname_calculate_newfeatures.Rmd' )" R -e "rmarkdown::render('module7b_studyname_merge_GGIRfeatures.Rmd' )" R -e "rmarkdown::render('module7c_studyname_runJIVE.Rmd' )" R -e "rmarkdown::render('module7d_studyname_calculate_WD_WE_avg_features.Rmd' )" ``` -------------------------------- ### CSS Styles for Code Blocks and Syntax Highlighting Source: https://github.com/weiguonimh/mmarch.ac/blob/main/mMARCH.AC.html This extensive CSS section provides styling for `code` elements and `sourceCode` blocks, ensuring proper white-space handling, overflow management, and line numbering. It also includes detailed rules for syntax highlighting, assigning specific colors to different code elements (e.g., comments, keywords, strings) to improve code readability. ```CSS code{white-space: pre-wrap;} span.smallcaps{font-variant: small-caps;} span.underline{text-decoration: underline;} div.column{display: inline-block; vertical-align: top; width: 50%;} div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} ul.task-list{list-style: none;} code { white-space: pre; } .sourceCode { overflow: visible; } pre > code.sourceCode { white-space: pre; position: relative; } pre > code.sourceCode > span { display: inline-block; line-height: 1.25; } pre > code.sourceCode > span:empty { height: 1.2em; } .sourceCode { overflow: visible; } code.sourceCode > span { color: inherit; text-decoration: inherit; } div.sourceCode { margin: 1em 0; } pre.sourceCode { margin: 0; } @media screen { div.sourceCode { overflow: auto; } } @media print { pre > code.sourceCode { white-space: pre-wrap; } pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; } } pre.numberSource code { counter-reset: source-line 0; } pre.numberSource code > span { position: relative; left: -4em; counter-increment: source-line; } pre.numberSource code > span > a:first-child::before { content: counter(source-line); position: relative; left: -1em; text-align: right; vertical-align: baseline; border: none; display: inline-block; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; padding: 0 4px; width: 4em; color: #aaaaaa; } pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; } div.sourceCode { } @media screen { pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; } } code span.al { color: #ff0000; font-weight: bold; } /* Alert */ code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */ code span.at { color: #7d9029; } /* Attribute */ code span.bn { color: #40a070; } /* BaseN */ code span.bu { } /* BuiltIn */ code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */ code span.ch { color: #4070a0; } /* Char */ code span.cn { color: #880000; } /* Constant */ code span.co { color: #60a0b0; font-style: italic; } /* Comment */ code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */ code span.do { color: #ba2121; font-style: italic; } /* Documentation */ code span.dt { color: #902000; } /* DataType */ code span.dv { color: #40a070; } /* DecVal */ code span.er { color: #ff0000; font-weight: bold; } /* Error */ code span.ex { } /* Extension */ code span.fl { color: #40a070; } /* Float */ code span.fu { color: #06287e; } /* Function */ code span.im { } /* Import */ code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */ code span.kw { color: #007020; font-weight: bold; } /* Keyword */ code span.op { color: #666666; } /* Operator */ code span.ot { color: #007020; } /* Other */ code span.pp { color: #bc7a00; } /* Preprocessor */ code span.sc { color: #4070a0; } /* SpecialChar */ code span.ss { color: #bb6688; } /* SpecialString */ code span.st { color: #4070a0; } /* String */ code span.va { color: #19177c; } /* Variable */ code span.vs { color: #4070a0; } /* VerbatimString */ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */ ``` -------------------------------- ### mMARCH.AC Main Call Shell Script Template Source: https://github.com/weiguonimh/mmarch.ac/blob/main/mMARCH.AC.html This comprehensive R script provides a template for executing mMARCH.AC analyses, designed for both interactive R console use and cluster job submission. It includes sections for parsing command-line arguments, defining custom `filename2id` functions, setting various analysis parameters for GGIR output, and handling duplicate sample IDs before initiating the core mMARCH.AC processing. ```R argv = commandArgs(TRUE); print(argv) print(paste("length=",length(argv),sep="")) mode<-as.numeric(argv[1]) print(c("mode =", mode)) # (Note) Please remove the above lines if you are running this within R console # instead of submitting jobs to a cluster. ######################################################################### # (user-define 1) you need to redefine this according different study!!!! ######################################################################### # example 1 filename2id.1<-function(x) unlist(strsplit(x,"\\."))[1] # example 2 (use csv file =c("filename","ggirID")) filename2id.2<-function(x) { d<-read.csv("./mMARCH.AC/inst/extdata/example/filename2id.csv",head=1,stringsAsFactors=F) y1<-which(d[,"filename"]==x) if (length(y1)==0) stop(paste("Missing ",x," in filename2id.csv file",sep="")) if (length(y1)>=1) y2<-d[y1[1],"newID"] return(as.character(y2)) } ######################################################################### # main call ######################################################################### mMARCH.AC.shell<-function(mode,filename2id=NULL){ library(mMARCH.AC) packageVersion("mMARCH.AC") # ?mMARCH.AC.maincall # run help to see all argumengts ######################################################################### # (user-define 2) Fill in parameters of your ggir output ########################################################################## currentdir = studyname = bindir = outputdir = setwd(currentdir) rmDup=FALSE # keep all subjects in mMARCH.AC PA.threshold=c(50,100,400) part5FN="WW_L50M100V400_T5A5" epochIn = 5 epochOut = 60 use.cluster = FALSE log.multiplier = 9250 QCdays.alpha = 7 QChours.alpha = 16 QCnights.feature.alpha = c(0,0,0,0) DoubleHour= "average" QC.sleepdur.avg=NULL QC.nblocks.sleep.avg=NULL useIDs.FN=NULL Rversion="R" desiredtz="US/Eastern" RemoveDaySleeper=FALSE NfileEachBundle=20 holidayFN=NULL trace=FALSE ######################################################################### # remove duplicate sample IDs for plotting and feature extraction ######################################################################### if (mode==3 & rmDup){ # step 1: read ./summary/*remove_temp.csv file (output of mode=2) keep.last<-TRUE #keep the latest visit for each sample sumdir<-paste(currentdir,"/summary",sep="") setwd(sumdir) inFN<-paste(studyname,"_samples_remove_temp.csv",sep="") useIDs.FN<-paste(sumdir,"/",studyname,"_samples_remove.csv",sep="") ######################################################################### # (user-define 3 as rmDup=TRUE) create useIDs.FN file ######################################################################### # step 2: create the ./summary/*remove.csv file manually or by R commands d<-read.csv(inFN,head=1,stringsAsFactors=F) d<-d[order(d[,"Date"]),] d<-d[order(d[,"newID"]),] d[which(is.na(d[,"newID"])),] S<-duplicated(d[,"newID"],fromLast=keep.last) #keep the last copy for nccr d[S,"duplicate"]<-"remove" write.csv(d,file=useIDs.FN,row.names=F) } ######################################################################### # call afterggir ``` -------------------------------- ### Execute mMARCH.AC Module 1 Source: https://github.com/weiguonimh/mmarch.ac/blob/main/mMARCH.AC.html This command runs Module 1 of the mMARCH.AC package. It primarily processes CSV files located in the `/meta/csv` folders of GGIR output. The processed data will be saved in the `./data` directory. ```R mMARCH.AC.shell(mode=1) ``` -------------------------------- ### CSS Styles for Lightable Tables Source: https://github.com/weiguonimh/mmarch.ac/blob/main/mMARCH.AC.html This CSS snippet defines the visual presentation for tables, specifically those with 'e-paper' and 'lightable-paper' classes. It includes rules for borders, padding, vertical alignment, hover effects, and striped row backgrounds to enhance readability and user experience. ```CSS e-paper tfoot tr:first-child td { border-top: 1px solid #00000020; } .lightable-paper thead tr:last-child th { color: #666; vertical-align: bottom; border-bottom: 1px solid #00000020; line-height: 1.15em; padding: 10px 5px; } .lightable-paper td { vertical-align: middle; border-bottom: 1px solid #00000010; line-height: 1.15em; padding: 7px 5px; } .lightable-paper.lightable-hover tbody tr:hover { background-color: #F9EEC1; } .lightable-paper.lightable-striped tbody tr:nth-child(even) { background-color: #00000008; } .lightable-paper.lightable-striped tbody td { border: 0; } ``` -------------------------------- ### mMARCH.AC Module 1 Output Files and Descriptions Source: https://github.com/weiguonimh/mmarch.ac/blob/main/mMARCH.AC.html This section describes the primary output file generated by mMARCH.AC Module 1, which summarizes the processed CSV files from GGIR output. ```APIDOC studyname_filesummary_csvlist.csv Description: Summary list of processed CSV files. ``` -------------------------------- ### dur_day_total_LIG_min Metric Definition Source: https://github.com/weiguonimh/mmarch.ac/blob/main/mMARCH.AC.html Total duration of day in minutes of light activity during the day. ```APIDOC Variable: dur_day_total_LIG_min Description: Total duration of day in minutes of light activity during the day Level: day Source: GGIR-part5 ``` -------------------------------- ### mMARCH.AC Module 0 Output Files and Descriptions Source: https://github.com/weiguonimh/mmarch.ac/blob/main/mMARCH.AC.html This section details the various R scripts, R Markdown files, and shell scripts generated or utilized by mMARCH.AC Module 0, along with their respective functionalities. These files support data transformation, report generation, feature extraction, and job submission to clusters. ```APIDOC module1a_data.transform.R (use.cluster=TRUE, optional) Description: R code for data transformation and merge for every 20 files in each partition. When the number of .bin files is large ( > 1000), the data merge could take long time, user could split the job and submit the job to a cluster for parallel computing. ``` ```APIDOC module1b_data.transform.sw (use.cluster=TRUE, optional) Description: Submit the job to a cluster for parallel computing ``` ```APIDOC module1c_data.transform.merge.sw (use.cluster=TRUE, optional) Description: Merge all partitions for the ENMO and ANGLEZ data ``` ```APIDOC module5_studyname_Data_process_report.Rmd Description: R markdown file for generate a comprehensive report of data processing and explortatory plots. ``` ```APIDOC module6_studyname_NonWear.report.Rmd Description: R markdown file for generate a report of nonwear score. ``` ```APIDOC module7a_studyname_calculate_newfeatures.Rmd Description: Extract some features from the actigraphy data using R ``` ```APIDOC module7b_studyname_merge_GGIRfeatures.Rmd Description: Extract other features from the GGIR output and merge all features together ``` ```APIDOC module7c_studyname_runJIVE.Rmd Description: Perform JIVE Decomposition for All Features using r.jive ``` ```APIDOC module7d_studyname_calculate_WD_WE_avg_features.Rmd Description: Extract some weekday/weekend specific features from the actigraphy data using R ``` ```APIDOC module9_swarm.sh Description: shell script to submit all jobs to the cluster ``` -------------------------------- ### SATP Metric Definition Source: https://github.com/weiguonimh/mmarch.ac/blob/main/mMARCH.AC.html Sedentary to active transition probabilities. ```APIDOC Variable: SATP Description: Sedentary to active transition probabilities. Level: day Source: mMARCH.AC ``` -------------------------------- ### ASTP Metric Definition Source: https://github.com/weiguonimh/mmarch.ac/blob/main/mMARCH.AC.html Active to sedentary transition probabilities. ```APIDOC Variable: ASTP Description: Active to sedentary transition probabilities. Level: day Source: mMARCH.AC ``` -------------------------------- ### GGIR CSV Output Files Source: https://github.com/weiguonimh/mmarch.ac/blob/main/mMARCH.AC.html Lists the primary CSV output files generated by GGIR, specifically the R data list summary. ```APIDOC studyname_filesummary_Rdatalist.csv ``` -------------------------------- ### Calling mMARCH.AC.maincall Function in R Source: https://github.com/weiguonimh/mmarch.ac/blob/main/mMARCH.AC.html This R code snippet demonstrates a comprehensive call to the `mMARCH.AC.maincall` function, which is the primary entry point for processing accelerometer data. It includes a wide range of parameters for configuring input/output directories, epoch settings, quality control thresholds, and other analysis specifics. ```R setwd(currentdir) mMARCH.AC.maincall(mode=mode, useIDs.FN=useIDs.FN, currentdir=currentdir, studyname=studyname, bindir=bindir, outputdir=outputdir, epochIn=epochIn, epochOut=epochOut, log.multiplier=log.multiplier, use.cluster=use.cluster, QCdays.alpha=QCdays.alpha, QChours.alpha=QChours.alpha, QCnights.feature.alpha=QCnights.feature.alpha, DoubleHour= DoubleHour, QC.sleepdur.avg=QC.sleepdur.avg, QC.nblocks.sleep.avg=QC.nblocks.sleep.avg, Rversion=Rversion, filename2id=filename2id, PA.threshold=PA.threshold, desiredtz=desiredtz, RemoveDaySleeper=RemoveDaySleeper, part5FN=part5FN, NfileEachBundle=NfileEachBundle, holidayFN=holidayFN, trace=trace) ``` -------------------------------- ### mMARCH.AC Module 4: Input, Command, and Output Source: https://github.com/weiguonimh/mmarch.ac/blob/main/mMARCH.AC.html Specifies the input file, the command for Module 4, and the output file containing imputed ENMO data where missing values are filled by the average ENMO over valid days. ```APIDOC Main Input File: ./data/flag_All_ studyname _ENMO.data.5s.csv Command: mMARCH.AC.shell(mode=4) Output Folder: ./data Output Files: impu.flag_All_studyname_ENMO.data.60s.csv: Imputation data for the merged ENMO data, and the missing values were imputated by the average ENMO over all the valid days for each subject. ``` -------------------------------- ### Module 5: Data Processing and Reporting Source: https://github.com/weiguonimh/mmarch.ac/blob/main/mMARCH.AC.html Documents the inputs, command, and outputs for Module 5, which generates a comprehensive report of data processing and exploratory plots from actigraphy data. ```APIDOC Module 5: Command: run module5_studyname_Data_process_report.Rmd Input Files: - ./summary/studyname_ggir_output_summary.xlsx - ./summary/part24daysummary.info.csv - ./data/plot.nonwearVSnvalidhours.csv - ./data/impu.flag_All_studyname_ENMO.data.flag.epochOuts.csv Output Folder: ./ Outputs: - module5_studyname_Data_process_report.html: A comprehensive report of data processing and explortatory plots. ``` -------------------------------- ### Lightable Table Styling CSS Classes Source: https://github.com/weiguonimh/mmarch.ac/blob/main/mMARCH.AC.html This extensive CSS defines various styles for tables, prefixed with `.lightable-`. It includes styles for minimal, classic, classic-2, material, material-dark, and paper table designs. Each style provides specific formatting for borders, spacing, padding, text color, and hover/striped row effects, enhancing the visual presentation of data tables. ```css .lightable-minimal { border-collapse: separate; border-spacing: 16px 1px; width: 100%; margin-bottom: 10px; } .lightable-minimal td { margin-left: 5px; margin-right: 5px; } .lightable-minimal th { margin-left: 5px; margin-right: 5px; } .lightable-minimal thead tr:last-child th { border-bottom: 2px solid #00000050; empty-cells: hide; } .lightable-minimal tbody tr:first-child td { padding-top: 0.5em; } .lightable-minimal.lightable-hover tbody tr:hover { background-color: #f5f5f5; } .lightable-minimal.lightable-striped tbody tr:nth-child(even) { background-color: #f5f5f5; } .lightable-classic { border-top: 0.16em solid #111111; border-bottom: 0.16em solid #111111; width: 100%; margin-bottom: 10px; margin: 10px 5px; } .lightable-classic tfoot tr td { border: 0; } .lightable-classic tfoot tr:first-child td { border-top: 0.14em solid #111111; } .lightable-classic caption { color: #222222; } .lightable-classic td { padding-left: 5px; padding-right: 5px; color: #222222; } .lightable-classic th { padding-left: 5px; padding-right: 5px; font-weight: normal; color: #222222; } .lightable-classic thead tr:last-child th { border-bottom: 0.10em solid #111111; } .lightable-classic.lightable-hover tbody tr:hover { background-color: #F9EEC1; } .lightable-classic.lightable-striped tbody tr:nth-child(even) { background-color: #f5f5f5; } .lightable-classic-2 { border-top: 3px double #111111; border-bottom: 3px double #111111; width: 100%; margin-bottom: 10px; } .lightable-classic-2 tfoot tr td { border: 0; } .lightable-classic-2 tfoot tr:first-child td { border-top: 3px double #111111; } .lightable-classic-2 caption { color: #222222; } .lightable-classic-2 td { padding-left: 5px; padding-right: 5px; color: #222222; } .lightable-classic-2 th { padding-left: 5px; padding-right: 5px; font-weight: normal; color: #222222; } .lightable-classic-2 tbody tr:last-child td { border-bottom: 3px double #111111; } .lightable-classic-2 thead tr:last-child th { border-bottom: 1px solid #111111; } .lightable-classic-2.lightable-hover tbody tr:hover { background-color: #F9EEC1; } .lightable-classic-2.lightable-striped tbody tr:nth-child(even) { background-color: #f5f5f5; } .lightable-material { min-width: 100%; white-space: nowrap; table-layout: fixed; font-family: Roboto, sans-serif; border: 1px solid #EEE; border-collapse: collapse; margin-bottom: 10px; } .lightable-material tfoot tr td { border: 0; } .lightable-material tfoot tr:first-child td { border-top: 1px solid #EEE; } .lightable-material th { height: 56px; padding-left: 16px; padding-right: 16px; } .lightable-material td { height: 52px; padding-left: 16px; padding-right: 16px; border-top: 1px solid #eeeeee; } .lightable-material.lightable-hover tbody tr:hover { background-color: #f5f5f5; } .lightable-material.lightable-striped tbody tr:nth-child(even) { background-color: #f5f5f5; } .lightable-material.lightable-striped tbody td { border: 0; } .lightable-material.lightable-striped thead tr:last-child th { border-bottom: 1px solid #ddd; } .lightable-material-dark { min-width: 100%; white-space: nowrap; table-layout: fixed; font-family: Roboto, sans-serif; border: 1px solid #FFFFFF12; border-collapse: collapse; margin-bottom: 10px; background-color: #363640; } .lightable-material-dark tfoot tr td { border: 0; } .lightable-material-dark tfoot tr:first-child td { border-top: 1px solid #FFFFFF12; } .lightable-material-dark th { height: 56px; padding-left: 16px; padding-right: 16px; color: #FFFFFF60; } .lightable-material-dark td { height: 52px; padding-left: 16px; padding-right: 16px; color: #FFFFFF; border-top: 1px solid #FFFFFF12; } .lightable-material-dark.lightable-hover tbody tr:hover { background-color: #FFFFFF12; } .lightable-material-dark.lightable-striped tbody tr:nth-child(even) { background-color: #FFFFFF12; } .lightable-material-dark.lightable-striped tbody td { border: 0; } .lightable-material-dark.lightable-striped thead tr:last-child th { border-bottom: 1px solid #FFFFFF12; } .lightable-paper { width: 100%; margin-bottom: 10px; color: #444; } .lightable-paper tfoot tr td { border: 0; } ``` -------------------------------- ### Module 7b: GGIR Feature Merging Source: https://github.com/weiguonimh/mmarch.ac/blob/main/mMARCH.AC.html Describes the inputs, command, and outputs for Module 7b, which extracts and merges additional features from GGIR output, generating various aggregated and plotted data. ```APIDOC Module 7b: Command: run module7b_studyname_merge_GGIRfeatures.Rmd Input Files: - GGIR: part2_summary.csv - GGIR: part2_daysummary.csv - GGIR: part4_nightsummary_sleep_cleaned.csv - GGIR: /results/QC/part4_nightsummary_sleep_full.csv - GGIR: part5_daysummary_part5FN.csv - module7_studyname_all_features_dictionary.xlsx Output Folder: ./ Outputs: - module7b_studyname_merge_GGIRfeatures.html: Extract other features from the GGIR output and merge all features together - module7b_studyname_all_features_1_day.csv: Raw data of all features - module7b_studyname_all_features_2_dayclean.csv: Keep sample with valid ENMO inputs - module7b_studyname_all_features_2_dayclean.csv.log: Log file of each variable of module5b_studyname_all_features_2_dayclean.csv - plot_module7b_studyname_all_features_2_dayclean.csv.pdf: Plot of each variable of module5b_studyname_all_features_2_dayclean.csv - module7b_studyname_all_features_3_subject.csv: Average variable at the subject level - module7b_studyname_all_features_3_subject.csv.log: Log file of each variable of module5b_studyname_all_features_3_subject.csv - plot_module7b_studyname_all_features_3_subject.csv.pdf: Plot of each variable of module5b_studyname_all_features_3_subject.csv - module7b_studyname_all_features_4_subjectSD.csv: subject level SD of each feature ``` -------------------------------- ### Module 7a: New Feature Calculation Source: https://github.com/weiguonimh/mmarch.ac/blob/main/mMARCH.AC.html Outlines the inputs, command, and outputs for Module 7a, which extracts new features from actigraphy data using R, including PCA at day and subject levels. ```APIDOC Module 7a: Command: run module7a_studyname_calculate_newfeatures.Rmd Input Files: - ./data/impu.flag_All_studyname_ENMO.data.flag.epochOuts.csv - GGIR: /results/QC/part4_nightsummary_sleep_full.csv Output Folder: ./ Outputs: - module7_studyname_all_features_dictionary.xlsx: Description of features - module7a_studyname_calculate_newfeatures.html: Extract some features from the actigraphy data using R - module7a_studyname_new_features_page1_features.csv: List of some features - module7a_studyname_new_features_page2_face_day_PCs.csv: Function PCA at the day level using fpca.face( ) - module7a_studyname_new_features_page3_face_subject_PCs.csv: Function PCA at the subject level using fpca.face( ) - module7a_studyname_new_features_page4_denseFLMM_day_PCs.csv: Function PCA at the day level using denseFLMM( ) - module7a_studyname_new_features_page5_denseFLMM_subject_PCs.csv: Function PCA at the subject level using denseFLMM( ) ``` -------------------------------- ### R: Main mMARCH.AC Shell Function Source: https://github.com/weiguonimh/mmarch.ac/blob/main/inst/template/STUDYNAME_module0.maincall.txt This is the primary R function, `mMARCH.AC.shell`, that orchestrates the execution of the mMARCH.AC package. It initializes package dependencies, sets various user-definable parameters for data processing, and includes conditional logic for removing duplicate sample IDs based on the 'mode' and 'rmDup' flags. Finally, it calls the core `mMARCH.AC.maincall` function with all configured parameters. ```R mMARCH.AC.shell<-function(mode,filename2id=NULL){ library(mMARCH.AC) library(xlsx) packageVersion("mMARCH.AC") # ?mMARCH.AC.maincall # run help to see all argumengts currentdir = studyname = bindir = outputdir = oldwd<-getwd() setwd(currentdir) rmDup=FALSE # keep all subjects in mMARCH.AC PA.threshold=c(40,100,400) PA.threshold2=c(50,100,400) part5FN="WW_L50M100V400_T5A5" epochIn = 5 epochOut = 60 use.cluster = FALSE log.multiplier = 9250 QCdays.alpha = 7 QChours.alpha = 16 QCnights.feature.alpha = c(0,0,0,0) DoubleHour= "average" QC.sleepdur.avg=NULL QC.nblocks.sleep.avg=NULL useIDs.FN=NULL Rversion="R" desiredtz="US/Eastern" RemoveDaySleeper=FALSE NfileEachBundle=20 holidayFN=NULL trace=FALSE if (mode==3 & rmDup){ keep.last<-TRUE #keep the latest visit for each sample sumdir<-paste(currentdir,"/summary",sep="") setwd(sumdir) inFN<-paste(studyname,"_samples_remove_temp.csv",sep="") useIDs.FN<-paste(sumdir,"/",studyname,"_samples_remove.csv",sep="") d<-read.csv(inFN,head=1,stringsAsFactors=F) d<-d[order(d[,"Date"]),] d<-d[order(d[,"newID"]),] d[which(is.na(d[,"newID"])),] S<-duplicated(d[,"newID"],fromLast=keep.last) #keep the last copy for nccr d[S,"duplicate"]<-"remove" write.csv(d,file=useIDs.FN,row.names=F) } setwd(currentdir) mMARCH.AC.maincall(mode=mode, useIDs.FN=useIDs.FN, currentdir=currentdir, studyname=studyname, bindir=bindir, outputdir=outputdir, epochIn=epochIn, epochOut=epochOut, log.multiplier=log.multiplier, use.cluster=use.cluster, QCdays.alpha=QCdays.alpha, QChours.alpha=QChours.alpha, QCnights.feature.alpha=QCnights.feature.alpha, DoubleHour= DoubleHour, QC.sleepdur.avg=QC.sleepdur.avg, QC.nblocks.sleep.avg=QC.nblocks.sleep.avg, Rversion=Rversion, filename2id=filename2id, PA.threshold=PA.threshold, PA.threshold2=PA.threshold2, desiredtz=desiredtz, RemoveDaySleeper=RemoveDaySleeper, part5FN=part5FN, NfileEachBundle=NfileEachBundle, holidayFN=holidayFN, trace=trace) setwd(oldwd) } ``` -------------------------------- ### Module 7c: JIVE Decomposition for Features Source: https://github.com/weiguonimh/mmarch.ac/blob/main/mMARCH.AC.html Details the inputs, command, and outputs for Module 7c, which performs JIVE Decomposition on all features using r.jive, generating joint and individual structure estimates. ```APIDOC Module 7c: Command: run module7b_studyname_merge_GGIRfeatures.Rmd Input Files: - module7b_studyname_all_features_3_subject.csv - module7b_studyname_all_features_4_subjectSD.csv Output Folder: ./ Outputs: - module7c_studyname_runJIVE.html: Perform JIVE Decomposition for All Features using r.jive - module7c_studyname_jive_Decomposition.csv: Joint and individual structure estimates - module7c_studyname_jive_predScore.csv: PCA scores of JIVE ( missing when jive.predict failes) ``` -------------------------------- ### alpha_a Metric Definition Source: https://github.com/weiguonimh/mmarch.ac/blob/main/mMARCH.AC.html Power law parameter for active bout. ```APIDOC Variable: alpha_a Description: Power law parameter for active bout. Level: day Source: mMARCH.AC ``` -------------------------------- ### dur_day_MVPA_bts_1_5_min Metric Definition Source: https://github.com/weiguonimh/mmarch.ac/blob/main/mMARCH.AC.html Total duration in minutes of Moderate and Vigorous Physical Activity (MVPA) for bouts 1 to 5 minutes. ```APIDOC Variable: dur_day_MVPA_bts_1_5_min Description: Total duration in minutes of Moderate and Vigorous Physical Activity (MVPA) for bouts 1 to 5 minutes Level: day Source: GGIR-part5 ``` -------------------------------- ### mMARCH.AC.shell Function Modes API Source: https://github.com/weiguonimh/mmarch.ac/blob/main/mMARCH.AC.html This API documentation describes the `mMARCH.AC.shell` function and its various operational modes. Users can specify a mode to perform different tasks such as creating R Markdown files, transforming data, generating summaries, cleaning data, or performing imputation. ```APIDOC mMARCH.AC.shell(mode: integer) mode: The operational mode for the shell function. mode = 0 : Create sw/Rmd file mode = 1 : Data transform (with or without cluster) mode = 2 : Summary generation mode = 3 : Data cleaning mode = 4 : Imputation ``` -------------------------------- ### dur_day_MVPA_bts_5_10_min Metric Definition Source: https://github.com/weiguonimh/mmarch.ac/blob/main/mMARCH.AC.html Total duration in minutes of Moderate and Vigorous Physical Activity (MVPA) for bouts 5 to 10 minutes. ```APIDOC Variable: dur_day_MVPA_bts_5_10_min Description: Total duration in minutes of Moderate and Vigorous Physical Activity (MVPA) for bouts 5 to 10 minutes Level: day Source: GGIR-part5 ``` -------------------------------- ### R: Execute mMARCH.AC Shell with Mode Source: https://github.com/weiguonimh/mmarch.ac/blob/main/inst/template/STUDYNAME_module0.maincall.txt This line executes the `mMARCH.AC.shell` function, passing the previously determined 'mode' argument. This initiates the main workflow of the mMARCH.AC package based on the specified operation mode. ```R mMARCH.AC.shell(mode) ``` -------------------------------- ### Module 7d: Weekday/Weekend Average Feature Calculation Source: https://github.com/weiguonimh/mmarch.ac/blob/main/mMARCH.AC.html Outlines the inputs, command, and outputs for Module 7d, which extracts weekday and weekend specific features from actigraphy data using R. ```APIDOC Module 7d: Command: run module7d_studyname_calculate_WD_WE_avg_features.Rmd Input File: ./data/impu.flag_All_studyname_ENMO.data.flag.epochOuts.csv Output Folder: ./ Outputs: - module7d_studyname_calculate_WD_WE_avg_features.html: Extract some weekday/weekend specific features from the actigraphy data using R - module7d_studyname_new_features_page1.csv: Perform JIVE Decomposition for All Features using r.jive ``` -------------------------------- ### dur_day_total_VIG_min Metric Definition Source: https://github.com/weiguonimh/mmarch.ac/blob/main/mMARCH.AC.html Total duration of day in minutes of vigorous activity during the day. ```APIDOC Variable: dur_day_total_VIG_min Description: Total duration of day in minutes of vigorous activity during the day Level: day Source: GGIR-part5 ``` -------------------------------- ### alpha_r Metric Definition Source: https://github.com/weiguonimh/mmarch.ac/blob/main/mMARCH.AC.html Power law parameter for sedentary bout. ```APIDOC Variable: alpha_r Description: Power law parameter for sedentary bout. Level: day Source: mMARCH.AC ```