forked from DrugBud-Suite/DockM8
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_py310.sh
executable file
·323 lines (265 loc) · 10.9 KB
/
setup_py310.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
g#!/bin/bash
USE_GIT=0
while getopts "g" opt; do
case $opt in
g)
USE_GIT=1
;;
\?)
echo "Usage: $0 [-g]" >&2
exit 1
;;
esac
done
BASEDIR=$PWD
# Check for the existence of required utilities
function check_dependency() {
local command_name="$1"
if ! command -v "$command_name" &> /dev/null; then
echo "ERROR: $command_name is not installed, please install manually. Please run : "sudo apt-get install $command_name""
exit 1
fi
}
check_dependency "wget"
if [ $USE_GIT -eq 1 ]; then
check_dependency "git"
fi
check_dependency "unzip"
check_dependency "gcc"
###############################################################
echo -e """
###############################################################
# Installing DockM8
###############################################################
"""
# install dependencies for xgboost, GWOVina & MGLTools
if [[ "$OSTYPE" == "darwin"* || "$OSTYPE" == "msys"* ]]; then
# dependencies for mac and windows
echo -e "DockM8 is not compatible with Mac OS or Windows!"
exit
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
echo -e "Detected Linux OS!"
fi
###############################################################
echo -e """
###############################################################
# Verifying conda install or installing miniconda3 if not found
###############################################################
"""
# check if conda is installed, and install miniconda3 if not
# if conda is not a recognised command then download and install
if ! command -v conda &> /dev/null; then
echo -e "No conda found - installing..."
mkdir -p $HOME/miniconda3
cd $HOME/miniconda3
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh --no-check-certificate -q --show-progress
# install miniconda3
cd $HOME/miniconda3 && chmod -x miniconda.sh
cd $BASEDIR && bash $HOME/miniconda3/miniconda.sh -b -u -p $HOME/miniconda3
# remove the installer
rm -f $HOME/miniconda3/miniconda.sh
# define conda installation paths
CONDA_PATH="$HOME/miniconda3/bin/conda"
CONDA_BASE=$BASEDIR/$HOME/miniconda3
CONDA_SH="$HOME/miniconda3/etc/profile.d/conda.sh"
else
echo -e "Found existing conda install!"
# if conda not installed then find location of existing installation
CONDA_PATH=$(which conda)
CONDA_BASE=$(conda info --base)
CONDA_SH=$CONDA_BASE/etc/profile.d/conda.sh
fi
###############################################################
echo -e """
###############################################################
# installing the DockM8 conda environment
###############################################################
"""
# source the bash files to enable conda command in the same session
if test -f ~/.bashrc; then
source ~/.bashrc
fi
if test -f ~/.bash_profile; then
source ~/.bash_profile
fi
# initiate conda
$CONDA_PATH init bash
# source the conda shell script once initiated
source $CONDA_SH
# configure conda to install environment quickly and silently
$CONDA_PATH config --set auto_activate_base false
$CONDA_PATH config --set ssl_verify False
# create the conda environment
ENV_NAME="dockm8"
if conda env list | grep -q "^$ENV_NAME\s"; then
echo "Conda environment '$ENV_NAME' already exists. Skipping creation."
conda activate dockm8
else
conda create -n $ENV_NAME python=3.10 -y
conda deactivate
conda activate $ENV_NAME
conda config --add channels conda-forge
conda install rdkit ipykernel scipy spyrmsd kneed scikit-learn-extra molvs seaborn xgboost openbabel docopt chembl_structure_pipeline tqdm -q -y
echo -e """
###############################################################
# Installing Pip packages, please wait...
###############################################################
"""
pip install pymesh espsim oddt biopandas redo MDAnalysis==2.0.0 prody==2.1.0 dgl Pebble tensorflow meeko posebusters streamlit -q
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu -q
pip install torch_scatter torch_sparse torch_spline_conv torch_cluster torch_geometric -q
echo -e """
###############################################################
# Finished installing pip packages
###############################################################
"""
fi
###############################################################
DOCKM8_FOLDER=""
if [[ -f dockm8.py ]]; then
echo -e "\nDockM8 repository found in current folder."
DOCKM8_FOLDER=$(pwd)
else
if [ $USE_GIT -eq 1 ]; then
# Replace wget logic with Git logic for DockM8 repository download
echo -e "\nDownloading DockM8 repository using Git..."
rm -rf ./DockM8
git clone https://gitlab.com/Tonylac77/DockM8.git DockM8
DOCKM8_FOLDER=$(pwd)/DockM8
echo -e "\nDockM8 repository downloaded using Git."
else
# Use wget logic for DockM8 repository download (as in your original script)
echo -e "\nDownloading DockM8 repository using wget..."
rm -rf ./DockM8
wget https://gitlab.com/Tonylac77/DockM8/-/archive/main/DockM8-main.tar.gz -O DockM8.tar.gz --no-check-certificate -q --show-progress
tar -xf DockM8.tar.gz
mv -f DockM8-main DockM8
DOCKM8_FOLDER=$(pwd)/DockM8
rm DockM8.tar.gz
echo -e "\nDockM8 repository downloaded using wget."
fi
fi
cd $DOCKM8_FOLDER
###############################################################
echo -e """
###############################################################
# Downloading Executables...
###############################################################
"""
if [[ ! -d $DOCKM8_FOLDER/software ]]; then
mkdir $DOCKM8_FOLDER/software
cd $DOCKM8_FOLDER/software
else
cd $DOCKM8_FOLDER/software
fi
if [[ ! -f $DOCKM8_FOLDER/software/gnina ]]; then
echo -e "\nDownloading GNINA!"
wget https://github.com/gnina/gnina/releases/latest/download/gnina --no-check-certificate -q --show-progress
chmod +x gnina
fi
if [[ ! -f $DOCKM8_FOLDER/software/qvina-w ]]; then
echo -e "\nDownloading QVINA-W!"
wget https://github.com/QVina/qvina/raw/master/bin/qvina-w --no-check-certificate -q --show-progress
chmod +x qvina-w
fi
if [[ ! -f $DOCKM8_FOLDER/software/qvina2.1 ]]; then
echo -e "\nDownloading QVINA2!"
wget https://github.com/QVina/qvina/raw/master/bin/qvina2.1 --no-check-certificate -q --show-progress
chmod +x qvina2.1
fi
if [[ ! -f $DOCKM8_FOLDER/software/PLANTS ]]; then
echo -e "\nPLANTS not found in software folder, if you want to use it, please see documentation for a link to register and download it!"
fi
if [[ ! -f $DOCKM8_FOLDER/software/KORP-PL ]]; then
echo -e "\nDownloading KORP-PL!"
wget https://files.inria.fr/NanoDFiles/Website/Software/KORP-PL/0.1.2/Linux/KORP-PL-LINUX-v0.1.2.2.tar.gz --no-check-certificate -q --show-progress
tar -xf KORP-PL-LINUX-v0.1.2.2.tar.gz
rm KORP-PL-LINUX-v0.1.2.2.tar.gz
chmod +x KORP-PL
fi
if [[ ! -f $DOCKM8_FOLDER/software/Convex-PL ]]; then
echo -e "\nDownloading Convex-PLR!"
wget https://files.inria.fr/NanoDFiles/Website/Software/Convex-PL/Files/Convex-PL-Linux-v0.5.tar.zip --no-check-certificate -q --show-progress
unzip Convex-PL-Linux-v0.5.tar.zip
tar -xf Convex-PL-Linux-v0.5.tar
rm Convex-PL-Linux-v0.5.tar.zip
rm Convex-PL-Linux-v0.5.tar
rm -r __MACOSX
chmod +x Convex-PL
fi
if [[ ! -f $DOCKM8_FOLDER/software/smina.static ]]; then
echo -e "\nDownloading Lin_F9!"
wget https://github.com/cyangNYU/Lin_F9_test/raw/master/smina.static --no-check-certificate -q --show-progress
chmod +x smina.static
fi
if [[ ! -d $DOCKM8_FOLDER/software/AA-Score-Tool-main ]]; then
echo -e "\nDownloading AA-Score!"
wget https://github.com/Xundrug/AA-Score-Tool/archive/refs/heads/main.zip --no-check-certificate -q --show-progress
unzip -q main.zip
rm main.zip
fi
if [[ ! -d $DOCKM8_FOLDER/software/gypsum_dl-1.2.1 ]]; then
echo -e "\nDownloading GypsumDL!"
wget https://github.com/durrantlab/gypsum_dl/archive/refs/tags/v1.2.1.tar.gz --no-check-certificate -q --show-progress
tar -xf v1.2.1.tar.gz
rm v1.2.1.tar.gz
fi
if [[ ! -d $DOCKM8_FOLDER/software/SCORCH ]]; then
echo -e "\nDownloading SCORCH!"
wget https://github.com/SMVDGroup/SCORCH/archive/refs/tags/v1.0.0.tar.gz --no-check-certificate -q --show-progress
tar -xf v1.0.0.tar.gz
rm v1.0.0.tar.gz
fi
if [[ ! -f $DOCKM8_FOLDER/software/rf-score-vs ]]; then
echo -e "\nDownloading RF-Score-VS!"
wget https://github.com/oddt/rfscorevs_binary/releases/download/1.0/rf-score-vs_v1.0_linux_2.7.zip -q --show-progress --no-check-certificate
unzip -q rf-score-vs_v1.0_linux_2.7.zip
rm rf-score-vs_v1.0_linux_2.7.zip
rm -r $DOCKM8_FOLDER/software/test
rm README.md
chmod +x rf-score-vs
fi
if [[ ! -d $DOCKM8_FOLDER/software/RTMScore-main ]]; then
echo -e "\nDownloading RTMScore!"
wget https://github.com/sc8668/RTMScore/archive/refs/heads/main.zip --no-check-certificate -q --show-progress
unzip -q main.zip
rm main.zip
rm $DOCKM8_FOLDER/software/RTMScore-main/scripts -r
rm $DOCKM8_FOLDER/software/RTMScore-main/121.jpg
fi
cd $BASEDIR
if [[ ! -f $DOCKM8_FOLDER/software/models/DeepCoy* ]]; then
echo -e "\nDownloading DeepCoy models!"
cd $DOCKM8_FOLDER/software/models
wget https://opig.stats.ox.ac.uk/data/downloads/DeepCoy_pretrained_models.tar.gz
tar -xf DeepCoy_pretrained_models.tar.gz -C $DOCKM8_FOLDER/software/
rm DeepCoy_pretrained_models.tar.gz
fi
echo -e """
###############################################################
# DockM8 installation complete
###############################################################
"""
###############################################################
echo -e """
###############################################################
# Checking installation success
###############################################################
"""
# Check if conda environment is present in the list of environments
if conda env list | grep -q $ENV_NAME; then
echo -e "\nDockM8 conda environment is present!"
else
echo -e "\nINSTALLATION ERROR : DockM8 conda environment is not present!"
fi
# Check if required packages are installed in the $ENV_NAME environment
required_packages=("rdkit" "ipykernel" "scipy" "spyrmsd" "kneed" "scikit-learn-extra" "molvs" "seaborn" "xgboost" "openbabel" "pymesh" "espsim" "oddt" "biopandas" "redo" "MDAnalysis==2.0.0" "prody==2.1.0" "dgl" "Pebble" "tensorflow" "meeko" "chembl_structure_pipeline" "posebusters" "streamlit" "torch" "torchvision" "torchaudio" "torch_scatter" "torch_sparse" "torch_spline_conv" "torch_cluster" "torch_geometric")
for package in "${required_packages[@]}"; do
if conda list -n $ENV_NAME "$package" &> /dev/null; then
echo -e "$package is installed in the $ENV_NAME environment!"
else
echo -e "\nINSTALLATION ERROR : $package is not installed in the $ENV_NAME environment!"
fi
conda activate $ENV_NAME
cd $DOCKM8_FOLDER
done