human-microbiome-compendium/sge_scripts/bm_correct_sampling.sh
2026-02-23 14:04:24 +01:00

48 lines
No EOL
938 B
Bash
Executable file

#!/usr/bin/env bash
#$ -V
#$ -cwd
#$ -N bmcorrectsamp
#$ -m besa
#$ -q short.q
#$ -t 1-6
#$ -pe thread 64
#$ -M louis.lacoste+migale@agroparistech.fr
#$ -o logs/$JOB_NAME
#$ -e logs/$JOB_NAME
# Creating log directory if it doesn't exists
BASE_DIR="/home/$USER/work/human-microbiome-compendium"
LOG_DIR=$(echo "$BASE_DIR/logs")
if [ ! -d "$LOG_DIR" ]; then
mkdir -p $LOG_DIR
fi
# Finding directory
APPLICATIONS_DIR=$(echo "$BASE_DIR")
echo $APPLICATIONS_DIR
ARGID=$(($SGE_TASK_ID % 3))
case $ARGID in
0)
echo -n "Model will be Chaillou"
MODE="chaillou"
;;
1)
echo -n "Model will be Ravel"
MODE="ravel"
;;
2)
echo -n "Model will be Mach"
MODE="mach"
;;
esac
readonly NB_CORES=$(sed -n 's/^#\$ -pe thread \(.*\)/\1/p' -- "$0")
echo -n "Model will be $MODE with $NB_CORES"
Rscript "${APPLICATIONS_DIR}/blockmodels_correct_sampling_effort.R.R" $MODE &>> logs/$JOB_NAME.$SGE_TASK_ID