miga-base 1.0.5.5 → 1.1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/miga/cli/action/doctor.rb +12 -4
- data/lib/miga/cli/action/env.rb +1 -1
- data/lib/miga/cli/action/init.rb +1 -1
- data/lib/miga/cli/action/ncbi_get/downloads.rb +230 -0
- data/lib/miga/cli/action/ncbi_get.rb +9 -217
- data/lib/miga/cli/action/wf.rb +7 -3
- data/lib/miga/common.rb +12 -11
- data/lib/miga/dataset/result.rb +2 -1
- data/lib/miga/version.rb +3 -3
- data/scripts/essential_genes.bash +7 -11
- data/test/common_test.rb +7 -7
- data/utils/FastAAI/FastAAI +3630 -0
- data/utils/FastAAI/{FastAAI → FastAAI-legacy}/FastAAI +1 -1
- data/utils/FastAAI/{kAAI_v1.0_virus.py → FastAAI-legacy/kAAI_v1.0_virus.py} +0 -0
- data/utils/distance/commands.rb +24 -13
- metadata +6 -4
@@ -226,7 +226,7 @@ def kmer_extract(input_files):
|
|
226
226
|
line = line.strip().split()
|
227
227
|
protein_name = line[0]
|
228
228
|
model_name = line[3]
|
229
|
-
score = line[8]
|
229
|
+
score = float(line[8])
|
230
230
|
if model_name in positive_matches:
|
231
231
|
if score > positive_matches[model_name][1]:
|
232
232
|
positive_matches[model_name] = [protein_name, score]
|
File without changes
|
data/utils/distance/commands.rb
CHANGED
@@ -141,32 +141,43 @@ module MiGA::DistanceRunner::Commands
|
|
141
141
|
##
|
142
142
|
# Execute a FastAAI command
|
143
143
|
def fastaai_cmd(targets)
|
144
|
-
qry_idx = dataset.result(:essential_genes).file_path(:
|
144
|
+
qry_idx = dataset.result(:essential_genes).file_path(:fastaai_index_2)
|
145
145
|
return nil unless qry_idx
|
146
146
|
|
147
|
-
#
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
fh.puts target_idx if target_idx
|
153
|
-
end
|
147
|
+
# Merge databases
|
148
|
+
donors = []
|
149
|
+
targets.each do |target|
|
150
|
+
tgt_idx = target&.result(:essential_genes)&.file_path(:fastaai_index_2)
|
151
|
+
donors << tgt_idx if tgt_idx
|
154
152
|
end
|
153
|
+
return nil if donors.empty?
|
155
154
|
run_cmd <<~CMD
|
156
|
-
FastAAI
|
157
|
-
|
155
|
+
FastAAI merge_db --donors "#{donors.join(',')}" \
|
156
|
+
--recipient "#{f1 = tmp_file}" --threads #{opts[:thr]}
|
157
|
+
CMD
|
158
|
+
|
159
|
+
# Run FastAAI
|
160
|
+
run_cmd <<~CMD
|
161
|
+
FastAAI db_query --query "#{qry_idx}" --target "#{f1}" \
|
162
|
+
--output "#{f2 = tmp_file}" --threads #{opts[:thr]} \
|
163
|
+
--do_stdev
|
158
164
|
CMD
|
159
165
|
|
160
166
|
# Save values in the databases
|
161
167
|
haai_data = {}
|
162
168
|
aai_data = {}
|
163
|
-
|
169
|
+
# Ugly workaround to the insistence of FastAAI to not provide the files
|
170
|
+
# I ask for ;-)
|
171
|
+
qry_results = File.basename(qry_idx, '.faix') + '_results.txt'
|
172
|
+
out_file = File.join(f2, 'results', qry_results)
|
173
|
+
File.open(out_file, 'r') do |fh|
|
164
174
|
fh.each do |ln|
|
165
175
|
out = ln.chomp.split("\t")
|
166
176
|
haai_data[out[1]] = [
|
167
177
|
out[2].to_f * 100, out[3].to_f * 100, out[4].to_i, out[5].to_i
|
168
178
|
]
|
169
|
-
|
179
|
+
out[6] = (out[6] =~ /^>/) ? 95.0 : out[6].to_f
|
180
|
+
aai_data[out[1]] = [out[6], 0, 0, 0]
|
170
181
|
end
|
171
182
|
end
|
172
183
|
puts "Results: #{haai_data.size} | Inferences: #{aai_data.size}"
|
@@ -174,7 +185,7 @@ module MiGA::DistanceRunner::Commands
|
|
174
185
|
batch_data_to_db(:aai, aai_data)
|
175
186
|
|
176
187
|
# Cleanup
|
177
|
-
[f1, f2
|
188
|
+
[f1, f2].each { |i| FileUtils.rm_r(i) }
|
178
189
|
end
|
179
190
|
|
180
191
|
##
|
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.0.
|
4
|
+
version: 1.1.0.0
|
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: 2021-
|
11
|
+
date: 2021-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: daemons
|
@@ -156,6 +156,7 @@ files:
|
|
156
156
|
- lib/miga/cli/action/ln.rb
|
157
157
|
- lib/miga/cli/action/ls.rb
|
158
158
|
- lib/miga/cli/action/ncbi_get.rb
|
159
|
+
- lib/miga/cli/action/ncbi_get/downloads.rb
|
159
160
|
- lib/miga/cli/action/new.rb
|
160
161
|
- lib/miga/cli/action/next_step.rb
|
161
162
|
- lib/miga/cli/action/option.rb
|
@@ -261,9 +262,10 @@ files:
|
|
261
262
|
- utils/FastAAI/00.Libraries/01.SCG_HMMs/Archaea_SCG.hmm
|
262
263
|
- utils/FastAAI/00.Libraries/01.SCG_HMMs/Bacteria_SCG.hmm
|
263
264
|
- utils/FastAAI/00.Libraries/01.SCG_HMMs/Complete_SCG_DB.hmm
|
264
|
-
- utils/FastAAI/FastAAI
|
265
|
+
- utils/FastAAI/FastAAI
|
266
|
+
- utils/FastAAI/FastAAI-legacy/FastAAI
|
267
|
+
- utils/FastAAI/FastAAI-legacy/kAAI_v1.0_virus.py
|
265
268
|
- utils/FastAAI/README.md
|
266
|
-
- utils/FastAAI/kAAI_v1.0_virus.py
|
267
269
|
- utils/adapters.fa
|
268
270
|
- utils/cleanup-databases.rb
|
269
271
|
- utils/core-pan-plot.R
|