[gmx-users] Removal of Waters in Hydrophobic Core

Sanim Rahman sanimr at mail.usf.edu
Thu Nov 24 22:12:17 CET 2016


Hello,

I am currently working through the second tutorial of the Bevan Labs KALP15
simulation. I am attempting to use the keepbyz.pl script to remove the
waters in the hydrophobic core. I have designated a upperz and
lowerz coordinated and followed the entire section highlighted in the
instructions, however, my output (new_system_sequential_numbers.gro) has no
deleted water molecules. It is the same system as  solvated.gro.

I believe my error is within the keepbyz.pl file, because when I input the
command:

chmod +x keepbyz.pl new_waters.gro > keep_these_waters.gro

the file "keep_these_waters.gro" is an empty file.

Here is my script for keepbyz.pl:

#!/bin/bash
# give new_waters.gro as first command line arguement
upperz=5.821
lowerz=0.574
sol=SOL
count=0
cat $1 | grep "$sol" | while read line; do
  for first in $line; do
    break
  done
  if [ "$count" = 3 ]; then
    count=0
  fi
  count=$(expr $count + 1)
  if [ "$count" != 1 ]; then
    continue
  fi
  l=${#line}
  m=$(expr $l - 24)  // would use -48 if velocities are also in .gro and
-24 otherwise
  i=1
  for word in ${line:$m}; do
    if [ "$i" = 1 ]; then
      popex=$word
    else
      if [ "$i" = 2 ]; then
        popey=$word
      else
        if [ "$i" = 3 ]; then
          popez=$word
          break
        fi
      fi
    fi
    i=$(expr $i + 1)
  done
  nolx=`echo "$popez > $upperz" | bc`
  nohx=`echo "$popez < $lowerz" | bc`
  myno=$(expr $nolx + $nohx)
  if [ "$myno" != 0 ]; then
    z=${#first}
    if [ "$z" != 8 ]; then
      sfirst="[[:space:]]$first"
    else
      sfirst=$first
    fi
    `echo grep $sfirst $1`
  fi
done

I will appreciate the help!

Regards,

*Sanim Rahman*
B.S. Chemical Engineering, 2019
Resident Assistant, Castor Hall Engineering Living Learning Community
2016-2017
Undergraduate Researcher, Global Center for Hearing and Speech Research
Honors College Engineering Peer Advisor
<https://www.linkedin.com/pub/sanim-rahman/108/a64/986>


More information about the gromacs.org_gmx-users mailing list