From: Jason V. <jv...@cs...> - 2009-06-09 18:55:43
|
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" <wa...@de...> > Subject: Re: [PyMOL] Hi all... > To: "Yasser Almeida Hernandez" <ped...@fe...>, > <pym...@li...> > Message-ID: > <896...@pl...lsci.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 : jv...@cs... Boston University : ja...@bu... PyMOLWiki : http://www.pymolwiki.org/ |