PATH_LIB_CONF="/pasteur/homes/gmillot/R/x86_64-pc-linux-gnu-library/3.5/"# absolute path of the library folder. Write "" if not required
PATH_LIB_CONF="/pasteur/homes/gmillot/R/x86_64-pc-linux-gnu-library/3.5/"# absolute path of the library folder. Write "none" if not required
PATH_IN_CONF="/pasteur/homes/gmillot/rogge12231/"# absolute path of the data folder
PATH_OUT_CONF="/pasteur/homes/gmillot/rogge12231/"# absolute path of the output folder
PATH_FUNCTION1_CONF="/pasteur/homes/gmillot/Git_versions_to_use/cute_little_R_functions-v4.5.0/"# Define the absolute pathway of the folder containing functions created by Gael Millot
################ File name
FILE_NAME1_CONF="supplementary_data_file_test.csv"# name of the data file to import
args<-commandArgs(trailingOnly=TRUE)# recover arguments written after the call of the Rscript, ie after r_341_conf $check_lod_gael_conf
tempo.arg.names<-c("path.lib","path.in","path.out","path.function1","file.name1","name.source.file1","ml.bootstrap.nb","project.name","activate.pdf","label.size","optional.text","slurm.loop.nb","analysis.kind","cross.valid.ratio","random.seed")# objects names exactly in the same order as in the bash code and recovered in args
tempo.arg.names<-c("path.lib","path.in","path.out","path.function1","file.name1","ml.bootstrap.nb","project.name","activate.pdf","label.size","optional.text","slurm.loop.nb","analysis.kind","cross.valid.ratio","random.seed")# objects names exactly in the same order as in the bash code and recovered in args
if(length(args)!=length(tempo.arg.names)){
tempo.cat<-paste0("\n\n================\n\nERROR: THE NUMBER OF ELEMENTS IN args (",length(args),") IS DIFFERENT FROM THE NUMBER OF ELEMENTS IN tempo.arg.names (",length(tempo.arg.names),")\nargs:",paste0(args,collapse=","),"\ntempo.arg.names:",paste0(tempo.arg.names,collapse=","),"\n\n================\n\n")
stop(tempo.cat)
...
...
@@ -30,6 +30,7 @@ for(i in 1:length(tempo.arg.names)){
}
################################ Recording of the initial parameters
################################ End Recording of the initial parameters
################################ DEBUG
...
...
@@ -58,9 +60,8 @@ project.name <-"rogge12231"
path.lib <- "/pasteur/homes/gmillot/softwares/R/x86_64-pc-linux-gnu-library/3.5/" # absolute path of the library folder. Write "none" if not required
path.in <- "/pasteur/homes/gmillot/rogge12231/" # absolute path of the data folder
path.out <- "/pasteur/homes/gmillot/rogge12231/" # absolute path of the output folder
path.function1 <- "/pasteur/homes/gmillot/Git_versions_to_use/cute_little_R_functions-v4.4.0/" # Define the absolute pathway of the folder containing functions created by Gael Millot
path.function1 <- "/pasteur/homes/gmillot/Git_versions_to_use/cute_little_R_functions-v4.4.0/cute_little_R_functions.R" # Define the absolute pathway of the folder containing functions created by Gael Millot
file.name1 <- "supplementary_data_file_test.csv" # name of the data file to import in path.in
name.source.file1 <- "cute_little_R_functions.R"
ml.bootstrap.nb <- 3
activate.pdf = TRUE
label.size <- 6
...
...
@@ -81,15 +82,15 @@ project.name <-"rogge12231"
path.lib <- "C:/Users/Gael/Documents/R/win-library/3.5/" # absolute path of the library folder. Write "none" if not required
path.in <- "C:/Users/Gael/Documents/Hub projects/20190126 Las Rogge 12231/Code VG and VR/" # absolute path of the data folder
path.out <- "C:/Users/Gael/Desktop/" # absolute path of the output folder
path.function1 <- "C:/Users/Gael/Documents/Git_versions_to_use/cute_little_R_functions-v4.5.0/" # Define the absolute pathway of the folder containing functions created by Gael Millot
# path.function1 <- "C:/Users/Gael/Documents/Git_versions_to_use/cute_little_R_functions-v4.5.0/cute_little_R_functions.R" # Define the absolute pathway of the folder containing functions created by Gael Millot
file.name1 <- "supplementary_data_file_test.csv" # name of the data file to import in path.in
name.source.file1 <- "cute_little_R_functions.R"
ml.bootstrap.nb <- 3
activate.pdf = TRUE
label.size <- 6
optional.text <- ""
slurm.loop.nb <- 1
analysis.kind <- "longit"
analysis.kind <- "valid_boot"
cross.valid.ratio <- 0.8
random.seed <- TRUE
'
...
...
@@ -124,7 +125,8 @@ req.package.list <- c(
if(path.lib=="none"){
path.lib<-.libPaths()# .libPaths(new = path.lib) # or .libPaths(new = c(.libPaths(), path.lib))
}else{
.libPaths(new=path.lib)
# .libPaths(new = ) add path to default path
.libPaths(new=sub(x=path.lib,pattern="/$|\\\\$",replacement=""))# .libPaths() does not support / at the end of a submitted path. Thus check and replace last / or \\ in path
cat(paste0("\n\n============\n\nERROR: DIRECTORY PATH INDICATED IN THE path.out PARAMETER DOES NOT EXISTS: ",paste(path.function1,collapse=" "),"\n\n============\n\n"))
cat(paste0("\n\n============\n\nERROR: name.source.file1 PARAMETER (",paste(name.source.file1,collapse=" "),") DOES NOT EXIST IN THE DIRECTORY PATH INDICATED IN THE path.function1 PARAMETER: ",path.function1,"\n\n============\n\n"))
if(length(path.function1)!=1){
stop(paste0("\n\n============\n\nERROR: path.function1 PARAMETER MUST BE LENGTH 1: ",paste(path.function1,collapse=" "),"\n\n============\n\n"))
cat(paste0("\n\n============\n\nERROR: file.name1 PARAMETER (",file.name1,") DOES NOT EXIST IN THE DIRECTORY PATH INDICATED IN THE path.in PARAMETER: ",path.in,"\n\n============\n\n"))
# next line cannot be put outside (which would have been convenient -> put into the SUP_VAR_tempo for display. But SUP_VAR_tempo for sbatch do not like spaces)
R_PROC2="${R_PROC} &> ${OUTPUT_DIR_PATH_tempo2}loop${COUNT}_r_console_messages.txt" # or "$R_PROC > ${OUTPUT_DIR_PATH_tempo2}loop${COUNT}_r_console_messages.txt 2>&1" # to add the estderror in the stdout
eval "$R_PROC2"
' | sbatch -p$DEDICATED_CONF--job-name=wait_loop1 --qos$QOS_CONF--time$MAX_RUNNING_TIME_CONF-c$NB_CPU_PER_TASK_CONF--mem-per-cpu$MEM_PER_CPU_CONF--mail-type END,FAIL --mail-user$MAIL_CONF--export$SUP_VAR_tempo--wait | tee-a${OUTPUT_DIR_PATH_tempo}/loop${COUNT}/loop${COUNT}_${PROJECT_NAME_CONF}_slurm_jobID.txt # write all th echo from the $PROC alaso into a log file
...
...
@@ -368,7 +366,7 @@ while [[ $COUNT < $(($LOOP_NB_CONF + 1)) ]] ; do
source $CONFIG_FILE # never forget this because another environment
# next line cannot be put outside (which would have been convenient -> put into the SUP_VAR_tempo for display. But SUP_VAR_tempo for sbatch do not like spaces)
R_PROC2="${R_PROC} &> ${OUTPUT_DIR_PATH_tempo2}loop${SLURM_ARRAY_TASK_ID}_r_console_messages.txt" # or "$R_PROC > ${OUTPUT_DIR_PATH_tempo2}loop${SLURM_ARRAY_TASK_ID}_r_console_messages.txt 2>&1" # to add the estderror in the stdout
eval "$R_PROC2"
' | sbatch -p$DEDICATED_CONF--array=2-$LOOP_NB_CONF--job-name=wait_loop_all --qos$QOS_CONF--time$MAX_RUNNING_TIME_CONF-c$NB_CPU_PER_TASK_CONF--mem-per-cpu$MEM_PER_CPU_CONF--mail-type END,FAIL --mail-user$MAIL_CONF--export$SUP_VAR_tempo--wait | tee-a$(for((i = 2 ; i <=$LOOP_NB_CONF; i++));do echo${OUTPUT_DIR_PATH_tempo}/loop${i}/loop${i}_${PROJECT_NAME_CONF}_slurm_jobID.txt ;done)# tee is dispached in all the dir of the job array
...
...
@@ -380,7 +378,7 @@ while [[ $COUNT < $(($LOOP_NB_CONF + 1)) ]] ; do
source $CONFIG_FILE # never forget this because another environment
# next line cannot be put outside (which would have been convenient -> put into the SUP_VAR_tempo for display. But SUP_VAR_tempo for sbatch do not like spaces)
R_PROC2="${R_PROC} &> ${OUTPUT_DIR_PATH_tempo2}loop${SLURM_ARRAY_TASK_ID}_r_console_messages.txt" # or "$R_PROC > ${OUTPUT_DIR_PATH_tempo2}loop${SLURM_ARRAY_TASK_ID}_r_console_messages.txt 2>&1" # to add the estderror in the stdout
eval "$R_PROC2"
' | sbatch -p$DEDICATED_CONF--array=1-$LOOP_NB_CONF--job-name=wait_loop_all --qos$QOS_CONF--time$MAX_RUNNING_TIME_CONF-c$NB_CPU_PER_TASK_CONF--mem-per-cpu$MEM_PER_CPU_CONF--mail-type END,FAIL --mail-user$MAIL_CONF--export$SUP_VAR_tempo--wait | tee-a$(for((i = 1 ; i <=$LOOP_NB_CONF; i++));do echo${OUTPUT_DIR_PATH_tempo}/loop${i}/loop${i}_${PROJECT_NAME_CONF}_slurm_jobID.txt ;done)# tee is dispached in all the dir of the job array
...
...
@@ -394,7 +392,7 @@ echo -e '#!/bin/sh
LOCAL_USER_VAR+=" SUP_VAR_tempo"# do not forget the space before the variable name
# write the previous line exactly like this, with no comments, otherwise do not work
source $CONFIG_FILE # never forget this because another environment
# next line cannot be put outside (which would have been convenient -> put into the SUP_VAR_tempo for display. But SUP_VAR_tempo for sbatch do not like spaces)
R_PROC2="${R_PROC} &> ${OUTPUT_DIR_PATH_FINAL/r_console_messages.txt" # or "$R_PROC > ${OUTPUT_DIR_PATH_FINAL/r_console_messages.txt 2>&1" # to add the estderror in the stdout
eval "$R_PROC2"
' | sbatch -p$DEDICATED_CONF--job-name=compil --qos$QOS_CONF--time$MAX_RUNNING_TIME_CONF-c$NB_CPU_PER_TASK_CONF--mem-per-cpu$MEM_PER_CPU_CONF--mail-type END,FAIL --mail-user$MAIL_CONF--export$SUP_VAR | tee-a${OUTPUT_DIR_PATH_tempo}/loop${COUNT}/loop${COUNT}_${PROJECT_NAME_CONF}_slurm_jobID.txt # write all th echo from the $PROC alaso into a log file