miga-base 0.7.3.0 → 0.7.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/miga/common/with_daemon.rb +1 -1
- data/lib/miga/common/with_daemon_class.rb +2 -1
- data/lib/miga/tax_dist.rb +0 -1
- data/lib/miga/version.rb +2 -2
- data/utils/distance/database.rb +1 -0
- data/utils/distance/pipeline.rb +4 -1
- data/utils/distance/runner.rb +5 -0
- data/utils/distance/temporal.rb +6 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e3f943800139b48778d227b3f0680bd71cac91774037f9f9e115842ccb3e6f4
|
4
|
+
data.tar.gz: 351042f7e77d3b2a3189a27fc37ead6c4fdb02ad519ba72a760d8e75a50dddf3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95f0728ad6f0d4359c32ed37deb9b215e6ecbd15fd5807796a8927eadb5ebfc1466d88e94afec179b33df9009d53e2f109166c5db5bf82424d6c31c6289cf780
|
7
|
+
data.tar.gz: 75a5c9f95150c0177f1cf29a2bac58547bb51e60f75fe1d3c42acc3a3945aee161d51e1af479187459312b39c9164a6955d28232cbeb923cb8dbe5b748b590d8
|
@@ -26,9 +26,10 @@ module MiGA::Common::WithDaemonClass
|
|
26
26
|
def last_alive(path)
|
27
27
|
f = alive_file(path)
|
28
28
|
f = terminated_file(path) unless File.exist? f
|
29
|
-
return nil unless File.exist? f
|
30
29
|
c = File.read(f)
|
31
30
|
return nil if c.nil? || c.empty?
|
32
31
|
Time.parse(c)
|
32
|
+
rescue Errno::ENOENT
|
33
|
+
return nil
|
33
34
|
end
|
34
35
|
end
|
data/lib/miga/tax_dist.rb
CHANGED
data/lib/miga/version.rb
CHANGED
@@ -10,7 +10,7 @@ module MiGA
|
|
10
10
|
# - Float representing the major.minor version.
|
11
11
|
# - Integer representing gem releases of the current version.
|
12
12
|
# - Integer representing minor changes that require new version number.
|
13
|
-
VERSION = [0.7, 3,
|
13
|
+
VERSION = [0.7, 3, 1]
|
14
14
|
|
15
15
|
##
|
16
16
|
# Nickname for the current major.minor version.
|
@@ -18,7 +18,7 @@ module MiGA
|
|
18
18
|
|
19
19
|
##
|
20
20
|
# Date of the current gem release.
|
21
|
-
VERSION_DATE = Date.new(2020, 4,
|
21
|
+
VERSION_DATE = Date.new(2020, 4, 23)
|
22
22
|
|
23
23
|
##
|
24
24
|
# Reference of MiGA.
|
data/utils/distance/database.rb
CHANGED
data/utils/distance/pipeline.rb
CHANGED
@@ -4,7 +4,7 @@ module MiGA::DistanceRunner::Pipeline
|
|
4
4
|
|
5
5
|
# Recursively classify the dataset, returning an Array with two entries:
|
6
6
|
# classification and cluster number
|
7
|
-
def classify(clades, classif, metric, result_fh, val_cls=nil)
|
7
|
+
def classify(clades, classif, metric, result_fh, val_cls = nil)
|
8
8
|
dir = File.expand_path(classif, clades)
|
9
9
|
med = File.expand_path('miga-project.medoids', dir)
|
10
10
|
return [classif,val_cls] unless File.size? med
|
@@ -32,6 +32,7 @@ module MiGA::DistanceRunner::Pipeline
|
|
32
32
|
|
33
33
|
# Builds a tree with all visited medoids from any classification level
|
34
34
|
def build_medoids_tree(metric)
|
35
|
+
$stderr.puts "Building medoids tree (metric = #{metric})"
|
35
36
|
db = query_db(metric)
|
36
37
|
return unless File.size? db
|
37
38
|
out_base = File.expand_path(dataset.name, home)
|
@@ -61,6 +62,7 @@ module MiGA::DistanceRunner::Pipeline
|
|
61
62
|
|
62
63
|
# Tests taxonomy
|
63
64
|
def tax_test
|
65
|
+
$stderr.puts "Testing taxonomy | opts = #{opts}"
|
64
66
|
# Get taxonomy of closest relative
|
65
67
|
from_ref_project = (project != ref_project)
|
66
68
|
res_dir = from_ref_project ?
|
@@ -95,6 +97,7 @@ module MiGA::DistanceRunner::Pipeline
|
|
95
97
|
|
96
98
|
# Transfer the taxonomy to the current dataset
|
97
99
|
def transfer_taxonomy(tax)
|
100
|
+
$stderr.puts "Transferring taxonomy"
|
98
101
|
return if tax.nil?
|
99
102
|
pval = (project.metadata[:tax_pvalue] || 0.05).to_f
|
100
103
|
tax_a = tax.
|
data/utils/distance/runner.rb
CHANGED
@@ -53,10 +53,12 @@ class MiGA::DistanceRunner
|
|
53
53
|
@opts[:ani_p] ||= 'blast+'
|
54
54
|
@opts[:distances_checkpoint] ||= 10
|
55
55
|
@opts[:distances_checkpoint] = @opts[:distances_checkpoint].to_i
|
56
|
+
$stderr.puts "Options: #{opts}"
|
56
57
|
end
|
57
58
|
|
58
59
|
# Launch the appropriate analysis
|
59
60
|
def go!
|
61
|
+
$stderr.puts "Launching analysis"
|
60
62
|
return if dataset.is_multi?
|
61
63
|
Dir.mktmpdir do |tmp_dir|
|
62
64
|
@tmp = tmp_dir
|
@@ -67,6 +69,7 @@ class MiGA::DistanceRunner
|
|
67
69
|
|
68
70
|
# Launch analysis for reference datasets
|
69
71
|
def go_ref!
|
72
|
+
$stderr.puts "Launching analysis for reference dataset"
|
70
73
|
# Initialize databases
|
71
74
|
initialize_dbs! true
|
72
75
|
|
@@ -84,6 +87,7 @@ class MiGA::DistanceRunner
|
|
84
87
|
##
|
85
88
|
# Launch analysis for query datasets
|
86
89
|
def go_query!
|
90
|
+
$stderr.puts "Launching analysis for query dataset"
|
87
91
|
# Check if project is ready
|
88
92
|
tsk = ref_project.is_clade? ? [:subclades, :ani] : [:clade_finding, :aai]
|
89
93
|
res = ref_project.result(tsk[0])
|
@@ -129,6 +133,7 @@ class MiGA::DistanceRunner
|
|
129
133
|
|
130
134
|
# Launch analysis for taxonomy jobs
|
131
135
|
def go_taxonomy!
|
136
|
+
$stderr.puts "Launching taxonomy analysis"
|
132
137
|
return unless project.metadata[:ref_project]
|
133
138
|
go_query! # <- yeah, it's actually the same, just different ref_project
|
134
139
|
end
|
data/utils/distance/temporal.rb
CHANGED
@@ -6,7 +6,11 @@ module MiGA::DistanceRunner::Temporal
|
|
6
6
|
|
7
7
|
# Copy input files to the (local) temporal folder
|
8
8
|
def create_temporals
|
9
|
-
rf = {
|
9
|
+
rf = {
|
10
|
+
essential_genes: :ess_genes,
|
11
|
+
cds: :proteins,
|
12
|
+
assembly: :largecontigs
|
13
|
+
}
|
10
14
|
rf.each do |res, file|
|
11
15
|
r = dataset.result(res)
|
12
16
|
f = r.nil? ? nil : r.file_path(file)
|
@@ -37,6 +41,7 @@ module MiGA::DistanceRunner::Temporal
|
|
37
41
|
|
38
42
|
# Copies temporal databases back to the MiGA Project
|
39
43
|
def checkpoint!(metric)
|
44
|
+
$stderr.puts "Checkpoint (metric = #{metric})"
|
40
45
|
SQLite3::Database.new(tmp_dbs[metric]) do |conn|
|
41
46
|
conn.execute("select count(*) from #{metric==:haai ? :aai : metric}")
|
42
47
|
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: 0.7.3.
|
4
|
+
version: 0.7.3.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: 2020-04-
|
11
|
+
date: 2020-04-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: daemons
|