miga-base 0.7.10.0 → 0.7.10.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/miga/cli/action/derep_wf.rb +4 -0
- data/lib/miga/daemon.rb +1 -1
- data/lib/miga/dataset/result.rb +17 -13
- data/lib/miga/lair.rb +1 -1
- data/lib/miga/project/dataset.rb +3 -5
- data/lib/miga/result/stats.rb +1 -1
- data/lib/miga/version.rb +2 -2
- data/test/project_test.rb +1 -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: f3b350bb3e5dce2f0f8d0006d7f0693ff746c157006890a1250f30d71d89a523
|
4
|
+
data.tar.gz: 1d94e39c61bfe191388d309eeb992b995350f6191dc74d5c7b15ae9741bcca09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2a47ca016873723f030c9435db7daa81c819a3f19c65ed7614c21d8d68d556af0dd7313b79d2678508a12762ecd36f7bd922f5cf45640b383c6aaadde91cdfe
|
7
|
+
data.tar.gz: e8218114c0e89d80eab2b6cf7eba5a1de6f26b7d27e3560af1da12fdfc9037f3557a5994e1b982cff35635cea3d23e18ef234758ef8e12b86fb56f782a41ef89
|
@@ -19,6 +19,10 @@ class MiGA::Cli::Action::DerepWf < MiGA::Cli::Action
|
|
19
19
|
'Use Average Amino Acid Identity (AAI) as genome similarity metric',
|
20
20
|
'By default: Use Average Nucleotide Identity (ANI)'
|
21
21
|
) { cli[:metric] = :aai }
|
22
|
+
opt.on(
|
23
|
+
'--ani',
|
24
|
+
'Use Average Nucleotide Identity (ANI) as similarity metric (default)'
|
25
|
+
) { cli[:metric] = :ani }
|
22
26
|
opt.on(
|
23
27
|
'--threshold FLOAT', Float,
|
24
28
|
"Metric threshold (%) to dereplicate. By default: #{cli[:threshold]}"
|
data/lib/miga/daemon.rb
CHANGED
@@ -185,7 +185,7 @@ class MiGA::Daemon < MiGA::MiGA
|
|
185
185
|
return if project.dataset_names.empty?
|
186
186
|
|
187
187
|
# Double-check if all datasets are ready
|
188
|
-
return unless project.done_preprocessing?
|
188
|
+
return unless project.done_preprocessing?
|
189
189
|
|
190
190
|
# Queue project-level job
|
191
191
|
to_run = project.next_task(nil, false)
|
data/lib/miga/dataset/result.rb
CHANGED
@@ -26,15 +26,24 @@ module MiGA::Dataset::Result
|
|
26
26
|
# The values are symbols:
|
27
27
|
# - empty: the dataset has no data
|
28
28
|
# - inactive: the dataset is inactive
|
29
|
+
# - upstream: the task is upstream from dataset's input
|
29
30
|
# - force: forced to ignore by metadata
|
30
31
|
# - project: incompatible project
|
31
32
|
# - noref: incompatible dataset, only for reference
|
32
33
|
# - multi: incompatible dataset, only for multi
|
33
34
|
# - nonmulti: incompatible dataset, only for nonmulti
|
35
|
+
# - complete: the task is already complete
|
34
36
|
# - execute: do not ignore, execute the task
|
35
37
|
def why_ignore(task)
|
36
|
-
if !
|
38
|
+
if !get_result(task).nil?
|
39
|
+
:complete
|
40
|
+
elsif !active?
|
37
41
|
:inactive
|
42
|
+
elsif first_preprocessing.nil?
|
43
|
+
:empty
|
44
|
+
elsif @@PREPROCESSING_TASKS.index(task) <
|
45
|
+
@@PREPROCESSING_TASKS.index(first_preprocessing)
|
46
|
+
:upstream
|
38
47
|
elsif !metadata["run_#{task}"].nil?
|
39
48
|
metadata["run_#{task}"] ? :execute : :force
|
40
49
|
elsif task == :taxonomy && project.metadata[:ref_project].nil?
|
@@ -56,7 +65,7 @@ module MiGA::Dataset::Result
|
|
56
65
|
# initial input. Passes +save+ to #add_result.
|
57
66
|
def first_preprocessing(save = false)
|
58
67
|
@first_processing ||= @@PREPROCESSING_TASKS.find do |t|
|
59
|
-
!
|
68
|
+
!add_result(t, save).nil?
|
60
69
|
end
|
61
70
|
end
|
62
71
|
|
@@ -121,17 +130,12 @@ module MiGA::Dataset::Result
|
|
121
130
|
# - complete: a task with registered results
|
122
131
|
# - pending: a task queued to be performed
|
123
132
|
def result_status(task)
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
:-
|
131
|
-
elsif ignore_task?(task)
|
132
|
-
:"ignore_#{why_ignore task}"
|
133
|
-
else
|
134
|
-
:pending
|
133
|
+
reason = why_ignore(task)
|
134
|
+
case reason
|
135
|
+
when :upstream; :-
|
136
|
+
when :execute; :pending
|
137
|
+
when :complete; :complete
|
138
|
+
else; :"ignore_#{reason}"
|
135
139
|
end
|
136
140
|
end
|
137
141
|
|
data/lib/miga/lair.rb
CHANGED
data/lib/miga/project/dataset.rb
CHANGED
@@ -134,12 +134,10 @@ module MiGA::Project::Dataset
|
|
134
134
|
##
|
135
135
|
# Are all the datasets in the project preprocessed? Save intermediate results
|
136
136
|
# if +save+ (until the first incomplete dataset is reached).
|
137
|
-
def done_preprocessing?(save =
|
138
|
-
|
139
|
-
|
140
|
-
return false if ds.is_ref? and not ds.done_preprocessing?(save)
|
137
|
+
def done_preprocessing?(save = false)
|
138
|
+
!each_dataset.any? do |d|
|
139
|
+
d.ref? && d.active? && !d.done_preprocessing?(save)
|
141
140
|
end
|
142
|
-
true
|
143
141
|
end
|
144
142
|
|
145
143
|
##
|
data/lib/miga/result/stats.rb
CHANGED
@@ -135,7 +135,7 @@ module MiGA::Result::Stats
|
|
135
135
|
# Inactivate low-quality datasets
|
136
136
|
min_qual = (project.metadata[:min_qual] || 50)
|
137
137
|
if min_qual != 'no' && stats[:quality] < min_qual
|
138
|
-
source.inactivate! 'Low genome
|
138
|
+
source.inactivate! 'Low quality genome'
|
139
139
|
end
|
140
140
|
end
|
141
141
|
stats
|
data/lib/miga/version.rb
CHANGED
@@ -8,7 +8,7 @@ module MiGA
|
|
8
8
|
# - Float representing the major.minor version.
|
9
9
|
# - Integer representing gem releases of the current version.
|
10
10
|
# - Integer representing minor changes that require new version number.
|
11
|
-
VERSION = [0.7, 10,
|
11
|
+
VERSION = [0.7, 10, 2]
|
12
12
|
|
13
13
|
##
|
14
14
|
# Nickname for the current major.minor version.
|
@@ -16,7 +16,7 @@ module MiGA
|
|
16
16
|
|
17
17
|
##
|
18
18
|
# Date of the current gem release.
|
19
|
-
VERSION_DATE = Date.new(2020, 6,
|
19
|
+
VERSION_DATE = Date.new(2020, 6, 30)
|
20
20
|
|
21
21
|
##
|
22
22
|
# Reference of MiGA.
|
data/test/project_test.rb
CHANGED
@@ -108,7 +108,7 @@ class ProjectTest < Test::Unit::TestCase
|
|
108
108
|
d1 = p1.add_dataset('BAH')
|
109
109
|
assert_not_predicate(p1, :done_preprocessing?)
|
110
110
|
FileUtils.touch(File.join(p1.path, 'data', '90.stats', "#{d1.name}.done"))
|
111
|
-
|
111
|
+
assert { p1.done_preprocessing? true }
|
112
112
|
assert_nil(p1.next_inclade)
|
113
113
|
p1.metadata[:type] = :clade
|
114
114
|
assert_equal(:subclades, p1.next_inclade)
|
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.10.
|
4
|
+
version: 0.7.10.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: 2020-06-
|
11
|
+
date: 2020-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: daemons
|