PyMOLers,

This example was just too cool not to be made into a script.  See

  http://www.pymolwiki.org/index.php/FindSurfaceResidues

-- Jason

> Message: 3
> Date: Mon, 8 Jun 2009 19:01:01 -0700
> From: "Warren DeLano" <war...@delsci.com>
> Subject: Re: [PyMOL] Hi all...
> To: "Yasser Almeida Hernandez" <pedro...@fenhi.uh.cu>,
>       <pymol-users@lists.sourceforge.net>
> Message-ID:
>       <896b75251ba19745a529b1b867893fa50eb...@planet.delsci.local>
> Content-Type: text/plain;     charset="US-ASCII"
> 
> As for the your general question:  can you "import pymol; from pymol
> import cmd; pymol.finish_launching(); etc"?
> 
> Answer 1: Yes, if you manually compile PyMOL open-source code into an
> existing Python interpreter. 
> 
> Or 
> 
> Answer 2: Yes, if you run your Python script using PyMOL's built-in
> Python interpreter (launch PyMOL as follows):
> 
> ./pymol your-script.py      # with full 3D GUI
>   
> ./pymol -qc your-script.py  # command-line only (in a terminal)
> 
> Or 
> 
> Answer 3: Yes, if you call your Python script from a PyMOL script via
> the "run" or "spawn" commands inside PyMOL.
> 
> However,
> 
> Answer 4: No, if you want precompiled PyMOL build to work with an
> external precompiled Python build.  This approach has proved impractical
> due unavoidable application binary interface (ABI) version mismatches
> between PyMOL, Python, and the host environment.
>  
> As for your specific question, this is something you could do with a
> plain old script without even introducing the complexity of Python:
> 
> 
> load $TUT/1hpv.pdb, query
> 
> remove not polymer
> 
> create tmp, query
> 
> set dot_solvent
> 
> get_area tmp, load_b=1
> 
> # threshold on what one considers an "exposed" atom (in A**2):
> 
> remove tmp and b<2.5
> 
> tmp_dict = {}
> 
> iterate tmp, tmp_dict[(chain,resv)]=1
> 
> select exposed 
> 
> exposed = tmp_dict.keys()
> 
> exposed.sort()
> 
> print "Solvent exposed residues (chain,residue):"
> 
> for res in exposed: print res
> 
> select exposed, query in tmp
> 
> dele tmp
> 
> 
> # visual confirmation
> 
> color white
> 
> color red, byres exposed
> 
> set sphere_solvent
> 
> as spheres
> 
> orient
> 
> 
> Cheers,
> Warren


-- 

Jason Vertrees, PhD

Dartmouth College : j...@cs.dartmouth.edu
Boston University : jas...@bu.edu

PyMOLWiki : http://www.pymolwiki.org/

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net

Reply via email to