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.
@@ -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]
@@ -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(:fastaai_index)
144
+ qry_idx = dataset.result(:essential_genes).file_path(:fastaai_index_2)
145
145
  return nil unless qry_idx
146
146
 
147
- # Run FastAAI
148
- File.open(f1 = tmp_file, 'w') { |fh| fh.puts qry_idx }
149
- File.open(f2 = tmp_file, 'w') do |fh|
150
- targets.each do |target|
151
- target_idx = target&.result(:essential_genes)&.file_path(:fastaai_index)
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 --qd "#{f1}" --rd "#{f2}" --output "#{f3 = tmp_file}" \
157
- --threads #{opts[:thr]}
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
- File.open(f3, 'r') do |fh|
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
- aai_data[out[1]] = [out[6].to_f, 0, 0, 0] if out[6] !~ /^>/
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, f3].each { |i| File.unlink(i) }
188
+ [f1, f2].each { |i| FileUtils.rm_r(i) }
178
189
  end
179
190
 
180
191
  ##
@@ -1,12 +1,12 @@
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+
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 Required version: v0.9.20+
9
- FastANI fastANI https://github.com/ParBLiSS/FastANI Required version: 1.1+
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
- OpenJDK (rdp) java https://adoptopenjdk.net/ Any Java VM would work
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.5.2
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-08-26 00:00:00.000000000 Z
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/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