"""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_6bkg_A_1-6bkg_T_P_D_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 30+32+35+74+81+82+83+84+85+86+87+88+91+159+162+164+192+193+194+195+197+199+200+201+250+251+253+271+272+273+274+275+276+277+278+279+292+293+294+296+298+331+345+346+347+348+349+350+352+353+354+367+403+427+430+432+441+443+445+447+449+451+453+454+470+472+473+474+475+476+481+482+483+504+505+506+507+508+509+510+511+512+513+542+544+560+565+566+567+568+569+570+575+576+577+578+579+580+582') cmd.select('B_interface', 'chain B and resi 2+3+4+5+6+7+8+9+10+11+12+13+14+15+16+22+23+24+25+26+27+28+29+30+31+32+33+34+35+36+37') cmd.select('interface', 'A_interface or B_interface') cmd.select('A_interface_H_bonds', 'chain A and resi 83+85+85+88+91+162+195+200+201+271+273+278+278+292+293+294+345+348+449+451+451+454+473+481+505+512+567+570+580') cmd.select('B_interface_H_bonds', 'chain B and resi 26+25+26+25+24+14+6+4+3+30+30+29+30+28+31+28+28+11+30+31+32+32+7+7+8+35+10+9+33') cmd.select('interface_H_bonds', 'A_interface_H_bonds or B_interface_H_bonds') cmd.select('A_interface_ligands', 'chain A and resi 703') 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())