From caf014b40b0d2975b3dda9f65d1de60c4d6ebe17 Mon Sep 17 00:00:00 2001 From: Kemin Zhou Date: Wed, 12 Oct 2016 13:24:21 -0700 Subject: [PATCH] modified scripts/download_genomic_library.sh --- scripts/download_genomic_library.sh | 35 +++++++++++++++++------------ 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/scripts/download_genomic_library.sh b/scripts/download_genomic_library.sh index 45b7dc3..b6a3d16 100755 --- a/scripts/download_genomic_library.sh +++ b/scripts/download_genomic_library.sh @@ -24,6 +24,8 @@ # viruses - NCBI RefSeq complete viral DNA and RNA genomes # human - NCBI RefSeq GRCh38 human reference genome +# these are the old version, new version is already much better + set -u # Protect against uninitialized vars. set -e # Stop on error @@ -33,6 +35,24 @@ FTP_SERVER="ftp://$NCBI_SERVER" RSYNC_SERVER="rsync://$NCBI_SERVER" THIS_DIR=$PWD +download_plasmid() { + echo downloading plasmids from NCBI refseq + mkdir -p $LIBRARY_DIR/Plasmids + cd $LIBRARY_DIR/Plasmids + if [ ! -e "lib.complete" ]; then + rm -f *.fna.gz + #wget $FTP_SERVER/genomes/Plasmids/plasmids.all.fna.tar.gz + wget $FTP_SERVER/genomes/refseq/plasmid/plasmid.1.1.genomic.fna.gz + wget $FTP_SERVER/genomes/refseq/plasmid/plasmid.2.1.genomic.fna.gz + echo -n "Unpacking..." + gunzip *.gz + echo " complete." + touch "lib.complete" + else + echo "Skipping download of plasmids, already downloaded here." + fi +} + case "$1" in "bacteria") mkdir -p $LIBRARY_DIR/Bacteria @@ -51,20 +71,7 @@ case "$1" in fi ;; "plasmids") - mkdir -p $LIBRARY_DIR/Plasmids - cd $LIBRARY_DIR/Plasmids - if [ ! -e "lib.complete" ] - then - rm -f plasmids.all.fna.tar.gz - wget $FTP_SERVER/genomes/Plasmids/plasmids.all.fna.tar.gz - echo -n "Unpacking..." - tar zxf plasmids.all.fna.tar.gz - rm plasmids.all.fna.tar.gz - echo " complete." - touch "lib.complete" - else - echo "Skipping download of plasmids, already downloaded here." - fi + download_plasmid ;; "viruses") mkdir -p $LIBRARY_DIR/Viruses