[gmx-users] File editing - only one layer of water around a molecule

Justin A. Lemkul jalemkul at vt.edu
Tue May 1 20:55:47 CEST 2012

On 5/1/12 2:40 PM, Lara Bunte wrote:
> Hi
> There is a new problem :-(
> If I used the commands
> g_select -s molecule.pdb -select '"Close to ISO" resname SOL and within 1.2 of resname ISO'
> and
> trjconv -n index.ndx -f molecule.pdb -s molecule.pdb -o output.pdb
> I got only water in my output.pdb

As you should expect.  Your command creates a group called "Close to ISO" that 
consists of any residue named SOL that has any atom within 1.2 nm of a residue 
named ISO.

> Than I tried all 8 possible permutations of ISO and SOL in g_select and I always got only water or only the molecule without any water.
> But what I need is the molecule and only three layers of water around the molecule.
> What is the problem?

There is no problem, you just need to do a bit more work.

You now have an index file with the water molecules that satisfy your criteria. 
  You then need to utilize that index file to create a new, merged group 
consisting of ISO and the water molecules.  You can use make_ndx:

make_ndx -f molecule.pdb -n index.ndx -o index_new.ndx

Type "help" to see examples.  What you need to do is merge your ISO group with 
your "Close to ISO" group.  So, for instance, if ISO is group 1 and "Close to 
ISO" is group 5, you would type:

1 | 5

at the make_ndx prompt, which will create a group called Close_to_ISO_ISO, thus 
a merged group of all atoms in "Close to ISO" and ISO.



Justin A. Lemkul
Ph.D. Candidate
ICTAS Doctoral Scholar
Department of Biochemistry
Virginia Tech
Blacksburg, VA
jalemkul[at]vt.edu | (540) 231-9080


More information about the gromacs.org_gmx-users mailing list