From: Axel Kohlmeyer (
Date: Wed Jun 25 2008 - 11:51:29 CDT

On Wed, 25 Jun 2008, Leonhard Henkes wrote:


check your selection syntax.

x < 25 or x > -25 is true for all atoms.


LH> Dear VMD user,
LH> at the moment I have set up a box system (x=50 Angstrom , y= 50 Angstrom, z=100 Angstrom) including water, a lipid bilayer (POPE) and a protein placed in the middle. The problem are some water molecules around the membrane. After reading the psfgen User Guide 1.4.5. I tried to reproduce the script for "deleting unwanted atoms" in which they produce a box and delete all the water outside the box. I liked the idea of deleting water with a box and I started to modify the script in a way, that it should delete all the waters inside this box/area. In the end, all waters get deleted and I'm running out of ideas, so plz have a look at my script and help me out.
LH> Thx for all your help,
LH> leo
LH> script:
LH> source "Config_leo.tcl"
LH> package require psfgen
LH> topology top_all27_prot_lipid.inp
LH> resetpsf
LH> readpsf $input.psf
LH> coordpdb $input.pdb
LH> mol load psf $input.psf pdb input.pdb
LH> set water_del [atomselect top "name OH2 and (x<25 or x>-25 or y<25 or y>-25 or z <25 or z>-25)"]
LH> foreach segid [$water_del get segid] resid [$water_del get resid] {
LH> delatom $segid $resid
LH> }
LH> writepdb $TEST_water.pdb
LH> writepsf $TEST_water.psf
LH> exit

Axel Kohlmeyer
   Center for Molecular Modeling   --   University of Pennsylvania
Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
tel: 1-215-898-1582,  fax: 1-215-573-6233,  office-tel: 1-215-898-5425
If you make something idiot-proof, the universe creates a better idiot.