miga-base 1.3.0.0 → 1.3.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0832ca5217f409e381a60a13fb077540c6850b3eac0410eb3f077c7e8c82b8ae'
4
- data.tar.gz: 44e8b3dfdda624c8fd11e7c2b2e142594383b64a912772b1ae6df8df7a0ef33b
3
+ metadata.gz: 40a63a5fbcb61f8bde852ec4d424df30c0c08cf1bc7b30266f58b009fccb9107
4
+ data.tar.gz: 57fcaf3141f47fc1995e62f555a6d8808aa0ba305864b9b7e3a3944788ebdbf7
5
5
  SHA512:
6
- metadata.gz: 5dcc61a0bfe803218b94b262f44ee88f2a591ba5416cbedf755f932811825aa91780967e6852aabbbfd38c436e56deef997635209efa7eb8d67fdcd31f9e1a59
7
- data.tar.gz: cadef92e9f5a6bc029323660962404c13e6344ef6c662dd2894e364f030b9f8d7d2f2c6ded2617f6de857e485e2e1eff3abafe71f4cb1e4013078dca86c7bf8a
6
+ metadata.gz: 4da9a958804e652844e9baaee473c00031e268ae3cde4f9d4b0ae52699b071938e4e1e2466316d719e007de4009266a21da05bb3bc6e4d2a9352ed26c4781be1
7
+ data.tar.gz: 4d75dd89ff67d727439ad10cdac278e510d0493a85a06b9b7c5a1f7ef1a4ab8d38280614557e7d9c9b566132731c271a8291acbebefbfdc60227ad58138f8b4d
@@ -194,7 +194,7 @@ class MiGA::Cli::Action::Init < MiGA::Cli::Action
194
194
  req_libraries = {
195
195
  r: %w[ape cluster vegan],
196
196
  ruby: %w[sqlite3 daemons json],
197
- python: %w[numpy sqlite3 pyhmmer]
197
+ python: %w[numpy sqlite3 pyhmmer pyrodigal]
198
198
  }
199
199
 
200
200
  req_libraries.each do |language, libraries|
@@ -231,15 +231,16 @@ module MiGA::Result::Stats
231
231
 
232
232
  # Fix estimates based on essential genes based on taxonomy
233
233
  def fix_essential_genes_by_domain
234
- return if (tax = source.metadata[:tax]).nil? ||
235
- !%w[Archaea Bacteria].include?(tax[:d]) ||
234
+ tax = source.metadata[:tax]
235
+ return if (!tax.nil? && !%w[Archaea Bacteria].include?(tax[:d])) ||
236
236
  file_path(:raw_report)
237
237
 
238
+ domain = tax.nil? ? 'AB' : tax[:d][0]
238
239
  MiGA::MiGA.DEBUG "Fixing essential genes by domain"
239
240
  scr = File.join(MiGA::MiGA.root_path, 'utils', 'domain-ess-genes.rb')
240
241
  rep = file_path(:report)
241
242
  $stderr.print MiGA::MiGA.run_cmd(
242
- ['ruby', scr, rep, "#{rep}.domain", tax[:d][0]],
243
+ ['ruby', scr, rep, "#{rep}.domain", domain],
243
244
  return: :output, err2out: true, source: :miga
244
245
  )
245
246
  add_file(:raw_report, "#{source.name}.ess/log")
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, 0, 0].freeze
15
+ VERSION = [1.3, 0, 1].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(2023, 3, 20)
23
+ VERSION_DATE = Date.new(2023, 3, 21)
24
24
 
25
25
  ##
26
26
  # References of MiGA
@@ -2,7 +2,7 @@ module MiGA::DistanceRunner::Commands
2
2
  ##
3
3
  # Estimates AAI against +targets+ using hAAI
4
4
  def haai(targets)
5
- puts "[#{Time.now}] hAAI: #{dataset.name} vs #{targets.size} targets"
5
+ $stderr.puts "[#{Time.now}] hAAI: #{dataset.name} vs #{targets.size} targets"
6
6
  empty_vals = targets.map { |_i| nil }
7
7
  return empty_vals if opts[:haai_p] == 'no'
8
8
 
@@ -19,7 +19,7 @@ module MiGA::DistanceRunner::Commands
19
19
  ##
20
20
  # Estimates or calculates AAI against +targets+
21
21
  def aai(targets)
22
- puts "[#{Time.now}] AAI: #{dataset.name} vs #{targets.size} targets"
22
+ $stderr.puts "[#{Time.now}] AAI: #{dataset.name} vs #{targets.size} targets"
23
23
 
24
24
  # Try hAAI first
25
25
  haai(targets)
@@ -41,7 +41,7 @@ module MiGA::DistanceRunner::Commands
41
41
  ##
42
42
  # Calculates ANI against +targets+
43
43
  def ani(targets)
44
- puts "[#{Time.now}] ANI: #{dataset.name} vs #{targets.size} targets"
44
+ $stderr.puts "[#{Time.now}] ANI: #{dataset.name} vs #{targets.size} targets"
45
45
  empty_vals = targets.map { |_i| nil }
46
46
  return empty_vals unless File.size?(tmp_file('largecontigs.fa'))
47
47
 
@@ -227,7 +227,7 @@ module MiGA::DistanceRunner::Commands
227
227
  aai_data[out[1]] = [out[6], 0, 0, 0]
228
228
  end
229
229
  end
230
- puts "Results: #{haai_data.size} | Inferences: #{aai_data.size}"
230
+ $stderr.puts "Results: #{haai_data.size} | Inferences: #{aai_data.size}"
231
231
  batch_data_to_db(:haai, haai_data)
232
232
  batch_data_to_db(:aai, aai_data)
233
233
 
@@ -104,6 +104,9 @@ module MiGA::DistanceRunner::Database
104
104
  ).first
105
105
  end if File.size?(db)
106
106
  y
107
+ rescue SQLite3::CorruptException => e
108
+ $stderr.puts "Corrupt database: #{db}"
109
+ raise e
107
110
  end
108
111
 
109
112
  ##
@@ -42,10 +42,19 @@ module MiGA::DistanceRunner::Temporal
42
42
  # Copies temporal databases back to the MiGA Project
43
43
  def checkpoint!(metric)
44
44
  $stderr.puts "Checkpoint (metric = #{metric})"
45
+
46
+ # This is simply to test database consistency before overwriting the
47
+ # previous persistent version
45
48
  SQLite3::Database.new(tmp_dbs[metric]) do |conn|
46
49
  conn.execute("select count(*) from #{metric == :haai ? :aai : metric}")
47
50
  end
48
- FileUtils.cp(tmp_dbs[metric], dbs[metric])
51
+
52
+ # This reduces the probability of other threads failing due to incomplete
53
+ # databases, +cp+ can be slower, and that effect is increased by the fact
54
+ # that tmp_dbs -> dbs could involve a transfer between filesystems, whereas
55
+ # +move+ within the same filesystem is nearly instantaenous
56
+ FileUtils.cp(tmp_dbs[metric], "#{dbs[metric]}.tmp")
57
+ FileUtils.move("#{dbs[metric]}.tmp", dbs[metric])
49
58
  @db_counts[metric] = 0
50
59
  end
51
60
  end
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.0.0
4
+ version: 1.3.0.1
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: 2023-03-20 00:00:00.000000000 Z
11
+ date: 2023-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: daemons