rbbt-util 5.40.4 → 5.40.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rbbt/resource/path.rb +10 -1
- data/lib/rbbt/util/migrate.rb +1 -0
- data/lib/rbbt/workflow/dependencies.rb +16 -10
- data/lib/rbbt/workflow/step/accessor.rb +11 -0
- data/lib/rbbt/workflow/step/info.rb +5 -1
- data/lib/rbbt/workflow/step.rb +0 -3
- data/lib/rbbt/workflow.rb +3 -1
- data/share/rbbt_commands/tsv/write_excel +4 -3
- data/share/rbbt_commands/workflow/cmd +8 -3
- data/share/rbbt_commands/workflow/info +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc59a09644d58c21eb59f643cd04bd50d4fc81a494f024cef8af1ea26197a0e7
|
4
|
+
data.tar.gz: 84c1669d61fce9e4a239ec7865aee04b67684f99911cc9e378b569517b819388
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df0ae52fabfa8c84c0d4a18861912972ac44b347867580087842d1856d4558f7dd1d4e2b7d9b0b0ae23f766a7001516445662114e050c3054458190061caab5e
|
7
|
+
data.tar.gz: 3e5c396193a6423d7c8afbb381c623844bf457d0a34ef329b7bfe6ac29f6a13841f23b9ce7c3bb051fdeeb35a2e72bfed16279aff52fb3a0ff1484b1587bb841
|
data/lib/rbbt/resource/path.rb
CHANGED
@@ -359,7 +359,16 @@ module Path
|
|
359
359
|
end
|
360
360
|
|
361
361
|
def list
|
362
|
-
|
362
|
+
begin
|
363
|
+
path = self.produce
|
364
|
+
rescue Resource::ResourceNotFound => e
|
365
|
+
begin
|
366
|
+
path = self.set_extension('list').produce
|
367
|
+
rescue Resource::ResourceNotFound
|
368
|
+
raise e
|
369
|
+
end
|
370
|
+
end
|
371
|
+
Open.read(path).split("\n")
|
363
372
|
end
|
364
373
|
|
365
374
|
def keys(field = 0, sep = "\t")
|
data/lib/rbbt/util/migrate.rb
CHANGED
@@ -165,7 +165,8 @@ module Workflow
|
|
165
165
|
workflow, dep_task, options = dependency
|
166
166
|
|
167
167
|
if override_dependencies[workflow.to_s] && value = override_dependencies[workflow.to_s][dep_task]
|
168
|
-
overriden = true if (options.nil? || ! options[:not_overriden]) && ! unlocated_override?(value)
|
168
|
+
overriden = true if (inputs.nil? || ! inputs[:not_overriden]) && (options.nil? || ! options[:not_overriden]) && ! unlocated_override?(value)
|
169
|
+
#overriden = true if (options.nil? || ! options[:not_overriden]) && ! unlocated_override?(value)
|
169
170
|
setup_override_dependency(value, workflow, dep_task)
|
170
171
|
else
|
171
172
|
|
@@ -189,21 +190,23 @@ module Workflow
|
|
189
190
|
job = workflow._job(dep_task, jobname, _inputs)
|
190
191
|
ComputeDependency.setup(job, compute) if compute
|
191
192
|
|
192
|
-
overriden = true if
|
193
|
+
overriden = true if Symbol === job.overriden? && (d.nil? || ! d[:not_overriden]) && (inputs.nil? || ! inputs[:not_overriden])
|
193
194
|
|
194
195
|
job
|
195
196
|
end
|
196
197
|
when Step
|
197
198
|
job = dependency
|
198
|
-
overriden = true if
|
199
|
+
overriden = true if Symbol === job.overriden? && (d.nil? || ! d[:not_overriden]) && (inputs.nil? || ! inputs[:not_overriden])
|
199
200
|
job
|
200
201
|
when Symbol
|
201
202
|
if override_dependencies[self.to_s] && value = override_dependencies[self.to_s][dependency]
|
202
|
-
overriden = true if (options.nil? || ! options[:not_overriden]) && ! unlocated_override?(value)
|
203
|
+
overriden = true if (inputs.nil? || ! inputs[:not_overriden]) && (options.nil? || ! options[:not_overriden]) && ! unlocated_override?(value)
|
204
|
+
#overriden = true if (options.nil? || ! options[:not_overriden]) && ! unlocated_override?(value)
|
203
205
|
setup_override_dependency(value, self, dependency)
|
204
206
|
else
|
205
207
|
job = _job(dependency, jobname, _inputs)
|
206
|
-
overriden = true if
|
208
|
+
overriden = true if Symbol === job.overriden && (options.nil? || ! options[:not_overriden]) && (inputs.nil? || ! inputs[:not_overriden])
|
209
|
+
|
207
210
|
job
|
208
211
|
end
|
209
212
|
when Proc
|
@@ -212,7 +215,8 @@ module Workflow
|
|
212
215
|
wf, task_name, options = orig_dep
|
213
216
|
|
214
217
|
if override_dependencies[wf.to_s] && value = override_dependencies[wf.to_s][task_name]
|
215
|
-
overriden = true if (options.nil? || ! options[:not_overriden]) && ! unlocated_override?(value)
|
218
|
+
overriden = true if (inputs.nil? || ! inputs[:not_overriden]) && (options.nil? || ! options[:not_overriden]) && ! unlocated_override?(value)
|
219
|
+
#overriden = true if (options.nil? || ! options[:not_overriden]) && ! unlocated_override?(value)
|
216
220
|
dep = setup_override_dependency(value, wf, task_name)
|
217
221
|
else
|
218
222
|
|
@@ -243,7 +247,8 @@ module Workflow
|
|
243
247
|
d[:task] ||= task_name
|
244
248
|
_override_dependencies = override_dependencies.merge(override_dependencies(d[:inputs] || {}))
|
245
249
|
d = if _override_dependencies[d[:workflow].to_s] && value = _override_dependencies[d[:workflow].to_s][d[:task]]
|
246
|
-
overriden = true if (options.nil? || ! options[:not_overriden]) && ! unlocated_override?(value)
|
250
|
+
overriden = true if (inputs.nil? || ! inputs[:not_overriden]) && (options.nil? || ! options[:not_overriden]) && ! unlocated_override?(value)
|
251
|
+
#overriden = true if (options.nil? || ! options[:not_overriden]) && ! unlocated_override?(value)
|
247
252
|
setup_override_dependency(value, d[:workflow], d[:task])
|
248
253
|
else
|
249
254
|
task_info = d[:workflow].task_info(d[:task])
|
@@ -251,7 +256,7 @@ module Workflow
|
|
251
256
|
_inputs = assign_dep_inputs({}, options.merge(d[:inputs] || {}), real_dependencies, task_info)
|
252
257
|
_jobname = d.include?(:jobname) ? d[:jobname] : jobname
|
253
258
|
job = d[:workflow]._job(d[:task], _jobname, _inputs)
|
254
|
-
overriden = true if
|
259
|
+
overriden = true if Symbol === job.overriden? && (d.nil? || ! d[:not_overriden]) && (inputs.nil? || ! inputs[:not_overriden])
|
255
260
|
job
|
256
261
|
end
|
257
262
|
end
|
@@ -267,14 +272,15 @@ module Workflow
|
|
267
272
|
dep[:workflow] ||= wf || self
|
268
273
|
_override_dependencies = override_dependencies.merge(override_dependencies(dep[:inputs] || {}))
|
269
274
|
if _override_dependencies[dep[:workflow].to_s] && value = _override_dependencies[dep[:workflow].to_s][dep[:task]]
|
270
|
-
overriden = true if (options.nil? || ! options[:not_overriden]) && ! unlocated_override?(value)
|
275
|
+
overriden = true if (inputs.nil? || ! inputs[:not_overriden]) && (options.nil? || ! options[:not_overriden]) && ! unlocated_override?(value)
|
276
|
+
#overriden = true if (options.nil? || ! options[:not_overriden]) && ! unlocated_override?(value)
|
271
277
|
setup_override_dependency(value, dep[:workflow], dep[:task])
|
272
278
|
else
|
273
279
|
task_info = (dep[:task] && dep[:workflow]) ? dep[:workflow].task_info(dep[:task]) : nil
|
274
280
|
_inputs = assign_dep_inputs({}, dep[:inputs], real_dependencies, task_info)
|
275
281
|
_jobname = dep.include?(:jobname) ? dep[:jobname] : jobname
|
276
282
|
job = dep[:workflow]._job(dep[:task], _jobname, _inputs)
|
277
|
-
overriden = true if
|
283
|
+
overriden = true if Symbol === job.overriden? && (d.nil? || ! d[:not_overriden]) && (inputs.nil? || ! inputs[:not_overriden])
|
278
284
|
job
|
279
285
|
end
|
280
286
|
end
|
@@ -16,6 +16,17 @@ class Step
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
+
def relocated
|
20
|
+
if @relocated.nil?
|
21
|
+
if Open.exists?(info_file) and (info[:path] != path)
|
22
|
+
@relocated = true
|
23
|
+
else
|
24
|
+
@relocated = false
|
25
|
+
end
|
26
|
+
end
|
27
|
+
@relocated
|
28
|
+
end
|
29
|
+
|
19
30
|
def self.serialize_info(info)
|
20
31
|
info = info.clean_version if IndiferentHash === info
|
21
32
|
INFO_SERIALIZER.dump(info)
|
@@ -48,7 +48,11 @@ class Step
|
|
48
48
|
IndiferentHash.setup info_inputs
|
49
49
|
@inputs = NamedArray.setup info_inputs.values_at(*task.inputs.collect{|name| name.to_s}), task.inputs
|
50
50
|
else
|
51
|
-
|
51
|
+
if Hash === info_inputs
|
52
|
+
@inputs = NamedArray.setup info_inputs.values, info_inputs.keys
|
53
|
+
else
|
54
|
+
@inputs = info_inputs
|
55
|
+
end
|
52
56
|
end
|
53
57
|
else
|
54
58
|
nil
|
data/lib/rbbt/workflow/step.rb
CHANGED
@@ -51,9 +51,6 @@ class Step
|
|
51
51
|
@info_mutex = Mutex.new
|
52
52
|
@inputs = inputs
|
53
53
|
NamedArray.setup @inputs, task.inputs.collect{|s| s.to_s} if task and task.respond_to? :inputs and task.inputs
|
54
|
-
if Open.exists?(info_file) and (info[:path] != path)
|
55
|
-
@relocated = true
|
56
|
-
end
|
57
54
|
end
|
58
55
|
|
59
56
|
def workflow
|
data/lib/rbbt/workflow.rb
CHANGED
@@ -495,7 +495,8 @@ module Workflow
|
|
495
495
|
end
|
496
496
|
end
|
497
497
|
|
498
|
-
overriden = true if dependencies.select{|d| d.overriden && d.clean_name != d.name }.any?
|
498
|
+
#overriden = true if dependencies.select{|d| d.overriden && d.clean_name != d.name }.any?
|
499
|
+
overriden = true if dependencies.select{|d| Symbol === d.overriden }.any?
|
499
500
|
|
500
501
|
input_values = task.take_input_values(inputs)
|
501
502
|
if real_inputs.empty? && Workflow::TAG != :inputs && ! overriden #&& ! dependencies.select{|d| d.overriden && d.clean_name != d.name }.any?
|
@@ -665,6 +666,7 @@ module Workflow
|
|
665
666
|
step = Step.new path
|
666
667
|
relocated = false
|
667
668
|
dependencies = (step.info[:dependencies] || []).collect do |task,name,dep_path|
|
669
|
+
dep_path = task if dep_path.nil?
|
668
670
|
if Open.exists?(dep_path) || Open.exists?(dep_path + '.info') || Open.remote?(dep_path) || Open.ssh?(dep_path)
|
669
671
|
Workflow._load_step dep_path
|
670
672
|
else
|
@@ -7,11 +7,12 @@ $0 = "rbbt #{$previous_commands*""} #{ File.basename(__FILE__) }" if $previous_c
|
|
7
7
|
|
8
8
|
options = SOPT.setup <<EOF
|
9
9
|
|
10
|
-
|
10
|
+
Write a Excel file with the contents of a TSV
|
11
11
|
|
12
|
-
$ rbbt tsv write_excel [options] <filename.tsv|-> <filename.xls|filename.xlsx>
|
12
|
+
$ rbbt tsv write_excel [options] <filename.tsv|-> [<filename.xls|filename.xlsx>]
|
13
13
|
|
14
|
-
|
14
|
+
If no target file is specified it uses the same input files but replaces extension. Specifying
|
15
|
+
the extension of the excel file select the excel format to use.
|
15
16
|
|
16
17
|
-k--key_field* Key field
|
17
18
|
-f--fields* Fields
|
@@ -70,9 +70,14 @@ begin
|
|
70
70
|
exit 0
|
71
71
|
else
|
72
72
|
if command == 'bootstrap'
|
73
|
-
|
74
|
-
|
75
|
-
|
73
|
+
if wf.libdir["test_workflow.rb"].exists?
|
74
|
+
Log.info "No bootstrap for #{ workflow }, running test_workflow.rb instead"
|
75
|
+
CMD.cmd_log('ruby', wf.libdir["test_workflow.rb"].find)
|
76
|
+
else
|
77
|
+
Log.info "No bootstrap for #{ workflow }, running examples instead"
|
78
|
+
CMD.cmd_log("rbbt workflow example #{ workflow }")
|
79
|
+
exit 0
|
80
|
+
end
|
76
81
|
end
|
77
82
|
|
78
83
|
raise ParameterException, "Error: Command not understood: #{command}"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbbt-util
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.40.
|
4
|
+
version: 5.40.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Vazquez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-10-
|
11
|
+
date: 2023-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -584,7 +584,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
584
584
|
- !ruby/object:Gem::Version
|
585
585
|
version: '0'
|
586
586
|
requirements: []
|
587
|
-
rubygems_version: 3.
|
587
|
+
rubygems_version: 3.5.0.dev
|
588
588
|
signing_key:
|
589
589
|
specification_version: 4
|
590
590
|
summary: Utilities for the Ruby Bioinformatics Toolkit (rbbt)
|