"""This is PyMOL script generated by PPI3D webserver. Run it with PyMOL and explore the structure of protein-protein interface. Usage: pymol script.py Commands: show_interface() show_hydrogen_bonds() show_interface_ligands() """ from pymol.wizard import Wizard cmd.load('https://bioinformatics.lt/ppi3d/downloads/example1/pdb_files/1_3l2p_A_1-3l2p_D_B_C_1.pdb') chain_A_color = 'carbon' # PyMOL default chain_B_color = 'cyan' # PyMOL default chain_A_residues_color = 'lightorange' chain_B_residues_color = 'lightmagenta' cmd.set('seq_view', 'on') cmd.set('label_position', '(2, 1, 2)') def start(): cmd.hide('all') cmd.show('cartoon') util.cbc() util.cnc() def visualize(selection, how, color, labels): if selection in cmd.get_names('selections'): cmd.show(how, selection) cmd.color(color, selection) if labels: label_selection = '%s and name ca' % selection cmd.set('label_color', color, label_selection) cmd.label(label_selection, '"%s-%s" % (resn, resi)') else: return def visualize_interface(what, how='sticks', labels=False, distances=False): global chain_A_residues_color global chain_B_residues_color start() suffix = ('_%s' % what) if what else '' a = 'A_interface%s' % suffix b = 'B_interface%s' % suffix visualize(a, how, chain_A_residues_color, labels) visualize(b, how, chain_B_residues_color, labels) if distances: cmd.delete('_distances') cmd.distance('_distances', a, b, mode=2) util.cnc() cmd.deselect() cmd.select('A_interface', 'chain A and resi 190+191+192+193+229+231+232+233+234+235+236+237+238+241+245+301+302+303+304+331+332+334+335+336+337+338+339+340+341+351+355+398+399+400+401+407+411+423+424+425+426+440+441+442+444+445+446+447+450+473+487+488+491+492+493+494+582+583+584+585+588+590+592+593+613+614+615+616+617+622+623+640+641+642+643+644+645+646+647+648+649+703+704+705+707+708+712+713+714+715+716+717+718+719+720') cmd.select('B_interface', 'chain B and resi 4+5+6+7+8+9+10+11+12+13+14+15+16+17+18+19+20+21+27+28+29+30+31+32+33+34+35+36+37+38+39+40+41+42') cmd.select('interface', 'A_interface or B_interface') cmd.select('A_interface_H_bonds', 'chain A and resi 191+192+193+193+233+235+238+301+303+336+338+341+351+440+441+442+493+494+583+588+593+614+616+616+622+640+641+641+648+703+703') cmd.select('B_interface_H_bonds', 'chain B and resi 41+40+41+42+30+29+29+19+20+9+8+8+7+32+34+32+16+16+6+34+35+11+9+10+11+13+12+13+38+13+14') cmd.select('interface_H_bonds', 'A_interface_H_bonds or B_interface_H_bonds') cmd.select('A_interface_ligands', 'chain A and resi 901') cmd.select('interface_ligands', 'A_interface_ligands') class PPI3D_Interface(Wizard): def show_interface(self): visualize_interface('') def show_hydrogen_bonds(self): visualize_interface('H_bonds', labels=True, distances=True) def show_interface_ligands(self): visualize_interface('ligands', 'spheres') def clear_labels(self): cmd.label('all', '') def get_panel(self): return [['1', 'PPI3D Interface', ''], ['2', 'Interface', 'cmd.get_wizard().show_interface()'], ['2', 'H-bonds', 'cmd.get_wizard().show_hydrogen_bonds()'], ['2', 'Interface ligands', 'cmd.get_wizard().show_interface_ligands()'], ['2', 'Clear labels', 'cmd.get_wizard().clear_labels()']] start() interface = PPI3D_Interface() cmd.set_wizard(interface) interface.show_interface() cmd.extend('show_interface', lambda: interface.show_interface()) cmd.extend('show_hydrogen_bonds', lambda: interface.show_hydrogen_bonds()) cmd.extend('show_interface_ligands', lambda: interface.show_interface_ligands()) cmd.extend('clear_labels', lambda: interface.clear_labels())