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
> -----Original Message-----
> From: Yasser Almeida Hernandez [mailto:[email protected]]
> Sent: Friday, June 05, 2009 9:18 AM
> To: [email protected]
> Subject: [PyMOL] Hi all...
>
> I want to make a python script to list the surface residues of a
> protein. The idea is import the pymol module inside the script,
> receive the pdb file to be analyzed and run the pymol's commands to do
> this task. It is possible..? the script is to tun in a classical
> terminal...
>
> Thanks...
>
> ----------------------------------------------------------------
> Correo FENHI
>
>
>
>
>
------------------------------------------------------------------------
--
> ----
> OpenSolaris 2009.06 is a cutting edge operating system for enterprises
> looking to deploy the next generation of Solaris that includes the
latest
> innovations from Sun and the OpenSource community. Download a copy and
> enjoy capabilities such as Networking, Storage and Virtualization.
> Go to: http://p.sf.net/sfu/opensolaris-get
> _______________________________________________
> PyMOL-users mailing list ([email protected])
> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
> Archives:
http://www.mail-archive.com/[email protected]
>
>
------------------------------------------------------------------------------
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 ([email protected])
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/[email protected]