Upload 3 files
Browse files- README.md +54 -0
- special_tokens_map.json +7 -0
- tokenizer_config.json +52 -0
README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ProfileBFN
|
| 2 |
+
Official implementation of ICLR 2025 ["ProfileBFN: Steering Protein Family Design through Profile Bayesian Flow"](https://openreview.net/forum?id=PSiijdQjNU¬eId=sRV2quHqPd).
|
| 3 |
+
|
| 4 |
+
## Environment
|
| 5 |
+
The environment is based on PyTorch 1.13. Follow the [official installation instructions](https://pytorch.org/get-started/previous-versions/) to set it up according to your CUDA version. Then, install the following packages:
|
| 6 |
+
|
| 7 |
+
```bash
|
| 8 |
+
pip install omegaconf hydra-core bitarray rdkit-pypi scipy lmdb numba scikit-learn
|
| 9 |
+
```
|
| 10 |
+
|
| 11 |
+
More detailed environment settings are located in env.yaml
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
-----
|
| 15 |
+
|
| 16 |
+
## Data
|
| 17 |
+
Data used for evaluating the model is already put in the `data` folder
|
| 18 |
+
|
| 19 |
+
---
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
## Checkpoints
|
| 23 |
+
We provide the pretrained checkpoint as [ProfileBFN_150M.ckpt](https://huggingface.co/hhhhhhh789/ProfileBFN_150M) and [ProfileBFN_650M.ckpt](https://huggingface.co/hhhhhhh789/ProfileBFN_650M), please download all files and set the CKPT_PATH to the corresponding directory.
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
## Sampling
|
| 27 |
+
`mkdir ./results` All Generation Results will be placed in such subdir.
|
| 28 |
+
|
| 29 |
+
Run `make sample_profile -f scripts.mk` to sample protein family based MSA. Note that inputs with inconsistent lengths would be automatically aligned.
|
| 30 |
+
|
| 31 |
+
Run `make sample_sequence -f scripts.mk` to sample protein family based on single protein sequence.
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
## Evaluation
|
| 35 |
+
### Evaluating generated protein family by CCMPRED
|
| 36 |
+
Clone [CCMPRED](https://github.com/jingjing-gong/contact_evaluation) repo in dir `test/ccmpred` and follow instructions as their README.
|
| 37 |
+
|
| 38 |
+
targets are generated sequence under `results/sample_profile` dir after the sampling process
|
| 39 |
+
```bash
|
| 40 |
+
cd test/ccmpred
|
| 41 |
+
docker build -f docker/Dockerfile -t exp/contact_evaluation .
|
| 42 |
+
CUDA_VISIBLE_DEVICES=4,5,6,7 ./scripts/run_evaluate.sh -i <input_dir> -o <output_dir>
|
| 43 |
+
```
|
| 44 |
+
|
| 45 |
+
|
| 46 |
+
## Citation
|
| 47 |
+
```bash
|
| 48 |
+
@article{gong2025steering,
|
| 49 |
+
title={Steering Protein Family Design through Profile Bayesian Flow},
|
| 50 |
+
author={Gong, Jingjing and Pei, Yu and Long, Siyu and Song, Yuxuan and Zhang, Zhe and Huang, Wenhao and Cao, Ziyao and Zhang, Shuyi and Zhou, Hao and Ma, Wei-Ying},
|
| 51 |
+
journal={arXiv preprint arXiv:2502.07671},
|
| 52 |
+
year={2025}
|
| 53 |
+
}
|
| 54 |
+
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"cls_token": "<s>",
|
| 3 |
+
"eos_token": "</s>",
|
| 4 |
+
"mask_token": "<mask>",
|
| 5 |
+
"pad_token": "<pad>",
|
| 6 |
+
"unk_token": "<unk>"
|
| 7 |
+
}
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"added_tokens_decoder": {
|
| 3 |
+
"0": {
|
| 4 |
+
"content": "<s>",
|
| 5 |
+
"lstrip": false,
|
| 6 |
+
"normalized": false,
|
| 7 |
+
"rstrip": false,
|
| 8 |
+
"single_word": false,
|
| 9 |
+
"special": true
|
| 10 |
+
},
|
| 11 |
+
"1": {
|
| 12 |
+
"content": "<pad>",
|
| 13 |
+
"lstrip": false,
|
| 14 |
+
"normalized": false,
|
| 15 |
+
"rstrip": false,
|
| 16 |
+
"single_word": false,
|
| 17 |
+
"special": true
|
| 18 |
+
},
|
| 19 |
+
"2": {
|
| 20 |
+
"content": "</s>",
|
| 21 |
+
"lstrip": false,
|
| 22 |
+
"normalized": false,
|
| 23 |
+
"rstrip": false,
|
| 24 |
+
"single_word": false,
|
| 25 |
+
"special": true
|
| 26 |
+
},
|
| 27 |
+
"3": {
|
| 28 |
+
"content": "<unk>",
|
| 29 |
+
"lstrip": false,
|
| 30 |
+
"normalized": false,
|
| 31 |
+
"rstrip": false,
|
| 32 |
+
"single_word": false,
|
| 33 |
+
"special": true
|
| 34 |
+
},
|
| 35 |
+
"32": {
|
| 36 |
+
"content": "<mask>",
|
| 37 |
+
"lstrip": false,
|
| 38 |
+
"normalized": false,
|
| 39 |
+
"rstrip": false,
|
| 40 |
+
"single_word": false,
|
| 41 |
+
"special": true
|
| 42 |
+
}
|
| 43 |
+
},
|
| 44 |
+
"clean_up_tokenization_spaces": true,
|
| 45 |
+
"cls_token": "<s>",
|
| 46 |
+
"eos_token": "</s>",
|
| 47 |
+
"mask_token": "<mask>",
|
| 48 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 49 |
+
"pad_token": "<pad>",
|
| 50 |
+
"tokenizer_class": "EsmTokenizer",
|
| 51 |
+
"unk_token": "<unk>"
|
| 52 |
+
}
|