forked from prcurran/hotspots
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.md.bak
240 lines (146 loc) · 7.43 KB
/
README.md.bak
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
************
# Hotspots API
************
[](https://prcurran.github.io/hotspots/)
[](https://github.com/prcurran/fragment_hotspot_maps/blob/master/LICENSE)
[](https://lgtm.com/projects/g/prcurran/fragment_hotspot_maps/alerts/)
[](https://lgtm.com/projects/g/prcurran/fragment_hotspot_maps/context:python)
[](https://gitter.im/fragmenthotspots/community)

The Hotspots API is the Python package for the Fragment Hotspot Maps project,
a knowledge-based method for determining small molecule binding "hotspots".
For more information on this method:
[Radoux, C.J. et. al., Identifying the Interactions that Determine Fragment Binding at Protein Hotspots J. Med. Chem. 2016, 59 (9), 4314-4325](dx.doi.org/10.1021/acs.jmedchem.5b01980)
Getting Started
===============
Although the Hotspots API is publicly available, it is dependant on the CSD
Python API - a commercial package.
If you are an academic user, it's likely your institution will have a license.
If you are unsure if you have a license or would like to enquire about
purchasing one, please contact support@ccdc.cam.ac.uk.
Please note, this is an academic project and we would therefore welcome
feedback, contributions and collaborations. If you have any queries regarding
this package please contact us (pcurran@ccdc.cam.ac.uk)!
Installation
============
1 Install CSDS 2020
----------------------
The CSDS is available from [here](https://www.ccdc.cam.ac.uk/support-and-resources/csdsdownloads/).
You will need your customer number and activation key. You must activate your license before proceeding.
2 Install GHECOM
-------------------
Ghecom is available from [here](https://pdbj.org/ghecom/download_src.html).
"The source code of the GHECOM is written in C, and developed and executed on
the linux environment (actually on the Fedora Core). For the installation,
you need the gcc compiler. If you do not want to use it, please change the
"Makefile" in the "src" directory."
Download the file ``ghecom-src-[date].tar.gz`` file.
tar zxvf ghecom-src-[date].tar.gz
cd src
make
NB: The executable will be located at the parent directory.
3 Create conda environment
------------------------------------------------
Download the environment.yml file from the github repositiory.
Open the file, and edit the file path to the your local ccdc conda channel
that was installed as part of your CSDS:
"file:///home/pcurran/CCDC/Python_API_2020/ccdc_conda_channel"
Save and close environment.yml.
Create conda environment using the environment.yml:
conda create -n hotspots -f environment.yml
Finally, there are a few environment variables to set:
$ export CSDHOME=/home/my_ccdc_software_dir/CCDC/CSD_2020
$ export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$CONDA_PREFIX/lib/python3.7/site-packages/ccdc/_lib:$LD_LIBRARY_PATH
$ export GHECOM_EXE=$PREFIX/ghecom_latest/ghecom
We recommend saving these within your conda environment. To do this, see `setup_environment.sh` shell script within
the hotspots repositiory. For more details on saving environment variables, see the
conda [documentation](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html).
4 Install Hotspots API
------------------------------------------------
Install Hotspots v1.0.3:
a) Latest stable release (recommended for most users):
conda activate hotspots
pip install hotspots
or
pip install https://github.com/prcurran/hotspots/archive/v1.0.3.zip
b) Very latest code
mkdir ./hotspots_code
cd hotspots_code
git clone git@github.com:prcurran/hotspots.git
conda activate hotspots
pip install ./hotspots
## Hotspots API Usage
---------------------
Start activating your Anaconda environment and setting some variables.
conda activate hotspots
export GHECOM_EXE=<path_to_GHECOM_executable>
export CSDHOME=<path_to_CSDS_installation>/CSD_2019
## Running a Calculation
---------------------
### Protein Preparation
The first step is to make sure your protein is correctly prepared for the
calculation. The structures should be protonated with small molecules and
waters removed. Any waters or small molecules left in the structure will
be included in the calculation.
One way to do this is to use the CSD Python API:
from ccdc.protein import Protein
prot = Protein.from_file('protein.pdb')
prot.remove_all_waters()
prot.add_hydrogens()
for l in prot.ligands:
prot.remove_ligand(l.identifier)
For best results, manually check proteins before submitting them for calculation.
### Calculating Fragment Hotspot Maps
---------------------
Once the protein is prepared, the `hotspots.calculation.Runner` object can be
used to perform the calculation:
from hotspots.calculation import Runner
runner = Runner()
# Only SuperStar jobs are parallelised (one job per processor). By default there are 3 jobs, when calculating charged interactions there are 5.
results = runner.from_protein(prot, nprocesses=3)
Alternatively, for a quick calculation, you can supply a PDB code and we will
prepare the protein as described above:
runner = Runner()
results = runner.from_pdb("1hcl", nprocesses=3)
## Reading and Writing Hotspots
----------------------------
### Writing
The `hotspots.hs_io` module handles the reading and writing of both `hotspots.calculation.results`
and `hotspots.best_volume.Extractor` objects. The output `.grd` files can become quite large,
but are highly compressible, therefore the results are written to a `.zip` archive by default,
along with a PyMOL run script to visualise the output.
from hotspots.hs_io import HotspotWriter
out_dir = "results/pdb1"
# Creates "results/pdb1/out.zip"
with HotspotWriter(out_dir) as writer:
writer.write(results)
### Reading
If you want to revisit the results of a previous calculation, you can load the
`out.zip` archive directly into a `hotspots.calculation.results` instance:
from hotspots.hs_io import HotspotReader
results = HotspotReader('results/pdb1/out.zip').read()
## Using the Output
---------------------
While Fragment Hotspot Maps provide a useful visual guide, the grid-based data
can be used in other SBDD analysis.
### Scoring
---------------------
One example is scoring atoms of either proteins or small molecules.
This can be done as follows:
from ccdc.protein import Protein
from ccdc.io import MoleculeReader, MoleculeWriter
from hotspots.calculation import Runner
r = Runner()
prot = Protein.from_file("1hcl.pdb") # prepared protein
hs = r.from_protein(prot)
# score molecule
mol = MoleculeReader("mol.mol2")
scored_mol = hs.score(mol)
with MoleculeWriter("score_mol.mol2") as w:
w.write(scored_mol)
# score protein
scored_prot = hs.score(hs.prot)
with MoleculeWriter("scored_prot.mol2") as w:
w.write(scored_prot)
To learn about other ways you can use the Hotspots API please see the examples
directory and read our API documentation.