From 7789a329c9bd3a42853285ec8e70d5116cb72d81 Mon Sep 17 00:00:00 2001 From: jeffersonfparil Date: Sun, 23 Jun 2024 16:25:31 +1000 Subject: [PATCH] error handling if gp.R does not exist --- inst/exec_Rscript/1-checks_and_submision.sh | 12 +++++++++++- inst/exec_Rscript/config.txt | 14 +------------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/inst/exec_Rscript/1-checks_and_submision.sh b/inst/exec_Rscript/1-checks_and_submision.sh index 12667e2..c719781 100755 --- a/inst/exec_Rscript/1-checks_and_submision.sh +++ b/inst/exec_Rscript/1-checks_and_submision.sh @@ -104,7 +104,7 @@ then else echo "Passed: You have permission to write in the output directory: $DIR_OUT." fi -### Check if the confighured slurm array job script exists +### Check if the configured slurm array job script exists if [ ! -f ${DIR_SRC}/2-gp_slurm_job.sh ] then echo "Error: The executable code directory: $DIR_SRC does not contain the script: 2-gp_slurm_job.sh. Are you sure this is the genomic_selection repo directory?" @@ -114,6 +114,16 @@ then else echo "Passed: The executable code directory: $DIR_SRC contains the script: 2-gp_slurm_job.sh." fi +### Check if the executable Rscript exists +if [ ! -f ${DIR_SRC}/gp.R ] +then + echo "Error: The executable code directory: $DIR_SRC does not contain the script: gp.R. Are you sure this is the genomic_selection repo directory?" + rm $0 + rm 2-gp_slurm_job.sh + exit 108 +else + echo "Passed: The executable Rscript: $DIR_SRC contains the Rscript: gp.R." +fi ### Initialise the output directory which will contain all the output Rds files across populations and traits if [ ! -d ${DIR_OUT}/output ] then diff --git a/inst/exec_Rscript/config.txt b/inst/exec_Rscript/config.txt index ab57b9c..1f67947 100644 --- a/inst/exec_Rscript/config.txt +++ b/inst/exec_Rscript/config.txt @@ -8,16 +8,4 @@ SBATCH --account="dbiopast2" SBATCH --ntasks=1 SBATCH --cpus-per-task=8 SBATCH --mem=64G -SBATCH --time=0-2:0:00 - -# GENOTYPE_DATA_RDS=${DIR_SRC}/input/test_geno.Rds -# PHENOTYPE_DATA_TSV=${DIR_SRC}/input/test_pheno.tsv -# KFOLDS=2 -# NREPS=2 -# DIR_OUT=${DIR_SRC} -# SBATCH --job-name="test" -# SBATCH --account="dbiopast2" -# SBATCH --ntasks=1 -# SBATCH --cpus-per-task=8 -# SBATCH --mem=64G -# SBATCH --time=0-2:0:00 \ No newline at end of file +SBATCH --time=0-2:0:00 \ No newline at end of file