Skip to content

A bi-directional attention neural network for compound–protein interaction and binding affinity prediction.

Notifications You must be signed in to change notification settings

CSUBioGroup/BACPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BACPI

BACPI: a bi-directional attention neural network for compound-protein interaction and binding affinity prediction

Requirements

numpy==1.19.1

pandas==1.0.5

rdkit==2009.Q1-1

scikit_learn==1.0.2

scipy==1.5.0

torch==1.6.0

Example usage

1. Compound–protein interaction prediction

This is a binary classification task, which aim to predict whether there is an interaction between the compound and the protein or not.

# Run the commandline
python main.py -task interaction -dataset human

2. Compound–protein binding affinity prediction

This is a regression task, which aim to predict a continuous value named binding affinity that reflects how tightly the compound binds to a particular target protein.

# Run the commandline
python main.py -task affinity -dataset Kd

3. Specify hyperparameters

There are many hyperparameters of the model (i.g. learning rate, batch size, epochs, step size, weight decay, hidden size, window size, layer size). For more information, see source code of main.py.

# Run the commandline
python main.py -task affinity -dataset Kd -lr 0.001 -batch_size 64 -num_epochs 15

4. Run on your datasets

NOTICE : Your dataset should be divided into train and test sets

Please prepare train.txt and test.txt file, and store them in the corresponding paths ('./data/interaction/dataset_name/' for CPI prediction and './data/affinity/dataset_name/' for affinity prediction). Each line in the data file contains the SMILES of the compound, the amino acid sequence of the protein, and the predicted label (interaction label: 0 or 1, affinity label: a continuous value), separated by commas(,). The format of the data file is as follows:

# interaction dataset
CC(C)C1=NN2C=CC=CC2=C1C(=O)C(C)C,MVDEDKKSGTRVFKKTSPNGKITTYLGKRDFIDRGDYVDLIDGMVLIDEEYIKDNRKVTAHLLAAFRYGREDLDVLGLTFRKDLISETFQVYPQTDKSISRPLSRLQERLKRKLGANAFPFWFEVAPKSASSVTLQPAPGDTGKPCGVDYELKTFVAVTDGSSGEKPKKSALSNTVRLAIRKLTYAPFESRPQPMVDVSKYFMMSSGLLHMEVSLDKEMYYHGESISVNVHIQNNSNKTVKKLKIYIIQVADICLFTTASYSCEVARIESNEGFPVGPG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TVDKKKYAAELHLVHWNTKYGDFGKAVQQPDGLAVLGIFLKVGSAKPGLQKVVDVLDSIKTKGKSADFTNFDPRGLLPESLDYWTYPGSLTTPPLLECVTWIVLKEPISVSSEQVLKFRKLNFNGEGEPEELMVDNWRPAQPLKNRQIKASFK,9.080921907623926
...
# Run the corresponding commandline according to the prediction task

# Compound–protein interaction prediction
python main.py -task interaction -dataset dataset_name

# Compound–protein binding affinity prediction
python main.py -task interaction -dataset dataset_name

About

A bi-directional attention neural network for compound–protein interaction and binding affinity prediction.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages