[gmx-users] how to introduce vacuum??

Oliver Beckstein oliver at biop.ox.ac.uk
Wed Aug 6 02:40:01 CEST 2003

On Tue, 5 Aug 2003, Pedro Alexandre Lapido Loureiro wrote:

> > 1: i have one water box with a protein & some other molecules. the
> >height ( 'c' in the dimensions of the system) of the box is 60
> >angstroms. Now I have to introduce vacuum in a section of the box (
> >say from height of 45 AU to 55 AU) how do i do that??

You can use the killres.pl perl script that I attached; it allows you
to remove z-slices of given residues (typically SOL) from a gro
file. You will also need the Messages.pm perl module (also attached &
read the line USAGE in the comments). Run 'killres.pl --help' for,
well, help.

I put Messages.pm in ~/lib/perl and killres.pl somewhere in my PATH (eg
~/bin); then I'd try something like

killres.pl --output=with_vac.gro --resname=SOL --z1=4.5 --z2==5.5 \

Note that this assumes that your waters are named as residues SOL and that
all distances in gro files are in nm (not Angstrom). It is important that
the first residue in the gro file starts with the number 1 (see bugs in

I admit that this script is a bit too complicated (after all, a simple awk
would (almost) do the job, too) but it worked for me sofar *provided there
are less than 100,000 atoms* in your gro file---otherwise strange things
happen (any hints & feedback appreciated).


Oliver Beckstein * oliver at bioch.ox.ac.uk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: killres.pl
Type: application/x-perl
Size: 9040 bytes
Desc: killres.pl
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-users/attachments/20030806/5be31772/attachment.pl>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Messages.pm
Type: application/x-perl
Size: 2737 bytes
Desc: Messages.pm
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-users/attachments/20030806/5be31772/attachment-0001.pl>

More information about the gromacs.org_gmx-users mailing list