Commit 6c9ca302 authored by Gael  MILLOT's avatar Gael MILLOT
Browse files

interm

parent 3e119e70
This diff is collapsed.
......@@ -11,7 +11,7 @@ erase.graphs <- TRUE # write TRUE to erase all the graphic windows in R before s
################################ End Initialization
sink(stdout(), type = "message")
script <- commandArgs(trailingOnly = FALSE)[1] # recover script name, e.g., r_341_conf $check_lod_gael_conf
script <- commandArgs(trailingOnly = FALSE)[4] # recover script name, e.g., r_341_conf $check_lod_gael_conf. 1) .exe R path, 2) --slave, 3) --no-restore, 4) --file and 5) --args
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", "ml.bootstrap.nb", "project.name", "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)){
......@@ -220,10 +220,10 @@ log.file <- paste0("loop", slurm.loop.nb,"_r_", project.name, "_", analysis.nb,"
# suppressWarnings(dir.create(path.out))
backup.name <- NULL # names of the object to save
fun_export_data(data = paste0("\n\n################################ ", log.file, " ################"), output = log.file, no.overwrite = FALSE, path = path.out, sep = 4)
fun_export_data(path = path.out, data = "################################ INITIAL DATA", output = log.file, sep = 4)
fun_export_data(path = path.out, data = "################################ INITIAL DATA", output = log.file)
fun_export_data(path = path.out, data = paste0("SCRIPT USED: ", script), output = log.file)
fun_export_data(path = path.out, data = paste0("KIND OF ANALYSIS PERFORMED: ", analysis.kind), output = log.file)
fun_export_data(path = path.out, data = paste0("THE RESPONSE USED IS THE COLUMN: response_ASDAS_R_NR", analysis.kind), output = log.file)
fun_export_data(path = path.out, data = paste0("THE RESPONSE USED IS THE COLUMN: response_ASDAS_R_NR"), output = log.file)
################ Graphical parameter ignition
......@@ -346,7 +346,7 @@ if(any((analysis.kind == "longit" & slurm.loop.nb == 1) | (analysis.kind == "val
fit <- contrasts.fit(fit, contrasts)
fit <- eBayes(fit)
ttab <- topTable(fit, coef = "R - NR", adjust.method = "BH", p.value = 0.05, number = nrow(X.limma))
fun_export_data(path = path.out, data = "################################ LIMMA ANALYSIS", output = log.file, sep = 4)
fun_export_data(path = path.out, data = "################################ LIMMA ANALYSIS", output = log.file)
fun_export_data(path = path.out, data = 'PARAMETERS USED: topTable(fit, coef = "R - NR", adjust.method = "BH", p.value = 0.05, number = nrow(X))' , output = log.file)
if(nrow(ttab) > 0){
fun_export_data(path = path.out, data = ttab , output = log.file)
......@@ -365,7 +365,7 @@ if(any((analysis.kind == "longit" & slurm.loop.nb == 1) | (analysis.kind == "val
######## 4.1 Discovery: Learning the Random Forest
fun_export_data(path = path.out, data = "################################ RANDOM FOREST LEARNING USING THE DISCOVERY SET", output = log.file, sep = 4)
fun_export_data(path = path.out, data = "################################ RANDOM FOREST LEARNING USING THE DISCOVERY SET", output = log.file)
# required data: df.nano
......@@ -493,7 +493,7 @@ if(any((analysis.kind == "longit" & slurm.loop.nb == 1) | (analysis.kind == "val
feature_importance <- getFeatureImportance(mod$learner.model$next.model)
df_imp <- data.frame(features = names(feature_importance$res),
importance = t(feature_importance$res), stringsAsFactors = FALSE)
importance.plot <- ggplot2::ggplot(data = df_imp, aes(x=features, y=importance)) + geom_bar(stat = "identity") + theme_bw() +
importance.plot <- ggplot2::ggplot(data = df_imp, aes(x = reorder(features, -importance), y=importance)) + geom_bar(stat = "identity") + theme_bw() +
theme(
axis.text.x = element_text(angle=90, vjust=0.5, hjust=1),
plot.title = ggplot2::element_text(hjust=1, vjust=1, size = label.size),
......@@ -519,17 +519,15 @@ if(any((analysis.kind == "longit" & slurm.loop.nb == 1) | (analysis.kind == "val
colnames(annot.rows) <- "ASDAS R/NR"
subdat <- df.tmp[, sort(mod.gene.names)]
ann_colors = list("ASDAS R/NR" = c(R = "steelblue", NR = "tomato"))
heatmap.plot <- pheatmap(t(scale(subdat)), silent = TRUE, annotation_col = annot.rows, cluster_cols = FALSE, show_colnames = FALSE, border_color = NA, color = colorRampPalette(c("red", "black", "green"))(499), annotation_colors = ann_colors, fontsize_row = label.size, fontsize_col = label.size)
tempo <- dev.set(pdf.nb) # assign to avoid the message
ggplot2ggplot() ; print(heatmap.plot)
backup.name <- c(backup.name, "heatmap.plot")
# ```
#
heatmap.plot <- pheatmap(t(scale(subdat)), silent = TRUE, annotation_col = annot.rows, cluster_cols = FALSE, show_colnames = FALSE, border_color = NA, color = colorRampPalette(c("red", "black", "green"))(499), annotation_colors = ann_colors, fontsize_row = label.size, fontsize_col = label.size)
print(ggplot2::ggplot()+ggplot2::theme_classic())
print(heatmap.plot)
# The correlation of the selected features is reprsented hereafter. We see that some of the selected features are strongly correlated.
#
# ```{r corrplot}
tempo <- dev.set(pdf.nb) # assign to avoid the message
corr.plot <- corrplot(cor(subdat), tl.col = "black", tl.cex = label.size / 10)
corr.plot <- corrplot::corrplot(cor(subdat), tl.col = "black", tl.cex = label.size / 5)
backup.name <- c(backup.name, "corr.plot")
if(analysis.kind == "valid_boot"){
......@@ -537,7 +535,7 @@ if(any((analysis.kind == "longit" & slurm.loop.nb == 1) | (analysis.kind == "val
}
}else if(analysis.kind == "valid_boot" & slurm.loop.nb > 1){
if( ! file.exists(paste0(path.loop1, "loop1_discov_data.RData"))){
stop(paste0("\n\n============\n\nERROR: LOOP ", slurm.loop.nb," CANNOT FIND THE ", paste0(path.loop1, "loop", slurm.loop.nb, "_res_data.RData"), " FILE\nDUE TO UNACTIVE BLOCKAGE OF THE LOOP 1 IN THE workflow.sh\n\n============\n\n"))
stop(paste0("\n\n============\n\nERROR: LOOP ", slurm.loop.nb," CANNOT FIND THE ", paste0(path.loop1, "loop1_discov_data.RData"), " FILE\nDUE TO UNACTIVE BLOCKAGE OF THE LOOP 1 IN THE workflow.sh\n\n============\n\n"))
}else{
load(paste0(path.loop1, "loop1_discov_data.RData"))
}
......@@ -553,7 +551,7 @@ if(any((analysis.kind == "longit" & slurm.loop.nb == 1) | (analysis.kind == "val
######## 4.2 Validate the model
#
fun_export_data(path = path.out, data = "################################ VALIDATION", output = log.file, sep = 4)
fun_export_data(path = path.out, data = "################################ VALIDATION", output = log.file)
# Now that the features of interest are selected, we can train the final models on the whole discovery set.
#
......@@ -641,7 +639,7 @@ backup.name <- c(backup.name, "data.pred1.genes.rf", "data.pred2.crp.rf", "data.
#
# ```{r prediction_probabilities}
fun_export_data(path = path.out, data = paste0("PREDICTION: "), output = log.file)
fun_export_data(path = path.out, data = paste0("PREDICTION FROM RANDOM FOREST, GENE ONLY, ANALYSIS: "), output = log.file)
fun_export_data(path = path.out, data = pred1.genes.rf$data, output = log.file, rownames.kept = TRUE)
......@@ -865,21 +863,33 @@ boxdat_melt <- reshape2::melt(boxdat,
id.vars = c("Y", "Cohort.name", "RF.COHORTE"),
variable.name = "Gene")
ggbox <- ggplot(data = boxdat_melt, aes(x=Y, y=value, colour=Y, shape = RF.COHORTE, linetype = RF.COHORTE)) +
geom_beeswarm(dodge.width = 0.75, alpha = 0.7) +
geom_boxplot(outlier.shape = NA, fill = NA) +
facet_wrap(~ Gene, ncol = 5) +
theme_bw() +
theme(
plot.title = ggplot2::element_text(hjust=1, vjust=1, size = label.size),
axis.text = ggplot2::element_text(size = label.size),
axis.title = ggplot2::element_text(size = label.size),
legend.text = ggplot2::element_text(size = label.size),
legend.title = ggplot2::element_text(size = label.size),
strip.text = ggplot2::element_text(size = label.size)
)
tempo <- dev.set(pdf.nb) # assign to avoid the message
print(ggbox)
facet.nrow = 4
facet.ncol = 4
boxdat_melt$Gene <- as.character(boxdat_melt$Gene)
pages.print.nb <- ceiling(length(unique(boxdat_melt$Gene)) / (facet.nrow * facet.ncol))
increm <- facet.nrow * facet.ncol
for(i0 in 1:pages.print.nb){
select <- (increm * i0 - increm + 1):(increm * i0)
if(max(select) > length(unique(boxdat_melt$Gene))){
select <- (increm * i0 - increm + 1):length(unique(boxdat_melt$Gene))
}
ggbox <- ggplot(data = boxdat_melt[boxdat_melt$Gene %in% unique(boxdat_melt$Gene)[select], ], aes(x=Y, y=value, colour=Y, shape = RF.COHORTE, linetype = RF.COHORTE)) +
ggbeeswarm::geom_beeswarm(dodge.width = 0.75, alpha = 0.7) +
geom_boxplot(outlier.shape = NA, fill = NA) +
facet_wrap(~ Gene, nrow = facet.nrow, ncol = facet.ncol, scales = "fixed", shrink = FALSE) + # scales = "fixed", shrink = FALSE to have same scale range
theme_bw() +
theme(
plot.title = ggplot2::element_text(hjust=1, vjust=1, size = label.size),
axis.text = ggplot2::element_text(size = label.size),
axis.title = ggplot2::element_text(size = label.size),
legend.text = ggplot2::element_text(size = label.size),
legend.title = ggplot2::element_text(size = label.size),
strip.text = ggplot2::element_text(size = label.size)
)
tempo <- dev.set(pdf.nb) # assign to avoid the message
print(ggbox)
}
# ```
#
######## 4.7 Frequencies associated to each predictor
......
This diff is collapsed.
......@@ -330,7 +330,7 @@ if [[ $R_ANALYSIS_KIND =~ longit && $LOOP_NB_CONF != 1 ]]; then
LOOP_NB_CONF=1
echo -e "\n\nR_ANALYSIS_KIND PARAMETER SET TO $R_ANALYSIS_KIND: LOOP_NB_CONF PARAMETER RESET TO 1\n\n"
fi
echo -e "\n\nALL CHECKS OK: PROCESS ENGAGED......................\n\n"
################ END CHECK
......@@ -343,61 +343,67 @@ mkdir ${OUTPUT_DIR_PATH_tempo}
for ((i=1; i<=$LOOP_NB_CONF; i++)); do
mkdir ${OUTPUT_DIR_PATH_tempo}/loop$i
done
SUP_VAR="SCRIPT_USED=$SCRIPT_USED,CONFIG_FILE=$CONFIG_FILE,REMOVE_TMP=$REMOVE_TMP,OUTPUT_DIR_PATH_tempo=$OUTPUT_DIR_PATH_tempo" # all this must be injected into the TARS job
SUP_VAR="SCRIPT_USED=$SCRIPT_USED,JOB_ID=$JOB_ID,CONFIG_FILE=$CONFIG_FILE,REMOVE_TMP=$REMOVE_TMP,OUTPUT_DIR_PATH_tempo=$OUTPUT_DIR_PATH_tempo" # all this must be injected into the TARS job
LOCAL_USER_VAR+=" OUTPUT_DIR_PATH_tempo SUP_VAR" # do not forget the space before the variable name
COUNT=0
while [[ $COUNT < $(($LOOP_NB_CONF + 1)) ]] ; do
((COUNT=COUNT + 1))
COUNT=1
while [[ $COUNT -lt $(($LOOP_NB_CONF + 1)) ]] ; do # is less than
SUP_VAR_tempo="$SUP_VAR,COUNT=$COUNT"
if [[ $R_ANALYSIS_KIND =~ valid_boot && $COUNT == 1 ]] ; then
if [[ $R_ANALYSIS_KIND =~ valid_boot && $COUNT == "1" ]] ; then
echo -e '#!/bin/sh
# write the previous line exactly like this, with no comments, otherwise do not work
source $CONFIG_FILE # never forget this because another environment
OUTPUT_DIR_PATH_tempo2="${OUTPUT_DIR_PATH_tempo}/loop${COUNT}/"
# 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)
echo -e "\nSBATCH CORRESPONDING TO R_ANALYSIS_KIND =~ valid_boot && COUNT == 1\n"
R_PROC="R_conf ${r_main_conf} $PATH_LIB_CONF $PATH_IN_CONF ${OUTPUT_DIR_PATH_tempo2} $r_main_functions_conf $FILE_NAME1_CONF $ML_BOOTSTRAP_NB_CONF $PROJECT_NAME_CONF $LABEL_SIZE $R_OPT_TXT_CONF $COUNT $R_ANALYSIS_KIND $CROSS_VALID_RATIO $R_RANDOM_SEED"
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
' | sbatch -p $DEDICATED_CONF --job-name=wait_loop1_${JOB_ID} --wait --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 | 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
# tricky part of this sbatch because the SUP_VAR_tempo will be used in the script piped to sbatch
((COUNT=COUNT + 1))
elif [[ $R_ANALYSIS_KIND =~ valid_boot && $COUNT > 1 ]] ; then
# echo -e "\nAFTER SBATCH CORRESPONDING TO R_ANALYSIS_KIND =~ valid_boot && COUNT == 1 COUNT = $COUNT"
elif [[ $R_ANALYSIS_KIND =~ valid_boot && $COUNT > "1" ]] ; then
echo -e '#!/bin/sh
echo "LOOP 1 HAS CORRECTLY BEEN WAIT FOR END\n"
' | sbatch --dependency=singleton --job-name=wait_loop1 --wait -p $DEDICATED_CONF --qos $QOS_CONF --time 1 -c 1 --mem-per-cpu 10M --mail-type END,FAIL --mail-user $MAIL_CONF
' | sbatch --dependency=singleton -p $DEDICATED_CONF --job-name=wait_loop1_${JOB_ID} --wait --qos $QOS_CONF --time 1 -c 1 --mem-per-cpu 10M --mail-type END,FAIL --mail-user $MAIL_CONF --export $SUP_VAR_tempo
echo -e '#!/bin/sh
# write the previous line exactly like this, with no comments, otherwise do not work
source $CONFIG_FILE # never forget this because another environment
OUTPUT_DIR_PATH_tempo2="${OUTPUT_DIR_PATH_tempo}/loop${SLURM_ARRAY_TASK_ID}/"
# 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)
echo -e "\nSBATCH CORRESPONDING TO R_ANALYSIS_KIND =~ valid_boot && COUNT > 1\n"
R_PROC="R_conf ${r_main_conf} $PATH_LIB_CONF $PATH_IN_CONF ${OUTPUT_DIR_PATH_tempo2} $r_main_functions_conf $FILE_NAME1_CONF $ML_BOOTSTRAP_NB_CONF $PROJECT_NAME_CONF $LABEL_SIZE $R_OPT_TXT_CONF ${SLURM_ARRAY_TASK_ID} $R_ANALYSIS_KIND $CROSS_VALID_RATIO $R_RANDOM_SEED" # beware $COUNT replaced by ${SLURM_ARRAY_TASK_ID} because job array
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
' | sbatch -p $DEDICATED_CONF --array=2-$LOOP_NB_CONF --job-name=wait_loop_all_${JOB_ID} --wait --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 | 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
# tricky part of this sbatch because the SUP_VAR_tempo will be used in the script piped to sbatch
COUNT=$(($LOOP_NB_CONF + 1))
# echo -e "\nAFTER SBATCH CORRESPONDING TO R_ANALYSIS_KIND =~ valid_boot && COUNT > 1 COUNT = $COUNT"
else
echo -e '#!/bin/sh
# write the previous line exactly like this, with no comments, otherwise do not work
source $CONFIG_FILE # never forget this because another environment
OUTPUT_DIR_PATH_tempo2="${OUTPUT_DIR_PATH_tempo}/loop${SLURM_ARRAY_TASK_ID}/"
# 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)
echo -e "\nSBATCH CORRESPONDING TO ELSE\n"
R_PROC="R_conf ${r_main_conf} $PATH_LIB_CONF $PATH_IN_CONF ${OUTPUT_DIR_PATH_tempo2} $r_main_functions_conf $FILE_NAME1_CONF $ML_BOOTSTRAP_NB_CONF $PROJECT_NAME_CONF $LABEL_SIZE $R_OPT_TXT_CONF ${SLURM_ARRAY_TASK_ID} $R_ANALYSIS_KIND $CROSS_VALID_RATIO $R_RANDOM_SEED"
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
' | sbatch -p $DEDICATED_CONF --array=1-$LOOP_NB_CONF --job-name=wait_loop_all --wait --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 | 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
# tricky part of this sbatch because the SUP_VAR_tempo will be used in the script piped to sbatch
COUNT=$(($LOOP_NB_CONF + 1))
COUNT=$(($LOOP_NB_CONF + 1))
# echo -e "\nAFTER SBATCH CORRESPONDING TO ELSE COUNT = $COUNT"
fi
done
echo -e '#!/bin/sh
echo "ALL LOOPS HAVE CORRECTLY BEEN WAIT FOR END\n"
' | sbatch --dependency=singleton --job-name=wait_loop_all --wait -p $DEDICATED_CONF --qos $QOS_CONF --time 1 -c 1 --mem-per-cpu 10M --mail-type END,FAIL --mail-user $MAIL_CONF
' | sbatch --dependency=singleton -p $DEDICATED_CONF --job-name=wait_loop_all_${JOB_ID} --wait --qos $QOS_CONF --time 1 -c 1 --mem-per-cpu 10M --mail-type END,FAIL --mail-user $MAIL_CONF --export $SUP_VAR_tempo
# echo -e "\nAFTER ALL FIRST ROUND OF SBATCH COUNT = $COUNT"
LOCAL_USER_VAR+=" SUP_VAR_tempo" # do not forget the space before the variable name
if [[ $R_ANALYSIS_KIND =~ longit || $LOOP_NB_CONF == 1 ]] ; then
if [[ $R_ANALYSIS_KIND =~ longit || $LOOP_NB_CONF == "1" ]] ; then
echo -e "\nNO NEED TO COMPILE DATA SINCE NO LOOP PERFORMED\n"
else
OUTPUT_DIR_PATH_FINAL="${OUTPUT_DIR_PATH_tempo}/final_res"
......@@ -407,7 +413,8 @@ else
# 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_PROC="R_conf ${r_compil_conf} $PATH_LIB_CONF ${OUTPUT_DIR_PATH_tempo}/ ${OUTPUT_DIR_PATH_FINAL}/ $r_main_functions_conf $PROJECT_NAME_CONF $LABEL_SIZE $R_OPT_TXT_CONF $LOOP_NB_CONF $R_ANALYSIS_KIND"
echo -e "\nSBATCH CORRESPONDING TO COMPIL\n"
R_PROC="R_conf ${r_compil_conf} $PATH_LIB_CONF ${OUTPUT_DIR_PATH_tempo}/ ${OUTPUT_DIR_PATH_FINAL}/ $r_main_functions_conf $PROJECT_NAME_CONF $LABEL_SIZE $R_OPT_TXT_CONF $LOOP_NB_CONF $R_ANALYSIS_KIND"
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_FINAL}/${PROJECT_NAME_CONF}_slurm_jobID.txt # write all th echo from the $PROC alaso into a log file
......@@ -417,7 +424,7 @@ fi
################ LANDING
echo -e "\nALL CHECKS OK: PROCESS ENGAGED......................\n"
echo -e "\n\n......................ALL JOBS SUBMITTED\n\n"
STOPTIME=$(date)
LOCAL_USER_VAR+=" STOPTIME" # do not forget the space before the variable name
echo -e "PROCESS END TIME:" $STOPTIME
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment