>>>>>>>>>>>># The following 4 lines:
# 1. load protein structure and rename it
# 2. add hydrogen (`h_add` us a primitive algorithm to add hydrogens onto a molecule.)
# 3. hide protein display
# 4. show cartoon display for protein
load E:\yunpan\docking\1hsg_prot.pdb, 1hsg
h_add 1hsg
hide everything, 1hsg
show cartoon, 1hsg
cmd.spectrum("count", lection="1hsg", byres=1)
# The following 6 lines:
# 1. load ligand structure and rename it
# 2. add hydrogen
# 3. hide ligand display
# 4. show ligand in sticks mode
# 5. Set width of stick to 0.15
# 6. Set atom color: C-white;N-blue;O-red
load E:\yunpan\docking\indinavir.pdbqt, indinavir
h_add indinavir
hide everything, indinavir
show sticks, indinavir
t stick_radius, 0.15
util.cbaw indinavir
# The following 1 line:
# 1. Select metal ions
lect metals, symbol mg+ca+fe+zn
# The following 2 lines:
# 1. Set hydrogen donator
# 2. Set hydrogen accrptor
# `lect` creates a named lection from an atom lection.
# `lect name, (lection)`
lect h_donator, (elem n,o and (neighbor hydro))
lect h_acceptor, (elem o or (elem n and not (neighbor hydro)))
# The following 4 lines:
# 1. Create link between ligand_h_acceptor and prot_h_donator within given distance 3.2
# 2. Create link between ligand_h_donator and prot_h_acceptor within given distance 3.2
# Set filter 3.6 for ideal geometry and filter 3.2 for minimally acceptable geometry
# 3. Set red color for ligand_h_acceptor and prot_h_donator
# 4. Set blue color for ligand_h_donator and prot_h_acceptor
# `distance` creates a new distance object between two lections. It will display all distances within the cutoff. Distance is also ud to make hydrogen bonds like `distance hbonds, all, all, 3.2, mode=2`. # distance [ name [, lection1 [, lection2 [, cutoff [, mode ]]]]]五长
distance LaccPdon, (indinavir and h_acceptor), (1hsg and h_donator), 3.2
distance LdonPacc, (indinavir and h_donator), (1hsg and h_acceptor), 3.2
color red, LaccPdon
color blue, LdonPacc
#distance Fe_C20, (fep and name C20), (heme and name fe))
# The following 6 lines:
# 1. Select non-hydro atoms of ligands
# 2. Select protein atoms within 5A of lected atoms in last step
# 3. Label alpha-c(ca) of lected residues with residue name and residue position
交通事故责任书# 4. Set label color back
# 5. Set background white
# 6. Hidden hydrogenes
lect le, indinavir & not hydro
lect le, byres (le expand 5) & 1hsg
one_letter ={'VAL':'V', 'ILE':'I', 'LEU':'L', 'GLU':'E', 'GLN':'Q', \
'ASP':'D', 'ASN':'N', 'HIS':'H', 'TRP':'W', 'PHE':'F', 'TYR':'Y', \
'ARG':'R', 'LYS':'K', 'SER':'S', 'THR':'T', 'MET':'M', 'ALA':'A', \
'GLY':'G', 'PRO':'P', 'CYS':'C'}
label name ca & le, "%s-%s" % (one_letter[resn],resi)
bg white
t label_color, black
hide (hydro)
# The follwing 5 lines
# 1. Comment out this line
# 2. Create an object `surrounding_res` to reprent lected protein atoms
# `create`: creates a new molecule object from a lection. It can also be ud to create states in an existing object.
# `create name, (lection)`
# 3. Display created surface
# 4. Set color for surrounding_res
高中语文作文# 5. Set transparency for surrounding_res
# Transparency is ud to adjust the transparency of Surfaces and Slices.
# `t transparency, F, lection`
#show surface, 1hsg
create surrounding_res, le
show surface, surrounding_res
color grey80, surrounding_res
t transparency, 0.5, surrounding_res
此外还可以使⽤如下脚本(list_hbonds.py)输出相互作⽤的原⼦及其位置。
# Copyright (c) 2010 Robert L. Campbell
from pymol import cmd
def list_hb(lection,lection2=None,cutoff=3.2,angle=55,mode=1,hb_list_name='hbonds'):
"""
USAGE
list_hb lection, [lection2 (default=None)], [cutoff (default=3.2)],
[angle (default=55)], [mode (default=1)],
[hb_list_name (default='hbonds')]
The script automatically adds a requirement that atoms in the
lection (and lection2 if ud) must be either of the elements N or
O.
喋喋不休的近义词If mode is t to 0 instead of the default value 1, then no angle
cutoff is ud, otherwi the angle cutoff is ud and defaults to 55
degrees.
<
To get a list of all H-bonds within chain A of an object
list_hb 1abc & c. a &! r. hoh, cutoff=3.2, hb_list_name=abc-hbonds
To get a list of H-bonds between chain B and everything el:
list_hb 1tl9 & c. b, 1tl9 &! c. b
"""
cutoff=float(cutoff)
angle=float(angle)
mode=float(mode)
# ensure only N and O atoms are in the lection
lection = lection + " & e. n+o"
if not lection2:
hb = cmd.find_pairs(lection,lection,mode=mode,cutoff=cutoff,angle=angle)
el:
lection2 = lection2 + " & e. n+o"
hb = cmd.find_pairs(lection,lection2,mode=mode,cutoff=cutoff,angle=angle)
# sort the list for easier reading
hb.sort(lambda x,y:(cmp(x[0][1],y[0][1])))
for pairs in hb:
cmd.iterate("%s and index %s" % (pairs[0][0],pairs[0][1]), 'print "%1s/%3s`%s/%-4s " % (chain,resn,resi,name),')
cmd.iterate("%s and index %s" % (pairs[1][0],pairs[1][1]), 'print "%1s/%3s`%s/%-4s " % (chain,resn,resi,name),')
print "%.2f" % cmd.distance(hb_list_name,"%s and index %s" % (pairs[0][0],pairs[0][1]),"%s and index %s" % (pairs[1][0],pairs[1][1]))
#d("list_hb",list_hb)
#if __name__ == "__main__":
cmd.load("E:/yunpan/docking/1hsg_prot.pdb", "1hsg")
cmd.h_add("(1hsg)")
cmd.load("E:/yunpan/docking/indinavir.pdbqt","indinavir")
cmd.h_add("(indinavir)")
h_donator = "elem n,o & (neighbor hydro)"
h_acceptor = "elem o | (elem n & !(neighbor hydro))"
lacc = "indinavir & (elem o | (elem n & !(neighbor hydro)))"
ldon = "indinavir & (elem n,o & (neighbor hydro))"
pacc = "1hsg & (elem o | (elem n & !(neighbor hydro)))"
pdon = "1hsg & (elem n,o & (neighbor hydro))"
list_hb(ldon, pacc, hb_list_name="l2p_hbonds")
list_hb(lacc, pdon, hb_list_name="p2l_hbonds")
输出结果如下:
PyMOL>run E:/docking/list_hbonds.py
B/MK1`902/N4 B/GLY`27/O 3.03
B/MK1`902/O4 B/GLY`27/O 3.16
秦琼武器B/MK1`902/O2 A/ASP`25/OD1 2.77
B/MK1`902/O2 B/ASP`25/OD1 2.63
看上去⽐显⽰的氢键少了三个,这是因为我们在第⼆个函数中使⽤了H-键⾓度限制,如果在调⽤时给定参数list_hb(mode=0)则会获得⼀致结果。
H-bond结果展⽰。第⼀张图为运⾏display.pml后的结果,蓝⾊虚线为氢键;第⼆张图为运⾏list_hbonds.py后的结果, 黄⾊虚线为氢键(覆盖了之前的蓝⾊)。可以通过点选LaccPdon, LdonPacc, l2p_hbonds显⽰不同的氢键。
展⽰疏⽔表⾯
# color_h
# -------
# PyMOL command to color protein molecules according to the Einberg hydrophobicity scale
船坞登陆舰
#
# Source: us.expasy/tools/pscale/Hphob.Einberg.html
# Amino acid scale: Normalized connsus hydrophobicity scale
# Author(s): Einberg D., Schwarz E., Komarony M., Wall R.
# Reference: J. Mol. Biol. 179:125-142 (1984)
#
# Amino acid scale values:
#
# Ala: 0.620
# Arg: -2.530
# Asn: -0.780
# Asp: -0.900
# Cys: 0.290
# Gln: -0.850
# Glu: -0.740
# Gly: 0.480
# His: -0.400
# Ile: 1.380
# Leu: 1.060
# Lys: -1.500
# Met: 0.640
# Phe: 1.190
# Pro: 0.120
# Ser: -0.180
# Thr: -0.050
# Trp: 0.810
# Tyr: 0.260
# Val: 1.080
#
# Usage:
# color_h (lection)
#
from pymol import cmd
def color_h(lection='all'):
s = str(lection)
print s
cmd.t_color('color_ile',[0.996,0.062,0.062]) cmd.t_color('color_phe',[0.996,0.109,0.109]) cmd.t_color('color_val',[0.992,0.156,0.156]) cmd.t_color('color_leu',[0.992,0.207,0.207]) cmd.t_color('color_trp',[0.992,0.254,0.254]) cmd.t_color('color_met',[0.988,0.301,0.301]) cmd.t_color('color_ala',[0.988,0.348,0.348]) cmd.t_color('color_gly',[0.984,0.394,0.394]) cmd.t_color('color_cys',[0.984,0.445,0.445]) cmd.t_color('color_tyr',[0.984,0.492,0.492]) cmd.t_color('color_pro',[0.980,0.539,0.539]) cmd.t_color('color_thr',[0.980,0.586,0.586]) cmd.t_color('color_r',[0.980,0.637,0.637]) cmd.t_color('color_his',[0.977,0.684,0.684]) cmd.t_color('color_glu',[0.977,0.730,0.730]) cmd.t_color('color_asn',[0.973,0.777,0.777]) cmd.t_color('color_gln',[0.973,0.824,0.824]) cmd.t_color('color_asp',[0.973,0.875,0.875]) cmd.t_color('color_lys',[0.899,0.922,0.922]) cmd.t_color('color_arg',[0.899,0.969,0.969]) lor("color_ile","("+s+" and resn ile)")
自传入党范文
def color_h2(lection='all'):
s = str(lection)
肾与膀胱相表里
print s
cmd.t_color("color_ile2",[0.938,1,0.938])
cmd.t_color("color_phe2",[0.891,1,0.891])
cmd.t_color("color_val2",[0.844,1,0.844])
cmd.t_color("color_leu2",[0.793,1,0.793])
cmd.t_color("color_trp2",[0.746,1,0.746])
cmd.t_color("color_met2",[0.699,1,0.699])
cmd.t_color("color_ala2",[0.652,1,0.652])
cmd.t_color("color_gly2",[0.606,1,0.606])
cmd.t_color("color_cys2",[0.555,1,0.555])
cmd.t_color("color_tyr2",[0.508,1,0.508])
cmd.t_color("color_pro2",[0.461,1,0.461])
cmd.t_color("color_thr2",[0.414,1,0.414])
cmd.t_color("color_r2",[0.363,1,0.363])
cmd.t_color("color_his2",[0.316,1,0.316])
cmd.t_color("color_glu2",[0.27,1,0.27])
cmd.t_color("color_asn2",[0.223,1,0.223])
cmd.t_color("color_gln2",[0.176,1,0.176])
cmd.t_color("color_asp2",[0.125,1,0.125])
cmd.t_color("color_lys2",[0.078,1,0.078])
cmd.t_color("color_arg2",[0.031,1,0.031])
lor("color_ala2","("+s+" and resn ala)") lor("color_gly2","("+s+" and resn gly)") lor("color_cys2","("+s+" and resn cys)") lor("color_tyr2","("+s+" and resn tyr)")
将上⾯的脚本存储为color_h.py,在PyMOL界⾯运⾏File-Run-color_h.py,在命令⾏输⼊>PyMOl color_h- Show surface。