Bohrium
robot
新建

空间站广场

论文
Notebooks
比赛
课程
Apps
我的主页
我的Notebooks
我的论文库
我的足迹

我的工作空间

任务
节点
文件
数据集
镜像
项目
数据库
公开
Jupyter_Dock | 虚拟筛选
化学信息学
Jupyter_Dock
分子对接
化学信息学Jupyter_Dock分子对接
liyq@dp.tech
发布于 2023-06-15
4
AI4SCUP-CNS-BBB(v1)

🏃🏻 快速开始
您可以直接在 Bohrium Notebook 上执行此文档。首先,请点击位于界面顶部的 开始连接 按钮,然后选择 ubuntu:22.04-py3.10 镜像并选择合适的的机器配置,稍等片刻即可开始运行。

📖 来源
本 Notebook 来自 https://github.com/AngelRuizMoreno/Jupyter_Dock,由李亚奇 📨 修改搬运至 Bohrium Notebook。

代码
文本

🎯 本教程旨在快速掌握 Jupyter Dock 的用法:使用simna 或者 Ledock 进行批量的分子对接。

  • 一键运行,你可以快速在实践中检验你的想法。

  • 丰富完善的注释,对于入门者友好。

代码
文本

那么就让我们开始吧

代码
文本

首先,我们将配置运行环境,并下载所需要的文件以及赋予相关软件可执行权限

代码
文本
[1]
!mamba install -c conda-forge pymol-open-source py3dmol openbabel pdbfixer vina rdkit cython -y --quiet
代码
文本
[2]
!apt-get update && apt-get upgrade -y && apt-get install libgl1-mesa-glx -y
Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Get:2 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
Get:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [108 kB]
Fetched 337 kB in 2s (152 kB/s)                                  
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libgl1-mesa-glx is already the newest version (22.2.5-0ubuntu0.1~22.04.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
代码
文本
[ ]
!pip install git+https://github.com/chemosim-lab/ProLIF.git && pip install meeko
代码
文本
[1]
!git clone https://github.com/AngelRuizMoreno/Jupyter_Dock
Cloning into 'Jupyter_Dock'...
remote: Enumerating objects: 2177, done.
remote: Counting objects: 100% (57/57), done.
remote: Compressing objects: 100% (29/29), done.
remote: Total 2177 (delta 39), reused 30 (delta 28), pack-reused 2120
Receiving objects: 100% (2177/2177), 30.84 MiB | 4.26 MiB/s, done.
Resolving deltas: 100% (1664/1664), done.
Updating files: 100% (596/596), done.
代码
文本

由于ledock 和 lepro 存在使用期限的限制,因此下载最新的版本以替换老旧的文件

代码
文本
[2]
!wget http://www.lephar.com/download/lepro_linux_x86 -O ./Jupyter_Dock/bin/lepro_linux_x86
--2023-06-15 00:53:32--  http://www.lephar.com/download/lepro_linux_x86
Resolving ga.dp.tech (ga.dp.tech)... 10.255.255.41
Connecting to ga.dp.tech (ga.dp.tech)|10.255.255.41|:8118... connected.
Proxy request sent, awaiting response... 200 OK
Length: 393683 (384K) [application/octet-stream]
Saving to: ‘./Jupyter_Dock/bin/lepro_linux_x86’

./Jupyter_Dock/bin/ 100%[===================>] 384.46K  27.2KB/s    in 14s     

2023-06-15 00:53:47 (27.5 KB/s) - ‘./Jupyter_Dock/bin/lepro_linux_x86’ saved [393683/393683]

代码
文本
[3]
!wget http://www.lephar.com/download/ledock_linux_x86 -O ./Jupyter_Dock/bin/ledock_linux_x86
--2023-06-15 00:53:51--  http://www.lephar.com/download/ledock_linux_x86
Resolving ga.dp.tech (ga.dp.tech)... 10.255.255.41
Connecting to ga.dp.tech (ga.dp.tech)|10.255.255.41|:8118... connected.
Proxy request sent, awaiting response... 200 OK
Length: 362677 (354K) [application/octet-stream]
Saving to: ‘./Jupyter_Dock/bin/ledock_linux_x86’

./Jupyter_Dock/bin/ 100%[===================>] 354.18K  32.4KB/s    in 6.8s    

2023-06-15 00:53:59 (51.8 KB/s) - ‘./Jupyter_Dock/bin/ledock_linux_x86’ saved [362677/362677]

代码
文本
[4]
!chmod +x -R ./Jupyter_Dock/bin
代码
文本

导入所需要的环境

代码
文本
[1]
from pymol import cmd
import py3Dmol

from openbabel import pybel

from rdkit import Chem
from rdkit.Chem import AllChem

import sys, os, random
sys.path.insert(1, 'utilities/')

from Jupyter_Dock.utilities.utils import getbox, generate_ledock_file, dok_to_sdf

import warnings
warnings.filterwarnings("ignore")

%config Completer.use_jedi = False
代码
文本
[8]
os.chdir('Jupyter_Dock/test/Virtual_Screening/')
代码
文本

1. 下载并预处理

使用Pymol是下载PDB结构的简单方法。当然,用户可以通过提供自己的文件来启动此或任何其他Jupyter Dock的脚本。

代码
文本
[9]
cmd.fetch(code='1X1R',type='pdb1')
cmd.select(name='Prot',selection='polymer.protein')
cmd.select(name='GDP',selection='organic')
cmd.save(filename='1X1R_clean.pdb',format='pdb',selection='Prot')
cmd.save(filename='1X1R_GDP.mol2',format='mol2',selection='GDP')
cmd.delete('all')
代码
文本

2. 体系可视化检查

得益于强大的py3Dmol工具,Jupyter Dock的一个很酷的功能是可以在notebook中可视化配体-蛋白质复合物和分子对接结果。

现在蛋白质和配体已经被预处理,建议对配体-蛋白质参考系统进行可视化检查。

代码
文本
[10]
view = py3Dmol.view()
view.removeAllModels()
view.setViewStyle({'style':'outline','color':'black','width':0.1})

view.addModel(open('1X1R_clean.pdb','r').read(),format='pdb')
Prot=view.getModel()
Prot.setStyle({'cartoon':{'arrows':True, 'tubes':True, 'style':'oval', 'color':'white'}})
view.addSurface(py3Dmol.VDW,{'opacity':0.6,'color':'white'})

view.addModel(open('1X1R_GDP.mol2','r').read(),format='mol2')
ref_m = view.getModel()
ref_m.setStyle({},{'stick':{'colorscheme':'greenCarbon','radius':0.2}})

view.zoomTo()
view.show()
代码
文本

3. simna 对接

尽管AutoDock Vina 1.2.0中存在诸多限制,但其他集成了AutoDock Vina的工具允许使用诸如自定义评分函数(smina)、快速执行(qvina)和使用更大搜索空间(qvina-w)等很酷的功能。Jupyter Dock可以在notebook中运行这些二进制文件,为用户提供更多选择。

Smina是AutoDock Vina的一个分支,专门定制用于支持评分函数开发和高性能能量最小化。Smina由匹兹堡大学的David Koes维护,与AutoDock项目没有直接关联。

提示: 下面的单元格包含了使用Smina运行当前分子对接示例的示例。然而,qvina和qvina-w的可执行文件可以在Jupyter Dock存储库的bin目录中找到。因此,用户可以通过添加必要的单元格或替换当前的分子对接引擎来使用这一类的工具。

3.1. 受体准备

尽管Smina是AutoDock Vina的修改版本,但在Smina中,受体的输入文件可以是PDBQT文件或具有所有残基中明确氢原子的PDB文件。在这一点上,我们可以使用Jupyter Dock的**fix_protein()**函数提供的蛋白质结构,或者使用LePro(有关更多信息,请参阅分子对接notebook2.1节)。

代码
文本
[11]
!../../bin/lepro_linux_x86 1X1R_clean.pdb

os.rename('pro.pdb','1X1R_clean_H.pdb') # Output from lepro is pro.pdb, this line will change the name to '1X1R_clean_H.pdb'
代码
文本

3.2. 配体准备

分子筛选程序中的配体分子可以来自各种来源(例如ZINC15、PubChem、DrugBank等),并且具有多种格式(例如SDF、PDB、MOL、MOL2、SMILES等)。下面的代码演示了使用SMILES代码中的分子的最简单方法之一。然而,用户可以使用任何已知的化学格式的分子,这要归功于PyBel和RDKit的使用。

无论分子的格式如何,或者对接算法之间的差异如何,配体准备至少需要实现以下目标:

  • 为分子设置适当的质子化和互变状态。
  • 提供有效的三维结构以初始化构象搜索。

Jupyter Dock通过使用pybel函数_make3D_和_localopt_生成质子化的中性分子,并在MMFF94s力场下进行能量最小化。

建议用户在运行分子对接之前,根据特殊配体需求调整pybel设置或使用其他准备方法。

代码
文本
[12]
smiles=['C1=NC(=C2C(=N1)N(C=N2)CCOCP(=O)(O)O)N',
'C1=NC(=C2C(=N1)N(C=N2)[C@H]3[C@@H]([C@@H]([C@H](O3)COP(=O)(O)O)O)O)N',
'C[C@@H](C1=CC2=C(C(=CC=C2)Cl)C(=O)N1C3=CC=CC=C3)NC4=NC=NC5=C4NC=N5',
'C1=NC(=C2C(=N1)N(C=N2)C3C(C(C(O3)CO)O)O)N',
'C[C@H](CN1C=NC2=C(N=CN=C21)N)OC[P@@](=O)(N[C@@H]',
'C1=NC(=C2C(=N1)N(C=N2)[C@H]3[C@@H]([C@@H]([C@H](O3)C[C@H](CC[C@@H](C(=O)O)N)N)O)O)N',
'C[S+](CC[C@@H](C(=O)O)N)C[C@@H]1[C@H]([C@H]([C@@H](O1)N2C=NC3=C(N=CN=C32)N)O)O',
'CN1C=C(C(=N1)OC)NC2=C3C(=NC(=N2)N4C[C@H]([C@@H](C4)F)NC(=O)C=C)N(C=N3)C',
'C1COC[C@@H]1NC2=C3C(=NC=N2)N(C=N3)[C@H]4[C@@H]([C@@H]([C@H](O4)CO)O)O']
代码
文本
[13]
out=pybel.Outputfile(filename='InputMols.mol2',format='mol2',overwrite=True)
for index,smi in enumerate(smiles):
mol=pybel.readstring(string=smi,format='smiles')
mol.title='mol_'+str(index)
mol.make3D('mmff94s')
mol.localopt(forcefield='mmff94s', steps=500)
out.write(mol)
out.close()
==============================
*** Open Babel Warning  in ParseSmiles
  Ignoring stereochemistry. Not enough connections to this atom. 
==============================
*** Open Babel Warning  in ParseSmiles
  Ignoring stereochemistry. Not enough connections to this atom. 
代码
文本

3.3. 定义对接格点

在这个例子中,将使用1X1R的天然配体GDP作为定义包围盒的参考。Molecular Docking Notebook的第4.3节介绍了 getbox() 函数,详细说明了如何根据参考配体定义包围盒。

代码
文本
[14]
cmd.load(filename='1X1R_clean_H.pdb',format='pdb',object='prot') #Not needed but as reference of the system
cmd.load(filename='1X1R_GDP.mol2',format='mol2',object='lig')

center,size=getbox(selection='lig',extending=6.0,software='vina')
cmd.delete('all')
print(center)
print(size)
{'center_x': 3.4204999953508377, 'center_y': 9.91599988937378, 'center_z': 11.27299976348877}
{'size_x': 19.56700000166893, 'size_y': 18.30399990081787, 'size_z': 23.20599937438965}
代码
文本

3.4. 对接

Jupyter Dock附带了Linux和Mac OS的smina可执行文件。通过运行这个二进制文件,可查看输入参数

代码
文本
[15]
!../../bin/smina -r 1X1R_clean_H.pdb -l InputMols.mol2 -o 1X1R_lig_smina_out.sdf --center_x {center['center_x']} --center_y {center['center_y']} --center_z {center['center_z']} --size_x {size['size_x']} --size_y {size['size_y']} --size_z {size['size_z']} --exhaustiveness 8 --num_modes 5
   _______  _______ _________ _        _______ 
  (  ____ \(       )\__   __/( (    /|(  ___  )
  | (    \/| () () |   ) (   |  \  ( || (   ) |
  | (_____ | || || |   | |   |   \ | || (___) |
  (_____  )| |(_)| |   | |   | (\ \) ||  ___  |
        ) || |   | |   | |   | | \   || (   ) |
  /\____) || )   ( |___) (___| )  \  || )   ( |
  \_______)|/     \|\_______/|/    )_)|/     \|


smina is based off AutoDock Vina. Please cite appropriately.

Weights      Terms
-0.035579    gauss(o=0,_w=0.5,_c=8)
-0.005156    gauss(o=3,_w=2,_c=8)
0.840245     repulsion(o=0,_c=8)
-0.035069    hydrophobic(g=0.5,_b=1.5,_c=8)
-0.587439    non_dir_h_bond(g=-0.7,_b=0,_c=8)
1.923        num_tors_div

Using random seed: -367124736

0%   10   20   30   40   50   60   70   80   90   100%
|----|----|----|----|----|----|----|----|----|----|
***************************************************

mode |   affinity | dist from best mode
     | (kcal/mol) | rmsd l.b.| rmsd u.b.
-----+------------+----------+----------
1       -7.5       0.000      0.000    
2       -7.5       4.475      6.248    
3       -7.2       5.868      8.077    
4       -7.2       1.216      2.442    
5       -7.1       1.026      2.091    
Refine time 22.673
Using random seed: -367124736

0%   10   20   30   40   50   60   70   80   90   100%
|----|----|----|----|----|----|----|----|----|----|
***************************************************

mode |   affinity | dist from best mode
     | (kcal/mol) | rmsd l.b.| rmsd u.b.
-----+------------+----------+----------
1       -9.8       0.000      0.000    
2       -9.4       1.294      1.815    
3       -8.8       1.608      2.687    
4       -8.7       4.408      7.149    
5       -8.7       1.068      1.973    
Refine time 33.008
Using random seed: -367124736

0%   10   20   30   40   50   60   70   80   90   100%
|----|----|----|----|----|----|----|----|----|----|
***************************************************

mode |   affinity | dist from best mode
     | (kcal/mol) | rmsd l.b.| rmsd u.b.
-----+------------+----------+----------
1       -9.2       0.000      0.000    
2       -9.0       2.602      4.915    
3       -8.7       2.604      5.474    
4       -8.6       2.506      4.873    
5       -8.3       3.860      7.243    
Refine time 52.533
Using random seed: -367124736

0%   10   20   30   40   50   60   70   80   90   100%
|----|----|----|----|----|----|----|----|----|----|
***************************************************

mode |   affinity | dist from best mode
     | (kcal/mol) | rmsd l.b.| rmsd u.b.
-----+------------+----------+----------
1       -7.9       0.000      0.000    
2       -7.7       3.179      6.244    
3       -7.6       1.965      2.820    
4       -7.5       1.810      2.779    
5       -7.5       3.925      5.696    
Refine time 16.865
Using random seed: -367124736

0%   10   20   30   40   50   60   70   80   90   100%
|----|----|----|----|----|----|----|----|----|----|
***************************************************

mode |   affinity | dist from best mode
     | (kcal/mol) | rmsd l.b.| rmsd u.b.
-----+------------+----------+----------
1       -7.2       0.000      0.000    
2       -7.1       3.579      4.740    
3       -7.1       3.230      7.583    
4       -7.0       3.223      7.817    
5       -6.6       4.665      7.373    
Refine time 26.114
Using random seed: -367124736

0%   10   20   30   40   50   60   70   80   90   100%
|----|----|----|----|----|----|----|----|----|----|
***************************************************

mode |   affinity | dist from best mode
     | (kcal/mol) | rmsd l.b.| rmsd u.b.
-----+------------+----------+----------
1       -9.9       0.000      0.000    
2       -9.3       2.268      8.027    
3       -8.3       1.638      2.465    
4       -7.8       1.937      2.733    
5       -7.8       2.064      3.332    
Refine time 68.488
Using random seed: -367124736

0%   10   20   30   40   50   60   70   80   90   100%
|----|----|----|----|----|----|----|----|----|----|
***************************************************

mode |   affinity | dist from best mode
     | (kcal/mol) | rmsd l.b.| rmsd u.b.
-----+------------+----------+----------
1       -10.0      0.000      0.000    
2       -8.9       2.991      8.380    
3       -8.7       2.812      8.208    
4       -8.5       1.136      2.014    
5       -8.0       2.537      3.212    
Refine time 64.825
Using random seed: -367124736

0%   10   20   30   40   50   60   70   80   90   100%
|----|----|----|----|----|----|----|----|----|----|
***************************************************

mode |   affinity | dist from best mode
     | (kcal/mol) | rmsd l.b.| rmsd u.b.
-----+------------+----------+----------
1       -7.9       0.000      0.000    
2       -7.9       2.429      7.587    
3       -7.8       1.847      2.344    
4       -7.7       2.488      7.317    
5       -7.3       3.291      7.857    
Refine time 69.800
Using random seed: -367124736

0%   10   20   30   40   50   60   70   80   90   100%
|----|----|----|----|----|----|----|----|----|----|
***************************************************

mode |   affinity | dist from best mode
     | (kcal/mol) | rmsd l.b.| rmsd u.b.
-----+------------+----------+----------
1       -8.9       0.000      0.000    
2       -8.0       2.819      7.359    
3       -8.0       2.286      7.383    
4       -8.0       2.548      7.450    
5       -7.5       3.193      7.316    
Refine time 32.074
Loop time 397.365
代码
文本

3.5. 对接结果的 3D 可视化

与系统可视化(第2节)类似,可以检查并将对接结果与参考结构(如果有)进行比较。Smina将对接得分对应的"minimizedAffinity"信息保存为分子的属性。

代码
文本
[16]
view = py3Dmol.view()
view.removeAllModels()
view.setViewStyle({'style':'outline','color':'black','width':0.1})

view.addModel(open('1X1R_clean_H.pdb','r').read(),'pdb')
Prot=view.getModel()
Prot.setStyle({'cartoon':{'arrows':True, 'tubes':True, 'style':'oval', 'color':'white'}})
view.addSurface(py3Dmol.VDW,{'opacity':0.8,'color':'white'})


view.addModel(open('1X1R_GDP.mol2','r').read(),'mol2')
ref_m = view.getModel()
ref_m.setStyle({},{'stick':{'colorscheme':'greenCarbon','radius':0.2}})


poses=Chem.SDMolSupplier('1X1R_lig_smina_out.sdf',True)
for p in list(poses)[::5]:
pose_1=Chem.MolToMolBlock(p)
print(p.GetProp('_Name'),'Score: {}'.format(p.GetProp('minimizedAffinity')))
color = ["#"+''.join([random.choice('0123456789ABCDEF') for j in range(6)])]
view.addModel(pose_1,'mol')
z= view.getModel()
z.setStyle({},{'stick':{'color':color[0],'radius':0.05,'opacity':0.6}})

view.zoomTo()
view.show()
mol_0 Score: -7.51074
mol_1 Score: -9.80314
mol_2 Score: -9.16021
mol_3 Score: -7.94220
mol_4 Score: -7.20014
mol_5 Score: -9.94492
mol_6 Score: -9.97500
mol_7 Score: -7.88604
mol_8 Score: -8.91896
代码
文本

4. 使用 Ledock 进行对接

LeDock旨在将小分子快速而准确地灵活对接到蛋白质中。它在Astex多样性集上的位姿预测准确率超过90%,对于类似药物的分子,每次运行大约需要3秒的时间。LeDock已经在高通量虚拟筛选项目中发现了新的激酶抑制剂和溴域拮抗剂。它直接使用SYBYL Mol2格式作为小分子的输入格式。

4.1. 受体准备

在LeDock中,蛋白质的输入文件是一个包含所有残基上显式氢原子的PDB文件。LePro是专为准备与LeDock进行对接的蛋白质结构而创建的工具。因此,在这个阶段,我们可以使用经过清理步骤后的文件以及Jupyter Dock的 fix_protein() 函数提供的蛋白质结构,或者实现LePro(有关更多信息,请参阅Molecular Docking笔记本的2.1节)。

4.2. 配体准备

在LeDock中,使用MOL2格式作为配体的输入。然而,LeDock无法接受多模型的MOL2文件作为输入。为了使用LeDock,我们可以按照与Smina(第3.2节)相同的方式进行准备,但每个配体生成一个MOL2文件。

代码
文本
[17]
smiles=['C1=NC(=C2C(=N1)N(C=N2)CCOCP(=O)(O)O)N',
'C1=NC(=C2C(=N1)N(C=N2)[C@H]3[C@@H]([C@@H]([C@H](O3)COP(=O)(O)O)O)O)N',
'C[C@@H](C1=CC2=C(C(=CC=C2)Cl)C(=O)N1C3=CC=CC=C3)NC4=NC=NC5=C4NC=N5',
'C1=NC(=C2C(=N1)N(C=N2)C3C(C(C(O3)CO)O)O)N',
'C[C@H](CN1C=NC2=C(N=CN=C21)N)OC[P@@](=O)(N[C@@H]',
'C1=NC(=C2C(=N1)N(C=N2)[C@H]3[C@@H]([C@@H]([C@H](O3)C[C@H](CC[C@@H](C(=O)O)N)N)O)O)N',
'C[S+](CC[C@@H](C(=O)O)N)C[C@@H]1[C@H]([C@H]([C@@H](O1)N2C=NC3=C(N=CN=C32)N)O)O',
'CN1C=C(C(=N1)OC)NC2=C3C(=NC(=N2)N4C[C@H]([C@@H](C4)F)NC(=O)C=C)N(C=N3)C',
'C1COC[C@@H]1NC2=C3C(=NC=N2)N(C=N3)[C@H]4[C@@H]([C@@H]([C@H](O4)CO)O)O']
代码
文本
[18]
for index,smi in enumerate(smiles):
mol=pybel.readstring(string=smi,format='smiles')
mol.title='mol_'+str(index)
mol.make3D('mmff94s')
mol.localopt(forcefield='mmff94s', steps=500)
out=pybel.Outputfile(filename='ledock_inputfiles/'+'mol_'+str(index)+'.mol2',format='mol2',overwrite=True)
out.write(mol)
out.close()
==============================
*** Open Babel Warning  in ParseSmiles
  Ignoring stereochemistry. Not enough connections to this atom. 
==============================
*** Open Babel Warning  in ParseSmiles
  Ignoring stereochemistry. Not enough connections to this atom. 
代码
文本

4.3. 对接格点的定义

这个步骤可以按照与Smina的框定义(第3.3节)相同的方式完成。为了在LeDock格式中获得与Smina docking相同的框,用户只需要将参数 "software" 从 "vina" 更改为 "ledock"。

提示: getbox() 函数的实现允许在AutoDock Vina和LeDock之间轻松复制结合位点,以便在两个程序之间通用。

代码
文本
[19]
cmd.load(filename='1X1R_clean_H.pdb',format='pdb',object='prot')
cmd.load(filename='1X1R_GDP.mol2',format='mol2',object='lig')

X,Y,Z=getbox(selection='lig',extending=6.0,software='ledock')
cmd.delete('all')
print(X)
print(Y)
print(Z)
{'minX': -6.363000005483627, 'maxX': 13.203999996185303}
{'minY': 0.7639999389648438, 'maxY': 19.067999839782715}
{'minZ': -0.3299999237060547, 'maxZ': 22.875999450683594}
代码
文本

4.4 对接

除了每个配体一个文件之外,Ledock还要求用户创建一个包含配体的对接路径的文件(在Jupyter Dock中为ligand.list)。可以使用以下代码单元格和 generate_ledock_file() 函数轻松创建这个文件。

代码
文本
[20]
l_list=[]
for file in os.listdir('ledock_inputfiles/'):
if 'mol2' in file:
l_list.append('ledock_inputfiles/'+file+'\n')
代码
文本
[21]
l_list
['ledock_inputfiles/mol_0.mol2\n',
 'ledock_inputfiles/mol_1.mol2\n',
 'ledock_inputfiles/mol_2.mol2\n',
 'ledock_inputfiles/mol_3.mol2\n',
 'ledock_inputfiles/mol_4.mol2\n',
 'ledock_inputfiles/mol_5.mol2\n',
 'ledock_inputfiles/mol_6.mol2\n',
 'ledock_inputfiles/mol_7.mol2\n',
 'ledock_inputfiles/mol_8.mol2\n']
代码
文本
[22]
generate_ledock_file(receptor='1X1R_clean_H.pdb',l_list=l_list,
l_list_outfile='ligand.list',
x=[X['minX'],X['maxX']],
y=[Y['minY'],Y['maxY']],
z=[Z['minZ'],Z['maxZ']],
n_poses=10,
rmsd=1.0,
out='dock.in')
代码
文本

一旦所有的分子对接参数都被输入到配置文件(dock.in)中,对接即可开始

代码
文本
[23]
!../../bin/ledock_linux_x86 dock.in
代码
文本

4.5. 将对接结果 DOK 转换为 SDF

LeDock生成的文件具有.dok扩展名,其中包含与pdb文件类似的对接属性。然而,.dok文件在表示化学结构方面并不常用。因此,Jupyter Dock可以将.dok文件转换为广泛使用的sdf格式。在保留化学特征的同时,Jupyter Dock将将“Pose”和“Score”结果保存为分子属性(有关详细信息,请参见分子对接笔记本的第6.5节)。

代码
文本
[25]
for file in os.listdir('ledock_inputfiles/'):
if '.dok' in file:
os.rename('ledock_inputfiles/'+file,'ledock_outfiles/'+file)
dok_to_sdf(dok_file='ledock_outfiles/'+file,output='ledock_outfiles/'+file.replace('dok','sdf'))
代码
文本

4.5. 对接结果的3D可视化

与系统可视化(第2节)类似,可以检查和比较分子对接的结果与参考结构(如果有的话)。

代码
文本
[26]
view = py3Dmol.view()
view.removeAllModels()
view.setViewStyle({'style':'outline','color':'black','width':0.1})

view.addModel(open('1X1R_clean_H.pdb','r').read(),'pdb')
Prot=view.getModel()
Prot.setStyle({'cartoon':{'arrows':True, 'tubes':True, 'style':'oval', 'color':'white'}})
view.addSurface(py3Dmol.VDW,{'opacity':0.8,'color':'white'})


view.addModel(open('1X1R_GDP.mol2','r').read(),'mol2')
ref_m = view.getModel()
ref_m.setStyle({},{'stick':{'colorscheme':'greenCarbon','radius':0.2}})

for file in os.listdir('ledock_outfiles/'):
if 'sdf' in file:
pose_1=Chem.SDMolSupplier('ledock_outfiles/'+file,False)[0]
p=Chem.MolToMolBlock(pose_1)
print('Name: {} | Pose: {} | Score: {}'.format(file.split('.')[0],pose_1.GetProp('Pose'),pose_1.GetProp('Score')))
color = ["#"+''.join([random.choice('0123456789ABCDEF') for j in range(6)])]
view.addModel(p,'mol')
z= view.getModel()
z.setStyle({},{'stick':{'color':color[0],'radius':0.05,'opacity':0.6}})

view.zoomTo()
view.show()
Name: mol_0 | Pose: 3 | Score: -8.52
Name: mol_1 | Pose: 6 | Score: -9.36
Name: mol_2 | Pose: 2 | Score: -8.33
Name: mol_3 | Pose: 4 | Score: -7.26
Name: mol_4 | Pose: 1 | Score: -7.55
Name: mol_5 | Pose: 2 | Score: -9.89
Name: mol_6 | Pose: 2 | Score: -9.62
Name: mol_7 | Pose: 1 | Score: -8.15
Name: mol_8 | Pose: 3 | Score: -7.17
代码
文本

参考

  1. https://github.com/AngelRuizMoreno/Jupyter_Dock

如果你使用这个notebook中的工具,记得引用相关文献

1. Jupyter Dock

Ruiz-Moreno A.J. Jupyter Dock: Molecular Docking integrated in Jupyter Notebooks. https://doi.org/10.5281/zenodo.5514956

2. Autodock Vina

Eberhardt, J., Santos-Martins, D., Tillack, A.F., Forli, S. (2021). AutoDock Vina 1.2.0: New Docking Methods, Expanded Force Field, and Python Bindings. Journal of Chemical Information and Modeling.

Trott, O., & Olson, A. J. (2010). AutoDock Vina: improving the speed and accuracy of docking with a new scoring function, efficient optimization, and multithreading. Journal of computational chemistry, 31(2), 455-461.

3. LeDock

Wang Z, Sun H, Yao X, Li D, Xu L, Li Y, et al. Comprehensive evaluation of ten docking programs on a diverse set of protein–ligand complexes: the prediction accuracy of sampling power and scoring power. Phys Chem Chem Phys. 2016;18: 12964–12975. https://doi.org/10.1039/C6CP01555G.

4. AutoDock Tools

Morris, G. M., Huey, R., Lindstrom, W., Sanner, M. F., Belew, R. K., Goodsell, D. S., & Olson, A. J. (2009). AutoDock4 and AutoDockTools4: Automated docking with selective receptor flexibility. Journal of computational chemistry, 30(16), 2785–2791. https://doi.org/10.1002/jcc.21256.

5. Pymol API

The PyMOL Molecular Graphics System, Version 1.2r3pre, Schrödinger, LLC.

6. OpenBabel

O'Boyle, N.M., Banck, M., James, C.A. et al. Open Babel: An open chemical toolbox. J Cheminform 3, 33 (2011). https://doi.org/10.1186/1758-2946-3-33.

7. RDKit

RDKit: Open-source cheminformatics; http://www.rdkit.org

8. py3Dmol

Keshavan Seshadri, Peng Liu, and David Ryan Koes. Journal of Chemical Education 2020 97 (10), 3872-3876. https://doi.org/10.1021/acs.jchemed.0c00579.

9. PDBFixer

P. Eastman, M. S. Friedrichs, J. D. Chodera, R. J. Radmer, C. M. Bruns, J. P. Ku, K. A. Beauchamp, T. J. Lane, L.-P. Wang, D. Shukla, T. Tye, M. Houston, T. Stich, C. Klein, M. R. Shirts, and V. S. Pande. 2013. OpenMM 4: A Reusable, Extensible, Hardware Independent Library for High Performance Molecular Simulation. Journal of Chemical Theory and Computation. ACS Publications. 9(1): 461-469.

10. MDAnalysis

R. J. Gowers, M. Linke, J. Barnoud, T. J. E. Reddy, M. N. Melo, S. L. Seyler, D. L. Dotson, J. Domanski, S. Buchoux, I. M. Kenney, and O. Beckstein. MDAnalysis: A Python package for the rapid analysis of molecular dynamics simulations. In S. Benthall and S. Rostrup, editors, Proceedings of the 15th Python in Science Conference, pages 98-105, Austin, TX, 2016. SciPy, doi:10.25080/majora-629e541a-00e.

N. Michaud-Agrawal, E. J. Denning, T. B. Woolf, and O. Beckstein. MDAnalysis: A Toolkit for the Analysis of Molecular Dynamics Simulations. J. Comput. Chem. 32 (2011), 2319-2327, doi:10.1002/jcc.21787. PMCID:PMC3144279.

11. ProLif

chemosim-lab/ProLIF: v0.3.3 - 2021-06-11.https://doi.org/10.5281/zenodo.4386984.

12. Fpocket

Le Guilloux, V., Schmidtke, P. & Tuffery, P. Fpocket: An open source platform for ligand pocket detection. BMC Bioinformatics 10, 168 (2009). https://doi.org/10.1186/1471-2105-10-168.

13. Smina

Koes, D. R., Baumgartner, M. P., & Camacho, C. J. (2013). Lessons learned in empirical scoring with smina from the CSAR 2011 benchmarking exercise. Journal of chemical information and modeling, 53(8), 1893–1904. https://doi.org/10.1021/ci300604z
代码
文本
化学信息学
Jupyter_Dock
分子对接
化学信息学Jupyter_Dock分子对接
点个赞吧
推荐阅读
公开
Jupyter_Dock | 对接结果分析
化学信息学Jupyter_Dock分子对接数据分析
化学信息学Jupyter_Dock分子对接数据分析
liyq@dp.tech
发布于 2023-06-15
3 转存文件
公开
Jupyter_Dock | 反向对接
化学信息学Jupyter_Dock分子对接
化学信息学Jupyter_Dock分子对接
liyq@dp.tech
发布于 2023-06-15
3 转存文件