Commit e40a498b authored by Christian Meesters's avatar Christian Meesters

minor fixes in accounting for different blast executables

parent 1cb9cc4b
......@@ -435,14 +435,14 @@ DATABASE="$DATABASEPATH/$DATABASEID"
### setup blast and splitup executable; check if exist
allowed_executables="blastx blastp blastn"
if [[ $allowed_executables =~ (^|[[:space:]])"$_arg_executable"($|[[:space:]]) ]]; then
BLASTEXE=$(which $_arg_executable)
else
error "$_arg_executable ought to be in $allowed_executables"
if [[ ! $allowed_executables =~ (^|[[:space:]])"$_arg_executable"($|[[:space:]]) ]]; then
# BLASTEXE=$(which $_arg_executable)
#else
error "$_arg_executable ought to be one of [$allowed_executables]"
fi
BLASTEXE=$(which $_arg_executable)
if [ -z $BLASTEXE ] && [[ $_arg_test == "off" ]]; then
error "'$BLAST' : not found, please load an appropriate module before restarting."
error "'$BLASTEXE' : not found, please load an appropriate module before restarting."
exit
fi
......@@ -509,12 +509,12 @@ echo "Self-Documentation:"
[[ $_arg_test == "on" ]] && echo " - This is a test-run, only"
echo " - The query input is '$FASTA'"
echo " - The database is '$DATABASE'"
BLASTVERSION=$($BLASTEXE -versioni | head -n1 | cut -f2 -d' ')
BLASTVERSION=$($BLASTEXE -version | head -n1 | cut -f2 -d' ')
echo " - The executable is '$BLASTEXE', version: $BLASTVERSION"
### check if this script is on node by checking env-variable $SLURM_JOB_ID, else send it to SLURM with given parameters and exit
if [ -z "$SLURM_JOB_ID" ]; then
submit_call="sbatch --no-requeue -o ${JOBTAG}_%j.out -J $JOBTAG -p $_arg_queue -A $_arg_assoc -t $_arg_runlimit -N $_arg_nodes -n $((64 * $_arg_nodes)) --gres=ramdisk:$_arg_ramdisk -c $_arg_blast_threads $SCRIPT --partition $_arg_queue --account $_arg_assoc --nodes $_arg_nodes --time $_arg_runlimit --blastmem $_arg_blastmem --ramdisk $_arg_ramdisk --threads $_arg_blast_threads --splitup $_arg_splitup_per_queryfile --executable=$BLASTEXE $FASTA $DATABASE $BLASTPARAMS"
submit_call="sbatch --no-requeue -o ${JOBTAG}_%j.out -J $JOBTAG -p $_arg_queue -A $_arg_assoc -t $_arg_runlimit -N $_arg_nodes -n $((64 * $_arg_nodes)) --gres=ramdisk:$_arg_ramdisk -c $_arg_blast_threads $SCRIPT --partition $_arg_queue --account $_arg_assoc --nodes $_arg_nodes --time $_arg_runlimit --blastmem $_arg_blastmem --ramdisk $_arg_ramdisk --threads $_arg_blast_threads --splitup $_arg_splitup_per_queryfile --executable=$_arg_executable $FASTA $DATABASE $BLASTPARAMS"
if [[ $_arg_test == "on" ]]; then
echo "Just testing - this command would be submitted:"
echo $submit_call
......@@ -608,9 +608,11 @@ echo 'module use /cluster/easybuild/nehalem/modules/all ' >> $cmd
echo 'module load bio/BLAST+' >> $cmd
printf "$BLASTEXE -num_threads $SLURM_CPUS_PER_TASK -db $RAMDISK/$(basename $DATABASE) $BLASTPARAMS " >> $cmd
#printf "$BLASTEXE -num_threads 2 -db $RAMDISK/$(basename $DATABASE) " >> $cmd
#TODO: write output to local host, copy back, when ready
echo '-query ./$1 -out ./output/$(basename ${1%fasta}out)' >> $cmd
chmod +x $cmd
HOSTLIST=$(scontrol show hostname $SLURM_JOB_NODELIST | paste -d, -s )
#parallel --controlmaster --workdir --sshdelay 0.2 $PWD -S $HOSTLIST -j $(($SLURM_JOB_NUM_NODES*$SLURM_CPUS_ON_NODE/$SLURM_CPUS_PER_TASK)) --env run_blast run_blast ::: $(find -type f -name 'group*.fasta')
parallel --workdir $PWD --sshdelay 0.2 -S $HOSTLIST -j 64 $cmd ::: $(find -type f -name 'group*.fasta')
......
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