# general_comments.pml
# --------------------

# A PyMOL script input file with comments.
# This file includes the most useful PyMOL options for many image types.
# Lines that start with a hash (#) are comments
# Some commands are commented out as well, uncomment if needed.
# ";" separates commands, we use it here to place the comments after the command for explanations
# Text file without comments here.
# This file to save as pml file with comments here.

reinitialize ; #reinitialize PyMOL to startup state -> important especially for re-reading pml scripts

# load structures
# ---------------

# load one or several structures
# load ../my_pdb.pdb, pdb1
  fetch 4eiy, pdb1 ; # fetches structure file from PDB entry 4eiy (as cif file)
# load ../my_reference.pdb, pdb2

# superpositions: use "super" or "cealign" instead of "align" for proteins with seq_identity <~ 30 %; align moved, reference
# align pdb1 and name CA, pdb2 and name CA and resi 100-200 ; # align based on CA coordinates and a certain region of the structure.


# create objects or selections
# --------------
--------------
create ligand, pdb1 and chain A and resi 2401
create receptor, pdb and chain A and not residue 2401
create env, byres (resn ZMA around 5.0) and not resn ZMA ; # all residues 5 Ang. around the ligand

# select ligenv, ligand or env


# general definitions and graphics
# --------------------------------

# note that the fog, fog_start, opaque_background options also change the corresponding options for ray trace mode, but these can also be controlled individually
#viewport 800, 600     ; # size of Pymol screen -> should be adapted to match the approx. visual appearance of the objects you want to show
set hash_max, 100     ; # memory assigned for ray tracing (in MB). Default is 100. Increase for increased speed, decrease if PyMOL crashes upon ray tracing
set bg_rgb, white     ; # white background. set bg can be used with predefined Pymol color values. (https://pymolwiki.org/index.php/Color_Values)
set depth_cue, on     ; # Enable fog in openGL rendering (draw and interactive view)
set fog, 1.0          ; # Sets fog density (0.0 ... 1.0)
set fog_start, 0.6    ; # controls z depth, where fog starts. Decrease to start more in front.
set orthoscopic, on   ; # Turning orthoscopic on, turns perspective off, -> parallel lines: parallel, identical for close and distant objects
clip slab, 100        ; # Sets the slab thickness to value in Angstrom, centered at the current screen center
set opaque_background, on ; # Draw background in bg_rgb color. Set to "off" for transparent background.
set ray_shadows, off  ; # Do not generate shadows in ray tracing mode
hide everything       ; # hide all previous objects, e.g. default PyMOL representations upon loading structures


# fold cartoon
# ------------

dss ; # improved secondary structure assignment
# set cartoon_side_chain_helper, on ; # for residues represented in cartoon and sticks: show only side_chain, force cartoon to go through CA
# set cartoon_fancy_helices, on  ; # test on and off and see what you prefer
# set cartoon_highlight_color, white ; # color on the inside of helices
set cartoon_gap_cutoff, 20; # increase the distance cutoff up to which missing loops will be shown as broken lines
set cartoon_transparency, 0.0
; # set cartoon transparency from 0.0 ... 1.0, may be followed by selection
show cartoon, receptor
# set cartoon_color, paleblue, receptor; # set the cartoon color independent of CA color (default is: CA color)

# molecular surface
# -----------------
#create msurface, receptor ; # create a new object for the surface to be able to switch it on and off
#hide all, msurface
#show surface, msurface
#set transparency, 0.5 , msurface; # transparency is in fact the cartoon transparency
#set surface_color, white, msurface ; # otherwise the color of the atoms near the surface will determine the color of the nearby surface regions


# residues
#----------

set stick_radius, 0.2
set valence, 0    ; # valence > 0 shows double bonds as such
#show sticks, resi 101-103 and chain A ; # show this residue range
#show sticks, resn CYS and (sidechain or name CA) ; # show all cysteine side chains
#show sticks, env
show sticks, resi 100+200 and not name C+N+O ; # show only side chain for these residues
util.cbay           ; # color N blue, O red, H white and C yellow -> for more options press tab after you typed in "util.cba" into the command line
color grey50, ele C ; # color carbon atoms grey
#util.chainbow("4eiy and not het") ; # the protein chain is colored as rainbow

show sticks, ligand
color gold, ligand and ele C
set valence, 1, ligand ; # value 1 -> show valences (double bonds ...) for the ligand; value 0 -> don't show double bonds


# metal ions and waters
# ---------------------

color grey, ele ZN
set sphere_scale, 0.3 ; # adjust radius of spheres, you may add a selection: set sphere_scale, radius, selection
show sphere, ele ZN ; # show metal ions as spheres

color red, resn HOH
show nb_spheres, resn HOH   ; # waters are generally named "HOH"
# set nb_spheres_size, 0.25 ; # change the size of the nb_spheres

# distances, interactions
# -----------------------

set dash_gap, 0.4
set dash_radius, 0.05
set dash_length, 0.3

#dist hbonds, ligand or env, ligand or env,  mode=2 ; # this command shows all polar distances
                                                   # this will include "interactions" that do NOT satisfy donor angle criteria or valid donor/acceptor pairs 
# specify interactions by clicking on the atoms and copy/paste selection strings
#dist hbond1, /4eiy/B/A/ZMA`2401/N15, /4eiy/B/A/ZMA`2401/N15
show dashes, hbonds ; # using an "*" character acts as a wildcard -> dashes are shown for e.g. for DIST1, DIST2, ...
hide labels, hbonds
color black, hbonds


# electron density maps
# ---------------------

#fetch 4eiy, type=2fofc, pdb1ed  ; # load 2fofc structure factors for this pdb id
#isomesh mesh1, pdb1ed, 1.0, ligand, carve=2.0  ; # generate mesh from structure factors
#set mesh_width, 0.3     ; # line width of the mesh
#color grey50, mesh1     ; # color of the mesh
#show mesh, mesh1        ; # show mesh as object mesh1


# labels (don't, add them in inkscape!)
# ------

set label_color, black
set label_outline_color, black
set label_bg_color, back   ; # set the overall background color to the semitransparent boxes behind the labels 
set label_size, 16
set label_font_id, 7
set label_position=[0.0, 0.0, 2.0] ; # shift label in x,y,z direction
#label name CA and resi 100+101,"%s-%s" % (resn,resi) ; # label selection in the style "HIS-18"
#label name CA and resi 100, "H100"


# viewpoint
# ---------

orient ligand ; # orients the ligand around the principal axes
center ligand ; # centers on the ligand
zoom ligand ; # zooms on a selection
# after you adjusted a good view press "Get View" or type in the command line "get_view" and paste the view matrix here!
# ***********PASTE VIEW MATRIX HERE ************


# for final raytracing:
# --------------------

# Press Display, Quality, Maximum Quality or uncomment the following line
# util.performance(0)   ; # Set  "high quality"
# adjust draw/ray size to sensible values and save the values here for later changes

# ray 1800, 1200 ; # ray tracing
# alternatively use the draw command to render the image with the Pymol OpenGL rendering engine
# draw 1800, 1200

# saving the image to a PNG file
# png 4eiy_protein.png ;# cd to a suitable directory before or include path

Back to PyMOL tutorial main page.