miga-base 1.3.22.0 → 1.3.22.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 18af6df383be9cb5a5ecba8ed914ec5c1878a70c8e8cb3825a590049b44a06b5
4
- data.tar.gz: a79ed870803ce5e4c7eb8e3380c79e43157de8090790d7d0ca9ace51fc6b12c7
3
+ metadata.gz: 5e4cafb2b821ae172aa9537d5c71c1cafddd6ed73adfa993da1267876dddaedf
4
+ data.tar.gz: 9fe748cc53152b70fe03a3d85bcf56b517fdae772c7eb1a96329394253f5ca78
5
5
  SHA512:
6
- metadata.gz: bce0394b7a0f750df581b767992d5eb54f842b40aa06bbfa5dbd8b7d0d6e8f8ae813930432756369e6da07a9b0a95d1c6067147d5e6ae2fae7df697f46a0b41d
7
- data.tar.gz: 8f5c085855514811ae1b781d4e58ce3af1b82034d0d92e10b3a558fd2130d7312fba7eb548852e67083eff310435bbb44bde074c342971acca140f9be80c88af
6
+ metadata.gz: 64c9508befc2bc9c7bf35041ab8ab2dc90aca74e38d80fc401dd6135e9a703135456a8cde5b88e61918007b6249b9e923b279ade15ade5c63ad2799d27b0350f
7
+ data.tar.gz: 3a74e3c63ca8332c16d5d3583890f6f4e47d8b0afd4cd178046877164083a73d918b37c04a8a8086c6c31d1b55efdf5bc913aa890869220ae5f2e68f8a976a1d
@@ -154,7 +154,14 @@ module MiGA::Project::Base
154
154
  },
155
155
  aai_save_rbm: {
156
156
  desc: 'Should RBMs be saved for OGS analysis?',
157
- default: proc { |project| project.clade? },
157
+ default: proc do |project|
158
+ project.clade? && project.option(:aai_p) != 'no'
159
+ end,
160
+ in: [true, false]
161
+ },
162
+ run_ogs: {
163
+ desc: 'Should orthologous groups be estimated?',
164
+ default: proc { |project| project.option(:aai_save_rbm) },
158
165
  in: [true, false]
159
166
  },
160
167
  ogs_identity: {
@@ -31,9 +31,11 @@ module MiGA::Project::Result
31
31
  ##
32
32
  # Is this +task+ to be bypassed?
33
33
  def ignore_task?(task)
34
- return true if metadata["run_#{task}"] == false
34
+ opt = "run_#{task}"
35
+ return true if metadata[opt] == false
36
+ return true if option?(opt) && option(opt) == false
35
37
 
36
- !clade? && @@INCLADE_TASKS.include?(task) && metadata["run_#{task}"] != true
38
+ !clade? && @@INCLADE_TASKS.include?(task) && metadata[opt] != true
37
39
  end
38
40
 
39
41
  ##
@@ -72,20 +74,21 @@ module MiGA::Project::Result
72
74
  ##
73
75
  # Add result type +:clade_finding+ at +base+ (no +_opts+ supported).
74
76
  def add_result_clade_finding(base, _opts)
77
+ r = nil
75
78
  if result_files_exist?(base, %w[.empty])
76
79
  r = MiGA::Result.new("#{base}.json")
77
80
  r.add_file(:empty, 'miga-project.empty')
78
- return r
79
- end
80
- return nil unless result_files_exist?(base, %w[.proposed-clades])
81
- unless clade? ||
82
- result_files_exist?(
83
- base, %w[.pdf .classif .medoids .class.tsv .class.nwk]
84
- )
85
- return nil
81
+ else
82
+ return nil unless result_files_exist?(base, %w[.proposed-clades])
83
+ unless clade? ||
84
+ result_files_exist?(
85
+ base, %w[.pdf .classif .medoids .class.tsv .class.nwk]
86
+ )
87
+ return nil
88
+ end
89
+ r = add_result_iter_clades(base)
86
90
  end
87
91
 
88
- r = add_result_iter_clades(base)
89
92
  r.add_file(:aai_dist_rds, 'miga-project.dist.rds')
90
93
  r.add_file(:aai_dist_rda, 'miga-project.dist.rda')
91
94
  r.add_file(:aai_tree, 'miga-project.aai.nwk')
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, 22, 0].freeze
15
+ VERSION = [1.3, 22, 2].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(2025, 2, 17)
23
+ VERSION_DATE = Date.new(2025, 2, 20)
24
24
 
25
25
  ##
26
26
  # References of MiGA
@@ -115,37 +115,37 @@ module MiGA::DistanceRunner::Commands
115
115
  f1 = tmp_file('largecontigs.fa')
116
116
  return unless File.size?(f1)
117
117
 
118
- # Run FastANI
119
- empty = true
120
- File.open(f2 = tmp_file, 'w') do |fh|
121
- targets.each do |target|
122
- target_asm = target&.result(:assembly)&.file_path(:largecontigs)
123
- if target_asm
124
- fh.puts target_asm
125
- empty = false
126
- end
118
+ # Select targets with assemblies
119
+ target_asm =
120
+ targets.map do |target|
121
+ target&.result(:assembly)&.file_path(:largecontigs)
122
+ end.compact
123
+
124
+ # Run FastANI in batches of up to 100 genomes
125
+ until target_asm.empty?
126
+ File.open(f2 = tmp_file, 'w') do |fh|
127
+ target_asm.shift(100).each { |i| fh.puts i }
127
128
  end
128
- end
129
- return if empty
130
- run_cmd <<~CMD
131
- fastANI -q "#{f1}" --rl "#{f2}" -t #{opts[:thr]} \
132
- -o "#{f3 = tmp_file}"
133
- CMD
129
+ run_cmd <<~CMD
130
+ fastANI -q "#{f1}" --rl "#{f2}" -t #{opts[:thr]} \
131
+ -o "#{f3 = tmp_file}"
132
+ CMD
134
133
 
135
- # Retrieve resulting data and save to DB
136
- data = {}
137
- File.open(f3, 'r') do |fh|
138
- fh.each do |ln|
139
- row = ln.chomp.split("\t")
140
- n2 = File.basename(row[1], '.gz')
141
- n2 = File.basename(n2, '.LargeContigs.fna')
142
- data[n2] = [row[2].to_f, 0.0, row[3].to_i, row[4].to_i]
134
+ # Retrieve resulting data and save to DB
135
+ data = {}
136
+ File.open(f3, 'r') do |fh|
137
+ fh.each do |ln|
138
+ row = ln.chomp.split("\t")
139
+ n2 = File.basename(row[1], '.gz')
140
+ n2 = File.basename(n2, '.LargeContigs.fna')
141
+ data[n2] = [row[2].to_f, 0.0, row[3].to_i, row[4].to_i]
142
+ end
143
143
  end
144
- end
145
- batch_data_to_db(:ani, data)
144
+ batch_data_to_db(:ani, data)
146
145
 
147
- # Cleanup
148
- [f2, f3].each { |i| File.unlink(i) }
146
+ # Cleanup
147
+ [f2, f3].each { |i| File.unlink(i) }
148
+ end
149
149
  end
150
150
 
151
151
  ##
data/utils/subclades.R CHANGED
@@ -226,8 +226,9 @@ generate_empty_files <- function (out_base) {
226
226
  plot(1, t = "n", axes = F)
227
227
  legend("center", "No data", bty = "n")
228
228
  dev.off()
229
- file.create(paste(out_base, ".1.classif", sep = ""))
230
- file.create(paste(out_base, ".1.medoids", sep = ""))
229
+ file.create(paste0(out_base, ".1.classif"))
230
+ file.create(paste0(out_base, ".1.medoids"))
231
+ file.create(paste0(out_base, ".empty"))
231
232
  }
232
233
 
233
234
  write_text_report <- function (out_base, ani.d, ani.medoids, ani.types) {
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.22.0
4
+ version: 1.3.22.2
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: 2025-02-17 00:00:00.000000000 Z
11
+ date: 2025-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: daemons