200 likes | 519 Views
Pymol Molecular Viewer: Pymol command language. most interaction with PyMOL is via a scripting language, not all functions are available from menus
E N D
most interaction with PyMOL is via a scripting language, not all functions are available from menus keyword followed optionally by one or more comma-separated arguments, e.g. color red, hetatm – colors all non-protein atoms red, color red – all atoms are red in most cases 1st argument is specific to command used, while the 2nd argument is the name of the object/selection, e.g. show spheres, resi 1
commonly used commands more in PyMol docs @ http://www.pymolwiki.org/
Pymol • download 1PD8, 1PD9 and 1PDB in PDB format • load them into Pymol as objects log_open log.pml load 1PD8.pdb, ter load 1PD9.pdb, bi load 1PDB.pdb, apo • Alignment align ter, apo align bi, apo
Secondary structure assignment • PDB files having ss from programs like DSSP • PyMOL has reasonably fast ss assignment using dss selection • To change assignments manually, the best way is to use the alter command as follows: show cartoon alter 40-52/, ss='L' # assign residues 40-52 as loop alter 52-65/, ss='S' # assign residues 52-65 as sheet alter 65-72/, ss='H' # assign residues 65-72 as helix rebuild # regenerate the cartoon
Pymol • download 1PD8, 1PD9 and 1PDB in PDB format • load them into Pymol as objects log_open log.pml load 1PD8.pdb, ter load 1PD9.pdb, bi load 1PDB.pdb, apo • Alignment align ter, apo align bi, apo • Alter Secondary structure alter (ter and (resi 59-60), ss='L' rebuild
Selections • Object (ter, bi and apo) • Show car, ter • Select 1, resn ALA and name N • #Select backbone nitrogens from alanineresidues • Show spheres, 1 • Select 2, resi 1:20 • #select residues 1-20 • Show sticks, 2 • select 3, elem O and not name OH • # Select all oxygen atoms except hydroxyls
Selection algebra and, or, not etc. how would you select resid 27 and resid 28?
# selects atoms that are part of chain a, but not # residue number 125. select chain a and (not resi 125) # The following two selections are equivalent select (name cb or name cg1 or name cg2) and chain A select name cb+cg1+cg2 and chain A # PyMOL will expand its logical selection out # from the innermost parentheses byres ((chain a or (chain b and (not resi 125))) around 5)
Pymol • select residue 301 in ter (name it CO4) • show it as stick, zoom at it • Save this selection as molecule in file co4-1.pdb • select CO4, (ter and resn CO4) • show stick, CO4 • Save co4-1.pdb, co4 • load co4-1.pdb, co4 #create new co4 object • Show surface, co4 • show sticks, byres ((ter and ((resn CO4) x; 3.5)))
objects vs. named-selections 1 • PyMOL creates an object-name to locate data when you load a data file. • Making selections is a way of pointing to a subset of that data. • Selections are in parentheses in control panel. • When you delete a selection-name, the data are still found under the object-name, but the data are no longer organized as the selection. In contrast, after you delete an object, you must reload the data to have access to it again. delete • PyMOL can hold several objects at the same time disable, enable
2 Named selections are static. Only atoms that exist at the time the selection is defined are included in the selection, even if atoms which are loaded subsequently fall within the selection criterion
Hydrogen bonds # EXAMPLE 1: Show hydrogen bonds between protein # and ligands (which must have hydrogens) load 1PD8.pdb,ter CO4 as a ligand h_add ter select don, (elem n,o and (neighbor hydro)) select acc, (elem o or (elem n and not (neighbor hydro))) dist HBA, (co4and acc),(terand don), 3.2 dist HBD, (co4and don),(terand acc), 3.2 delete don delete acc hide (hydro) hide labels,HBA hide labels,HBD
PymolHydrogen bonds • h_addter • select HD, (elemn,o and (neighbor hydro)) • select HA, (elem o or (elem n and not (neighbor hydro))) • dist HBD, (co4 and HD), (ter and HA), 3.5 #distant name = (selection1), (selection2), cutoff distant (selections are in the same obj) • dist HBA, (co4 and HA), (ter and HB), 3.5 • dist X, (ter and (resi 301 and name; C5')), (ter and (resi 31 and name; CE2)), 4.5
Pymol bg white set bg_rgb, [120, 12, 30] set dash_width, 5 set dash_radius, 10 label (resi 301 and name; o3'), "CO4" label (resi 31 and name; CA), “Phe31” set label_font_id, 10 set label_color, red
Save your work • PyMOL script – text file with commands, each at one line • *.pml • useful feature: get_view command • run script from PyMOL: @log.pml • or from command line as pymol aaa.pml • save the image • ray • png