#!/bin/csh 
#	impala.csh <seq file> <db> <evalue> <filter flag>
#	<db> = blplus|blminus|prints
#
#echo 1=$1 2=$2 3=$3 4=$4
setenv BLASTFILTER /usr/local/filter
setenv NCBI /usr/local/blast
#setenv LD_LIBRARY_PATH /usr/lib:/usr/ucblib:/opt/local/lib
#
unalias cp
unalias rm

umask 006
chmod 660 $1

#	Impala is intolerant of format deviations
./blimps-bin/fastaseqs $1 $1.fas >& /dev/null
if ($4 == 'T') then
   $BLASTFILTER/seg $1.fas -x > $1.imp
else
   cp $1.fas $1.imp
endif

$NCBI/impala -i $1.imp -P ../impala/$2 -e $3 -z 0

rm $1 $1.fas $1.imp
#
exit(0)
