miga-base 1.3.13.8 → 1.3.13.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/miga/json.rb +1 -1
- data/lib/miga/remote_dataset/base.rb +9 -0
- data/lib/miga/remote_dataset/download.rb +6 -3
- data/lib/miga/remote_dataset.rb +10 -0
- data/lib/miga/version.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 805637216225db5718e2a8a085046a64beae0ec816da3ecc01fda274194b83aa
|
4
|
+
data.tar.gz: 7c063bcd35554dd6ac7784ddeb37cf3a8e5b1f3ac3349f3ba4af9c5a7425806b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74fe73270087e6ceb32fea09e2a2b13e1f8687c96fe39b42f68c0fdbea5d172b15ab946843ba184667071c34f3080a3e12613b7ecf078d90656514f96654044b
|
7
|
+
data.tar.gz: 6d4e2ff50403236cdc90349aa67263590781c7ff4694cafb2bf35b81b57480026f3f59543145181e20f71b4cbee85d5682adf11d9813e86ea25ef1c40291c345
|
data/lib/miga/json.rb
CHANGED
@@ -134,6 +134,15 @@ module MiGA::RemoteDataset::Base
|
|
134
134
|
end,
|
135
135
|
method: :get
|
136
136
|
},
|
137
|
+
ncbi_fetch: {
|
138
|
+
dbs: { nuccore: { stage: :metadata, format: :gb } },
|
139
|
+
uri: lambda do |opts|
|
140
|
+
@@_EUTILS_BUILD[:efetch,
|
141
|
+
db: opts[:db], id: opts[:ids], rettype: opts[:format], retmode: :text
|
142
|
+
]
|
143
|
+
end,
|
144
|
+
method: :get
|
145
|
+
},
|
137
146
|
ncbi_search: {
|
138
147
|
dbs: {
|
139
148
|
assembly: { stage: :metadata, format: :json },
|
@@ -107,9 +107,12 @@ class MiGA::RemoteDataset
|
|
107
107
|
|
108
108
|
MiGA::MiGA.DEBUG 'Empty sequence, attempting download as WGS records'
|
109
109
|
a, b = opts[:obj].metadata[:ncbi_wgs].split('-', 2)
|
110
|
-
|
111
|
-
|
112
|
-
|
110
|
+
ids = [a]
|
111
|
+
unless b.nil?
|
112
|
+
pref = longest_common_prefix([a, b])
|
113
|
+
rang = a[pref.size .. -1].to_i .. b[pref.size .. -1].to_i
|
114
|
+
ids = rang.map { |k| "%s%0#{a.size - pref.size}i" % [pref, k] }
|
115
|
+
end
|
113
116
|
download_rest(opts.merge(universe: :ncbi, db: :nuccore, ids: ids))
|
114
117
|
end
|
115
118
|
|
data/lib/miga/remote_dataset.rb
CHANGED
@@ -300,6 +300,16 @@ class MiGA::RemoteDataset < MiGA::MiGA
|
|
300
300
|
metadata[:web_assembly_gz] ||=
|
301
301
|
'%s/%s_genomic.fna.gz' % [url_dir, File.basename(url_dir)]
|
302
302
|
end
|
303
|
+
|
304
|
+
# If all conditions are right, try getting the WGS range
|
305
|
+
if @_ncbi_asm_json_doc['wgs'] && !@_ncbi_asm_json_doc['wgs'].empty? &&
|
306
|
+
metadata[:ncbi_nuccore] && !metadata[:ncbi_wgs]
|
307
|
+
doc = self.class.download(:ncbi_fetch, :nuccore, metadata[:ncbi_nuccore], :gb).split(/\n/)
|
308
|
+
ln = doc.grep(/^WGS\s+\S+-\S+/).first
|
309
|
+
wgs = ln&.gsub(/^WGS\s+(\S+-\S+).*/, '\1')
|
310
|
+
metadata[:ncbi_wgs] = wgs if wgs
|
311
|
+
end
|
312
|
+
|
303
313
|
@_ncbi_asm_json_doc
|
304
314
|
end
|
305
315
|
|
data/lib/miga/version.rb
CHANGED
@@ -12,7 +12,7 @@ module MiGA
|
|
12
12
|
# - String indicating release status:
|
13
13
|
# - rc* release candidate, not released as gem
|
14
14
|
# - [0-9]+ stable release, released as gem
|
15
|
-
VERSION = [1.3, 13,
|
15
|
+
VERSION = [1.3, 13, 10].freeze
|
16
16
|
|
17
17
|
##
|
18
18
|
# Nickname for the current major.minor version.
|
@@ -20,7 +20,7 @@ module MiGA
|
|
20
20
|
|
21
21
|
##
|
22
22
|
# Date of the current gem relese.
|
23
|
-
VERSION_DATE = Date.new(2024,
|
23
|
+
VERSION_DATE = Date.new(2024, 4, 1)
|
24
24
|
|
25
25
|
##
|
26
26
|
# References of MiGA
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: miga-base
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.13.
|
4
|
+
version: 1.3.13.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luis M. Rodriguez-R
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: daemons
|