-/big/appl/mmtsb/perl/convpdb.pl -out generic_noh z_tleap.pdb > noh.pdb
-/opt/pymol-svn/pymol -cq /big/appl/amber_refine/dss.py | awk \
-'{ires[NR]=$2;ss[NR]=$3}END{for (i=2;i<=NR;i++) {if (ss[i-1]!=ss[i]&&ss[i-1]=="L") printf "%s;",ires[i];if (ss[i-1]!=ss[i]&&ss[i]=="L") printf "%s;%s\n",ires[i-1],ss[i-1]}}' \
+cat << EOF >leap.bat
+source leaprc.ff14SB
+xx3 = loadpdb tmp1.pdb
+EOF
+
+pdb=$1
+shift
+while true; do
+ if [ $1 ]; then
+ echo bond xx3.$1.SG xx3.$2.SG >> leap.bat
+ awk -v ires=$1 -f ../files/cyx.awk $pdb > tmp1
+ awk -v ires=$2 -f ../files/cyx.awk tmp1 > $pdb
+ shift
+ shift
+ else
+ break
+ fi
+done
+cat << EOF >> leap.bat
+saveamberparm xx3 t.top t.crd
+savepdb xx3 z_tleap.pdb
+quit
+EOF
+
+$AMBERHOME/bin/tleap -f leap.bat
+
+/users2/local/mmtsb/perl/convpdb.pl -out generic_noh z_tleap.pdb > noh.pdb
+/users2/local/pymol_1.6/pymol -cq /users2/CASP12/EXAMPLES/all-atom/amber_files/dss.py | awk \
+'{ires[NR]=$2;ss[NR]=$3}END{for (i=2;i<=NR;i++) {if (ss[i-1]!=ss[i]&&ss[i-1]!="L") printf "%s;%s\n",ires[i-1],ss[i-1];if (ss[i-1]!=ss[i]&&ss[i]!="L") printf "%s;",ires[i];}}' \