#!/bin/csh

#Version   2/22/94
# Run prstrc as a command
#Synopsis: prstrc.csh infile outfile start finish alpha_helix_min
# alpha_threshold alpha_cutoff beta_threshold beta_cutoff turn_threshold
# omega_loop_threshold hydropathy_avg

#Convert arguments to variables
set INFILE  = $1
set OUTFILE = $2
set START   = $3
set FINISH  = $4
set ALPHA_HELIX_MIN      = $5
set ALPHA_THRESHOLD      = $6
set ALPHA_CUTOFF         = $7
set BETA_THRESHOLD       = $8
set BETA_CUTOFF          = $9
set TURN_THRESHOLD       = $10
set OMEGA_LOOP           = $11
set HYDROPATHY_AVG       = $12


set PID = $$ #process id

grep -v ';' $INFILE > TEMP.$PID

#get sequence name from TEMP.$PID
set SEQNAME = `head -1 TEMP.$PID`

# Determine the size of seq. in seqfilex  and seqfiley and make sure that
# start and finish values aren't greater than seq. length.
tail +2 TEMP.$PID > SEQ.$PID

@ SEQLENGTH = (`wc -c < SEQ.$PID` - `wc -l < SEQ.$PID`) - 1
if ($START > $SEQLENGTH) set START = $SEQLENGTH
if ($FINISH > $SEQLENGTH) set FINISH = $SEQLENGTH



#initial filenames
echo n            # don't print graphic output 
echo $OUTFILE     #outfile
echo p            # protein
echo $INFILE
echo $SEQNAME
echo y            #specify subsequence to use
echo $START
echo $FINISH

# Parameters
echo $ALPHA_HELIX_MIN
echo $ALPHA_THRESHOLD
echo $ALPHA_CUTOFF
echo $BETA_THRESHOLD
echo $BETA_CUTOFF
echo $TURN_THRESHOLD
echo $OMEGA_LOOP
echo $HYDROPATHY_AVG
echo n                        #continue to next case?


/usr/bin/rm  *.$PID
