From: Axel Kohlmeyer (
Date: Thu Nov 10 2011 - 09:27:47 CST

On Thu, Nov 10, 2011 at 8:58 AM, arash azari <> wrote:
> Dear all,
> I would like to know extra options for pbwithin selection in atomselect.
> Could you please let me know (by using pbwithin) how can I select all
> the water molecules in all image cells, not only 26 cells?

you cannot.

> How can I use the option “numperiodic” in atomselect?

you cannot.

> For more information please read the following lines.

what is described below is a different issue.
if you want to analyze an unwrapped trajectory
with on-the-fly-pbc evaluation, you will have
to implement the low-level code yourself. you
can do this by extending the c/c++ code within
VMD or writing a standalone tool. but as it
stands, there is no magic keyword to atomselect
that will make it do something that hasn't
been programmed yet.


> Thank you,
> Regards,
> Arash
> For example whenever I am saying to VMD to select:
> “name OH2 and pbwithin 5 of protein” and then loop over 40 ns of my
> simulation length to get the pdf files for each frame, it returns e.g.
> 12000 atoms for the first frame and it ends up with 7000 atoms for the
> last frame; my system leaks!
> When I checked my system in VMD and used the selection command in
> graphical representation GUI, I noticed that pbwithin only selects the
> atoms in the adjacent image cells (a cube with 27 cells which the
> central one is our original cell, say 26 image cells for selection),
> but I have so many water (oxygen) molecules which are located outside
> these image cells and pbwithin does not select them.
> I know one way is using PBCTools and wrap everything within the
> original cell, but I would like to avoid this option, because I am
> calculating the diffusion coefficient (MSD) for water molecules and I
> cannot use the wrap command.
> Another way is by writing a painful code (my system is slightly large;
> around 500,000 atoms) which selects all the water molecules and makes
> an imaginary protein coordinates in all image cells and then
> calculating the distance from protein and making selection and getting
> index.
> --
> Arash Azari

Dr. Axel Kohlmeyer
College of Science and Technology
Temple University, Philadelphia PA, USA.