@@ -12,9 +12,29 @@ PURPLE='\033[00;35m'
1212CYAN=' \033[00;36m'
1313
1414ms_path=${PWD/ metascreener*/ } /metascreener
15- simg=" singularity exec --bind=${PWD} $ms_path /singularity/metascreener .simg"
15+ simg=" singularity exec --bind=${PWD} $ms_path /singularity/ESSENCE-Dock .simg"
1616extra_metascreener=" $ms_path /MetaScreener/extra_metascreener"
1717
18+ if [ ! -f " $ms_path /singularity/ESSENCE-Dock.simg" ]; then
19+ echo " The required ESSENCE-Dock Singularity image doesn't seem to be present. Would you like to download it automatically? "
20+ echo " (Y/y) Download Singularity image automatically"
21+ echo " (N/n) Exit"
22+ read -r answer
23+ while [ " ${answer,,} " != " y" ] && [ " ${answer,,} " != " yes" ] && [ " ${answer,,} " != " n" ] && [ " ${answer,,} " != " no" ]; do
24+ echo " Would you like to download the Singularity image automatically?"
25+ echo " (Y/y) Download Singularity image automatically"
26+ echo " (N/n) Exit"
27+ read -r answer
28+ done
29+ if [ " ${answer,,} " = " y" ] || [ " ${answer,,} " = " yes" ]; then
30+ wget --no-check-certificate -r " https://drive.usercontent.google.com/download?id=1yN63r8sl26VMZJtdrAG4e_JQFFlb1eE8&confirm=t" -O ${ms_path} /singularity/ESSENCE-Dock.simg
31+ echo " The Singularity image has been downloaded"
32+ else
33+ echo " Exiting.. Please install the Singularity image and try again"
34+ exit
35+ fi
36+ fi
37+
1838printHelp (){
1939 printf " ${GREEN} %6s ${CYAN} %5s ${NONE} %-s \n" " -$1 )" " [ $2 ]" " $3 "
2040}
@@ -32,6 +52,8 @@ function help()
3252 printHelp " np | no-postprocessing | raw" " O" " Skip post-processing of the best results, so no PSE or PLIP interactions are generated. Post-processing is performed by default"
3353 printHelp " n | nc" " O" " Amount of compounds to include in the final PyMol Session. Default is 50"
3454 printHelp " cl | cluster" " O" " String with options to launch in the cluster. Important: Always accompany this flag with an argument! For example: \" -p standard --time 12:00:00 ...\" "
55+ printHelp " c | cpus" " O" " Number of CPUs to use"
56+ printHelp " t | timeout" " O" " Max time spent processing per compound"
3557 printHelp " s | silent" " O" " Silent Mode: Don't show the progression of the ESSENCE-Dock consensus calculations. Only works without the -cl flag: silent mode disabled by default"
3658 printHelp " ns | nosilent" " O" " No Silent Mode: Show the progression of the ESSENCE-Dock consensus calculations. Only works with the -cl flag: silent mode enabled by default"
3759 printHelp " sc | skip-cleanup" " O" " Skip the cleanup: intermediate files will not be removed"
@@ -53,7 +75,8 @@ skipcleanup=false
5375cluster_opt=sequential
5476input_dirs=0
5577debug=false
56-
78+ CPUS=1
79+ timeoutLimit=3
5780# Parameters
5881while (( $# ))
5982 do
@@ -86,7 +109,9 @@ while (( $# ))
86109 --SKIP-CLEANUP | -SKIP-CLEANUP | -SC) skipcleanup=true;;
87110 --NOSILENT | -NOSILENT | -NS) CLsilent=false;;
88111 --NO-POSTPROCESSING | -NO-POSTPROCESSING | -RAW | -NP) noPostProcessing=true;;
89- --CLUSTER | -CLUSTER| -CL) cluster_opt=$2 ;;
112+ --CLUSTER | -CLUSTER | -CL) cluster_opt=$2 ;;
113+ --CPUS | -CPU | -C) CPUS=$2 ;;
114+ --TIMEOUT | -TIMEOUT | -T) timeoutLimit=$2 ;;
90115 --HELP | -HELP | -H) help
91116 esac
92117 fi
@@ -122,16 +147,16 @@ else
122147fi
123148
124149if [ -d $out ]; then
125- while [ " $input " != " Y " ] && [ " $input " != " y " ] && [ " $input " != " N " ] && [ " $input " != " n " ] ; do
126- echo " CreateFile: The directory ${folder_experiment } already exists. To continue you must delete this directory. Do you want to delete it? "
150+ while [ " ${ input,,} " != " y " ] && [ " ${ input,,} " != " yes " ] && [ " ${ input,,} " != " n " ] && [ " ${ input,,} " != " no " ]; do
151+ echo " The output directory ${out } already exists. To continue you must delete this directory. Do you want to delete it? "
127152 echo " (Y/y) Delete folder"
128153 echo " (N/n) Exit"
129154 read input
130155 done
131- if [ " $input " == " Y " ] || [ " $input " == " y " ]; then
156+ if [ " ${ input,,} " == " y " ] || [ " ${ input,,} " == " yes " ]; then
132157 rm -r ${out}
133158 mkdir ${out}
134- elif [ " $input " == " n" ] || [ " $input " == " N " ]; then
159+ elif [ " ${ input,,} " == " n" ] || [ " ${ input,,} " == " no " ]; then
135160 exit
136161 fi
137162 else
@@ -143,7 +168,7 @@ cross="${simg} python ${extra_metascreener}/results/cross/ESSENCE-Dock_cross.py
143168
144169# Execute the commands
145170if [[ " $cluster_opt " == " sequential" ]]; then
146- join=" ${simg} python3 ${extra_metascreener} /results/join/ESSENCE-Dock_Consensus.py -o ${out} -r ${receptor} -dd ${DiffDockPath} -f ${lst} -s ${silent} -n ${numberOfCompounds} -raw ${noPostProcessing} "
171+ join=" ${simg} python ${extra_metascreener} /results/join/ESSENCE-Dock_Consensus.py -o ${out} -r ${receptor} -dd ${DiffDockPath} -f ${lst} -s ${silent} -n ${numberOfCompounds} -raw ${noPostProcessing} -c ${CPUS} -t ${timeoutLimit }"
147172 echo " Preparing docking runs for ESSENCE-Dock Consensus.."
148173 if $debug ; then
149174 echo -e " \e[0;34m[DEBUG] Full Command:\n${cross} \e[0m"
@@ -176,7 +201,7 @@ if [[ "$cluster_opt" == "sequential" ]];then
176201 fi
177202
178203else
179- join=" ${simg} python3 ${extra_metascreener} /results/join/ESSENCE-Dock_Consensus.py -o ${out} -r ${receptor} -dd ${DiffDockPath} -f ${lst} -s ${CLsilent} -n ${numberOfCompounds} -raw ${noPostProcessing} "
204+ join=" ${simg} python ${extra_metascreener} /results/join/ESSENCE-Dock_Consensus.py -o ${out} -r ${receptor} -dd ${DiffDockPath} -f ${lst} -s ${CLsilent} -n ${numberOfCompounds} -raw ${noPostProcessing} -c ${CPUS} -t ${timeoutLimit }"
180205 receptorName=" ${receptor##*/ } "
181206 mkdir " $out /job_data/"
182207 name_job=" ${out} /job_data/ESSENCE-Dock_Consensus_${receptorName% .* } .sh"
0 commit comments