[gmx-users] genbox/editconf

Yang Ye leafyoung81-group at yahoo.com
Thu Jan 12 09:35:57 CET 2006

Junfang.Zhang at csiro.au wrote:

>Dear Yang Ye and Gromacs Users,
>Can you please let me know how to insert water molecules (water.gro)
>between two fixed layers (wall.gro). The normal of the layers is in z
>When I used
>genbox -cp wall.gro -cs water.gro -box 2.112 1.828 1.8 -o out.gro
>I found some water molecules are not between the two layers.
try a smaller z-value, say 1.75.

>As -box specify the box vector lengths, 
>how could I put water molecules in the range of z coordinates between
>0.5 and 1.8?
If above does not work, try this with perfectionism.

get the resulting .gro file (water_box.gro) from above, strip out file 
header and footer, leave just

1SOL   OW  ...
1SOL   HW1 ...

And use this line,

awk 'BEGIN {pass=0;} NR % 3 == 1 {pass=0; line1=$0; if ($6>1.8 || 
$6<0.5) {pass=1;}} NR % 3 == 2 {line2=$0;if ($6>1.8 || $6<0.5) 
{pass=1;}} NR % 3 == 0 {line3=$0;if ($6>1.8 || $6<0.5) {pass=1;} if 
(pass==0) {printf("%s\n%s\n%s\n", line1,line2,line3);}}' water_box.gro

And collect the output as file.

>Thank you in advance,
>gmx-users mailing list
>gmx-users at gromacs.org
>Please don't post (un)subscribe requests to the list. Use the 
>www interface or send it to gmx-users-request at gromacs.org.

Yang Ye
/Computational Biology Lab
School of Biological Sciences
Nanyang Technological University
Tel: 6316-2884

More information about the gromacs.org_gmx-users mailing list