#!/bin/csh
# Get list of vdw radii and put in your directory
#
cp $OSDIR/data/radii $PWD/radii

# Run main program
#
# You need to create "os.fil" according to docs
#
$OSDIR/bin/main < os.fil
#
# Output is in file, "prot.srf"
#
# Clean up after run
#
rm *.ms
rm part*
rm file.srf
rm radii

# Run program to evaluate OS environments
#
# Output is in file, "prot.eval"
#
# If wanted uncomment next three lines
#
#cp $OSDIR/data/tot_aa_hsg.lis $PWD
#$OSDIR/bin/occsurf > prot.eval
#rm tot_aa_hsg.lis

# Prepare file of Normalized Residue Surface Ratio, Ri
#  for plotting
#
# The x,y list for plotting is in "ri.plt"
#
# If wanted uncomment next three lines
#
#grep 'Ri:' prot.eval > ri.tmp
#awk '{printf("%4s%9.2f\n",$4,$2)}' ri.tmp > ri.plt
#rm ri.tmp

# Prepare file of average Raylengths  
#  for each residue
#
# The x,y list for plotting is in "raylength.plt"
#
# If wanted uncomment next three lines
#
#grep 'Ray' prot.srf > ray.tmp
#awk '{printf("%4s%9.2f\n",$5,$3)}' ray.tmp > raylength.plt
#rm ray.tmp 

# Prepare file for plotting and analyzing Packing Value
#  for each residue
#
# The summary output will be in the file, "prot.pak"
# The x,y list for plotting will be in "pak.plt"
#
# If not wanted comment the next four lines
#
$OSDIR/bin/respak
sed '/Resnum/d' prot.pak > tmp.pak
awk '{print $1,$5}' tmp.pak > pak.plt
rm tmp.pak

# Analyze interchain occluded surface
#
# Concatenate the two chains (A and B) into the 
#  same PDB input file and reunumber consecutively
# Then edit the xxxx and yyyy in the line below to be
#  the residue number of the first and last residue in
#  the chain to be calculated and uncomment the line.
#
#echo 'xxxx\nyyyy\n' | $OSDIR/bin/intchos

# Prepare object file for displaying extended rays in
#  MidasPlus (open this with the cmd, "open obj rays")
#
# This should only be done if you calculated a few 
#  residues only - the file is very big!
#
# If wanted uncomment next line
#$OSDIR/bin/makerays