#! /bin/csh -f
#
# script to make an accession number index for the embl library newdata file
#

echo "emblaccession.script Version 1.0"
echo ""

set RM = "/bin/rm -f"
set SORT = sort

#
# LIBFILE is what you've called the sequence library
#
set LIBFILE = emseq.all

# get entry names and accession numbers
emblaccess1 $LIBFILE access.list
if ( $status ) goto abort

# sort on entry name
${SORT} access.list >! access.sorted
if ( $status ) goto abort
${RM} access.list

# assign entry numbers to entry names
access2 access.sorted access.entry
if ( $status ) goto abort
${RM} access.sorted

# sort on accession numbers
${SORT} -b +1 access.entry >! access.sorted2
if ( $status ) goto abort
${RM} access.entry

# create index files
access4 access.sorted2 acnum.trg acnum.hit
if ( $status ) goto abort
${RM} access.sorted2

echo "Completion successful"
echo ""

exit 0

#
# Abort
#
abort:
echo "emblaccession.script: aborting due to serious error"
exit 2
