Some Useful Pymol Commands (revised 1/1/2020) This list is compiled by Loren Williams, Georgia Tech #----------------------------------------------------------------------------- ## Header: General Commands ## # delete all objects and reset pymol reinitialize # set the background color to white bg_color white # make the background transparent for ray trace set ray_opaque_background, 0 # set the ray trace mode # normal color set ray_trace_mode, 0 # normal color + black outline #set ray_trace_mode, 1 # black outline only #set ray_trace_mode, 2 # turn off shadows during ray trace set ray_shadows, 0 # set the mouse mode for laptop. config_mouse one_button # run the python program for hydrogen bonding interactions. run files/python/list_hbonds.py #------put the python program list_hbonds.py #------into the directory python. ## End of Header: General Commands ## #---------------------------------------- #-------------Part 1---------------- Navigation in Pymol (uses unix-like commands) #type these into the command line set mouse_selection_mode, 1 # sets the mouse to one button, good for laptop pwd # Where am I? (present working directory) # example pwd #---------gives you the following type of information /Users/LDW ls # What is in this directory? (list files and directories) # example ls #---------gives you the following type of information about the contents of the directory Applications Desktop Documents Downloads Downloads_Mail cd # change the directory # examples cd Desktop #--------- move down to the directory Desktop cd ../ #--------- move up one directory level cd /Users/LDW/Desktop/Folder_in_Desktop/BamHI #--------- fully specify the path, move to folder BamHI #-------------Part 2-------------------------- Loading a coordinate file load # load your pdb coordinates into pymol # example load 1s72.pdb, object_name #this loads the pdb file 1s72.pdb into an object called object_name disable object_name # turns object_name off enable object_name # turn object_name on delete object_name # removes object_name #-------------Part 3-------------------------- Set the Background Color bg_color white # set the background color white bg_color black # set the background color black bg_color red # set the background color red #-------------Part 4-------------------------- Selecting things and Creating Objects # click on an atom You clicked /4y6k//B/TRP`242/CA # CODE /object/segi/chain/resi/name # these commands make objects called obj_name create obj_name, resn TRP create obj_name, resi 242 create obj_name, name CA create obj_name, chain B # the last one puts the atoms from Chain B into obj_name # bolean functions. create obj_name, resn TRP and name CA create object_two chains, (chain A+B) create object_residue_number, resi 4 create object_residue_type, resn ADE create object_water, resn hoh create object atom_type, name N7 create object atom_type, name N* create object_element_C, element C create object_element_C, element C* create object_backbone, (name C3'+C4'+C5'+O3'+O5'+P+O1P+O2P) # use 'select' instead of 'create' to select atoms #-------------Part 5-------------------------- Representations of Molecules # Show molecules as sticks, spacefill, cartoon, etc hide everything, object_name # do this first. Turns off all representations of the # the atoms in object_name. show spheres, object_name # turns on the space-filling representation of object_name # now change the van der Waal radii of the atoms in object_name alter object_name, vdw=.6 rebuild # also set sphere_scale, 1 show sticks, object_name # turns on a stick representation of the object object_name # Set the thickness of sticks set stick_radius = 0.3, object_name # possible representations in pymol # lines # spheres # mesh # ribbon # cartoon # sticks # dots # surface # nb_spheres #-------------Part 6-------------------------- Cartoons show cartoon, object_name # shows object_name as a cartoon http://www.pymolwiki.org/index.php/Examples_of_nucleic_acid_cartoons use these commands ---------- set cartoon_ladder_mode, 1 set cartoon_ring_mode, 3 set ray_trace_mode, 1 set ray_trace_color, black forcing secondary structure alter TT_bb_iso_L22 and ((resi 81-90) or (resi 91-99)), ss='L' alter TT_bb_iso_L22 and ((resi 81-89) or (resi 91-99)), ss='S' show cartoon show cartoon, TT_a_iso_* color cyan, TT_a_iso_* ------------------------------ # DNA Cartoon Styles set cartoon_ring_mode=1, object_name set cartoon_ring_mode=2, object_name set cartoon_ring_mode=3, object_name # these commands show reduced representationss of DNA or RNA, with bases and sugars filled in. # set the width of the tube radius in the cartoon representation set cartoon_tube_radius=0.3, object_name # Protein Cartoon set cartoon_fancy_helices=1, object_name set cartoon_cylindrical_helices,2, object_name set cartoon_loop_radius=0.1, object_name # Draw the loops smooth=1 or pass through CA positions=0 # Set to 0 when showing side chains from a loop set cartoon_smooth_loops = 0 #-------------Part 7-------------------------- Colors # color each DNA nucleotides a different color color red, (resn ADE or resn A) and (object_name) color blue, (resn URA or resn U) and (object_name) color forest, (resn CYT or resn C) and (object_name) color violetpurple, (resn GUA or resn G) and (object_name) # color atoms by type color wheat, name C* and (object_name) color red, name O* and (object_name) color blue, name N* and (object_name) color yellow, name P* and (object_name) color orange, name S* and (object_name) # color the phosphate groups color yelloworange, (object_name and name P) color yelloworange, (object_name and name O5*) color yelloworange, (object_name and name O3*) color yelloworange, (object_name and name O1P) color yelloworange, (object_name and name O2P) # color by secondary structure color smudge, ss s and object_name color red, ss h and object_name color wheat, ss l and object_name #-------------Part 8---------------------- Transparency # change the transparency of the spheres in "object_name" set sphere_transparency=0.4, object_name # there are other, related commands for manipulating the transparency # of sticks, cartoons, etc. #-------------Part 8a-------------------------------- Superimposition # superimpose myoglobin_s onto hemoglobin_s align myoglobin_s, hemoglobin_s # myoglobin_s is moved #-------------Part 9---------------------------------- Hydrogen bonds distance WC_hbond1, (name O2,N3,N4 and resn C and object_name), (name N2,N1,O6 and resn G and object_name), 3.4 distance WC_hbond2, (name N3,O4 and resn T and b_dna_2 ), (name N1,N6 and resn A and object_name ), 3.4 color black, WC_hbond* set label_color, black, WC_hbond* # or else hide labels, WC_hbond* set dash_width, 5 set dash_gap, 0.2 #-------------Part 10---------------------------------- Labels label YRNA_interface and name Ca, resi+resn or label YRNA_interface and name Ca, "some text" set label_size, 18.0, YRNA_interface set label_color, deepteal, YRNA_interface set label_outline_color, black, YRNA_interface set label_shadow_mode=2, YRNA_interface set label_position, [1.3,1,2], YRNA_interface #-------------Part 11---------------------------------- forcing/breaking bonds bond (name Mg and resi 8026 and object_name), (name O1P and resi 2608 and object_name) unbond (name Mg and resi 8026 and object_name), (name O2P and resi 2610 and object_name) #-------------Part 12---------------------------------- Measurements and Interfaces # measure all distances less that 3.4 between resi 64 and object_name, # and put it in object dist_object distance dist_object = (resi 64), (object_name), 3.4 # set the font of object dist_object set label_font_id=7, dist_object # set the dash width set dash_width=3.5, dist_object # set the color color black, dist_object # within command show spheres, protein within 4 of (DNA and resn A and name N3) # Finds all atoms in object protein that are # within 4 ang of N3 atoms of A's in object DNA # byres: select entire residues within a certain distance of an object create interface, byres((object_name1 or object_name2 or object_name3) within 5 of object_name4) # or to create the interface around residue gpd within object1gp2 # don't forget the not statement create interface, byres((1gp2 and not resn gdp) within 5 of resn gdp) # and distance hbond1, (name O*,N* and glucose1), (name N*,O* and interface), 3.4 dihedral alpha1, (name O3* and resi 1748), (name P and resi 1749), (name O5* and resi 1749), (name C5* and resi 1749) # measure the torsion angle alpha for residue 1749 and put it in object alpha1 color deepteal, alpha1 set label_color, deepteal, alpha1 set dihedral_size, 1.0, alpha1 set angle_size, .6, b* #-------------Part 13---------------------------------- Making Images ray 800,800 # ray trace a figure (at resolution of 800x800 pixals) ray 200,200 # ray trace a figure (at resolution of 200x200 pixals) save view_2.png # write out a figure 'view_2.png' save figure_4_scratch/view_2.png # write out a figure 'view_2.png' into subdirectory 'figure_4_scratch' set light, (0,-5,-20) set direct = .5 # manipulate the lighting (not sure how these relate to each other # set direct = 1.0 puts the light directly on the normal, at the camera set ray_trace_fog = 0 # turn off the fog set ray_shadows=0 # don't show shadows. Especially for large structures set ray_opaque_background, off # transparent background - useful for overlaying images ##-------------Part 14---------------------------------- crystallography symexp syma=phosphate, (pt_center), 4.0 # load symmetry, # create objects containing sym-related phosphates within 4 ang of pt_center # objects pt_center and phosphate must already exist #----------------electron density maps isomesh summap_obj, summap, 1.5, (all), 1.0 #syntax: isomesh name_final, name_in_obj, contour level, residue range, border color density, summap_obj # isomesh dna_summap, summap, 2.5, (dna_coords),carve=1.6 color blue, dna_summap # carve the map around a specific set of atoms # in this case the dna_coords, with a 1.6 cushion