#!/bin/bash # iteratively removes all water molecules that are not buried while read fname; do echo "Processing $fname" cat ${fname}.pdb > temp.p cat ${fname}.pdb > temp1 while [ -s temp.p ] do cat temp1 > temp.p ~/Programs/naccess2.1.1/naccess temp.p -w grep "^ATOM" temp.asa > temp1 grep " HOH " temp.asa | perl -e 'while(<>){@a=split;if($a[-2] == 0.0) {print;}}' >> temp1 diff temp.asa temp1 > temp.p done mv temp1 ${fname}.q0 done < $1