diff --git a/wGRR b/wGRR index f84cfc6b6ff30571025422e077e17b580fdaf4fd..aa076305ccdf2f7dafbdc5dd86d79529ceb0d1f7 100755 --- a/wGRR +++ b/wGRR @@ -19,7 +19,7 @@ display_usage() { echo "${bold}USAGE:${normal} $ZSH_ARGZERO -f <fasta_file> [OPTIONS]" echo "" echo "${bold}MANDATORY PARAMETERS:${normal}" - echo " -f <string> fasta file with all proteins of all the compared genetic elements." + echo " -i <string> fasta file with all proteins of all the compared genetic elements." echo " All identifiers must be formatted as:" echo " >element_identifier_XXX" echo " where XXX is a serie of numbers unique for each protein of each element." @@ -44,6 +44,8 @@ display_usage() { echo " Only applicable to Maestro, for the wGRR calculation step." echo " default: not set" echo " -T Test run. Useful to get stats on the input file and correctly set the -a parameter." + echo " -f In sbatch mode, will use the fast QOS (jobs limited to 2 hours)" + echo " Warning: be sure the jobs will run under 2 hours otherwise they will fail." echo "" echo "${bold}DESCRIPTION:${normal}" echo "This pipeline will do all proteins pairwise comparisons using the MMseqs2 software and then process " @@ -90,7 +92,7 @@ textifyDuration() { } ## parameters initialization -PRT="N.O.P.R.T" ## -f +PRT="N.O.P.R.T" ## -i MMPATH="N.O.P.A.T.H" ## -p OUT="N.O.O.U.T" ## -o THREADS=1 ## -t @@ -102,17 +104,19 @@ MMS_DEF_MAX_SEQS=300 MIDENT=0 MMS_MAX_SEQ_PARAM="" TESTRUN=0 ## -T +FAST=0 ## -f ## catch option values -while getopts :Tf:p:o:t:a:m: option ; do +while getopts :fTi:p:o:t:a:m: option ; do case $option in - f) PRT="$OPTARG"; if [ ! -f $PRT ]; then echo "[ERROR] -- fasta file '$PRT' not found (option -f)." ; exit 1 ; fi ;; + i) PRT="$OPTARG"; if [ ! -f $PRT ]; then echo "[ERROR] -- fasta file '$PRT' not found (option -f)." ; exit 1 ; fi ;; p) MMPATH="$OPTARG" ;; o) OUT="$OPTARG"; if [ -f "$OUT".wgrr.final.txt ]; then echo "[ERROR] -- file $OUT.wgrr.final.txt already exists. Change option -o or remove this file and relaunch." ; exit 1 ; fi ;; t) THREADS="$OPTARG"; if [[ ! $THREADS =~ ^[0-9]+$ ]]; then echo "[ERROR] -- number of threads $THREADS must be an integer (option -t)." ; exit 1 ; fi ;; a) ARRAYSIZE="$OPTARG"; if [[ ! $ARRAYSIZE =~ ^[0-9]+$ ]]; then echo "[ERROR] -- number of genomes comparisons $ARRAYSIZE must be an integer (option -a)." ; exit 1 ; fi ;; m) MAXJOBS="$OPTARG"; if [[ ! $MAXJOBS =~ ^[0-9]+$ ]]; then echo "[ERROR] -- max number of simulteaneous jobs $MAXJOBS must be an integer (option -m)." ; exit 1 ; fi ;; T) TESTRUN=1 ;; + f) FAST=1 ;; :) echo "option $OPTARG : missing argument" ; exit 1 ;; \?) echo "$OPTARG : invalid option" ; exit 1 ;; esac @@ -321,6 +325,9 @@ else else JOBARRAY="1-${NJOBS}" fi + if [[ $FAST == 1 ]] ; then + PARTITION="fast,dedicated" + fi JID=$(sbatch --parsable --wait -p "$PARTITION" --array="$JOBARRAY" -c 1 -J "wGRR_worker" --mem=$REQMEM --wrap="./wGRR_worker.zsh $ARRAYSIZE $OUT $NJOBS 1 $PRT $tmp") PQT=$(sacct -X -j $JID -o Reserved -n | awk 'NR==1{prevt=0}{t=0;n=split($1,a,"-");if(n>1){t=t+a[1]*86400};split(a[n],b,":");t=t+b[1]*3600+b[2]*60+b[3];if(t<prevt){tt=tt+prevt}prevt=t}END{print tt+t}') printf "%-10s -- %s %s %s %s %s\n" "[INFO]" "The job" $JID "has been" $(textifyDuration $PQT) "in queue" | tee -a ${OUT}.wgrr.log