#load the PDB file
load c:\2CM8.pdb

#adjust background lighting
#set the ambient lighting
set ambient=0.14 
#set the direct lighting
set direct=0.3  

#hide the default representation
hide all

#set up variables for representations

#fancy helices
set cartoon_fancy_helices=1 
#flat beta sheets
set cartoon_flat_sheets = 0 
#smooth loops
set cartoon_smooth_loops = 0  
#cartoon representation of the protein
show cartoon, /2CM8//A  
#transparency of the cartoon representation of the protein
set cartoon_transparency=0.5, /2CM8//A 

#sphere representation of the waters
show sphere, /2CM8//Z 
#set size of the sphere for the water at 0.2
set sphere_scale=0.2, /2CM8//Z

#dot representation of the Mg ion
show dot, /2CM8//A/1300  
#set density of the dots for the water at 5
set dot_density=5, /2CM8//Z

#stick representation of the ligand
show sticks, /2CM8//A/1299 
#set the radius of the sticks to 0.4
set stick_radius=.4

#surface representation of the protein
show surface, /2CM8//A  
#transparency of the surface representation of the protein
set transparency=0.3, /2CM8//A  

#make a custom color
cmd.set_color('cyan',[0.5,1.0,1.0])

#color the structures
#color the protein salmon
color salmon, /2CM8//A  
#color the waters the custom color cyan
color cyan, /2CM8//Z
#color the Mg ion red
color red, /2CM8//A/1300 
#color the ligand the blue
color blue, /2CM8//A/1299 

#set label variables
#label color
set label_color=dash
#label font
set label_font_id=4
#set label position
set label_position=[3,3,2]
#add labels
label /2CM8//A/1299/C12, "ligand"
label /2CM8//A/1300, "Mg ion"

# set the view
set_view (\
     0.454857916,   -0.874098599,   -0.170457616,\
    -0.826678693,   -0.485608459,    0.284229279,\
    -0.331220239,    0.011628916,   -0.943481266,\
     0.000000000,    0.000000000, -275.660125732,\
    43.778598785,   16.942298889,   15.083831787,\
   236.467651367,  314.852630615,    1.000000000 )

# move to the right place
#translate [-40,-30,0]

#set up the variables for the background representation
#color the background yellow
bg_color black  
#set the depth
set depth_cue=0  
#add some fog
set ray_trace_fog=10

#prepare variables for ray tracing 
#set the orthoscopy
set orthoscopic=0.3  
#improve the resolution
set antialias=1.0  
#crank up the glossiness
set spec_power = 200  
set spec_refl=1.5 


#specify a large ray-traced image type,
#ray 600,600

#save the scene
#png c:\filename.png