Skip to content

Commit

Permalink
cleaning up after a failed run
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffersonfparil committed Jun 23, 2024
1 parent 5f088b7 commit c927873
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions inst/exec_Rscript/1-checks_and_submision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ DIR_OUT=${DIR_SRC}
if [ ! -f $GENOTYPE_DATA_RDS ]
then
echo "Error: The genotype file: $GENOTYPE_DATA_RDS does not exist. Are you specifying the full path? Is the name correct?"
rm $0
rm 2-gp_slurm_job.sh
exit 101
else
echo "Passed: The genotype file: $GENOTYPE_DATA_RDS exists."
Expand All @@ -58,6 +60,8 @@ fi
if [ ! -f $PHENOTYPE_DATA_TSV ]
then
echo "Error: The phenotype file: $PHENOTYPE_DATA_TSV does not exist. Are you specifying the full path? Is the name correct?"
rm $0
rm 2-gp_slurm_job.sh
exit 102
else
echo "Passed: The phenotype file: $PHENOTYPE_DATA_TSV exists."
Expand All @@ -69,6 +73,8 @@ geno = suppressWarnings(tryCatch(readRDS(args[1]), error=function(e){print("Erro
if [ $(Rscript test_geno_rds.R $GENOTYPE_DATA_RDS | grep -i "error" | wc -l) -eq 1 ]
then
echo "Error: The genotype file: $GENOTYPE_DATA_RDS is not an Rds file."
rm $0
rm 2-gp_slurm_job.sh
exit 103
else
echo "Passed: The genotype file: $GENOTYPE_DATA_RDS is an Rds file."
Expand All @@ -81,6 +87,8 @@ pheno = suppressWarnings(tryCatch(read.delim(args[1], sep="\t", header=TRUE), er
if [ $(Rscript test_pheno_rds.R $PHENOTYPE_DATA_TSV | grep -i "error" | wc -l) -eq 1 ]
then
echo "Error: The phenotype file: $GENOTYPE_DATA_RDS is not formatted according to specifications. It should be tab-delimited and a header line must be present."
rm $0
rm 2-gp_slurm_job.sh
exit 104
else
echo "Passed: The phenotype file: $GENOTYPE_DATA_RDS is tab-delimited with a header line."
Expand All @@ -90,6 +98,8 @@ rm test_pheno_rds.R
if [ ! -w $DIR_OUT ]
then
echo "Error: You do not have permission to write in the output directory: $DIR_OUT. Please use an output directory you have write acess to."
rm $0
rm 2-gp_slurm_job.sh
exit 106
else
echo "Passed: You have permission to write in the output directory: $DIR_OUT."
Expand All @@ -98,6 +108,8 @@ fi
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?"
rm $0
rm 2-gp_slurm_job.sh
exit 107
else
echo "Passed: The executable code directory: $DIR_SRC contains the script: 2-gp_slurm_job.sh."
Expand Down
2 changes: 1 addition & 1 deletion inst/exec_Rscript/config.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
GENOTYPE_DATA_RDS=${DIR_SRC}/input_tmp/test_geno.Rds
GENOTYPE_DATA_RDS=${DIR_SRC}/input_tmp/test_geno.RdsX
PHENOTYPE_DATA_TSV=${DIR_SRC}/input_tmp/test_pheno.tsv
KFOLDS=2
NREPS=2
Expand Down

0 comments on commit c927873

Please sign in to comment.