美文网首页郑的分子对接计算机
Autodock vina批量分子对接(虚拟筛选)

Autodock vina批量分子对接(虚拟筛选)

作者: 可能性之兽 | 来源:发表于2022-02-15 23:37 被阅读0次

    我是一块砖,哪里需要那里搬。。一两年前做过一次分子对接,没想到又被叫去做(不过需求完全不同,这次要批量,而且是小分子,服务器也换了,一切都需要找资料完全重启,不过现在资料比以前多很多了,感谢各位大佬),简单记录一下

    资料来源

    首选看这个,可以跟着手操一波小分子的下载和软件的使用(主要录制的比较好)
    【虚拟筛选】使用Autodock_vina进行批量分子对接_哔哩哔哩_bilibili

    但是接着就要看这个(上面那个不是很全),这个大佬最详细(蛋白的处理看这个
    小分子虚拟筛选与分子模拟课程——4.批量小分子对接_哔哩哔哩_bilibili

    基础知识:比如为何需要pdbqt格式
    分子对接基础知识 - xiaojikuaipao - 博客园 (cnblogs.com)

    安装的指导文件看下面这些

    vina的指导文档,必看(提供了好几种安装方式,一种不行换一种,其实操作非常详细了,很多都不一定需要手动调整,直接Linux里面用就行)
    Installation — Autodock Vina 1.2.0 documentation (autodock-vina.readthedocs.io)
    vina的指导pdf
    https://autodock-vina.readthedocs.io/_/downloads/en/latest/pdf/

    Open Babel的安装
    Open Babel的安装与使用 - 云+社区 - 腾讯云 (tencent.com)

    一,蛋白的下载和处理

    1. PDB文件内容

    文献搜索,或者网站中找,但老实说它的搜索功能有点奇怪,有时候不同关键词(但是应该指向的是一种东西)不同结果
    RCSB PDB: Homepage

    2.PDB文件的处理

    2.1 去除原有小分子ligand+加氢(polar)+导出为pdbqt文件

    Discover_studio
    【八分熟肉】【分子对接】使用Discovery_studio进行分子对接前蛋白质预处理_哔哩哔哩_bilibili

    或者pymol 处理

    还要安装windows版本的MGBtools,主要是为了导出pdbqt文件,操作如下

    image.png

    3.对接的口袋哪里找

    用这个网站预测,然后下载活性区域
    Zentrum für Bioinformatik: Universität Hamburg - Proteins Plus Server

    4.使用autodocktools进行活性口袋的预测,得到配置文件config.txt

    receptor=
    ligand=
    
    center_x=100.657
    center_y=6.351
    center_y=40.898
    
    size_x=46
    size_y=34
    size_z=28
    
    exhaustiveness=16
    num_modes=9
    energy_range=4
    
    

    二,软件的安装

    vina 和openbabel的安装

    2.11 vina的conda和pip安装

    这里注意要是python3.7的环境,因为最新版本已经到10了,所以如果直接安装python3的话,会装到python3.10,会有报错

    conda create -n vina2 python=3.7
    conda activate vina2
    pip install -U numpy vina
    

    但是奇葩的是虽然安装上,但是输入vina是没有办法调用的,不知道什么原因,但是好在官网提供了其他方式,直接下载即可用
    Installation — Autodock Vina 1.2.0 documentation (autodock-vina.readthedocs.io)

    2.12 vina的直接使用

    Releases · ccsb-scripps/AutoDock-Vina (github.com)

    注意要给权限

    chmod 755 vina_1.2.3_linux_x86_64
    

    调用出结果即可

    ./vina_1.2.0_linux_x86_64 --help
    
    ## 或者使用绝对路径
    
    
    2.13 官网下载vina(最佳方式,推荐)

    使用了半天才发现,官网这个下载才是最佳的,Linux下载解压之后,里面还有一个叫vina_split的脚本,这个很重要,因为如果你从zinc上下载的是pdbqt格式的话,下载的pbdqt格式是一个整体,需要用这个软件去分割
    Download AutoDock4 – AutoDock (scripps.edu)

    2.13 openbabel

    用来解压mol文件,因为我们从zinc数据库下载的是一个mol2的压缩文件,要用这个进行解压

    conda install -y openbabel  ## 用来解压mol文件
    
    常用分子格式转换命令
    mol2格式转pdbqt格式:
    obabel -imol2 ligand.mol2 -opdbqt -O ligand.pdbqt
    
    pdb格式转mol2格式:
    obabel -ipdb ligand.pdb -omol2 ligand.mol2
    
    smiles格式转2D的sdf格式:
    obabel ligands.smi -O ligands.sdf –gen2d
    
    smiles格式转3D的sdf格式:
    obabel ligands.smi -O ligands.sdf –gen3d
    
    sdf格式转smiles格式,删除氢:
    obabel ligands.sdf -osmi -O ligands.smi -d
    
    sdf格式转smiles格式,添加氢:
    obabel ligands.sdf -O ligands.smi -h
    

    2.2 MGLTools的安装

    用来将mol2转换为pdbqt文件,注意看下面的这个教程的操作

    直接下载,然后解压即可,需要用到其中的prepare_ligand4.py
    Downloads – mgltools (scripps.edu)

    Linux上安装MGLtools - 知乎 (zhihu.com)

    bash $MGL_ROOT/install.sh
    
    

    !后面会出现install.sh后面会出现几个alias,要将其放入.bashrc,还要source一下

    这个软件因为是python2写的,所以注意需要用到python2的环境,所以按照上面的教程设置2也行,或者直接创建conda的python2的环境

     conda create -n vina3 python=2.7
    

    三, zinc小分子数据库的下载

    如何从ZINC数库(www.zinc15.docking.org)下载虚拟筛选化合物库 - 知乎 (zhihu.com)

    按照第一个视频上面的操作就好,我们下载的是mol2格式,通过fda认证的小分子药物
    ZINC (docking.org)

    四.基础操作

    4.1 obabel解压缩

    首先我们下载的是一个fda.mol2文件,这是个大的压缩文件,要使用obabel 进行解压缩成若干个小的mol2文件

    obabel -i mol2 fda.mol2 -o mol2 -O fda.mol2 -m
    

    4.2 使用MGLTools中的小工具循环将mol2文件转换为pdbqt文件

     for i in *mol2;do echo $i; pythonsh ~/Biosfot/mgltools_x86_64Linux2_1.5.6/MGLToolsPckgs/AutoDockTools/Utilities24/prepare_ligand4.py  -l $i $i.pdbqt ;done
    
    

    4.3 进行分子对接

    因为我使用的是不需要安装的vina,也就是GitHub下载的版本,这个版本又和视频之中的不一样,会少了一个log选项,所以你如果是按照视频之中的安装,那么分子对接的命令和我是不一致的,help一下命令,看看参数

    AutoDock Vina v1.2.3
    
    Input:
      --receptor arg             rigid part of the receptor (PDBQT)
      --flex arg                 flexible side chains, if any (PDBQT)
      --ligand arg               ligand (PDBQT)
      --batch arg                batch ligand (PDBQT)
      --scoring arg (=vina)      scoring function (ad4, vina or vinardo)
    
    Search space (required):
      --maps arg                 affinity maps for the autodock4.2 (ad4) or vina
                                 scoring function
      --center_x arg             X coordinate of the center (Angstrom)
      --center_y arg             Y coordinate of the center (Angstrom)
      --center_z arg             Z coordinate of the center (Angstrom)
      --size_x arg               size in the X dimension (Angstrom)
      --size_y arg               size in the Y dimension (Angstrom)
      --size_z arg               size in the Z dimension (Angstrom)
      --autobox                  set maps dimensions based on input ligand(s) (for
                                 --score_only and --local_only)
    
    Output (optional):
      --out arg                  output models (PDBQT), the default is chosen based
                                 on the ligand file name
      --dir arg                  output directory for batch mode
      --write_maps arg           output filename (directory + prefix name) for
                                 maps. Option --force_even_voxels may be needed to
                                 comply with .map format
    
    Misc (optional):
      --cpu arg (=0)             the number of CPUs to use (the default is to try
                                 to detect the number of CPUs or, failing that, use
                                 1)
      --seed arg (=0)            explicit random seed
      --exhaustiveness arg (=8)  exhaustiveness of the global search (roughly
                                 proportional to time): 1+
      --max_evals arg (=0)       number of evaluations in each MC run (if zero,
                                 which is the default, the number of MC steps is
                                 based on heuristics)
      --num_modes arg (=9)       maximum number of binding modes to generate
      --min_rmsd arg (=1)        minimum RMSD between output poses
      --energy_range arg (=3)    maximum energy difference between the best binding
                                 mode and the worst one displayed (kcal/mol)
      --spacing arg (=0.375)     grid spacing (Angstrom)
      --verbosity arg (=1)       verbosity (0=no output, 1=normal, 2=verbose)
    
    Configuration file (optional):
      --config arg               the above options can be put here
    
    Information (optional):
      --help                     display usage summary
      --help_advanced            display usage summary with advanced options
      --version                  display program version
    
    
    

    先简单测试一波一个分子能不能操作

    ./vina_1.2.3_linux_x86_64 --config config.txt --ligand fda666.pdbqt --out test/666.pdbqt
    

    可以,那么循环操作就可以了

    for i in *pdbqt;do ./vina_1.2.3_linux_x86_64 --config config.txt --ligand $i --out test/$i.log ;done
    

    不过很明显从参数来看vina 1.2版本以上是内置了使用cpu并行运算的,一次搞n个分子,但是不是很明白怎么操作,有知道的大佬可以在评论区说一下

    但是我还是懂的其他Linux和python的并行操作的,起码有三种方式可以搞,但是在这里就不展开了(哈,会不会有人想打我)

    补充:vina可以在python中使用的脚本

    看到这个我也就明白为何pip安装的Linux调用不了,因为这个是直接在python调用包才行(自己有点愚蠢了)

    Python scripting — Autodock Vina 1.2.0 documentation (autodock-vina.readthedocs.io)

    #! /usr/bin/env python
    # -*- coding: utf-8 -*-
    #
    # My first example with AutoDock Vina in python
    #
    
    from vina import Vina
    
    
    v = Vina(sf_name='vina')
    
    v.set_receptor('1iep_receptor.pdbqt')
    
    v.set_ligand_from_file('1iep_ligand.pdbqt')
    v.compute_vina_maps(center=[15.190, 53.903, 16.917], box_size=[20, 20, 20])
    
    # Score the current pose
    energy = v.score()
    print('Score before minimization: %.3f (kcal/mol)' % energy[0])
    
    # Minimized locally the current pose
    energy_minimized = v.optimize()
    print('Score after minimization : %.3f (kcal/mol)' % energy_minimized[0])
    v.write_pose('1iep_ligand_minimized.pdbqt', overwrite=True)
    
    # Dock the ligand
    v.dock(exhaustiveness=32, n_poses=20)
    v.write_poses('1iep_ligand_vina_out.pdbqt', n_poses=5, overwrite=True)
    

    之后还有分子动力学模拟,之前看过一篇文献叫Beware of docking!
    ,大概意思就是docking只能提供一个切面,分子动力学模拟比较可靠一点。所以如果想要深入的话,可以以分子对接作为筛选,筛选前面几个分子然后去做分子动力学模拟。

    相关文章

      网友评论

        本文标题:Autodock vina批量分子对接(虚拟筛选)

        本文链接:https://www.haomeiwen.com/subject/uadllrtx.html