# Download swissprot and create tab separated files from it.
# This will take about 10 minutes.

ssh eieio
mkdir -p /cluster/store5/swissprot/090703/build
cd /cluster/store5/swissprot/090703/build
wget ftp://us.expasy.org/databases/sp_tr_nrdb/sprot.dat.gz
wget ftp://us.expasy.org/databases/sp_tr_nrdb/trembl.dat.gz
wget ftp://us.expasy.org/databases/sp_tr_nrdb/trembl_new.dat.gz
zcat *.data.gz | spToDb stdin ../tabFiles

# Create the database.  
ssh hgsql
hgsql mysql <<end
create database sp090703;
end

# Load it up with table definitions from source directory
hgsql sp090703 < ~/src/hg/protein/spToDb/hgspDb.sql

# Load up the data from tab files.  This takes about 30 minutes.
cd /cluster/store5/swissprot/090703/tabFiles
foreach i (*.tab)
    mysqlimport $db $i.tab
end

# Clean up tab files
cd ..
rm -r tabFiles

# If you need to grab the swissProt data files do something
# like this:
ssh eieio
cd /cluster/store5/swissprot
mkdir $date
cd $date
mkdir build
cd build
wget ftp://us.expasy.org/databases/sp_tr_nrdb/sprot.dat.gz
wget ftp://us.expasy.org/databases/sp_tr_nrdb/trembl.dat.gz
wget ftp://us.expasy.org/databases/sp_tr_nrdb/trembl_new.dat.gz

