PSP - 蛋白质与蛋白质的扩散对接 DiffDock-PP 算法

2023-12-21 03:28

本文主要是介绍PSP - 蛋白质与蛋白质的扩散对接 DiffDock-PP 算法,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

欢迎关注我的CSDN:https://spike.blog.csdn.net/
本文地址:https://spike.blog.csdn.net/article/details/135115528

DiffDock-PP

DiffDock-PP is a new approach to rigid-body protein-protein docking that is based on a diffusion generative model that learns to translate and rotate unbound protein structures into their bound conformations, and a confidence model that learns to rank different poses generated by the score model and select the best one.

DiffDock-PP 是一种新的刚体蛋白质-蛋白质对接方法,基于扩散生成模型,该模型学习将未结合的蛋白质结构翻译和旋转为其结合构象,基于置信模型,该模型学习对评分模型生成的不同姿势,进行排序并选择最佳姿势。

  • Paper:DiffDock-PP: Rigid Protein-Protein Docking with Diffusion Models
  • Github:https://github.com/ketatam/DiffDock-PP

算法整体思路与 DiffDock 接近,Paper:DiffDock: Diffusion Steps, Twists, and Turns for Molecular Docking

Conda 环境配置:

conda create -n diffdock_pp python=3.10.8
conda activate diffdock_ppconda install pytorch=1.13.0 pytorch-cuda=11.6 -c pytorch -c nvidia

验证 PyTorch 是否安装成功:

import torch
print(torch.__version__)  # 1.13.0
print(torch.cuda.is_available())  # True

安装其他包:

pip install --no-cache-dir  torch-scatter==2.0.9 torch-sparse==0.6.15 torch-cluster torch-spline-conv torch-geometric -f https://data.pyg.org/whl/torch-1.13.0+cu116.htmlpip install numpy dill tqdm pyyaml pandas biopandas scikit-learn biopython e3nn wandb tensorboard tensorboardX matplotlib

下载数据,具体数据路径 datasets/DIPS/pairs_pruned,即:

bypy downfile /psp_data/diffdock_pp/DIPS.zip DIPS.zip

具体使用位于 src/inference.sh,参考 dips_esm_inference.yaml

 data:dataset: dipsdata_file: datasets/DIPS/data_file_100_test.csvdata_path: datasets/DIPS/pairs_pruned
...

其中,数据文件 data_file_100_test.csv,即:

path,split
eb/1ebo.pdb2_1.dill,test
dm/3dmp.pdb3_2.dill,test
kq/1kq1.pdb1_1.dill,test
b2/2b24.pdb1_8.dill,test
cf/3cf0.pdb1_6.dill,test
...

还需要下载 ESM 的 650M 模型,位于 torchhub/checkpoints,否则下载很慢,即:

esm2_t33_650M_UR50D-contact-regression.pt
esm2_t33_650M_UR50D.pt

其中数据类型是 dill 类型,PDB 转换成 dill 类型,参考 https://github.com/octavian-ganea/equidock_public#dips-data

运行推理脚本:

sh src/inference.sh

其中,在运行时,在 src/geom_utils/so3.py 中,需要预处理 npy ,耗时较长,即:

.so3_cdf_vals2.npy
.so3_exp_score_norms2.npy
.so3_omegas_array2.npy
.so3_score_norms2.npy

运行日志:

SCORE_MODEL_PATH: checkpoints/large_model_dips/fold_0/
CONFIDENCE_MODEL_PATH: checkpoints/large_model_dips/fold_0/
SAVE_PATH: ckpts/test_large_model_dips
09:50:16 Starting Inference
data loading: 100%|| 100/100 [00:00<00:00, 561486
09:50:18 Computing ESM embeddings
Using cache found in torchhub/facebookresearch_esm_main
ESM: 100%|██████████| 4/4 [00:10<00:00,  2.70s/it]
ESM: 100%|██████████| 4/4 [00:06<00:00,  1.61s/it]
09:50:50 finished tokenizing residues with ESM
09:50:50 finished tokenizing all inputs
09:50:50 100 entries loaded
09:50:50 finished loading raw data
09:50:50 running inference
09:50:50 finished creating data splits
miniconda3/envs/diffdock_pp/lib/python3.10/site-packages/torch/jit/_check.py:181: UserWarning: The TorchScript type system doesn't support instance-level annotations on empty non-base types in `__init__`. Instead, either 1) use a type annotation in the class body, or 2) wrap the type in `torch.jit.Attribute`.warnings.warn("The TorchScript type system doesn't support "
09:50:52 loaded model with kwargs: 
checkpoint checkpoints/large_model_dips/fold_0/model_best_338669_140_31.084_30.347.pth
09:50:52 loaded checkpoint from checkpoints/large_model_dips/fold_0/model_best_338669_140_31.084_30.347.pth
09:50:53 loaded model with kwargs: 
checkpoint checkpoints/confidence_model_dips/fold_0/model_best_0_6_0.241_0.887.pth
09:50:53 loaded checkpoint from checkpoints/confidence_model_dips/fold_0/model_best_0_6_0.241_0.887.pth
09:50:53 finished loading model
args.temp_sampling: 2.4390%|                                                                                                       | 0/100 [00:00<?, ?it/s]09:53:42 Completed 0 out of 40 steps
09:53:44 Completed 1 out of 40 steps
09:53:46 Completed 2 out of 40 steps
09:53:48 Completed 3 out of 40 steps
...

预测结果,1B26 Receptor 和 Ligand,即:
Img

NVCC Bug,参考 GitHub - Failed building wheel for torch-cluster:

      In file included from csrc/cuda/graclus_cuda.cu:3:0:diffdock_pp/lib/python3.10/site-packages/torch/include/ATen/cuda/CUDAContext.h:10:10: fatal error: cusolverDn.h: No such file or directory#include <cusolverDn.h>^~~~~~~~~~~~~~compilation terminated.error: command 'diffdock_pp/bin/nvcc' failed with exit code 1[end of output]note: This error originates from a subprocess, and is likely not a problem with pip.ERROR: Failed building wheel for torch-clusterRunning setup.py clean for torch-cluster
Failed to build torch-cluster
ERROR: Could not build wheels for torch-cluster, which is required to install pyproject.toml-based projects

解决方案,参考 [BUG] fatal error: cusolverDn.h: No such file or directory:

export PATH=/usr/local/cuda/bin:$PATH

这篇关于PSP - 蛋白质与蛋白质的扩散对接 DiffDock-PP 算法的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/518489

相关文章

openCV中KNN算法的实现

《openCV中KNN算法的实现》KNN算法是一种简单且常用的分类算法,本文主要介绍了openCV中KNN算法的实现,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的... 目录KNN算法流程使用OpenCV实现KNNOpenCV 是一个开源的跨平台计算机视觉库,它提供了各

springboot+dubbo实现时间轮算法

《springboot+dubbo实现时间轮算法》时间轮是一种高效利用线程资源进行批量化调度的算法,本文主要介绍了springboot+dubbo实现时间轮算法,文中通过示例代码介绍的非常详细,对大家... 目录前言一、参数说明二、具体实现1、HashedwheelTimer2、createWheel3、n

SpringBoot实现MD5加盐算法的示例代码

《SpringBoot实现MD5加盐算法的示例代码》加盐算法是一种用于增强密码安全性的技术,本文主要介绍了SpringBoot实现MD5加盐算法的示例代码,文中通过示例代码介绍的非常详细,对大家的学习... 目录一、什么是加盐算法二、如何实现加盐算法2.1 加盐算法代码实现2.2 注册页面中进行密码加盐2.

Java时间轮调度算法的代码实现

《Java时间轮调度算法的代码实现》时间轮是一种高效的定时调度算法,主要用于管理延时任务或周期性任务,它通过一个环形数组(时间轮)和指针来实现,将大量定时任务分摊到固定的时间槽中,极大地降低了时间复杂... 目录1、简述2、时间轮的原理3. 时间轮的实现步骤3.1 定义时间槽3.2 定义时间轮3.3 使用时

如何用java对接微信小程序下单后的发货接口

《如何用java对接微信小程序下单后的发货接口》:本文主要介绍在微信小程序后台实现发货通知的步骤,包括获取Access_token、使用RestTemplate调用发货接口、处理AccessTok... 目录配置参数 调用代码获取Access_token调用发货的接口类注意点总结配置参数 首先需要获取Ac

如何通过Golang的container/list实现LRU缓存算法

《如何通过Golang的container/list实现LRU缓存算法》文章介绍了Go语言中container/list包实现的双向链表,并探讨了如何使用链表实现LRU缓存,LRU缓存通过维护一个双向... 目录力扣:146. LRU 缓存主要结构 List 和 Element常用方法1. 初始化链表2.

golang字符串匹配算法解读

《golang字符串匹配算法解读》文章介绍了字符串匹配算法的原理,特别是Knuth-Morris-Pratt(KMP)算法,该算法通过构建模式串的前缀表来减少匹配时的不必要的字符比较,从而提高效率,在... 目录简介KMP实现代码总结简介字符串匹配算法主要用于在一个较长的文本串中查找一个较短的字符串(称为

通俗易懂的Java常见限流算法具体实现

《通俗易懂的Java常见限流算法具体实现》:本文主要介绍Java常见限流算法具体实现的相关资料,包括漏桶算法、令牌桶算法、Nginx限流和Redis+Lua限流的实现原理和具体步骤,并比较了它们的... 目录一、漏桶算法1.漏桶算法的思想和原理2.具体实现二、令牌桶算法1.令牌桶算法流程:2.具体实现2.1

Python中的随机森林算法与实战

《Python中的随机森林算法与实战》本文详细介绍了随机森林算法,包括其原理、实现步骤、分类和回归案例,并讨论了其优点和缺点,通过面向对象编程实现了一个简单的随机森林模型,并应用于鸢尾花分类和波士顿房... 目录1、随机森林算法概述2、随机森林的原理3、实现步骤4、分类案例:使用随机森林预测鸢尾花品种4.1

不懂推荐算法也能设计推荐系统

本文以商业化应用推荐为例,告诉我们不懂推荐算法的产品,也能从产品侧出发, 设计出一款不错的推荐系统。 相信很多新手产品,看到算法二字,多是懵圈的。 什么排序算法、最短路径等都是相对传统的算法(注:传统是指科班出身的产品都会接触过)。但对于推荐算法,多数产品对着网上搜到的资源,都会无从下手。特别当某些推荐算法 和 “AI”扯上关系后,更是加大了理解的难度。 但,不了解推荐算法,就无法做推荐系