From: Justin Gullingsrud (
Date: Fri Dec 27 2002 - 09:46:09 CST

On Fri, Dec 27, 2002 at 10:41:52AM +0900, Rukman Hertadi wrote:


> Hi,
> I am just starting to use VMD 1.8, it is amazing that we can solvate the
> molecule using solvate plugin. I'd like to soak my protein into a spherical
> water droplet rather than a water box, can anybody who has the tcl scripts
> sent me the sample script.

You can carve a spherical drop of water out of a box by creating a sufficiently
large box, then deleting waters that are too far from the center. After you
create the box, load the newly created psf and pdb files back into VMD, then
enter something like the following at the Tcl console (or save it in a file
and run it as a script):

package require psfgen
set rad 25 # The radius of the water droplet
set r2 [expr $rad*$rad] # radius squared
set wat2delete [atomselect top "name OH2 and (sqr(x)+sqr(y)+sqr(z)>$r2"]
foreach segid [$wat2delete get segid] resid [$wat2delete get resid] {
  delatom $segid $resid
writepsf bubble.psf
writepdb bubble.pdb

The bubble will of course be centered at the origin; adjust the atom selection
accordingly to move the center of the bubble.


> Thank you in advance.
> Rukman Hertadi
> Laboratory of Biodynamics
> Graduate School of Bioscience and Biotechnology
> Tokyo Institute of Technology
> 4259 Nagatsuta-cho, Midori-ku, Yokohama,
> Kanagawa 226-8501, Japan.
> Phone: +81-45-924-5739
> FAX: +81-45-924-5806
> email:

  Justin Gullingsrud        3111 Beckman Institute        217-244-8946
  I been dropping the new science, and I be kicking the new knowledge,
  and I'm seeing to a degree that you can't get in college.  -- b.boys