-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_py310.sh
255 lines (196 loc) · 7.7 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
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 MolDockLab
###############################################################
"""
# install dependencies for xgboost, GWOVina & MGLTools
if [[ "$OSTYPE" == "darwin"* || "$OSTYPE" == "msys"* ]]; then
# dependencies for mac and windows
echo -e "MolDockLab 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 MolDockLab 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="moldocklab"
if conda env list | grep -q "^$ENV_NAME\s"; then
echo "Conda environment '$ENV_NAME' already exists. Skipping creation."
conda activate moldocklab
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 plip ambertools -y
conda install conda-forge::pymol-open-source bioconda/label/cf201901::muscle -y
echo -e """
###############################################################
# Installing Pip packages, please wait...
###############################################################
"""
pip install pymesh oddt prody==2.4.1 redo MDAnalysis Pebble tensorflow==2.15 keras==2.15 meeko posebusters hdbscan e3nn pydantic plotly bravado black pybel
pip3 install torch==2.2.0 torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
pip install -U kaleido fair-esm[esmfold]==2.0.0
pip install torch_scatter torch_sparse==0.6.17 torch_spline_conv torch_cluster==1.6.0 torch_geometric
pip install dgl -f https://data.dgl.ai/wheels/torch-2.2/repo.html
echo -e """
###############################################################
# Finished installing pip packages
###############################################################
"""
fi
###############################################################
MolDockLab_FOLDER=$(pwd)
cd $MolDockLab_FOLDER
###############################################################
echo -e """
###############################################################
# Downloading Executables...
###############################################################
"""
if [[ ! -d $MolDockLab_FOLDER/software ]]; then
mkdir -p $MolDockLab_FOLDER/software
cd $MolDockLab_FOLDER/software
else
cd $MolDockLab_FOLDER/software
fi
if [[ ! -f $MolDockLab_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 $MolDockLab_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 [[ ! -d $MolDockLab_FOLDER/software/DiffDock ]]; then
echo -e "\nCloning DiffDock!"
cd $MolDockLab_FOLDER/software
git clone git@github.com:mbackenkoehler/DiffDock.git
cd $MolDockLab_FOLDER # Return to the original directory
fi
if [[ ! -f $MolDockLab_FOLDER/software/smina.static ]]; then
echo -e "\nDownloading Lin_F9!"
cd $MolDockLab_FOLDER/software
wget https://github.com/cyangNYU/Lin_F9_test/raw/master/smina.static --no-check-certificate -q --show-progress
cd $MolDockLab_FOLDER
chmod +x smina.static
fi
if [[ ! -d $MolDockLab_FOLDER/software/gypsum_dl-1.2.1 ]]; then
echo -e "\nDownloading GypsumDL!"
cd $MolDockLab_FOLDER/software
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
cd $MolDockLab_FOLDER
fi
if [[ ! -d $MolDockLab_FOLDER/software/SCORCH ]]; then
echo -e "\nCloning SCORCH!"
cd $MolDockLab_FOLDER/software
git clone git@github.com:SMVDGroup/SCORCH.git
cd $MolDockLab_FOLDER # Return to the original directory
fi
if [[ ! -d $MolDockLab_FOLDER/software/PLIPify ]]; then
echo -e "\nCloning PLIPify!"
cd $MolDockLab_FOLDER/software
git clone git@github.com:hamzaibrahim21/plipify.git
cd $MolDockLab_FOLDER # Return to the original directory
fi
if [[ ! -d $MolDockLab_FOLDER/software/RTMScore ]]; then
echo -e "\nCloning RTMScore!"
cd $MolDockLab_FOLDER/software
git clone git@github.com:sc8668/RTMScore.git
cd $MolDockLab_FOLDER # Return to the original directory
fi
cd $BASEDIR
echo -e """
###############################################################
############## MolDockLab installation complete ###############
###############################################################
"""
###############################################################
# Check if conda environment is present in the list of environments
if conda env list | grep -q $ENV_NAME; then
echo -e "\nMolDockLab conda environment is present!"
else
echo -e "\nINSTALLATION ERROR : MolDockLab conda environment is not present!"
fi
conda activate $ENV_NAME
cd $MolDockLab_FOLDER