#!/bin/sh
if [ $# -eq 0 ] ; then
  bn=`basename $0`
  echo "1st form: $bn <par file1> [<par file2> [<tol> [<res selector> [<top file(s)>]]]]
Reads ring information; finds all trigonal centers. Outputs relevant data if
the sum of the angles deviates more than <tol> from planarity.
2nd form: $bn -s <parameter> <par file1> [<par file2>
                                              [<res selector> [<top file(s)>]]]
Finds all residues in which <parameter> is used and generate a list of other
parameters that are *directly* affected by changing it.
Notes: - <res selector> is a single regexp against which the whole
         RESI/PRES line is matched.
       - If <top file> is not specified, it is expected on STDIN."
  exit
 fi
if [ "$1" = "-s" ] ; then
  fpar=1
  fpar1=$2
  fpar2=$3
  fpar3=$4
  parf1=$5
  parf2=$6
  rselect=$7
  shift 7
 else
  parf1=$1
  parf2=$2
  if [ "$3" = "" ] ; then
    tolerance=0
   else 
    tolerance=$3
   fi
  rselect=$4
  shift 4
 fi
awk -v fp=$fpar -v fp1=$fpar1 -v fp2=$fpar2 -v fp3=$fpar3 -v par1=$parf1 -v par2=$parf2 -v tol=$tolerance -v rsel=$rselect -f $CONPATH/angawk $*
