
#######################################################################
How to run postGGIR?
#######################################################################

(1) create the template file in R 
 
library(postGGIR) 
create.postGGIR()

(2) cat STUDYNAME_part0.maincall.R > Example_part0.maincall.R

(3) fill in the paramters in Example_part0.maincall.R 
 
currentdir =  
studyname =
bindir = NULL
binfile.list = NULL
outputdir =  
QCdays.alpha = 0
QChours.alpha = 0
part5FN = 
   ......


(4)  Call Example_part0.maincall.R to create all template files 

R>  call.afterggir(mode=0)
or
R --no-save --no-restore --args  < Example_part0.maincall.R  0

The following files are created, 
   part5_Example_postGGIR.report.Rmd
   part6_Example_postGGIR.nonwear.report.Rmd
   part7a_Example_postGGIR_JIVE_1_somefeatures.Rmd
   part7b_Example_postGGIR_JIVE_2_allfeatures.Rmd
   part7c_Example_postGGIR_JIVE_3_excelReport.Rmd
   part7d_Example_postGGIR_JIVE_4_outputReport.Rmd
   part7e_Example_postGGIR_JIVE_5_somefeatures_weekday.Rmd
   part9_swarm.sh

(5) Within R,
    call.afterggir(mode=1)
    call.afterggir(mode=2)
    call.afterggir(mode=3)
    call.afterggir(mode=4)
    run part5_Example_postGGIR.report.Rmd
    run part6_Example_postGGIR.nonwear.report.Rmd
    run part7a_Example_postGGIR_JIVE_1_somefeatures.Rmd
    run part7b_Example_postGGIR_JIVE_2_allfeatures.Rmd 
    run part7c_Example_postGGIR_JIVE_3_runJIVE.Rmd
    run part7d_Example_postGGIR_JIVE_4_somefeatures_weekday.Rmd

(6) Or Submit all jobs to a cluster  

sbatch --time=100:00:00 --mem=120g    part9_swarm.sh   


Note. Due to small sample size in the example data, some features such as functional PCA may not able to run successfully.
