Coder Social home page Coder Social logo

karmaloop's Introduction

KarmaLoop

Highly accurate and efficient deep learning paradigm for full-atom protein loop modeling with KarmaLoop

Contents

Overview

KarmaLoop is novel deep learning paradigm for fast and accurate full-atom protein loop modeling.
The framework consists of four main steps: creating Python environments, selecting pocket, generating graphs and loop modeling.

Environment

You can create a new environment by the following command

conda env create -f karmaloop_env.yml -n karmaloop
conda activate karmaloop

or you can download the conda-packed file, and then unzip it in ${anaconda install dir}/envs

${anaconda install dir} represents the dir where the anaconda is installed. For me, ${anaconda install dir}=/root/anaconda3 .

mkdir /root/anaconda3/envs/karmaloop
tar -xzvf karmaloop.tar.gz -C /root/anaconda3/envs/karmaloop
conda activate karmaloop

Demo & Reproduction

Assume that the project is at /root and therefore the project path is /root/KarmaLoop.

We provide a shell script to reproduce the loop modeling result reported in the manuscript. If you only want to reproduce the result, simply run the following command:

cd /root/KarmaLoop
# modify the reproduciton.sh file to ensure the ${project_dir} is your project path, default is /root/KarmaLoop
bash reproduction.sh

Tutorial & Usage

If you wonder how to use this tool, follow the steps below.

1. Preprocess protein data

The purpose of this step is to identify residues that are within a 12ร… radius of any loop atom and use them as the pocket of the protein. The pocket file ({PDBID}_{ChainID}_{LoopStartResIdx}_{LoopEndResIdx}_12A.pdb) will also be saved on the pockets_dir.

cd /root/KarmaLoop/utils 
python -u pre_processing.py 
--protein_file_dir ~/your/raw/pdb/path 
--pocket_file_dir ~/dst/pocket/path 
--csv_file ~/your/raw/csv/path/

Example for the single demo:

cd /root/KarmaLoop/utils 
python -u pre_processing.py --protein_file_dir /root/KarmaLoop/example/single_example/raw --pocket_file_dir /root/KarmaLoop/example/single_example/pocket --csv_file /root/KarmaLoop/example/single_example/single_example.csv

Example for CASP15:

cd /root/KarmaLoop/utils 
python -u pre_processing.py --protein_file_dir /root/KarmaLoop/example/CASP15/raw --pocket_file_dir /root/KarmaLoop/example/CASP15/pocket --csv_file /root/KarmaLoop/example/CASP15/CASP15.csv

2. Generate graphs based on protein-loop complexes

This step will generate graphs for protein-loop complexes and save them (*.dgl) to graph_file_dir.

cd /root/KarmaLoop/utils 
python -u generate_graph.py 
--protein_file_dir ~/your/raw/pdb/path 
--pocket_file_dir ~/generated/pocket/path 
--graph_file_dir ~/the/directory/for/saving/graph 

Example for the single demo:

cd /root/KarmaLoop/utils 
python -u generate_graph.py --protein_file_dir /root/KarmaLoop/example/single_example/raw --pocket_file_dir /root/KarmaLoop/example/single_example/pocket --graph_file_dir /root/KarmaLoop/example/single_example/graph 

Example for CASP15:

cd /root/KarmaLoop/utils 
python -u generate_graph.py --protein_file_dir /root/KarmaLoop/example/CASP15/raw --pocket_file_dir /root/KarmaLoop/example/CASP15/pocket --graph_file_dir /root/KarmaLoop/example/CASP15/graph 

3. loop modeling

This step will perform loop modelling based on the graphs. (finished in about several minutes)

cd /root/KarmaLoop/utils 
python -u loop_generating.py
--graph_file_dir ~/the/directory/for/saving/graph 
--out_dir ~/path/for/recording/loop_conformation & confidence score 
--multi_conformation whether predict miltiple loop conformations
--save_file whether save predicted loop conformations
--scoring whether calculate confidence score
--batch_size 64 
--random_seed 2023 

Example for the single demo:

cd /root/KarmaLoop/utils 
python -u loop_generating.py --graph_file_dir /root/KarmaLoop/example/single_example/graph --out_dir /root/KarmaLoop/example/single_example/test_result --batch_size 64 --random_seed 2023 --multi_conformation --scoring --save_file 

Example for CASP15:

cd /root/KarmaLoop/utils 
python -u loop_generating.py --graph_file_dir /root/KarmaLoop/example/CASP15/graph --model_file /root/KarmaLoop/model_pkls/karmaloop.pkl --out_dir /root/KarmaLoop/example/CASP15/test_result --batch_size 64 --random_seed 2023 --scoring --save_file 

4. Post-processing (Optional)

Using OpenMM to optimize the predicted conformations of protein loop, KarmaLoop modeled loop file should be taken as input.

It may occurs 'There is no registered Platform called "CUDA"' error you can try conda install -c omnia openmm cudatoolkit=YOUR_CUDA_VERSION to fix it. For me, the CUDA_VERSION is 11.3. It works for me.

cd /root/KarmaLoop/utils
python -u post_processing.py 
--modeled_loop_dir ~/path/for/recording/loop_conformation
--output_dir ~/path/for/recording/post-processing/loop_conformation

Example for the single demo:

cd /root/KarmaLoop/utils 
python -u post_processing.py --modeled_loop_dir /root/KarmaLoop/example/single_example/test_result/0 --output_dir /root/KarmaLoop/example/single_example/test_result/post

Example for CASP15:

cd /root/KarmaLoop/utils 
python -u post_processing.py --modeled_loop_dir /root/KarmaLoop/example/CASP15/test_result/0 --output_dir /root/KarmaLoop/example/CASP15/test_result/post

\

karmaloop's People

Contributors

karma211225 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

karmaloop's Issues

mat1 and mat2 shapes

Just followed instruction for single_example but got the following error, could you please help?

python -u loop_generating.py --graph_file_dir ../example/single_example/graph --out_dir ../example/single_example/test_result --batch_size 64 --random_seed 2023 --multi_conformation --scoring --save_file

########### Start modelling loop ###########
pdb_ids: 3

load model

0%| | 0/1 [00:01<?, ?it/s]
Traceback (most recent call last):
File "/home/antibody/KarmaLoop-main/utils/loop_generating.py", line 121, in
pos_pred, mdn_score = model.module.modelling_loop(data, scoring=args.scoring, recycle_num=3, dist_threhold=5)
File "/home/antibody/KarmaLoop-main/architecture/Net_architecture.py", line 175, in modelling_loop
pro_node_s, loop_node_s = self.encoding(data)
File "/home/antibody/KarmaLoop-main/architecture/Net_architecture.py", line 78, in encoding
proatom_node_s = self.loop_encoder(data['protein_atom'].node_s.to(torch.float32), data['protein_atom', 'pa2pa', 'protein_atom'].edge_s.to(torch.float32), data['protein_atom', 'pa2pa', 'protein_atom'].edge_index)
File "/home/miniconda/envs/gpu9/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/home/antibody/KarmaLoop-main/architecture/GraphTransformer_Block.py", line 428, in forward
edge_feats = self.edge_encoder(edge_s)
File "/home/miniconda/envs/gpu9/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/home/miniconda/envs/gpu9/lib/python3.9/site-packages/torch/nn/modules/linear.py", line 114, in forward
return F.linear(input, self.weight, self.bias)
RuntimeError: mat1 and mat2 shapes cannot be multiplied (4984x22 and 20x128)

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.