File size: 10,519 Bytes
40e5504
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
324
325
326
327
328
329
330
---
license: mit
language:
- en
- zh
tags:
- OneScience
- life-science
- protein
- binding-site
- GPSite
frameworks: PyTorch
---

<p align="center">
  <strong>
    <span style="font-size: 30px;">GPSite</span>
  </strong>
</p>

# Model Introduction

GPSite is a geometry-aware multitask network for protein binding-site prediction. It simultaneously predicts potential binding sites between protein residues and DNA, RNA, peptides, proteins, ATP, heme (HEM), and various metal ions. The method uses sequence representations generated by a pretrained protein language model and predicted structures to perform binding-site prediction, without relying on MSA or experimentally resolved protein structures.

Paper:

> **Genome-scale annotation of protein binding sites via language model and geometric deep learning**  
> https://doi.org/10.7554/eLife.93695

# Model Description

GPSite takes a protein FASTA sequence as input. The complete inference workflow first uses ESMFold to predict the protein structure and ProtT5-XL-UniRef50 to extract sequence representations. It then combines the predicted structure with DSSP features to construct residue-level geometric representations, and finally uses the GPSite graph neural network to output residue-level prediction scores for multiple binding-site types simultaneously.

# Use Cases

| Use case | Description |
| --- | --- |
| Protein binding-site prediction | Predict residue-level binding-site scores from a protein sequence |
| Multi-ligand binding analysis | Simultaneously predict binding sites for DNA, RNA, peptides, proteins, ATP, HEM, and various metal ions |
| Prediction without an experimental structure | Use ESMFold to predict the structure without providing an experimentally resolved structure in advance |
| Batch protein sequence analysis | Perform structure prediction, feature extraction, and site prediction on multiple protein sequences in a FASTA file |

# Usage

## 1. Using OneCode

Experience intelligent one-click AI4S programming in the OneCode online environment:

[Try intelligent one-click AI4S programming](https://web-2069360198568017922-iaaj.ksai.scnet.cn:58043/home)

## 2. Manual Installation and Usage

**Hardware Requirements**

- A GPU/DCU is recommended for running GPSite because ESMFold structure prediction in the complete workflow requires substantial computation and GPU memory.
- GPSite supports CPU execution, but the structure prediction stage is significantly slower without a GPU/DCU.

### Set Up the Runtime Environment

#### DCU Environment

```bash
# Activate DTK and CONDA first
conda create -n onescience311 python=3.11 -y
conda activate onescience311

# Install with uv support
pip install onescience[bio] \
  -i http://mirrors.onescience.ai:3141/pypi/simple/ \
  --trusted-host mirrors.onescience.ai
```

#### Environment Notes
- If you encounter missing dependencies or version incompatibilities during execution, refer to the dependency versions specified in `requirements.txt` and install or adjust the relevant dependencies as needed.
- The following versions are recommended for ProtTrans-related dependencies:

```bash
python -m pip install \
  "transformers==4.30.1" \
  "tokenizers==0.13.3" \
  "sentencepiece==0.1.99"
```

- ESMFold-related dependencies can be installed as follows:

```bash
python -m pip install "fair-esm[esmfold]"
python -m pip install modelcif==0.7
```

- GPSite also requires `dllogger`. If online installation fails, download the `dllogger` source code and install it locally from the source directory:

```bash
python -m pip install /path/to/dllogger-master
```

### Prepare Weights and Models

Complete GPSite inference depends not only on the GPSite weights in this repository, but also on ProtT5, ESMFold, and ESM-2 weights. Complete the following preparations before first use.

#### 1) GPSite Model Weights

The `model/` directory in the GPSite repository contains five trained weights:

```text
model/
β”œβ”€β”€ fold0.ckpt
β”œβ”€β”€ fold1.ckpt
β”œβ”€β”€ fold2.ckpt
β”œβ”€β”€ fold3.ckpt
└── fold4.ckpt
```

During inference, the five models above are loaded in sequence and their prediction results are averaged. The complete model package downloaded from Hugging Face should already include these weights required for GPSite inference, so separate downloads are normally unnecessary.

#### 2) ProtT5-XL-UniRef50

GPSite uses ProtT5-XL-UniRef50 to extract protein sequence representations. The model can be downloaded from:

```text
https://zenodo.org/record/4644188
```

After downloading the model, make sure that `PROTTRANS_DIR` in `scripts/run_infer.sh` points to the actual model directory. `scripts/predict.py` reads this path through the `PROTTRANS_PATH` environment variable.

#### 3) ESMFold and ESM-2

The official version of GPSite automatically downloads ESMFold and ESM-2 on the first run. If the runtime environment has limited network access or is offline, prepare the local weights in advance. The recommended location is:

```text
weight/checkpoints/
β”œβ”€β”€ esmfold_3B_v1.pt
β”œβ”€β”€ esm2_t36_3B_UR50D.pt
└── esm2_t36_3B_UR50D-contact-regression.pt
```

Also make sure that `ESMFOLD_HUB_DIR` in `scripts/run_infer.sh` points to the `weight` directory within the project.

ESMFold v1 also loads ESM-2 internally, so at least the following files are required:

```text
esmfold_3B_v1.pt
esm2_t36_3B_UR50D.pt
```
It is also recommended to keep:

```text
esm2_t36_3B_UR50D-contact-regression.pt
```

#### 4) DSSP

GPSite calls the following during structural feature extraction:

```text
scripts/feature_extraction/mkdssp
```

Before first use, make sure that this file has execute permission:

```bash
chmod +x scripts/feature_extraction/mkdssp
```

## 3. Quick Start

### Download the Model Package

```bash
hf download OneScience-Group/GPSite --local-dir ./GPSite
cd GPSite
```
- Complete GPSite inference additionally depends on **ProtT5-XL-UniRef50, ESMFold, ESM-2, and OpenFold**. Follow "Prepare Weights and Models" to install the relevant models, weights, and OpenFold first.
- GPSite additionally depends on OpenFold. OpenFold must be installed in the current Python/Conda environment; its source code does not need to remain in the project directory. To install from source, download and extract the OpenFold source code, then run the following in the source directory:

```bash
python3 setup.py install
```

# Example Data

The official GPSite example input is located at:

```text
conf/example/demo.fa
```

The input uses the standard FASTA format:

```text
>protein_id
MSEQUENCE...
```

GPSite automatically creates an output subdirectory based on the FASTA filename. For example, if the input is `conf/example/demo.fa`, the output will be located at:

```text
<OUTPUT_DIR>/demo/
```

# Inference

Before running inference, enter the GPSite project root and make sure that the model paths in `scripts/run_infer.sh` have been changed to the actual paths in your environment:

```bash
cd /path/to/GPSite
```

In particular, check:

```bash
PROTTRANS_DIR="/path/to/prot_t5_xl_uniref50"
ESMFOLD_HUB_DIR="/path/to/weight"
```

The basic usage of the inference script is:

```bash
bash scripts/run_infer.sh <GPU_ID> <FASTA_PATH> <OUTPUT_DIR>
```

Arguments:

| Argument | Description |
| --- | --- |
| `<GPU_ID>` | GPU index to use; in a single-GPU environment, this is typically `0` |
| `<FASTA_PATH>` | Path to the input FASTA file; a relative or absolute path can be used |
| `<OUTPUT_DIR>` | Root output directory; the script automatically creates a subdirectory based on the FASTA filename |

Run the demo:

```bash
bash scripts/run_infer.sh 0 ./conf/example/demo.fa ./results/
```

The command above reads `conf/example/demo.fa` and generates intermediate files and final prediction results under `./results/demo/`.

Run your own FASTA file:

```bash
bash scripts/run_infer.sh 0 /path/to/your.fa ./results/
```

For example, if the input file is `/public/home/user/test.fa` and the root output directory is `./results/`, the final prediction results are typically located at:

```text
./results/test/pred/
```

During inference, GPSite sequentially performs ESMFold structure prediction, ProtT5 sequence representation extraction, DSSP structural feature extraction, and prediction with the five GPSite models. When the process completes successfully, the terminal log should contain messages similar to:

```text
Feature extraction is done
Prediction is done
Results are saved in <OUTPUT_DIR>/<FASTA_NAME>/pred/
```

## Inference Workflow

The complete inference workflow is:

```text
FASTA input
  ↓
ESMFold structure prediction
  ↓
ProtT5 sequence representation extraction
  ↓
PDB / DSSP / geometric feature processing
  ↓
GPSite five-model inference
  ↓
Average the outputs of the five models
  ↓
Residue-level scores for 10 binding-site types
```

# Output Description

Assuming that the input file is `demo.fa` and the root output directory is `./results/`, the final prediction results are located at:

```text
./results/demo/pred/
```

The main results include:

```text
pred/
β”œβ”€β”€ overview.txt
β”œβ”€β”€ A0A009IHW8.txt
└── A0A011QK89.txt
```

The files are:

- `overview.txt`: Summary of the overall prediction results for all input proteins.
- `<Protein_ID>.txt`: Residue-level prediction results for the corresponding protein.

The residue-level prediction files contain scores for the following 10 binding-site types:

```text
DNA
RNA
Peptide
Protein
ATP
HEM
ZN
CA
MG
MN
```

According to the official GPSite documentation, residues with normalized prediction scores greater than `0.5` can be considered predicted binding sites.

# Official OneScience Information

| Platform | Main OneScience repository | Skills repository |
| --- | --- | --- |
| Gitee | https://gitee.com/onescience-ai/onescience | https://gitee.com/onescience-ai/oneskills |
| GitHub | https://github.com/onescience-ai/OneScience | https://github.com/onescience-ai/oneskills |


# Citation and License

- Original GPSite paper: [Genome-scale annotation of protein binding sites via language model and geometric deep learning](https://doi.org/10.7554/eLife.93695).
- The official GPSite source code is released under the MIT License; see `LICENSE` in the repository root.
- If you use this repository in research, we recommend citing the original GPSite paper and the relevant OneScience project information. If you use external models such as ESMFold or ProtT5, also include citations as required by the respective projects.