Commit d6381c08 authored by Christian Meesters's avatar Christian Meesters

some fixes in the autoselection and biopython selection scheme

parent 40443c28
...@@ -139,7 +139,7 @@ _arg_compress=on ...@@ -139,7 +139,7 @@ _arg_compress=on
print_help () print_help ()
{ {
echo "This script's help msg" echo "This script's help msg"
printf 'Usage: %s [-l|--runlimit <arg>] [-p|--partition <arg>] [-s|--splitup <arg>] [-N|--nodes <arg>] [--executable <arg>] [-m|--mem <arg>] [--blastparams <string>] [-r|--ramdisk <arg>] [--blastdir <arg>] [--(no-)test] [-h|--help] <FASTA> <DATABASE>\n' "$(basename $0)\n" printf 'Usage: %s [-l|--runlimit <arg>] [-p|--partition <arg>] [-N|--nodes <arg>] [--executable <arg>] [--blastparams <string>] [-r|--ramdisk <arg>] [--blastdir <arg>] [--(no-)test] [-h|--help] <FASTA> <DATABASE>\n' "$(basename $0)\n"
printf 'HINT: The FASTA and DATABASE items need to be full paths to files.\n' printf 'HINT: The FASTA and DATABASE items need to be full paths to files.\n'
printf "\\t\\033[1m%s\\033[0m\\t\\t%s\\n" "<FASTA>" "path to the query FASTA file" printf "\\t\\033[1m%s\\033[0m\\t\\t%s\\n" "<FASTA>" "path to the query FASTA file"
printf "\\t\\033[1m%s\\033[0m\\t%s\\n" "<DATABASE>" "path to the database file" printf "\\t\\033[1m%s\\033[0m\\t%s\\n" "<DATABASE>" "path to the database file"
...@@ -149,11 +149,8 @@ print_help () ...@@ -149,11 +149,8 @@ print_help ()
printf "\\t\\033[1m%s\\033[0m\\t%s\\n" "-N,--nodes" "number of nodes (1 is the default)" printf "\\t\\033[1m%s\\033[0m\\t%s\\n" "-N,--nodes" "number of nodes (1 is the default)"
printf "\\t\\033[1m%s\\033[0m\\t%s\\n" "--reservation" "reservation to use (none is the default)" printf "\\t\\033[1m%s\\033[0m\\t%s\\n" "--reservation" "reservation to use (none is the default)"
printf "\\t\\033[1m%s\\033[0m\\t%s\\n" "--time" "time in minutes (300 is the default)" printf "\\t\\033[1m%s\\033[0m\\t%s\\n" "--time" "time in minutes (300 is the default)"
printf "\\t\\033[1m%s\\033[0m\\t%s\\n" "-m,--mem" "memory which is required per node (defaults to 115500 M, but should be min. 242500 M for blastn, omit the unit for submitting)"
printf "\\t\\033[1m%s\\033[0m\\t%s\\n" "-r,--ramdisk" "ramdisk size in units of GiB (default is 40 GiB)"
printf "\\t\\033[1m%s\\033[0m\\t%s\\n" "-t,--threads" "blast threads (default is 1)" printf "\\t\\033[1m%s\\033[0m\\t%s\\n" "-t,--threads" "blast threads (default is 1)"
printf "\\t\\033[1m%s\\033[0m\\t%s\\n" "--blastparams" "blast parameters (default is -outfmt 6 (for blank tabulated output))" printf "\\t\\033[1m%s\\033[0m\\t%s\\n" "--blastparams" "blast parameters (default is -outfmt 6 (for blank tabulated output))"
printf "\\t\\033[1m%s\\033[0m\\t%s\\n" "-s,--splitup" "No. of FASTA sequences per query file (default is to generate ~5000 files)"
printf "\\t\\033[1m%s\\033[0m\\t%s\\n" "--blastdir" "output directory (default is composition of input names)" printf "\\t\\033[1m%s\\033[0m\\t%s\\n" "--blastdir" "output directory (default is composition of input names)"
printf "\\t\\033[1m%s\\033[0m\\t%s\\n" "--executable" "choose executable (currently only from NCBI-BLAST, default: blastx)" printf "\\t\\033[1m%s\\033[0m\\t%s\\n" "--executable" "choose executable (currently only from NCBI-BLAST, default: blastx)"
printf "\\t\\033[1m%s\\033[0m\\t%s\\n" "--compress" "if set, the output files will be merged and compressed (time consuming!, defaultt: off)" printf "\\t\\033[1m%s\\033[0m\\t%s\\n" "--compress" "if set, the output files will be merged and compressed (time consuming!, defaultt: off)"
...@@ -224,7 +221,10 @@ credits() ...@@ -224,7 +221,10 @@ credits()
echo " - faster stage-in for reference data" echo " - faster stage-in for reference data"
echo " - automerge for -outfmt=6" echo " - automerge for -outfmt=6"
echo " - -outfmt=6 is now the default" echo " - -outfmt=6 is now the default"
echo "- v0.5.1 -- 29. Aug. 2019 -- numerous fixes" echo "- v0.5.1 -- 29. Aug. 2019 -- numerous housekeeping fixes"
echo "- v0.5.2 -- 02. Sep. 2019 -- fix:"
echo " - consistent biopython inclusion"
echo " - auto-detection of database size and memory selection"
echo echo
echo "Current version is: $SCRIPT_VERSION" echo "Current version is: $SCRIPT_VERSION"
echo echo
...@@ -595,7 +595,7 @@ fi ...@@ -595,7 +595,7 @@ fi
export _arg_executable export _arg_executable
### which is the reference directory size? ### which is the reference directory size?
_arg_ramdisk=$(du -shL --block-size=1M "$_arg_database" | cut -f1 )M _arg_ramdisk=$(du -shL --block-size=1M "$_arg_database" | cut -f1 )
if [[ ! $SCRIPT == /* ]]; then if [[ ! $SCRIPT == /* ]]; then
SCRIPT="$PWD/$SCRIPT"; SCRIPT="$PWD/$SCRIPT";
fi fi
...@@ -603,20 +603,37 @@ fi ...@@ -603,20 +603,37 @@ fi
# which cluster are we on? # which cluster are we on?
cluster=$(sacctmgr show cluster -p| tail -n1| cut -f1 -d '|') cluster=$(sacctmgr show cluster -p| tail -n1| cut -f1 -d '|')
# if the cluster is Mogon I, set the memory default accordingly: # if the cluster is Mogon I, set the memory default accordingly:
allowed_mem_setting=""
if [ "$cluster" == "mogon" ]; then if [ "$cluster" == "mogon" ]; then
if [ $_arg_mem -ne 0 ]; then # user tries to select a non-default memory allowed_mem_settings="115500 242500 497500"
allowed_mem_setting="115500 242500 497500" # add a savety measure (100 MB, each core)
if [[ ! $allowed_mem_settings =~ (^|[[:space:]])"_arg_mem"($|[[:space:]]) ]]; then for setting in $allowed_mem_settings; do
error "Memory selection out to be one of [$allowed_mem_settings]" if [ $((_arg_ramdisk + 6400 )) -lt $setting ]; then
allowed_mem_setting="$allowed_mem_setting $setting"
fi fi
else # set a default memory done
if [ "$_arg_executable" == "blastn" ]; then # test whether there is any valid setting left
_memory_request="242500M" if [ -z "$allowed_mem_setting" ]; then
else error "database > available + necessary RAM"
_memory_request="115500M" exit 1
fi
# remove first space, if any
allowed_mem_setting="${allowed_mem_setting/ /}"
if [ $_arg_mem -ne 0 ]; then # user tries to select a non-default memory
if [[ ! "$allowed_mem_setting" =~ (^|[[:space:]])"$_arg_mem"($|[[:space:]]) ]]; then
error "Memory selection out to be one of [$allowed_mem_setting]"
exit 1
fi fi
# select a default
else
_memory_request=$(echo $allowed_mem_setting | cut -d" " -f1)M
#if [ "$_arg_executable" == "blastn" ]; then
# _memory_request="242500M"
#else
# _memory_request="115500M"
#fi
fi fi
else else # to be implemented for MII
if [ $_arg_mem -ne 0 ]; then # user tries to select a non-default memory if [ $_arg_mem -ne 0 ]; then # user tries to select a non-default memory
allowed_mem_setting="115500 242500 497500" allowed_mem_setting="115500 242500 497500"
if [[ ! $allowed_mem_settings =~ (^|[[:space:]])"_arg_mem"($|[[:space:]]) ]]; then if [[ ! $allowed_mem_settings =~ (^|[[:space:]])"_arg_mem"($|[[:space:]]) ]]; then
...@@ -630,6 +647,8 @@ else ...@@ -630,6 +647,8 @@ else
fi fi
fi fi
fi fi
# finally add another MB to the ramdisk to be save and the unit
_arg_ramdisk=$((_arg_ramdisk + 1024 ))M
### how many entries are there in the FASTA file? ### how many entries are there in the FASTA file?
nentries=$(grep '>' $FASTA | wc -l) nentries=$(grep '>' $FASTA | wc -l)
......
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