Hi Stephane,
Tsjerk as usual provides a clever answer. However, if in any case a
urea goes missing an atom, maybe due to experimental reasons, or you
want to use this technique for something other than urea then Tsjerk's
answer will need to be modified.
I offer a slightly different solution. I've written a script that
counts distinct molecular objects in a given selection. You can
download it from the PyMOLWiki here,
http://www.pymolwiki.org/index.php/Count_molecules_in_selection.
See the examples to learn how to use it.
Tsjerk's solution will always be faster. Mine will be more flexible.
Use what works for you.
Cheers,
-- Jason
On Fri, Sep 28, 2012 at 10:03 AM, ABEL Stephane 175950
<[email protected]> wrote:
> for the pymol-users mailing list archive and to close my message
>
> Tsjerk Wassenaar gave the command :
>
> print cmd.count_atoms("byres resn URE within 3.5 of peptide")/8. it works !!!
>
> Thanks to him !!!
>
> Bye
>
> Stephane
>
> ------------------------------
>
> Message: 8
> Date: Fri, 28 Sep 2012 12:59:27 +0000
> From: ABEL Stephane 175950 <[email protected]>
> Subject: [PyMOL] Obtain the number of molecule in the first hydration
> shell of a peptide.
> To: "[email protected]"
> <[email protected]>
> Message-ID:
> <[email protected]>
> Content-Type: text/plain; charset="us-ascii"
>
> Dear pymol users,
>
> I would like to obtain with Pymol (v1.3) the number of urea molecules in the
> first shell of a peptide. To do this I have defined the object urea as
> following
>
> select UREA, resn URE
>
> and used the following cutoff for the first hydration shell:
>
> select UREA_firstshell, UREA within 3.5 of peptide
>
> And finally used the command:
>
> print cmd.count_atoms("UREA_firstshell") to obtain the number of atom at the
> distance of 3.5 A from the peptide.
>
> Of course, these commands work well, but my aim is to obtain the number of
> molecules instead of the number of atoms. How to do that ?
>
> For info, urea has 8 atoms.
>
> Thank you for you help
>
> Stephane
>
>
> ------------------------------
>
> ------------------------------------------------------------------------------
> Got visibility?
> Most devs has no idea what their production app looks like.
> Find out how fast your code is with AppDynamics Lite.
> http://ad.doubleclick.net/clk;262219671;13503038;y?
> http://info.appdynamics.com/FreeJavaPerformanceDownload.html
>
> ------------------------------
>
> _______________________________________________
> PyMOL-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pymol-users
>
>
> End of PyMOL-users Digest, Vol 76, Issue 10
> *******************************************
> ------------------------------------------------------------------------------
> Got visibility?
> Most devs has no idea what their production app looks like.
> Find out how fast your code is with AppDynamics Lite.
> http://ad.doubleclick.net/clk;262219671;13503038;y?
> http://info.appdynamics.com/FreeJavaPerformanceDownload.html
> _______________________________________________
> PyMOL-users mailing list ([email protected])
> Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
> Archives: http://www.mail-archive.com/[email protected]
--
Jason Vertrees, PhD
PyMOL Product Manager
Schrödinger, Inc.
(e) [email protected]
(o) +1 (603) 374-7120
------------------------------------------------------------------------------
Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219671;13503038;y?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
PyMOL-users mailing list ([email protected])
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/[email protected]