Giter Site home page Giter Site logo

bacpi's Introduction

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,MVDEDKKSGTRVFKKTSPNGKITTYLGKRDFIDRGDYVDLIDGMVLIDEEYIKDNRKVTAHLLAAFRYGREDLDVLGLTFRKDLISETFQVYPQTDKSISRPLSRLQERLKRKLGANAFPFWFEVAPKSASSVTLQPAPGDTGKPCGVDYELKTFVAVTDGSSGEKPKKSALSNTVRLAIRKLTYAPFESRPQPMVDVSKYFMMSSGLLHMEVSLDKEMYYHGESISVNVHIQNNSNKTVKKLKIYIIQVADICLFTTASYSCEVARIESNEGFPVGPGGTLSKVFAVCPLLSNNKDKRGLALDGQLKHEDTNLASSTILDSKTSKESLGIVVQYRVKVRAVLGPLNGELFAELPFTLTHSKPPESPERTDRGLPSIEATNGSEPVDIDLIQLHEELE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VLKFRKLNFNGEGEPEELMVDNWRPAQPLKNRQIKASFK,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

bacpi's People

Contributors

zhanglilu avatar luke037 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.