rbbt-util 5.42.0 → 5.43.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rbbt/annotations/util.rb +1 -1
- data/lib/rbbt/association/database.rb +2 -1
- data/lib/rbbt/association/index.rb +1 -0
- data/lib/rbbt/association/util.rb +13 -3
- data/lib/rbbt/entity.rb +6 -5
- data/lib/rbbt/hpc/orchestrate/batches.rb +1 -1
- data/lib/rbbt/hpc/orchestrate/chains.rb +3 -4
- data/lib/rbbt/knowledge_base/traverse.rb +24 -16
- data/lib/rbbt/persist/tsv/tokyocabinet.rb +1 -1
- data/lib/rbbt/resource/path.rb +7 -2
- data/lib/rbbt/resource.rb +1 -1
- data/lib/rbbt/tsv/parallel/traverse.rb +44 -0
- data/lib/rbbt/tsv/parser.rb +7 -6
- data/lib/rbbt/tsv/serializers.rb +1 -1
- data/lib/rbbt/tsv/util.rb +12 -0
- data/lib/rbbt/util/log/progress.rb +1 -1
- data/lib/rbbt/util/misc/bgzf.rb +5 -4
- data/lib/rbbt/util/misc/development.rb +4 -4
- data/lib/rbbt/util/misc.rb +1 -1
- data/lib/rbbt/workflow/remote_workflow/driver/rest.rb +8 -3
- data/lib/rbbt/workflow/remote_workflow/remote_step.rb +4 -0
- data/lib/rbbt/workflow/util/trace.rb +2 -2
- data/lib/rbbt/workflow.rb +2 -2
- data/test/rbbt/association/test_database.rb +0 -2
- data/test/rbbt/association/test_open.rb +1 -1
- data/test/rbbt/entity/test_identifiers.rb +7 -47
- data/test/rbbt/hpc/orchestrate/test_batches.rb +2 -45
- data/test/rbbt/hpc/orchestrate/test_chains.rb +13 -44
- data/test/rbbt/hpc/orchestrate/test_rules.rb +2 -35
- data/test/rbbt/hpc/test_batch.rb +18 -22
- data/test/rbbt/hpc/test_hpc_test_workflows.rb +0 -0
- data/test/rbbt/hpc/test_pbs.rb +1 -1
- data/test/rbbt/hpc/test_slurm.rb +6 -10
- data/test/rbbt/knowledge_base/test_enrichment.rb +5 -3
- data/test/rbbt/knowledge_base/test_entity.rb +26 -6
- data/test/rbbt/knowledge_base/test_query.rb +1 -1
- data/test/rbbt/knowledge_base/test_registry.rb +34 -41
- data/test/rbbt/knowledge_base/test_traverse.rb +106 -58
- data/test/rbbt/persist/test_tsv.rb +4 -4
- data/test/rbbt/persist/tsv/test_lmdb.rb +7 -5
- data/test/rbbt/test_entity.rb +8 -5
- data/test/rbbt/test_knowledge_base.rb +107 -30
- data/test/rbbt/test_packed_index.rb +5 -5
- data/test/rbbt/test_tsv.rb +1 -1
- data/test/rbbt/test_workflow.rb +83 -78
- data/test/rbbt/tsv/test_accessor.rb +4 -0
- data/test/rbbt/tsv/test_attach.rb +2 -5
- data/test/rbbt/tsv/test_index.rb +8 -2
- data/test/rbbt/tsv/test_manipulate.rb +0 -3
- data/test/rbbt/util/R/test_model.rb +0 -2
- data/test/rbbt/util/misc/test_bgzf.rb +3 -3
- data/test/rbbt/util/misc/test_communication.rb +5 -3
- data/test/rbbt/util/test_migrate.rb +1 -3
- data/test/rbbt/util/test_misc.rb +7 -2
- data/test/rbbt/util/test_procpath.rb +1 -1
- data/test/rbbt/util/test_python.rb +12 -8
- data/test/rbbt/workflow/step/test_dependencies.rb +0 -4
- data/test/rbbt/workflow/test_remote_workflow.rb +6 -5
- data/test/rbbt/workflow/util/test_archive.rb +4 -8
- data/test/rbbt/workflow/util/test_orchestrator.rb +5 -15
- data/test/test_helper.rb +25 -1
- metadata +5 -5
- data/test/rbbt/test_hpc.rb +0 -16
data/test/rbbt/util/test_misc.rb
CHANGED
@@ -471,7 +471,7 @@ eum fugiat quo voluptas nulla pariatur?"
|
|
471
471
|
end
|
472
472
|
|
473
473
|
def test_snake_case
|
474
|
-
|
474
|
+
assert_equal "kinase_SAR_fari", Misc.snake_case("KinaseSARFari")
|
475
475
|
end
|
476
476
|
|
477
477
|
def test_bootstrap
|
@@ -676,7 +676,7 @@ Commands:
|
|
676
676
|
assert_equal "1.10.2-dirty", Misc.scan_version_text(txt, "bcftools")
|
677
677
|
|
678
678
|
txt =<<-EOF
|
679
|
-
The Genome Analysis Toolkit (GATK)
|
679
|
+
The Genome Analysis Toolkit (GATK) 4.1.4.1
|
680
680
|
HTSJDK Version: 2.21.0
|
681
681
|
Picard Version: 2.21.2
|
682
682
|
EOF
|
@@ -719,5 +719,10 @@ Written by Mike Haertel and others, see <http://git.sv.gnu.org/cgit/grep.git/tre
|
|
719
719
|
end
|
720
720
|
|
721
721
|
end
|
722
|
+
|
723
|
+
def test_tokenize
|
724
|
+
iii Misc.tokenize("One Two 'this is Three'")
|
725
|
+
iii Misc.tokenize("some - 'Ex t=tr'")
|
726
|
+
end
|
722
727
|
end
|
723
728
|
|
@@ -67,19 +67,23 @@ def python_print():
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def test_keras
|
70
|
-
|
71
|
-
|
72
|
-
|
70
|
+
keyword_test :tensorflow do
|
71
|
+
defined = RbbtPython.run do
|
72
|
+
pyimport "tensorflow.keras.models", as: :km
|
73
|
+
defined?(km.Sequential)
|
74
|
+
end
|
75
|
+
assert defined
|
73
76
|
end
|
74
|
-
assert defined
|
75
77
|
end
|
76
78
|
|
77
79
|
def test_keras_import
|
78
|
-
|
79
|
-
|
80
|
-
|
80
|
+
keyword_test :tensorflow do
|
81
|
+
defined = RbbtPython.run do
|
82
|
+
pyfrom "tensorflow.keras.models", import: :Sequential
|
83
|
+
defined?(self::Sequential)
|
84
|
+
end
|
85
|
+
assert defined
|
81
86
|
end
|
82
|
-
assert defined
|
83
87
|
end
|
84
88
|
|
85
89
|
def test_iterate
|
@@ -169,7 +169,6 @@ class TestWorkflowDependency < Test::Unit::TestCase
|
|
169
169
|
|
170
170
|
def test_task4
|
171
171
|
size = 100000
|
172
|
-
Log.severity = 0
|
173
172
|
content = (0..size).to_a.collect{|num| "Line #{num}" } * "\n"
|
174
173
|
last_line = nil
|
175
174
|
TmpFile.with_file(content) do |input_file|
|
@@ -227,7 +226,6 @@ class TestWorkflowDependency < Test::Unit::TestCase
|
|
227
226
|
size = 100000
|
228
227
|
content = (1..size).to_a.collect{|num| "Line #{num}" } * "\n"
|
229
228
|
last_line = nil
|
230
|
-
Log.severity = 0
|
231
229
|
TmpFile.with_file(content) do |input_file|
|
232
230
|
begin
|
233
231
|
job = DepWorkflow.job(:task6, "TEST", :input_file => input_file)
|
@@ -250,7 +248,6 @@ class TestWorkflowDependency < Test::Unit::TestCase
|
|
250
248
|
size = 10000
|
251
249
|
content = (0..size).to_a.collect{|num| "Line #{num}" } * "\n"
|
252
250
|
last_line = nil
|
253
|
-
Log.severity = 0
|
254
251
|
TmpFile.with_file(content) do |input_file|
|
255
252
|
begin
|
256
253
|
job = DepWorkflow.job(:task8, "TEST", :input_file => input_file)
|
@@ -285,7 +282,6 @@ class TestWorkflowDependency < Test::Unit::TestCase
|
|
285
282
|
end
|
286
283
|
|
287
284
|
def test_resume
|
288
|
-
Log.severity = 0
|
289
285
|
job = ResumeWorkflow.job(:reverse)
|
290
286
|
job.recursive_clean
|
291
287
|
assert_raise do
|
@@ -59,7 +59,7 @@ class TestRemoteWorkflow < Test::Unit::TestCase
|
|
59
59
|
end
|
60
60
|
|
61
61
|
def test_rest
|
62
|
-
|
62
|
+
keyword_test :rest do
|
63
63
|
|
64
64
|
remote_workflow_server(TestWFRest) do |client|
|
65
65
|
job = client.job(:hi, nil, {})
|
@@ -89,10 +89,11 @@ class TestRemoteWorkflow < Test::Unit::TestCase
|
|
89
89
|
|
90
90
|
|
91
91
|
def test_ssh
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
92
|
+
keyword_test :ssh do
|
93
|
+
client = RemoteWorkflow.new "ssh://#{ENV["HOSTNAME"] || 'localhost'}:Translation", "Translation"
|
94
|
+
job = client.job("translate", "SSH-TEST-1", :genes => ["TP53","KRAS"])
|
95
|
+
assert_equal 2, job.run.select{|l| l =~ /ENSG/}.length
|
96
|
+
end
|
96
97
|
end
|
97
98
|
end
|
98
99
|
|
@@ -16,16 +16,12 @@ class TestClass < Test::Unit::TestCase
|
|
16
16
|
job = ArchiveTestWF.job(:test_archive)
|
17
17
|
job.run
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
Step.migrate(job.path, :current, :delete => false, :print => false)
|
23
|
-
end
|
24
|
-
assert_equal "TEST", Open.read(File.join(tmpdir, 'var/jobs/ArchiveTestWF/test_archive/Default'))
|
19
|
+
TmpFile.with_file do |tmpdir|
|
20
|
+
Misc.in_dir tmpdir do
|
21
|
+
Step.migrate(job.path, :current, :delete => false, :print => false)
|
25
22
|
end
|
23
|
+
assert_equal "TEST", Open.read(File.join(tmpdir, 'var/jobs/ArchiveTestWF/test_archive/Default'))
|
26
24
|
end
|
27
|
-
|
28
|
-
|
29
25
|
end
|
30
26
|
end
|
31
27
|
|
@@ -66,9 +66,7 @@ TestWF:
|
|
66
66
|
EOF
|
67
67
|
|
68
68
|
orchestrator = Workflow::Orchestrator.new(TestWF::MULT, "cpus" => 30, "IO" => 4, "size" => 10 )
|
69
|
-
|
70
|
-
orchestrator.process(rules, jobs)
|
71
|
-
end
|
69
|
+
orchestrator.process(rules, jobs)
|
72
70
|
|
73
71
|
data = Workflow.trace jobs, :plot_data => true
|
74
72
|
eend = data.column("End.second").values.collect{|v| v.to_f}.max
|
@@ -120,9 +118,7 @@ TestWF:
|
|
120
118
|
EOF
|
121
119
|
|
122
120
|
orchestrator = Workflow::Orchestrator.new(TestWF::MULT, "cpus" => 30, "IO" => 4, "size" => 10 )
|
123
|
-
|
124
|
-
orchestrator.process(rules, jobs)
|
125
|
-
end
|
121
|
+
orchestrator.process(rules, jobs)
|
126
122
|
|
127
123
|
jobs.each do |job|
|
128
124
|
assert job.step(:c).dependencies.empty?
|
@@ -167,9 +163,7 @@ TestWF:
|
|
167
163
|
EOF
|
168
164
|
|
169
165
|
orchestrator = Workflow::Orchestrator.new(TestWF::MULT, "cpus" => 30, "IO" => 4, "size" => 10 )
|
170
|
-
|
171
|
-
orchestrator.process(rules, jobs)
|
172
|
-
end
|
166
|
+
orchestrator.process(rules, jobs)
|
173
167
|
|
174
168
|
jobs.each do |job|
|
175
169
|
assert job.step(:c).dependencies.empty?
|
@@ -212,9 +206,7 @@ TestWF:
|
|
212
206
|
EOF
|
213
207
|
|
214
208
|
orchestrator = Workflow::Orchestrator.new(TestWF::MULT, "cpus" => 30, "IO" => 4, "size" => 10 )
|
215
|
-
|
216
|
-
orchestrator.process(rules, jobs)
|
217
|
-
end
|
209
|
+
orchestrator.process(rules, jobs)
|
218
210
|
|
219
211
|
jobs.each do |job|
|
220
212
|
next unless job.task_name.to_s == 'd'
|
@@ -258,9 +250,7 @@ TestWF:
|
|
258
250
|
EOF
|
259
251
|
|
260
252
|
orchestrator = Workflow::Orchestrator.new(TestWF::MULT, "cpus" => 30, "IO" => 4, "size" => 10 )
|
261
|
-
|
262
|
-
orchestrator.process(rules, jobs)
|
263
|
-
end
|
253
|
+
orchestrator.process(rules, jobs)
|
264
254
|
|
265
255
|
jobs.each do |job|
|
266
256
|
next unless job.task_name.to_s == 'd' || job.task_name.to_s == 'e'
|
data/test/test_helper.rb
CHANGED
@@ -10,6 +10,7 @@ require 'rubygems'
|
|
10
10
|
|
11
11
|
require 'rbbt'
|
12
12
|
require 'rbbt/resource/path'
|
13
|
+
require 'rbbt/util/config'
|
13
14
|
|
14
15
|
|
15
16
|
class TestServerLoaded < Exception; end
|
@@ -41,10 +42,33 @@ class Test::Unit::TestCase
|
|
41
42
|
#end
|
42
43
|
end
|
43
44
|
|
45
|
+
def config(*args)
|
46
|
+
Rbbt::Config.get *args
|
47
|
+
end
|
48
|
+
|
49
|
+
def keyword_test(key, &block)
|
50
|
+
test = config(:test, key)
|
51
|
+
if %w(true yes).include?(test.to_s.downcase)
|
52
|
+
block.call
|
53
|
+
else
|
54
|
+
Log.high "Not testing for #{key}"
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def self.datadir_test
|
59
|
+
#Rbbt.root.test.data
|
60
|
+
Path.setup(File.join(File.dirname(__FILE__), 'data'))
|
61
|
+
end
|
62
|
+
|
44
63
|
def self.datafile_test(file)
|
45
|
-
|
64
|
+
datadir_test[file.to_s]
|
46
65
|
end
|
47
66
|
|
67
|
+
def datadir_test
|
68
|
+
Test::Unit::TestCase.datadir_test
|
69
|
+
end
|
70
|
+
|
71
|
+
|
48
72
|
def datafile_test(file)
|
49
73
|
Test::Unit::TestCase.datafile_test(file)
|
50
74
|
end
|
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.
|
4
|
+
version: 5.43.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Vazquez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-02-
|
11
|
+
date: 2024-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -468,6 +468,7 @@ files:
|
|
468
468
|
- test/rbbt/hpc/orchestrate/test_chains.rb
|
469
469
|
- test/rbbt/hpc/orchestrate/test_rules.rb
|
470
470
|
- test/rbbt/hpc/test_batch.rb
|
471
|
+
- test/rbbt/hpc/test_hpc_test_workflows.rb
|
471
472
|
- test/rbbt/hpc/test_orchestrate.rb
|
472
473
|
- test/rbbt/hpc/test_pbs.rb
|
473
474
|
- test/rbbt/hpc/test_slurm.rb
|
@@ -489,7 +490,6 @@ files:
|
|
489
490
|
- test/rbbt/test_association.rb
|
490
491
|
- test/rbbt/test_entity.rb
|
491
492
|
- test/rbbt/test_fix_width_table.rb
|
492
|
-
- test/rbbt/test_hpc.rb
|
493
493
|
- test/rbbt/test_knowledge_base.rb
|
494
494
|
- test/rbbt/test_monitor.rb
|
495
495
|
- test/rbbt/test_packed_index.rb
|
@@ -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.5.
|
587
|
+
rubygems_version: 3.5.6
|
588
588
|
signing_key:
|
589
589
|
specification_version: 4
|
590
590
|
summary: Utilities for the Ruby Bioinformatics Toolkit (rbbt)
|
@@ -600,6 +600,7 @@ test_files:
|
|
600
600
|
- test/rbbt/hpc/orchestrate/test_chains.rb
|
601
601
|
- test/rbbt/hpc/orchestrate/test_rules.rb
|
602
602
|
- test/rbbt/hpc/test_batch.rb
|
603
|
+
- test/rbbt/hpc/test_hpc_test_workflows.rb
|
603
604
|
- test/rbbt/hpc/test_orchestrate.rb
|
604
605
|
- test/rbbt/hpc/test_pbs.rb
|
605
606
|
- test/rbbt/hpc/test_slurm.rb
|
@@ -621,7 +622,6 @@ test_files:
|
|
621
622
|
- test/rbbt/test_association.rb
|
622
623
|
- test/rbbt/test_entity.rb
|
623
624
|
- test/rbbt/test_fix_width_table.rb
|
624
|
-
- test/rbbt/test_hpc.rb
|
625
625
|
- test/rbbt/test_knowledge_base.rb
|
626
626
|
- test/rbbt/test_monitor.rb
|
627
627
|
- test/rbbt/test_packed_index.rb
|
data/test/rbbt/test_hpc.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
require File.join(File.expand_path(File.dirname(__FILE__)), '..', 'test_helper.rb')
|
2
|
-
require 'rbbt/hpc'
|
3
|
-
require 'rbbt/workflow'
|
4
|
-
|
5
|
-
|
6
|
-
class TestHPC < Test::Unit::TestCase
|
7
|
-
def test_relay
|
8
|
-
|
9
|
-
Log.severity = 0
|
10
|
-
Workflow.require_workflow "Translation"
|
11
|
-
job = Translation.job(:translate, nil, :genes => %w(TP53 KRAS))
|
12
|
-
Marenostrum.relay job
|
13
|
-
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|