#!/bin/bash -e
#
# build-genbank
#
# Script that runs that download, processing, and alignment of GenBank and
# RefSeq.  This is run by cron daily.  It will run genbank-align to do
# alignment part.  That script should be edited add new genomes and assemblies.
# and run by hand if alignment needs to be manually finished.

# errors terminate with message
set -e
trap "echo Error: build-genbank failed on `hostname` >&2; exit 1" ERR
exec </dev/null

# initialize
gbRoot=/cluster/data/genbank
cd $gbRoot
. $gbRoot/lib/gbCommon.sh

# download and process
cd $gbRoot
nice gbDownloadStep
nice gbProcessStep -mkOrganismList

nice etc/align-genbank

echo "`hostname` genbank build completed"
