前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >两蛋白间的分子对接3—使用AlphaFold进行

两蛋白间的分子对接3—使用AlphaFold进行

原创
作者头像
sheldor没耳朵
发布于 2025-04-08 07:38:54
发布于 2025-04-08 07:38:54
51400
代码可运行
举报
文章被收录于专栏:R语言可视化R语言可视化
运行总次数:0
代码可运行

两蛋白间的分子对接3—使用AlphaFold进行

据说AlphaFold进行分子对接比传统的蛋白分子工具如zdock、hdock的对接效果更好。因为AlphaFold是柔性对接,而其他是刚性对接或者半柔性对接。这次学习使用AlphaFold进行分子对接,以NEDD4L和TKTL1分子对接为例。

1.获取NEDD4L和TKTL1的氨基酸序列

  • Uniprot网站中获取NEDD4L氨基酸序列,可以直接复制。同理获取TKTL1的氨基酸序列,未展示。
  • 将分别将氨基酸序列复制到alphafold(https://alphafoldserver.com/)中,进行分子对接(注:需要google账户和科学上网)。点击提交,后重新命名,一般等待5min可以出结果
  • 下载分子对接结果,选择top0进行后续处理和可视化

2.使用Maestro进行结构优化

  • 将model 0 的文件直接拉到Maestro中(注意提前设置好工作目录),点击protein preparation workflow,点击run,进行加氢操作,结构优化等。提交完等待running结束即可
  • 出现这个界面,表示优化已经完成。检查两个链条是否为chain A和chain B。否则需要更改为chain A和chain B,不然后续ppi.py脚本无法执行。输出PDB格式文件

3.pymol中进行可视化操作

  • 安装ppi.py脚本文件,Choose file选择ppi.py这个脚本,安装脚本

ppi.py

这段 Python 脚本是专门在 PyMOL 中执行的,用来分析和可视化蛋白质-蛋白质相互作用(PPI),重点包括:

  1. π-π stacking(芳香环之间的堆叠)
  2. Salt bridge(盐桥)
  3. Hydrogen bonds(氢键) 同时,脚本还设置了可视化参数,便于展示结果。
代码语言:python
代码运行次数:0
运行
AI代码解释
复制
from pymol import cmd
from pymol.cmd import util
import sys
import os
import math

def pi_pi_angle(x1,x2,x3,y1,y2,y3):
    import numpy as np
    #print(x1,x2,x3,y1,y2,y3)

    B1, B2, B3 = [x1[0] - x2[0], x1[1] - x2[1], x1[2] - x2[2]]
    C1, C2, C3 = [x1[0] - x3[0], x1[1] - x3[1], x1[2] - x3[2]]
    #print([x1[0] - x2[0], x1[1] - x2[1], x1[2] - x2[2]])
    n1 = [B2 * C3 - C2 * B3, B3 * C1 - C3 * B1, B1 * C2 - C1 * B2]
    D1, D2, D3 = [y1[0] - y2[0], y1[1] - y2[1], y1[2] - y2[2]]
    E1, E2, E3 = [y1[0] - y3[0], y1[1] - y3[1], y1[2] - y3[2]]
    n2 = [D2 * E3 - E2 * D3, D3 * E1 - E3 * D1, D1 * E2 - E1 * D2]
    dot_product = np.dot(n1, n2)
    magnitude1 = np.linalg.norm(n1)  # ????????????????
    magnitude2 = np.linalg.norm(n2)
    #print(dot_product,magnitude1,magnitude2,dot_product / (magnitude1 * magnitude2))

    xx = math.acos(dot_product / (magnitude1 * magnitude2))
    degree = math.degrees(xx)
    if degree > 90:
        degree = 180 - degree
    return round(degree,2)

def pi_pi(aro_ring_info,cutoff=5.0):
    aro_resn =['HIS','PHE','TRP','TYR']
    aro_resn_list = '+'.join(aro_resn)
    chA_aro_res = f'inter_1 and resn {aro_resn_list}'
    chB_aro_res = f'inter_2 and resn {aro_resn_list}'
    chA_aro_res_list = list(set([f'resi {a.resi} and resn {a.resn}' for a in cmd.get_model(chA_aro_res).atom]))
    chB_aro_res_list = list(set([f'resi {a.resi} and resn {a.resn}' for a in cmd.get_model(chB_aro_res).atom]))
    for A in chA_aro_res_list:
        for B in chB_aro_res_list:
            A_type = A.split()[-1]
            B_type = B.split()[-1]
            #print(f'{A} and name {aro_ring_info[A_type]}')
            x = cmd.centerofmass(f'inter_1 and {A} and name {aro_ring_info[A_type]}')
            y = cmd.centerofmass(f'inter_2 and {B} and name {aro_ring_info[B_type]}')
            dist = math.sqrt((x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2)
            if dist < cutoff:
                cmd.show('sticks',f'inter_1 and {A}')
                cmd.show('sticks', f'inter_2 and {B}')
                cmd.label(f'name CA and  inter_1 and {A}', 'oneletter+resi')
                cmd.label(f'name CA and  inter_2 and {B}', 'oneletter+resi')
                x1 = cmd.get_coords(f"{A} and name {aro_ring_info[A_type].split('+')[0]}")[0]
                x2 = cmd.get_coords(f"{A} and name {aro_ring_info[A_type].split('+')[1]}")[0]
                x3 = cmd.get_coords(f"{A} and name {aro_ring_info[A_type].split('+')[2]}")[0]
                y1 = cmd.get_coords(f"{B} and name {aro_ring_info[B_type].split('+')[0]}")[0]
                y2 = cmd.get_coords(f"{B} and name {aro_ring_info[B_type].split('+')[1]}")[0]
                y3 = cmd.get_coords(f"{B} and name {aro_ring_info[B_type].split('+')[2]}")[0]
                print(A,B)
                pi_angle = pi_pi_angle(x1, x2, x3, y1, y2, y3)
                pi_name = f'pi_{A.split()[1]}_{B.split()[1]}_{str(pi_angle)}'
                print(A, B,pi_name)


                cmd.distance(pi_name, f"inter_1 and resi {A.split()[1]} and name {aro_ring_info[A_type]}", f'inter_2 and resi {B.split()[1]} and name {aro_ring_info[B_type]}', mode=4, label=0)


def Salt_bridge(ChA,ChB,cutoff=5.0):
    selection_1 = f'{ChB} and ((resn LYS and name NZ) or (resn ARG and name NE+NH*))'
    a_charge_res = set([f'chain {a.chain} and  resi {a.resi} and resn {a.resn}' for a in cmd.get_model(f'inter_1 and resn LYS+ARG+ASP+GLU').atom])
    b_charge_res = set([f'chain {a.chain} and resi {a.resi} and resn {a.resn}' for a in cmd.get_model(f'inter_2  and resn LYS+ARG+ASP+GLU').atom])
    #print(a_charge_res)
    p_info = {'LYS':'NZ','ARG':'NE+NH*'}
    n_info = {'ASP':'OD*+OE*','GLU':'OD*+OE*'}
    for a  in a_charge_res:
        a_resn = a.split()[-1]
        for b in b_charge_res:
            b_resn = b.split()[-1]
            name = f'SB_{a.split()[4]}_{b.split()[4]}'

            if (a_resn in ['LYS','ARG']) and (b_resn in ['ASP','GLU']):
                a_resn_atom = p_info[a_resn]
                b_resn_atom = n_info[b_resn]
                #print(a,b)
                #print(a_resn_atom,b_resn_atom)
                selection_1 = f'{a} and name {a_resn_atom}'
                selection_2 = f'{b} and name {b_resn_atom}'
                cal_saltbrige(selection_1, selection_2, name, a,b,cutoff)


            elif (a_resn in ['ASP','GLU'] ) and (b_resn in ['LYS','ARG']):
                a_resn_atom = n_info[a_resn]
                b_resn_atom = p_info[b_resn]


                selection_1 = f'{a} and name {a_resn_atom}'
                selection_2 = f'{b} and name {b_resn_atom}'
                cal_saltbrige(selection_1,selection_2,name, a,b,cutoff)





def cal_saltbrige(selection1,selection2,name,a,b,cutoff):
    x = cmd.centerofmass(selection1)
    y = cmd.centerofmass(selection2)
    dist = math.sqrt((x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2)

    if dist < cutoff:
        cmd.show('stick', a)
        cmd.show('stick', b)
        print(a,b)
        cmd.label(f'name CA and  {a}', 'oneletter+resi')
        cmd.label(f'name CA and  {b}', 'oneletter+resi')

        cmd.distance(name, selection1, selection2, mode=4, label=0)
    return name

def DA_Hbond(DA_type,select1,select2,cutoff='3.5',angle='150'):
    hbond_pairs = []
    pairs = cmd.find_pairs(select1, select2, mode=0, cutoff=cutoff)
    for pair in pairs:

        D_atom = f'index {pair[0][1]}'
        A_atom = f'index {pair[1][1]}'
        HD_atom = f'e. h and neighbor({D_atom})'
        index_1 = [a.index for a in cmd.get_model(A_atom).atom]
        index_2 = [a.index for a in cmd.get_model(HD_atom).atom]
        index_3 = [a.index for a in cmd.get_model(D_atom).atom]

        for h in index_2:
            h_angle = cmd.angle('angle', A_atom, f'index {h}', D_atom)
            #print(type, pair, h_angle)
            if h_angle > float(angle):
                D_atom_name = [f'{a.resi}-{a.name}' for a  in cmd.get_model(f'index {pair[0][1]} ').atom][0]

                A_atom_name = [f'{a.resi}-{a.name}' for a  in cmd.get_model(f'index {pair[1][1]} ').atom][0]
                #name = [f'HB-{a.resi}{a.resn}{a.chain}-{base_atom_name}-lig-{lig_atom_name}' for a in cmd.get_model(f'index {pair[0][1]} and polymer').atom][0]
                name = f'{DA_type}_{D_atom_name}_{A_atom_name}'
                cmd.show('stick', f'byres(index {pair[0][1]})')
                cmd.show('stick', f'byres(index {pair[1][1]})')
                cmd.label(f'name CA and byres(index {pair[0][1]})', 'oneletter+resi')
                cmd.label(f'name CA and  byres(index {pair[1][1]})', 'oneletter+resi')


                cmd.distance(name, f'index {index_1[0]} ', f'index {h} ', label=0)

                break
    return hbond_pairs
def ppi(pdb_name,ChA="A",ChB="B",dist=5):
    #cmd.h_add('all')
    #cmd.remove('solvent and resn SO4, NA,CL,GOL')
    cmd.set_color("c1",[1.000, 0.675, 0.718])
    #cmd.set_color("c2",[0.8353,0.6039,0.7098])
    cmd.remove('not polymer')
    #util.cbc('all', first_color=7, quiet=1, legacy=0, _self=cmd)
    cmd.select('inter_1',f'{pdb_name} and chain {ChA} and byres(chain {ChB}) around {dist}')
    cmd.select('inter_2', f'{pdb_name} and chain {ChB} and byres(chain {ChA}) around {dist}')
    util.cba('c1',f'chain {ChA}')
    util.cba('slate', f'chain {ChB}')
    else_part  = cmd.select('else',f'{pdb_name} and  not (chain {ChA}+{ChB})')
    if else_part > 0:
        util.cba('lime', 'else')

    chA_D = f'inter_1 and  e. o+n and (neighbor e. h)'
    chB_A =  f'inter_2 and  e. o+n '
    DA_Hbond('HDA',chA_D,chB_A)
    chB_D = f'inter_2 and  e. o+n and (neighbor e. h)'
    chA_A = f'inter_1 and  e. o+n '
    DA_Hbond('HAD',chB_D,chA_A)
    aro_ring_name = {'HIS':'CG+ND1+CE1+NE2+CD2',
                     'TRP':'CH2+CZ3+CE3+CZ2+CE2+CD2',
                     'TYR':'CG+CD1+CE1+CZ+CE2+CD2',
                     'PHE':'CG+CD1+CE1+CZ+CE2+CD2'}
    pi_pi(aro_ring_name)
    Salt_bridge(ChA,ChB)
    cmd.do('set cartoon_transparency, 0.6')
    cmd.do('set dash_gap, 0.2')
    cmd.do('set dash_round_ends, 0')
    cmd.do('set label_size, 22')
    cmd.do('set dash_color, cyan,pi*')
    cmd.do('set dash_color, violet,SB*')
    cmd.do('set dash_radius, 0.1')
    cmd.do('set stick_radius, 0.15')
    cmd.delete('angle')
    cmd.disable('angle')
    cmd.set('bg_rgb', 'white')
    cmd.remove("all & hydro & not nbr. (don.|acc.)")
    cmd.do('set ray_trace_mode, 1')
    #cmd.do('set label_bg_color, white')
    #cmd.do('set label_bg_transparency, 0.7')
    cmd.do('set label_connector, on')
    cmd.do('set label_color, c1,chain A')
#    cmd.do('set stick_color, c1, chain A,elemC')
    cmd.do('set label_color, slate,chain B')
#    cmd.do('set stick_color, slate, chain B')
    cmd.do('set cartoon_loop_radius, 0.3')
    cmd.do('set ray_trace_mode, 1')
    cmd.do('set ray_shadows,0')
    cmd.do('set specular, 0')
    cmd.do('space cmyk')
    cmd.do('set ray_trace_color, [0,0,0]')
    cmd.do('set stick_h_scale,1')
    #set ray_shadow, off
    #ray_trace_mode set to 3
    #cmd.do('set ray_shadow,on')
    #cmd.save(f'{pdb_name}_interaction.pse')
cmd.extend("ppi", ppi)
  • 导入上述pdb文件,使用ppi脚本,就可以直接显示作用结果了
  • 可视化操作,hide cartoon后,调整标签位置;show cartoon后,调整透明度大小,然后Draw出去就好了

hide cartoon

show cartoon

  • hide sticks、hide labels后,调整cartoon透明度为0,获取整体的图。然后在进行组图就可以了

hide sticks

hide labels

4.对接结合能计算

  • 即可获取模型的自由能

5.对接面积计算

6.常见问题

  • 辨析π-π stacking(芳香环之间的堆叠)、Salt bridge(盐桥)、Hydrogen bond(氢键)、Van der Waals 力(范德华力)
  • 分子对接模型,其自由能一般多少可以认为对接效果好
代码语言:r
AI代码解释
复制
📌 说明:
越负的值代表结合越稳定(放出更多能量)
不同软件(如 AutoDock, Glide, Vina)打分标准略有不同,但通常在这个范围附近
静态对接仅提供初步判断,真实结合能力还需考虑:
受体和配体柔性
溶剂效应
分子动力学(MD)模拟等
🔬 举个例子:
药物候选分子对靶标蛋白的对接结果是 -9.5 kcal/mol → 可能是高亲和性结合
某种天然产物对某酶的对接结果是 -6.2 kcal/mol → 有中等活性潜力
-3.8 kcal/mol → 通常被认为不够强或可忽略
  • 蛋白对接中什么是刚性对接、什么是柔性对接。使用alphafold对接和使用zdock、hdock对接有什么区别?

参考资料:https://www.bilibili.com/video/BV1xnQ8YaEy2?share_source=copy_web&spm_id_from=333.788.videopod.sections&vd_source=b6fa58fce4b5e0fc33b25e14b4f5774

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 两蛋白间的分子对接3—使用AlphaFold进行
    • 1.获取NEDD4L和TKTL1的氨基酸序列
    • 2.使用Maestro进行结构优化
    • 3.pymol中进行可视化操作
    • 4.对接结合能计算
    • 5.对接面积计算
    • 6.常见问题
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档