gnina分子对接

type
status
date
slug
summary
tags
category
icon
password
分子对接+卷积神经网络打分
使用卷积神经网络(CNN)对对接生成的姿势(pose)进行打分,预测结合亲和力(affinity)和姿势准确性。vina似乎必须用pdbqt格式,所有必须转成pdbqt格式,而gnina支持sdf,pdb,smiles等,不需要自己转,原理还是因为GNINA 使用 OpenBabel 处理输入,因此支持 OpenBabel 的所有格式。

1. 安装依赖库文件

2. 安装openbabel3

配置环境变量
测试

3. libmolgrid编译安装

进入虚拟环境
配置libmolgrid环境变量

4. gnina编译安装

又下载了libtorch(此处省略)
总的环境变量
 

如何批量操作实践

加氢

针对受体蛋白,gnina不会自动添加氢原子,因为蛋白结构复杂,氢原子位置依赖pH值、残基状态等。可以提前用H++进行处理,或者简单点直接用DS处理。 针对配体小分子,--addH 参数默认是True,所以默认给小分子添加氢原子,配体不用提前做加氢原子处理。
将文件夹中所有sdf文件名写入到一个txt中
批量处理脚本
赋予执行权限
创建输出文件夹。
修改路径。
执行

结果

成功结合在配体附近
notion image

rescore和refinement对比

参数 --cnn_scoring rescore结果:
Using random seed: 42
0% 10 20 30 40 50 60 70 80 90 100% |----|----|----|----|----|----|----|----|----|----|
| pose 0 | initial pose not within box
mode | affinity | intramol | CNN | CNN | (kcal/mol) | (kcal/mol) | pose score | affinity -----+------------+------------+------------+---------- 1 -8.95 -1.36 0.3060 7.056 2 -9.42 -0.19 0.2392 7.042 3 -9.59 -2.74 0.2094 6.785 4 -8.17 -0.23 0.1901 5.897 5 -7.35 0.38 0.1861 5.213 6 -6.81 0.03 0.1505 5.404 7 -6.87 -3.04 0.1377 5.374 8 -7.21 -1.69 0.1364 5.447 9 -6.84 -2.57 0.1318 5.237


参数--cnn_scoring refinement结果:
0% 10 20 30 40 50 60 70 80 90 100% |----|----|----|----|----|----|----|----|----|----|
| pose 0 | ligand outside box | pose 0 | ligand outside box | pose 0 | ligand outside box | pose 0 | ligand outside box | pose 0 | ligand outside box | pose 0 | ligand outside box | pose 0 | ligand outside box | pose 0 | ligand outside box | pose 0 | ligand outside box | pose 0 | ligand outside box | pose 0 | ligand outside box
 
mode | affinity | intramol | CNN | CNN | (kcal/mol) | (kcal/mol) | pose score | affinity -----+------------+------------+------------+---------- 1 -1.12 15.60 0.5259 6.345 2 -0.30 1.70 0.4251 6.568 3 4.34 0.65 0.4239 6.747 4 1.40 -2.03 0.3928 6.570 5 12.13 -0.86 0.3894 6.445 6 2.87 28.94 0.3588 6.656 7 0.43 -0.48 0.3558 6.772 8 -0.52 13.72 0.3056 6.255 9 -2.24 -2.47 0.2873 6.204
可见设置--cnn_scoring refinement有多个pose。设置--cnn_scoring rescore只有一个参数,速度快。


批量提取对接信息写入csv

全局对接

找蛋白中心
搜索框尺寸(--size_x/y/z):需要足够大以覆盖整个受体。可以通过计算受体坐标的最大和最小值来确定:
我全局对接,第一次结果和第二次不一样?太奇怪了。第一次好多对接在距离蛋白很远的位置。我严重怀疑结果有问题,就又对接一次,参数也没改,结果这次都接在了蛋白上。有说法。
第二天:有说法个屁,我傻逼了,用错了,对接中心选错了,难怪会飞。选对对接盒子之后,全局对接没有任何问题。

用VMD算集合中心

set sel [atomselect top all] set center [measure center $sel] puts "Protein geometric center: $center"

啊啊啊啊啊又发现个问题,github上usage直接就写了,全局对接,
To perform whole protein docking:
直接把对接盒子--autobox_ligand设置成蛋白rec.pdb即可,艹。

参数注释

常用参数
smina是vina的fork,gnina是smina的fork。
gnina的好多参数是和smina一样的,可以参考smina。
 

下载预编译的二进制文件

又发现一个问题,之前的clone源代码进行编译,没毛病,但并不是唯一的方法。原来还可以下载预编译的二进制文件,打包了很多依赖,也不用自己再下载,节约时间。其实人家在Installation也说了:We recommend that you use the pre-built binary unless you have significant experience building software on Linux, in which case building from source might result in an executable more optimized for your system.
如何判断是支持linux还是windows运行的:
Releases 页面的Assets 部分一般会说明,一般都是linux,除非exe或者特殊说明。
靠一个更简单的方法,直接在colab运行,人家已经弄好了An example colab notebook showing how to use gnina is available here. 适用小任务快速对接。不过批量处理还是建议在本地。
这个学习好使3天半,净时间可能10个小时,包括写这个博客的时间,不过现在再让我做可能10分钟就能跑,也是进步。。。。。。吧。

参考资料

GitHub:
 
python学习路线及反思氨基酸重编号
Loading...
Catalog
Article List
解决问题
蛋白模拟
小小编程
机器学习
要看文献
成长思考
自娱自乐