miga-base 1.0.5.2 → 1.1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/miga-env +6 -0
- 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/scripts/miga.bash +2 -2
- 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
- data/utils/requirements.txt +7 -7
- metadata +7 -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
|
##
|
data/utils/requirements.txt
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
Software Test exec Website
|
2
|
-
-------- --------- -------
|
3
|
-
Ruby ruby https://www.ruby-lang.org/
|
4
|
-
Python python3 https://www.python.org/
|
1
|
+
Software Test exec Website Notes
|
2
|
+
-------- --------- ------- -----
|
3
|
+
Ruby ruby https://www.ruby-lang.org/ Required version: 2.3+
|
4
|
+
Python python3 https://www.python.org/ Required version: 3+
|
5
5
|
R R http://www.r-project.org/
|
6
6
|
SQLite3 sqlite3 https://www.sqlite.org/
|
7
7
|
NCBI BLAST+ blastp ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/LATEST
|
8
|
-
DIAMOND diamond http://ab.inf.uni-tuebingen.de/software/diamond
|
9
|
-
FastANI fastANI https://github.com/ParBLiSS/FastANI
|
8
|
+
DIAMOND diamond http://ab.inf.uni-tuebingen.de/software/diamond Required version: v0.9.20+
|
9
|
+
FastANI fastANI https://github.com/ParBLiSS/FastANI Required version: 1.1+
|
10
10
|
HMMer 3.0+ hmmsearch http://hmmer.janelia.org/software
|
11
11
|
Bedtools bedtools http://bedtools.readthedocs.org/en/latest/
|
12
12
|
Prodigal prodigal http://prodigal.ornl.gov
|
@@ -17,6 +17,6 @@ FaQCs (reads) FaQCs https://github.com/LANL-Bioinformatics/FaQCs
|
|
17
17
|
Falco (reads) falco https://github.com/smithlabcode/falco
|
18
18
|
Seqtk (reads) seqtk https://github.com/lh3/seqtk
|
19
19
|
Fastp (reads) fastp https://github.com/OpenGene/fastp
|
20
|
-
|
20
|
+
Temurin (rdp) java https://adoptium.net/ Any Java VM would work
|
21
21
|
MyTaxa (mytaxa) MyTaxa http://enve-omics.ce.gatech.edu/mytaxa
|
22
22
|
Krona (mytaxa) ktImportText https://github.com/marbl/Krona/wiki
|
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
|
@@ -107,6 +107,7 @@ files:
|
|
107
107
|
- README.md
|
108
108
|
- Rakefile
|
109
109
|
- bin/miga
|
110
|
+
- bin/miga-env
|
110
111
|
- lib/miga.rb
|
111
112
|
- lib/miga/_data/aai-intax-blast.tsv.gz
|
112
113
|
- lib/miga/_data/aai-intax-diamond.tsv.gz
|
@@ -155,6 +156,7 @@ files:
|
|
155
156
|
- lib/miga/cli/action/ln.rb
|
156
157
|
- lib/miga/cli/action/ls.rb
|
157
158
|
- lib/miga/cli/action/ncbi_get.rb
|
159
|
+
- lib/miga/cli/action/ncbi_get/downloads.rb
|
158
160
|
- lib/miga/cli/action/new.rb
|
159
161
|
- lib/miga/cli/action/next_step.rb
|
160
162
|
- lib/miga/cli/action/option.rb
|
@@ -260,9 +262,10 @@ files:
|
|
260
262
|
- utils/FastAAI/00.Libraries/01.SCG_HMMs/Archaea_SCG.hmm
|
261
263
|
- utils/FastAAI/00.Libraries/01.SCG_HMMs/Bacteria_SCG.hmm
|
262
264
|
- utils/FastAAI/00.Libraries/01.SCG_HMMs/Complete_SCG_DB.hmm
|
263
|
-
- utils/FastAAI/FastAAI
|
265
|
+
- utils/FastAAI/FastAAI
|
266
|
+
- utils/FastAAI/FastAAI-legacy/FastAAI
|
267
|
+
- utils/FastAAI/FastAAI-legacy/kAAI_v1.0_virus.py
|
264
268
|
- utils/FastAAI/README.md
|
265
|
-
- utils/FastAAI/kAAI_v1.0_virus.py
|
266
269
|
- utils/adapters.fa
|
267
270
|
- utils/cleanup-databases.rb
|
268
271
|
- utils/core-pan-plot.R
|