Annotation wizard

From PyMOLWiki
Revision as of 21:53, 19 May 2011 by Inchoate (talk | contribs) (Created page with "Here's an example of using the annotation wizard: <source lang="python"> import pymol ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Here's an example of using the annotation wizard:

import pymol                                                                                                                                                                                
                                                                                                                                                                                            
# fetch a protein and setup the view
cmd.fetch("1oky", async=0)                                                                                                                                                                  
cmd.extract("ligand", "resn STU")                                                                                                                                                           
cmd.show_as("sticks", "resn STU")                                                                                                                                                           
cmd.show("surface", "ligand")                                                                                                                                                               
cmd.flag("ignore", "not rep surface")                                                                                                                                                       
cmd.set("surface_color", "grey")                                                                                                                                                            
cmd.set("transparency", 0.3)                                                                                                                                                                
cmd.distance("(ligand)", "(poly)", quiet=1, mode=2, label=1)                                                                                                                                

# turn on the annotation wizard + prompt                                                                                                                                                                                            
cmd.wizard("annotation")                                                                                                                                                                    
cmd.set("wizard_prompt_mode", 1)                                                                                                                                                            

pymol.session.annotation = {}                                                                                                                                                               
                                                                                                                                                                                            
state_dict = {1: ['\\999Molecules:','  \\459staurosporine (ligand)','  \\459protein (1oky)','\\999Objects:','  \\459Hydrogen bond neighbors',]}                                             
                                                                                                                                                                                            
pymol.session.annotation["1oky"] = state_dict