#!/bin/sh -f
# example script showing how autobuster can be run
# setup autoBUSTER 
. $BDG_home/setup.sh
# write results to a directory:
RESULTDIR="ab_runs/"$0"_result"
# write out the .Gelly file
cat << $gellyeof > $0".Gelly"
# get rid of shorts contacts across the disulfide
EXCLUDE A|232 A|245
EXCLUDE B|232 B|245
EXCLUDE C|232 C|245
EXCLUDE D|232 D|245
EXCLUDE E|232 E|245
EXCLUDE F|232 F|245
$gellyeof
# 
(time refine                                      			\
   -p 1osgBasicNCS_003_autoncs_followon_removeSSbond.pdb                \
   -m 1osg.mtz                                    			\
   -B "individual"  -noWAT                        			\
    AdjustXrayWeightAutomatically="no" weight_start="1080"           	\
   -autoncs                                       			\
   -Gelly $0".Gelly"                            			\
   -d $RESULTDIR                                  			\
  ) > $0".log"
if [ $? -ne 0 ]
then
  exit 1;
fi
# copy out the pdb and mtz files to this directory.
cp $RESULTDIR"/refine.pdb" $0"_refine.pdb"
cp $RESULTDIR"/refine.mtz" $0"_refine.mtz"
# delete the .Gelly file to be neat
rm  $0".Gelly"
