Skip to main content

If you have any questions regarding the code/data, please contact Yufan Liu via andyalbert97@gmail.com.

CLAPE framework

This repo holds the code of CLAPE (Contrastive Learning And Pre-trained Encoder) framework for protein-ligands binding sites prediction. We provide 3 ligand-binding tasks including protein-DNA, protein-RNA, and antibody-antigen binding sites prediction, an we will also provide small molecules binding sites weight in the future (check CLAPE-SMB for reference).

Usage

CLAPE is primarily dependent on a large-scale pre-trained protein language model ProtBert implemented using HuggingFace's Transformers and PyTorch. Please install the dependencies in advance, or create a conda/mamba envrionment using provided environment file. If you are using CLAPE-SMB, please install ESM.

wget https://github.com/YAndrewL/CLAPE/blob/main/environment.yaml
conda env create -f environment.yaml
conda activate clape 

1. Python package from pypi

We provide a python package for predicting ligand-binding sites of given protein sequences in FASTA format. Here we provide a sample file, and please use CLAPE as following steps, taking DNA-binding sites prediction as an example:

# download model weights and example file
wget https://github.com/YAndrewL/CLAPE/blob/main/example.fa
wget https://github.com/YAndrewL/CLAPE/blob/main/weights/DNA.pth
pip install clape  # install clape from pypi
# package usage example
from clape import Clape

model = Clape(model_path="model_path", ligand="DNA")
results = model.predict(input_file="example.fa")

You can set keep_score to True to keep the predicted score from model, and use switch_ligand to change to another binding site prediction task.

2. Command line tools

We also provide a command line tool, which will be installed along the python package, you may use as below:

clape --input example.fa --output out.txt --ligand DNA --model /path/to/downloaded/model

This command will first load the pre-trained models, users can specify the downloading directory using the --cache parameter.

Some parameters are described as follows:

Parameters Descriptions
--help Show the help doc.
--ligand Specify the ligand for prediction, DNA, RNA, and AB (antibody) are supported now.
--threshold Specify the threshold for identifying the binding site, the value needs to be between 0 and 1, default: 0.5.
--input The path of the input file in FASTA format.
--output The path of the output file, the first and the second line are the same as the input file, and the third line is the prediction result.
--cache The path for saving the pre-trained parameters, default: protbert.
--model The path for trained backbone models.

Citation

If you find our work helpful, please kindly cite the BibTex as following:

@article{10.1093/bib/bbad488,
    author = {Liu, Yufan and Tian, Boxue},
    title = "{Protein–DNA binding sites prediction based on pre-trained protein language model and contrastive learning}",
    journal = {Briefings in Bioinformatics},
    volume = {25},
    number = {1},
    pages = {bbad488},
    year = {2024},
    month = {01},
    abstract = "{Protein–DNA interaction is critical for life activities such as replication, transcription and splicing. Identifying protein–DNA binding residues is essential for modeling their interaction and downstream studies. However, developing accurate and efficient computational methods for this task remains challenging. Improvements in this area have the potential to drive novel applications in biotechnology and drug design. In this study, we propose a novel approach called Contrastive Learning And Pre-trained Encoder (CLAPE), which combines a pre-trained protein language model and the contrastive learning method to predict DNA binding residues. We trained the CLAPE-DB model on the protein–DNA binding sites dataset and evaluated the model performance and generalization ability through various experiments. The results showed that the area under ROC curve values of the CLAPE-DB model on the two benchmark datasets reached 0.871 and 0.881, respectively, indicating superior performance compared to other existing models. CLAPE-DB showed better generalization ability and was specific to DNA-binding sites. In addition, we trained CLAPE on different protein–ligand binding sites datasets, demonstrating that CLAPE is a general framework for binding sites prediction. To facilitate the scientific community, the benchmark datasets and codes are freely available at https://github.com/YAndrewL/clape.}",
    issn = {1477-4054},
    doi = {10.1093/bib/bbad488},
    url = {https://doi.org/10.1093/bib/bbad488},
    eprint = {https://academic.oup.com/bib/article-pdf/25/1/bbad488/55381199/bbad488.pdf},
}

Update

  • [Aug. 2024] CLAPE can be used as a python package now, please check clape in pypi.

  • [Mar. 2024] The training code is released with CLAPE-SMB, please check this repo for reference.

  • [Jan. 2024] Our paper is publised in Briefings in Bioinformatics, please check the online version.

Metadata

Release files for clape 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for clape 0.0.3
File Size Uploaded
clape-0.0.3.tar.gz 10.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for clape 0.0.3
File Interpreter ABI Platform
clape-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 21.4 kB

Release files / clape-0.0.3.tar.gz

Download URL clape-0.0.3.tar.gz
Size 10.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f1dd3c73cb2e62a50c83d40eba306fa058459ac0559ff3b9d61db9d015f00ea9
BLAKE2b-256 checksum
How to use checksums
f44fa727733a0ececf600e069c65c34272001f4c2defc2f3be57a411e128e5f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.9

Release files / clape-0.0.3-py3-none-any.whl

Download URL clape-0.0.3-py3-none-any.whl
Size 10.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9b376f3c8e27e05b835a152895721af60df942cc434063ea88a2da524903d97a
BLAKE2b-256 checksum
How to use checksums
0a30b612f871fe4265eb14dfecee2cfe574c4bafd36793b7866fba3c4d172ebe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.9

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page