ncbi-blast-dbs 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ncbi-blast-dbs.rake +18 -3
- data/ncbi-blast-dbs.gemspec +1 -1
- metadata +1 -1
data/lib/ncbi-blast-dbs.rake
CHANGED
@@ -1,10 +1,25 @@
|
|
1
1
|
require 'net/ftp'
|
2
2
|
|
3
|
+
# Downloads tarball at the given URL if a local copy does not exist, or if the
|
4
|
+
# local copy is older than at the given URL, or if the local copy is corrupt.
|
3
5
|
def download(url)
|
4
6
|
file = File.basename(url)
|
5
|
-
|
6
|
-
|
7
|
-
|
7
|
+
# Download tarball if the local copy is older than at the given URL or fetch
|
8
|
+
# it for the first time.
|
9
|
+
sh "wget -N #{url}"
|
10
|
+
# Resume aborted download. Do nothing if the file is already fully retrieved
|
11
|
+
# (at the cost is a round trip to server).
|
12
|
+
sh "wget -c #{url}"
|
13
|
+
|
14
|
+
# Always download md5 and verify the tarball. Re-download tarball if corrupt;
|
15
|
+
# extract otherwise.
|
16
|
+
sh "wget #{url}.md5 && md5sum -c #{file}.md5" do |matched, _|
|
17
|
+
if !matched
|
18
|
+
sh "rm #{file} #{file}.md5"; download(url)
|
19
|
+
else
|
20
|
+
sh "tar xvf #{file}"
|
21
|
+
end
|
22
|
+
end
|
8
23
|
end
|
9
24
|
|
10
25
|
def databases
|
data/ncbi-blast-dbs.gemspec
CHANGED
@@ -2,7 +2,7 @@ Gem::Specification.new do |s|
|
|
2
2
|
s.authors = ['Anurag Priyam']
|
3
3
|
s.email = ['anurag08priyam@gmail.com']
|
4
4
|
s.name = 'ncbi-blast-dbs'
|
5
|
-
s.version = '0.0.
|
5
|
+
s.version = '0.0.4'
|
6
6
|
s.summary = 'Fast download BLAST databases from NCBI.'
|
7
7
|
s.description = <<DESC
|
8
8
|
Downloads BLAST databases from NCBI. Database files (volumes) are downloaded in
|