Debian Codegraph @

download-sequence

raw
1 #!/bin/sh
2
3 # Public domain notice for all NCBI EDirect scripts is located at:
4 # https://www.ncbi.nlm.nih.gov/books/NBK179288/#chapter6.Public_Domain_Notice
5
6 # download-sequence BCT PLN
7
8 if [ "$#" -lt 1 ]
9 then
10 echo "Must have at least one sequence division abbreviation"
11 exit 1
12 fi
13
14 filt="grep"
15 while [ "$#" -gt 0 ]
16 do
17 filt=$( echo "$filt -e $1" )
18 shift
19 done
20 filt=$( echo "$filt" | tr '[A-Z]' '[a-z]' )
21
22 download() {
23 nquire -lst ftp.ncbi.nlm.nih.gov ncbi-asn1 |
24 grep "aso.gz" | eval "$filt" | sort -V |
25 skip-if-file-exists |
26 while read fl
27 do
28 echo "$fl"
29 echo "$fl" |
30 nquire -asp ftp.ncbi.nlm.nih.gov ncbi-asn1
31 done
32 }
33
34 download
35 if [ $? -ne 0 ]
36 then
37 download
38 fi