Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use HTTPS instead for plasmids, update path #529

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions scripts/download_genomic_library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ set -e # Stop on error
LIBRARY_DIR="$KRAKEN2_DB_NAME/library"
NCBI_SERVER="ftp.ncbi.nlm.nih.gov"
FTP_SERVER="ftp://$NCBI_SERVER"
HTTP_SERVER="https://$NCBI_SERVER"
RSYNC_SERVER="rsync://$NCBI_SERVER"
THIS_DIR=$PWD

Expand Down Expand Up @@ -61,15 +62,16 @@ case $library_name in
cd $LIBRARY_DIR/plasmid
rm -f library.f* plasmid.*
## This is staying FTP only D/L for now
1>&2 echo -n "Downloading plasmid files from FTP..."
wget -q --no-remove-listing --spider $FTP_SERVER/genomes/refseq/plasmid/
1>&2 echo -n "Downloading plasmid file manifest from FTP..."
wget -q --no-remove-listing --spider $FTP_SERVER/refseq/release/plasmid/
if [ -n "$KRAKEN2_PROTEIN_DB" ]; then
awk '{ print $NF }' .listing | perl -ple 'tr/\r//d' | grep '\.faa\.gz' > manifest.txt
else
awk '{ print $NF }' .listing | perl -ple 'tr/\r//d' | grep '\.fna\.gz' > manifest.txt
fi
cat manifest.txt | xargs -n1 -I{} wget -q $FTP_SERVER/genomes/refseq/plasmid/{}
cat manifest.txt | xargs -n1 -I{} gunzip -c {} > $library_file
1>&2 echo -n "Downloading plasmid files from HTTP..."
cat manifest.txt | xargs -I{} wget -q $HTTP_SERVER/refseq/release/plasmid/{}
cat manifest.txt | xargs -I{} gunzip -c {} > $library_file
rm -f plasmid.* .listing
scan_fasta_file.pl $library_file > prelim_map.txt
1>&2 echo " done."
Expand Down