From: Olaf Lenz (lenzo_at_mpip-mainz.mpg.de)
Date: Sat Apr 17 2010 - 10:06:32 CDT

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 04/17/2010 03:40 PM, bharat gupta wrote:
> I kept my protein for simulation for 3ns duration but after 2ns
> simulation it has started coming out of the simulation box and the
> same thing happened with a friend of mine twice when he simulated his
> protein for 3ns . In gromacs we can tackle the same problem by setting
> the protein location to the centre of the box .. Can you tell me how
> can I do this in using pbc tools in VMD.

There is no way to fix the protein to the center with help of the pbc
tools. The pbc tools can only change which periodic box the atoms are in.
However, you can implement a function that shifts all atoms so that the
protein is always in the center in Tcl easily. Just have a look at the
different Tcl functions that VMD provides (in the UG:
http://www.ks.uiuc.edu/Research/vmd/current/ug/)
atomsel moveby (http://www.ks.uiuc.edu/Research/vmd/current/ug/node118.html)
measure center (http://www.ks.uiuc.edu/Research/vmd/current/ug/node133.html)

So, try something like (not tested, just from my mind):

# replace PROTEIN-SEL with the selection expression for the protein
set proteinsel [atomselect top "PROTEIN-SEL"]
# compute the offset (center of the protein)
set offset [vecinvert [measure center $proteinsel]}

# select all atoms
set allsel [atomselect top "all"]
# move all atoms by the given offset
$allsel moveby $center

I would guess you'll have to adapt this until it works.

Olaf
- --
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvJznQACgkQtQ3riQ3oo/pNogCeLnGfk+0ilwKvrLWxeiy5YP43
PHAAn1vwzBqyTZ2Sz/buHxJGToW98CgO
=OZN4
-----END PGP SIGNATURE-----