#!/bin/tcsh

# This is a simple script which will carry out all of the basic steps
# required to make a PSIPRED prediction. Note that it assumes that the
# following programs are available in the appropriate directories:
# seq2mtx - PSIPRED V2 program
# psipred - PSIPRED V2 program
# psipass2 - PSIPRED V2 program

# Where the PSIPRED V2 programs have been installed
set execdir = ./bin

# Where the PSIPRED V2 data files have been installed
set datadir = ./data

set basename = $1:r
set rootname = $basename:t
set outname = $basename.chk

echo "Generating mtx file from sequence" $1 "..."

$execdir/seq2mtx $1 > psitmp.mtx

echo "Predicting secondary structure based on single sequence ..."

echo Pass1 ...

$execdir/psipred psitmp.mtx $datadir/weights_s.dat $datadir/weights_s.dat2 $datadir/weights_s.dat3 > $rootname.ss

echo Pass2 ...

$execdir/psipass2 $datadir/weights_p2.dat 1 1.0 1.0 $rootname.ss2 $rootname.ss > $rootname.horiz

# Remove temporary files

echo Cleaning up ...
\rm -f psitmp.* error.log

echo "Final output files:" $rootname.ss2 $rootname.horiz
echo "Finished."
