Cun,

To answer your last outstanding question, I don't think PyMOL saves
anything beside the basic atom info for PDB files.  PSE files--PyMOL
session files--save everything.  If you're using linux or a Mac, you
can always just paste the header back on.  An unideal solution, but it
will work.  For those familiar with Warren, he used to joke that PyMOL
could read nearly everything, but didn't export much.  :-)

Good work on that script.  As an exercise, I created a similar script
that given any selection, it will select atoms of a certain type
within it.  So, you can do something like:
    selInside someSelection, solvent
    selInside someSelection, *
which will create a new selection of all those solvent atoms inside
the bounding box (which can be any selection, box or object) you
declare.  You could also create two pseudoatoms anywhere you in your
pdb and use those to define the bounding box. For example,
   load $TUT/1hpv.pdb
   pseudoatom b1, pos=[0,0,0]
   pseudoatom b2, pos=[10,10,10]
   selInside b1 or b2
and the new selection called (insideBoundingObj) has those atoms
within b1 and b2 selected.

You can access the script at http://pymolwiki.org/index.php/SelInside

Hope this helps,

-- Jason

--
Jason Vertrees, PhD

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



On Thu, Nov 26, 2009 at 6:00 PM, Cun Zhang <apzc2...@gmail.com> wrote:
> hi, Jason.
> Thank you for your advice.  I  attach the pdb file at the end.
>
> Cun Zhang
>
>
> The script which is to delete the water molecules inside CNT (with Radii
> 6.26 A ) is :
>
> #!/usr/bin/python
> import __main__
> __main__.pymol_argv = ['pymol','-qc']#Quiet and no GUI
>
> import sys,os,re,pexpect
> import pymol
> from pymol import cmd
>
> pymol.finish_launching()
>
> def selHOH(R):
>     cmd.delete("CNT")
>     cmd.delete("water")
>     cmd.select("CNT","resn UNK")
>     cmd.center("CNT")
>     CENTER=cmd.get_position()[0:2]
>     cmd.delete("CNT")
>     cmd.select("water","resn SOL")
>     atoms=cmd.get_model("water")
>     cmd.select("Water",None)
>     for at in atoms.atom:
>         if (at.coord[0]-CENTER[0])**2+(at.coord[1]-CENTER[1])**2<R**2:
>             cmd.select("Water","Water or byres index %d"%at.index)
>     cmd.remove("Water")
>     cmd.deselect()
>
> The command I use in pymol is:
>
>>load b4em.pdb
>>run selSOL.py
>>selHOH(6.2)
>>save b4em.pdb
>
> b4em.pdb
>
>
>
> 27/11/09 04:48:54, Jason Vertrees <jason.vertr...@gmail.com>:
>
> Can you send me a copy of the PDB file? I'd like to try it on my computer.
>
> Jason Vertrees, PhD
>
> PyMOLWiki -- http://www.pymolwiki.org
>
>
>
> On Wed, Nov 25, 2009 at 9:28 PM, Cun Zhang <apzc2...@gmail.com> wrote:
>> Hi, pymol users.
>> I'm a pymol newbie .I have serval question.
>> I have a pdb file which include the information about box size, like
>> TITLE     God Rules Over Mankind, Animals, Cosmos and Such
>> REMARK    THIS IS A SIMULATION BOX
>> CRYST1   39.000   39.000   56.140  90.00  90.00  90.00 P 1           1
>> MODEL        1
>> HETATM    1  C   UNK     1      25.851  19.500   0.710  1.00  0.00
>>
>> I run pymol, and load it, then delete some molecules and save it. Now the
>> information about box size is losing.
>>
>> 2. Is there any way to get  the information about bonds, angles and
>> dihedrals ?
>>    I found the following command can display the bonds information, but
>> can't be assigned to a variable.
>>       >cmd.select('all')
>>       >atoms=cmd.get_model('sele')
>>       >print atoms.list()
>> 3. Is there any way to learn these python api commands of pymol ?
>>
>> Thank you!
>>
>>
>> Blog: http://blog.4message.net
>>
>>
>> ------------------------------------------------------------------------------
>> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
>> 30-Day
>> trial. Simplify your report design, integration and deployment - and focus
>> on
>> what you do best, core application coding. Discover what's new with
>> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
>> _______________________________________________
>> 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
>>

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
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