Skip to content

Commit 0293931

Browse files
tevangspeleo3
authored andcommitted
show_ligand_interactions: new command (Pymol-Scripts#102)
New PyMOL command for creating publication quality images about receptor-ligand interactions.
1 parent 182a3c9 commit 0293931

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

show_ligand_interactions.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#show_ligand_interactions v.1.0
2+
# author: Thomas Evangelidis, 2019
3+
# License: BSD-2-Clause
4+
5+
from pymol import cmd, util
6+
7+
def show_ligand_interactions(recsel="not hetatm", ligsel="hetatm", cutoff=5):
8+
"""
9+
DESCRIPTION
10+
11+
Visualize interactions between receptor and ligand.
12+
13+
ARGUMENTS
14+
15+
recsel = string: atom selection of the receptor {default: "not hetatm"}
16+
17+
ligsel = string: atom selections of the ligand {default: "hetatm"}
18+
19+
cutoff = float: show as sticks all receptor residues within this distance from the ligand {default: 5.0}
20+
"""
21+
cmd.select('ligand', ligsel)
22+
cmd.select('receptor', recsel)
23+
cmd.bg_color('white')
24+
cmd.show_as('cartoon')
25+
cmd.show_as('sticks', 'hetatm')
26+
cmd.set('cartoon_transparency', 0.2)
27+
cmd.spectrum(selection=recsel+" or "+ligsel,byres=1)
28+
util.cbag('not elem C')
29+
cmd.set('cartoon_fancy_helices', 1);
30+
cmd.show("sticks", "(hydro)");
31+
cmd.select("pocket", "byres (receptor within %s of ligand)" % cutoff);
32+
cmd.show("sticks", "pocket")
33+
cmd.hide('(h. and (e. c extend 1))')
34+
cmd.set('h_bond_max_angle', 30)
35+
cmd.set('h_bond_cutoff_center', 3.6)
36+
cmd.set('h_bond_cutoff_edge', 3.2)
37+
cmd.dist('ligand_Hbonds', 'ligand', 'receptor', 3.5, mode=2)
38+
cmd.set('dash_radius', 0.15)
39+
# now set the label options
40+
cmd.set('label_size', 20)
41+
cmd.set('label_position', [0,0,10])
42+
43+
cmd.extend('show_ligand_interactions', show_ligand_interactions)

0 commit comments

Comments
 (0)