rbbt-util 5.43.0 → 5.44.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rbbt/association/util.rb +1 -1
  3. data/lib/rbbt/hpc/batch.rb +19 -17
  4. data/lib/rbbt/tsv/accessor.rb +6 -11
  5. data/lib/rbbt/tsv/dumper.rb +21 -10
  6. data/lib/rbbt/tsv/index.rb +2 -1
  7. data/lib/rbbt/util/misc/math.rb +0 -1
  8. data/lib/rbbt/util/open.rb +1 -1
  9. data/lib/rbbt/workflow/step/info.rb +1 -0
  10. data/lib/rbbt/workflow/step.rb +2 -1
  11. data/python/rbbt/__init__.py +2 -2
  12. data/share/rbbt_commands/workflow/task +1 -1
  13. metadata +4 -220
  14. data/test/rbbt/annotations/test_util.rb +0 -43
  15. data/test/rbbt/association/test_database.rb +0 -87
  16. data/test/rbbt/association/test_index.rb +0 -127
  17. data/test/rbbt/association/test_item.rb +0 -15
  18. data/test/rbbt/association/test_open.rb +0 -63
  19. data/test/rbbt/association/test_util.rb +0 -108
  20. data/test/rbbt/entity/test_identifiers.rb +0 -34
  21. data/test/rbbt/hpc/orchestrate/test_batches.rb +0 -70
  22. data/test/rbbt/hpc/orchestrate/test_chains.rb +0 -108
  23. data/test/rbbt/hpc/orchestrate/test_rules.rb +0 -59
  24. data/test/rbbt/hpc/test_batch.rb +0 -64
  25. data/test/rbbt/hpc/test_hpc_test_workflows.rb +0 -0
  26. data/test/rbbt/hpc/test_orchestrate.rb +0 -144
  27. data/test/rbbt/hpc/test_pbs.rb +0 -43
  28. data/test/rbbt/hpc/test_slurm.rb +0 -28
  29. data/test/rbbt/knowledge_base/test_enrichment.rb +0 -50
  30. data/test/rbbt/knowledge_base/test_entity.rb +0 -62
  31. data/test/rbbt/knowledge_base/test_query.rb +0 -46
  32. data/test/rbbt/knowledge_base/test_registry.rb +0 -74
  33. data/test/rbbt/knowledge_base/test_syndicate.rb +0 -48
  34. data/test/rbbt/knowledge_base/test_traverse.rb +0 -133
  35. data/test/rbbt/persist/test_tsv.rb +0 -88
  36. data/test/rbbt/persist/tsv/test_cdb.rb +0 -18
  37. data/test/rbbt/persist/tsv/test_kyotocabinet.rb +0 -27
  38. data/test/rbbt/persist/tsv/test_leveldb.rb +0 -18
  39. data/test/rbbt/persist/tsv/test_lmdb.rb +0 -20
  40. data/test/rbbt/persist/tsv/test_sharder.rb +0 -164
  41. data/test/rbbt/persist/tsv/test_tokyocabinet.rb +0 -262
  42. data/test/rbbt/resource/test_path.rb +0 -49
  43. data/test/rbbt/test_annotations.rb +0 -167
  44. data/test/rbbt/test_association.rb +0 -103
  45. data/test/rbbt/test_entity.rb +0 -252
  46. data/test/rbbt/test_fix_width_table.rb +0 -135
  47. data/test/rbbt/test_knowledge_base.rb +0 -226
  48. data/test/rbbt/test_monitor.rb +0 -11
  49. data/test/rbbt/test_packed_index.rb +0 -68
  50. data/test/rbbt/test_persist.rb +0 -85
  51. data/test/rbbt/test_resource.rb +0 -110
  52. data/test/rbbt/test_tsv.rb +0 -669
  53. data/test/rbbt/test_workflow.rb +0 -609
  54. data/test/rbbt/tsv/parallel/test_through.rb +0 -40
  55. data/test/rbbt/tsv/parallel/test_traverse.rb +0 -456
  56. data/test/rbbt/tsv/test_accessor.rb +0 -319
  57. data/test/rbbt/tsv/test_attach.rb +0 -715
  58. data/test/rbbt/tsv/test_change_id.rb +0 -61
  59. data/test/rbbt/tsv/test_csv.rb +0 -49
  60. data/test/rbbt/tsv/test_excel.rb +0 -171
  61. data/test/rbbt/tsv/test_field_index.rb +0 -19
  62. data/test/rbbt/tsv/test_filter.rb +0 -187
  63. data/test/rbbt/tsv/test_index.rb +0 -308
  64. data/test/rbbt/tsv/test_manipulate.rb +0 -334
  65. data/test/rbbt/tsv/test_marshal.rb +0 -24
  66. data/test/rbbt/tsv/test_matrix.rb +0 -20
  67. data/test/rbbt/tsv/test_parallel.rb +0 -7
  68. data/test/rbbt/tsv/test_parser.rb +0 -101
  69. data/test/rbbt/tsv/test_stream.rb +0 -253
  70. data/test/rbbt/tsv/test_util.rb +0 -52
  71. data/test/rbbt/util/R/test_eval.rb +0 -43
  72. data/test/rbbt/util/R/test_model.rb +0 -128
  73. data/test/rbbt/util/R/test_plot.rb +0 -38
  74. data/test/rbbt/util/concurrency/processes/test_socket.rb +0 -70
  75. data/test/rbbt/util/concurrency/test_processes.rb +0 -192
  76. data/test/rbbt/util/concurrency/test_threads.rb +0 -40
  77. data/test/rbbt/util/log/test_progress.rb +0 -111
  78. data/test/rbbt/util/misc/test_bgzf.rb +0 -48
  79. data/test/rbbt/util/misc/test_communication.rb +0 -13
  80. data/test/rbbt/util/misc/test_development.rb +0 -26
  81. data/test/rbbt/util/misc/test_format.rb +0 -10
  82. data/test/rbbt/util/misc/test_indiferent_hash.rb +0 -14
  83. data/test/rbbt/util/misc/test_lock.rb +0 -77
  84. data/test/rbbt/util/misc/test_multipart_payload.rb +0 -202
  85. data/test/rbbt/util/misc/test_omics.rb +0 -116
  86. data/test/rbbt/util/misc/test_pipes.rb +0 -343
  87. data/test/rbbt/util/misc/test_serialize.rb +0 -24
  88. data/test/rbbt/util/python/test_util.rb +0 -25
  89. data/test/rbbt/util/simpleopt/test_get.rb +0 -12
  90. data/test/rbbt/util/simpleopt/test_parse.rb +0 -10
  91. data/test/rbbt/util/simpleopt/test_setup.rb +0 -76
  92. data/test/rbbt/util/test_R.rb +0 -37
  93. data/test/rbbt/util/test_chain_methods.rb +0 -22
  94. data/test/rbbt/util/test_cmd.rb +0 -87
  95. data/test/rbbt/util/test_colorize.rb +0 -22
  96. data/test/rbbt/util/test_concurrency.rb +0 -6
  97. data/test/rbbt/util/test_config.rb +0 -69
  98. data/test/rbbt/util/test_excel2tsv.rb +0 -10
  99. data/test/rbbt/util/test_filecache.rb +0 -36
  100. data/test/rbbt/util/test_log.rb +0 -52
  101. data/test/rbbt/util/test_migrate.rb +0 -34
  102. data/test/rbbt/util/test_misc.rb +0 -728
  103. data/test/rbbt/util/test_open.rb +0 -200
  104. data/test/rbbt/util/test_procpath.rb +0 -23
  105. data/test/rbbt/util/test_python.rb +0 -144
  106. data/test/rbbt/util/test_semaphore.rb +0 -36
  107. data/test/rbbt/util/test_simpleDSL.rb +0 -55
  108. data/test/rbbt/util/test_simpleopt.rb +0 -11
  109. data/test/rbbt/util/test_ssh.rb +0 -10
  110. data/test/rbbt/util/test_tmpfile.rb +0 -32
  111. data/test/rbbt/workflow/step/test_dependencies.rb +0 -295
  112. data/test/rbbt/workflow/step/test_save_load_inputs.rb +0 -136
  113. data/test/rbbt/workflow/test_doc.rb +0 -30
  114. data/test/rbbt/workflow/test_remote_workflow.rb +0 -99
  115. data/test/rbbt/workflow/test_schedule.rb +0 -0
  116. data/test/rbbt/workflow/test_step.rb +0 -231
  117. data/test/rbbt/workflow/test_task.rb +0 -85
  118. data/test/rbbt/workflow/util/test_archive.rb +0 -27
  119. data/test/rbbt/workflow/util/test_data.rb +0 -67
  120. data/test/rbbt/workflow/util/test_orchestrator.rb +0 -263
  121. data/test/test_helper.rb +0 -114
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d1bbf2cefca44eecad7465a8d4dc1b88f53f18d1e63e310353061b43ad46bed9
4
- data.tar.gz: f54f659da9eca312d116430d88019f067ce5ccf519724a2a448e3b4d31dfb767
3
+ metadata.gz: 1c39baa8ee0c2633bea3878720d29aa0f49a057db7ec6700187685c7a07f7eae
4
+ data.tar.gz: ad0f8a09cb34faa3d0aa3388c26733d4849d307a02df02989656c0aced5ea72a
5
5
  SHA512:
6
- metadata.gz: eaad34515129ffd123064e9af920b5f83f3897c957de45e3bef04a1101d961d419863729f21665773b81f535f3fdba45d490ce41870f9db87f0e0e5d5f987233
7
- data.tar.gz: d48552f30e6434b0e27e173eb62f41a3126ecb9065cba58f2f5737f8e3aef0e2183503076a40cc6586832d90458ae5e572a55171758452f3699a4225704bc25e
6
+ metadata.gz: dcfcf7f6ea2b45dd4ca5e1257fb22cec0f06280be2b6c9aac3b118e1e649a8f5948db0162f62735b9c113ee9a878cb89e8f98a99fd7026a7f58f061531b93f89
7
+ data.tar.gz: 59e94fecbb50bf9d7635545aab508ee6b986e44f81acac59aac7e888f6c9c5748fb2d0324a0e83d784c78b249e67a50baaaba1d40b58612f194de111fd4c6579
@@ -10,7 +10,7 @@ module Association
10
10
  end
11
11
 
12
12
  def self.parse_field_specification(spec)
13
- return [2,nil,nil] if Numeric === spec
13
+ return [spec,nil,nil] if Numeric === spec
14
14
  spec = spec.split "=>" unless Array === spec
15
15
  field_part, final_format = spec
16
16
 
@@ -110,23 +110,25 @@ module HPC
110
110
 
111
111
  task = Symbol === job.overriden ? job.overriden : job.task_name
112
112
 
113
- #override_deps = job.overriden_deps.collect do |dep|
114
- # name = [dep.workflow.to_s, dep.task_name] * "#"
115
- # [name, dep.path] * "="
116
- #end.uniq * ","
117
-
118
- if job.overriden?
119
- #override_deps = job.rec_dependencies.
120
- # select{|dep| Symbol === dep.overriden }.
121
-
122
- override_deps = job.overriden_deps.
123
- collect do |dep|
124
- name = [dep.workflow.to_s, dep.task_name] * "#"
125
- [name, dep.path] * "="
126
- end.uniq * ","
127
-
128
- options[:override_deps] = override_deps unless override_deps.empty?
129
- end
113
+ override_deps = job.overriden_deps.collect do |dep|
114
+ name = [dep.workflow.to_s, dep.task_name] * "#"
115
+ [name, dep.path] * "="
116
+ end.uniq * ","
117
+
118
+ options[:override_deps] = override_deps unless override_deps.empty?
119
+
120
+ #if job.overriden?
121
+ # #override_deps = job.rec_dependencies.
122
+ # # select{|dep| Symbol === dep.overriden }.
123
+ #
124
+ # override_deps = job.overriden_deps.
125
+ # collect do |dep|
126
+ # name = [dep.workflow.to_s, dep.task_name] * "#"
127
+ # [name, dep.path] * "="
128
+ # end.uniq * ","
129
+
130
+ # options[:override_deps] = override_deps unless override_deps.empty?
131
+ #end
130
132
 
131
133
  # Save inputs into inputs_dir
132
134
  inputs_dir = Misc.process_options options, :inputs_dir
@@ -567,13 +567,13 @@ module TSV
567
567
  end
568
568
  end
569
569
 
570
- def dumper_stream(keys = nil, no_options = false, unmerge = false)
570
+ def dumper_stream(keys = nil, no_options = false, unmerge = false, stream = nil)
571
571
  unmerge = false unless type == :double
572
572
 
573
573
  options = self.options
574
574
  options[:type] = :list if unmerge
575
575
 
576
- TSV::Dumper.stream options do |dumper|
576
+ TSV::Dumper.stream options, filename, stream do |dumper|
577
577
  case no_options
578
578
  when FalseClass, nil
579
579
  dumper.init
@@ -631,11 +631,11 @@ module TSV
631
631
  end
632
632
  end
633
633
  end
634
+ dumper.close
634
635
  rescue Exception
635
636
  Log.exception $!
636
637
  raise $!
637
638
  end
638
- dumper.close
639
639
  end
640
640
  end
641
641
 
@@ -651,14 +651,9 @@ module TSV
651
651
  end
652
652
  end
653
653
 
654
- io = dumper_stream(keys, no_options, unmerge)
655
-
656
- str = ''
657
- while block = io.read(Misc::BLOCK_SIZE)
658
- str << block
659
- end
660
-
661
- str
654
+ io = dumper_stream(keys, no_options, unmerge, StringIO.new)
655
+ io.rewind
656
+ io.read
662
657
  end
663
658
 
664
659
  def to_unmerged_s(keys = nil, no_options = false)
@@ -1,13 +1,24 @@
1
1
  module TSV
2
2
  class Dumper
3
3
  attr_accessor :in_stream, :stream, :options, :filename, :sep
4
- def self.stream(options = {}, filename = nil, &block)
4
+ def self.stream(options = {}, filename = nil, stream = nil, &block)
5
5
  dumper = TSV::Dumper.new options, filename
6
- Thread.new(Thread.current) do |parent|
6
+ if stream
7
+ dumper.set_stream stream if stream
7
8
  yield dumper
8
- dumper.close
9
+ stream
10
+ else
11
+ thread = Thread.new(Thread.current) do |parent|
12
+ yield dumper
13
+ end
14
+ ConcurrentStream.setup(dumper.stream, threads: thread)
9
15
  end
10
- dumper.stream
16
+ end
17
+
18
+ def set_stream(stream)
19
+ @stream.close
20
+ @in_stream.close
21
+ @in_stream = @stream = stream
11
22
  end
12
23
 
13
24
  def initialize(options, filename = nil)
@@ -56,16 +67,16 @@ module TSV
56
67
 
57
68
  str = TSV.header_lines(key_field, fields, options.merge(init_options || {}))
58
69
 
59
- Thread.pass while IO.select(nil, [@in_stream],nil,1).nil?
70
+ Thread.pass while IO.select(nil, [@in_stream],nil,1).nil? if IO === @in_stream
60
71
 
61
- @in_stream.puts str
72
+ @in_stream << str
62
73
  end
63
74
 
64
75
  def add(k,v)
65
76
  @fields ||= @options[:fields]
66
77
  @sep ||= @options[:sep]
67
78
  begin
68
- Thread.pass while IO.select(nil, [@in_stream],nil,1).nil?
79
+ Thread.pass while IO.select(nil, [@in_stream],nil,1).nil? if IO === @in_stream
69
80
  @in_stream << k << TSV::Dumper.values_to_s(v, @fields, @sep)
70
81
  rescue IOError
71
82
  rescue Exception
@@ -74,16 +85,16 @@ module TSV
74
85
  end
75
86
 
76
87
  def close_out
77
- @stream.close unless @stream.closed?
88
+ @stream.close unless StringIO === @stream || @stream.closed?
78
89
  end
79
90
 
80
91
  def close_in
81
92
  @in_stream.join if @in_stream.respond_to?(:join) && ! @in_stream.joined?
82
- @in_stream.close unless @in_stream.closed?
93
+ @in_stream.close if @in_stream.respond_to?(:close) && ! @in_stream.closed?
83
94
  end
84
95
 
85
96
  def close
86
- close_in
97
+ close_in unless @in_stream == @stream
87
98
  end
88
99
  end
89
100
  end
@@ -125,7 +125,7 @@ module TSV
125
125
  def self.index(file, options = {})
126
126
  persist_options = Misc.pull_keys options, :persist
127
127
  persist_options[:prefix] ||= "StaticIndex[#{options[:target] || :key}]"
128
-
128
+
129
129
  Log.debug "Static Index: #{ file } - #{Misc.fingerprint options}"
130
130
  Persist.persist_tsv nil, file, options, persist_options do |data|
131
131
  data_options = Misc.pull_keys options, :data
@@ -258,6 +258,7 @@ module TSV
258
258
  else
259
259
  file.object_id.to_s
260
260
  end
261
+
261
262
  persist_options = Misc.pull_keys options, :persist
262
263
  persist_options[:prefix] ||= "StaticRangeIndex[#{start_field}-#{end_field}]"
263
264
 
@@ -1,4 +1,3 @@
1
-
2
1
  module Misc
3
2
 
4
3
  Log2Multiplier = 1.0 / Math.log(2.0)
@@ -729,7 +729,7 @@ module Open
729
729
  dir_sub_path.push content
730
730
  save_content_in_repo(*dir_sub_path)
731
731
  else
732
- FileUtils.mkdir_p File.dirname(file)
732
+ FileUtils.mkdir_p File.dirname(file) unless File.directory?(file)
733
733
  case
734
734
  when block_given?
735
735
  begin
@@ -62,6 +62,7 @@ class Step
62
62
  def load_dependencies_from_info
63
63
  relocated = nil
64
64
  @dependencies = (self.info[:dependencies] || []).collect do |task,name,dep_path|
65
+ dep_path = task if dep_path.nil?
65
66
  if Open.exists?(dep_path) || Open.exists?(dep_path + '.info')
66
67
  Workflow._load_step dep_path
67
68
  else
@@ -303,7 +303,8 @@ class Step
303
303
 
304
304
  if result_description
305
305
  entity_info = info.dup
306
- entity_info.merge! info[:inputs] if info[:inputs]
306
+ # Also load entity_info in rbbt6
307
+ entity_info.merge! info[:inputs] if Hash === info[:inputs]
307
308
  res = prepare_result res, result_description, entity_info
308
309
  end
309
310
 
@@ -67,10 +67,10 @@ def tsv_preamble(line, comment_char="#"):
67
67
  return header
68
68
 
69
69
 
70
- def tsv_header(filename, sep="\t", comment_char="#"):
70
+ def tsv_header(filename, sep="\t", comment_char="#", encoding='utf8'):
71
71
  import re
72
72
 
73
- f = open(filename)
73
+ f = open(filename, encoding=encoding)
74
74
  line = f.readline().strip()
75
75
 
76
76
  if (not line.startswith(comment_char)):
@@ -484,7 +484,7 @@ begin
484
484
 
485
485
  if server = options.delete(:relay)
486
486
  require 'rbbt/workflow/remote_workflow'
487
- relay_dependencies = options.delete(:relay_dependencies).split(",")
487
+ relay_dependencies = options.delete(:relay_dependencies).split(",") if options[:relay_dependencies]
488
488
  produce_dependencies_for_relay = options.delete(:produce_dependencies_for_relay)
489
489
 
490
490
  jobs_to_relay = relay_dependencies ? match_dependencies(relay_dependencies, job.rec_dependencies) : [job]
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.43.0
4
+ version: 5.44.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-28 00:00:00.000000000 Z
11
+ date: 2024-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -457,114 +457,6 @@ files:
457
457
  - share/rbbt_commands/workflow/write_info
458
458
  - share/unicorn.rb
459
459
  - share/workflow_config.ru
460
- - test/rbbt/annotations/test_util.rb
461
- - test/rbbt/association/test_database.rb
462
- - test/rbbt/association/test_index.rb
463
- - test/rbbt/association/test_item.rb
464
- - test/rbbt/association/test_open.rb
465
- - test/rbbt/association/test_util.rb
466
- - test/rbbt/entity/test_identifiers.rb
467
- - test/rbbt/hpc/orchestrate/test_batches.rb
468
- - test/rbbt/hpc/orchestrate/test_chains.rb
469
- - test/rbbt/hpc/orchestrate/test_rules.rb
470
- - test/rbbt/hpc/test_batch.rb
471
- - test/rbbt/hpc/test_hpc_test_workflows.rb
472
- - test/rbbt/hpc/test_orchestrate.rb
473
- - test/rbbt/hpc/test_pbs.rb
474
- - test/rbbt/hpc/test_slurm.rb
475
- - test/rbbt/knowledge_base/test_enrichment.rb
476
- - test/rbbt/knowledge_base/test_entity.rb
477
- - test/rbbt/knowledge_base/test_query.rb
478
- - test/rbbt/knowledge_base/test_registry.rb
479
- - test/rbbt/knowledge_base/test_syndicate.rb
480
- - test/rbbt/knowledge_base/test_traverse.rb
481
- - test/rbbt/persist/test_tsv.rb
482
- - test/rbbt/persist/tsv/test_cdb.rb
483
- - test/rbbt/persist/tsv/test_kyotocabinet.rb
484
- - test/rbbt/persist/tsv/test_leveldb.rb
485
- - test/rbbt/persist/tsv/test_lmdb.rb
486
- - test/rbbt/persist/tsv/test_sharder.rb
487
- - test/rbbt/persist/tsv/test_tokyocabinet.rb
488
- - test/rbbt/resource/test_path.rb
489
- - test/rbbt/test_annotations.rb
490
- - test/rbbt/test_association.rb
491
- - test/rbbt/test_entity.rb
492
- - test/rbbt/test_fix_width_table.rb
493
- - test/rbbt/test_knowledge_base.rb
494
- - test/rbbt/test_monitor.rb
495
- - test/rbbt/test_packed_index.rb
496
- - test/rbbt/test_persist.rb
497
- - test/rbbt/test_resource.rb
498
- - test/rbbt/test_tsv.rb
499
- - test/rbbt/test_workflow.rb
500
- - test/rbbt/tsv/parallel/test_through.rb
501
- - test/rbbt/tsv/parallel/test_traverse.rb
502
- - test/rbbt/tsv/test_accessor.rb
503
- - test/rbbt/tsv/test_attach.rb
504
- - test/rbbt/tsv/test_change_id.rb
505
- - test/rbbt/tsv/test_csv.rb
506
- - test/rbbt/tsv/test_excel.rb
507
- - test/rbbt/tsv/test_field_index.rb
508
- - test/rbbt/tsv/test_filter.rb
509
- - test/rbbt/tsv/test_index.rb
510
- - test/rbbt/tsv/test_manipulate.rb
511
- - test/rbbt/tsv/test_marshal.rb
512
- - test/rbbt/tsv/test_matrix.rb
513
- - test/rbbt/tsv/test_parallel.rb
514
- - test/rbbt/tsv/test_parser.rb
515
- - test/rbbt/tsv/test_stream.rb
516
- - test/rbbt/tsv/test_util.rb
517
- - test/rbbt/util/R/test_eval.rb
518
- - test/rbbt/util/R/test_model.rb
519
- - test/rbbt/util/R/test_plot.rb
520
- - test/rbbt/util/concurrency/processes/test_socket.rb
521
- - test/rbbt/util/concurrency/test_processes.rb
522
- - test/rbbt/util/concurrency/test_threads.rb
523
- - test/rbbt/util/log/test_progress.rb
524
- - test/rbbt/util/misc/test_bgzf.rb
525
- - test/rbbt/util/misc/test_communication.rb
526
- - test/rbbt/util/misc/test_development.rb
527
- - test/rbbt/util/misc/test_format.rb
528
- - test/rbbt/util/misc/test_indiferent_hash.rb
529
- - test/rbbt/util/misc/test_lock.rb
530
- - test/rbbt/util/misc/test_multipart_payload.rb
531
- - test/rbbt/util/misc/test_omics.rb
532
- - test/rbbt/util/misc/test_pipes.rb
533
- - test/rbbt/util/misc/test_serialize.rb
534
- - test/rbbt/util/python/test_util.rb
535
- - test/rbbt/util/simpleopt/test_get.rb
536
- - test/rbbt/util/simpleopt/test_parse.rb
537
- - test/rbbt/util/simpleopt/test_setup.rb
538
- - test/rbbt/util/test_R.rb
539
- - test/rbbt/util/test_chain_methods.rb
540
- - test/rbbt/util/test_cmd.rb
541
- - test/rbbt/util/test_colorize.rb
542
- - test/rbbt/util/test_concurrency.rb
543
- - test/rbbt/util/test_config.rb
544
- - test/rbbt/util/test_excel2tsv.rb
545
- - test/rbbt/util/test_filecache.rb
546
- - test/rbbt/util/test_log.rb
547
- - test/rbbt/util/test_migrate.rb
548
- - test/rbbt/util/test_misc.rb
549
- - test/rbbt/util/test_open.rb
550
- - test/rbbt/util/test_procpath.rb
551
- - test/rbbt/util/test_python.rb
552
- - test/rbbt/util/test_semaphore.rb
553
- - test/rbbt/util/test_simpleDSL.rb
554
- - test/rbbt/util/test_simpleopt.rb
555
- - test/rbbt/util/test_ssh.rb
556
- - test/rbbt/util/test_tmpfile.rb
557
- - test/rbbt/workflow/step/test_dependencies.rb
558
- - test/rbbt/workflow/step/test_save_load_inputs.rb
559
- - test/rbbt/workflow/test_doc.rb
560
- - test/rbbt/workflow/test_remote_workflow.rb
561
- - test/rbbt/workflow/test_schedule.rb
562
- - test/rbbt/workflow/test_step.rb
563
- - test/rbbt/workflow/test_task.rb
564
- - test/rbbt/workflow/util/test_archive.rb
565
- - test/rbbt/workflow/util/test_data.rb
566
- - test/rbbt/workflow/util/test_orchestrator.rb
567
- - test/test_helper.rb
568
460
  homepage: http://github.com/mikisvaz/rbbt-util
569
461
  licenses:
570
462
  - MIT
@@ -584,116 +476,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
584
476
  - !ruby/object:Gem::Version
585
477
  version: '0'
586
478
  requirements: []
587
- rubygems_version: 3.5.6
479
+ rubygems_version: 3.5.10
588
480
  signing_key:
589
481
  specification_version: 4
590
482
  summary: Utilities for the Ruby Bioinformatics Toolkit (rbbt)
591
- test_files:
592
- - test/rbbt/annotations/test_util.rb
593
- - test/rbbt/association/test_database.rb
594
- - test/rbbt/association/test_index.rb
595
- - test/rbbt/association/test_item.rb
596
- - test/rbbt/association/test_open.rb
597
- - test/rbbt/association/test_util.rb
598
- - test/rbbt/entity/test_identifiers.rb
599
- - test/rbbt/hpc/orchestrate/test_batches.rb
600
- - test/rbbt/hpc/orchestrate/test_chains.rb
601
- - test/rbbt/hpc/orchestrate/test_rules.rb
602
- - test/rbbt/hpc/test_batch.rb
603
- - test/rbbt/hpc/test_hpc_test_workflows.rb
604
- - test/rbbt/hpc/test_orchestrate.rb
605
- - test/rbbt/hpc/test_pbs.rb
606
- - test/rbbt/hpc/test_slurm.rb
607
- - test/rbbt/knowledge_base/test_enrichment.rb
608
- - test/rbbt/knowledge_base/test_entity.rb
609
- - test/rbbt/knowledge_base/test_query.rb
610
- - test/rbbt/knowledge_base/test_registry.rb
611
- - test/rbbt/knowledge_base/test_syndicate.rb
612
- - test/rbbt/knowledge_base/test_traverse.rb
613
- - test/rbbt/persist/test_tsv.rb
614
- - test/rbbt/persist/tsv/test_cdb.rb
615
- - test/rbbt/persist/tsv/test_kyotocabinet.rb
616
- - test/rbbt/persist/tsv/test_leveldb.rb
617
- - test/rbbt/persist/tsv/test_lmdb.rb
618
- - test/rbbt/persist/tsv/test_sharder.rb
619
- - test/rbbt/persist/tsv/test_tokyocabinet.rb
620
- - test/rbbt/resource/test_path.rb
621
- - test/rbbt/test_annotations.rb
622
- - test/rbbt/test_association.rb
623
- - test/rbbt/test_entity.rb
624
- - test/rbbt/test_fix_width_table.rb
625
- - test/rbbt/test_knowledge_base.rb
626
- - test/rbbt/test_monitor.rb
627
- - test/rbbt/test_packed_index.rb
628
- - test/rbbt/test_persist.rb
629
- - test/rbbt/test_resource.rb
630
- - test/rbbt/test_tsv.rb
631
- - test/rbbt/test_workflow.rb
632
- - test/rbbt/tsv/parallel/test_through.rb
633
- - test/rbbt/tsv/parallel/test_traverse.rb
634
- - test/rbbt/tsv/test_accessor.rb
635
- - test/rbbt/tsv/test_attach.rb
636
- - test/rbbt/tsv/test_change_id.rb
637
- - test/rbbt/tsv/test_csv.rb
638
- - test/rbbt/tsv/test_excel.rb
639
- - test/rbbt/tsv/test_field_index.rb
640
- - test/rbbt/tsv/test_filter.rb
641
- - test/rbbt/tsv/test_index.rb
642
- - test/rbbt/tsv/test_manipulate.rb
643
- - test/rbbt/tsv/test_marshal.rb
644
- - test/rbbt/tsv/test_matrix.rb
645
- - test/rbbt/tsv/test_parallel.rb
646
- - test/rbbt/tsv/test_parser.rb
647
- - test/rbbt/tsv/test_stream.rb
648
- - test/rbbt/tsv/test_util.rb
649
- - test/rbbt/util/R/test_eval.rb
650
- - test/rbbt/util/R/test_model.rb
651
- - test/rbbt/util/R/test_plot.rb
652
- - test/rbbt/util/concurrency/processes/test_socket.rb
653
- - test/rbbt/util/concurrency/test_processes.rb
654
- - test/rbbt/util/concurrency/test_threads.rb
655
- - test/rbbt/util/log/test_progress.rb
656
- - test/rbbt/util/misc/test_bgzf.rb
657
- - test/rbbt/util/misc/test_communication.rb
658
- - test/rbbt/util/misc/test_development.rb
659
- - test/rbbt/util/misc/test_format.rb
660
- - test/rbbt/util/misc/test_indiferent_hash.rb
661
- - test/rbbt/util/misc/test_lock.rb
662
- - test/rbbt/util/misc/test_multipart_payload.rb
663
- - test/rbbt/util/misc/test_omics.rb
664
- - test/rbbt/util/misc/test_pipes.rb
665
- - test/rbbt/util/misc/test_serialize.rb
666
- - test/rbbt/util/python/test_util.rb
667
- - test/rbbt/util/simpleopt/test_get.rb
668
- - test/rbbt/util/simpleopt/test_parse.rb
669
- - test/rbbt/util/simpleopt/test_setup.rb
670
- - test/rbbt/util/test_R.rb
671
- - test/rbbt/util/test_chain_methods.rb
672
- - test/rbbt/util/test_cmd.rb
673
- - test/rbbt/util/test_colorize.rb
674
- - test/rbbt/util/test_concurrency.rb
675
- - test/rbbt/util/test_config.rb
676
- - test/rbbt/util/test_excel2tsv.rb
677
- - test/rbbt/util/test_filecache.rb
678
- - test/rbbt/util/test_log.rb
679
- - test/rbbt/util/test_migrate.rb
680
- - test/rbbt/util/test_misc.rb
681
- - test/rbbt/util/test_open.rb
682
- - test/rbbt/util/test_procpath.rb
683
- - test/rbbt/util/test_python.rb
684
- - test/rbbt/util/test_semaphore.rb
685
- - test/rbbt/util/test_simpleDSL.rb
686
- - test/rbbt/util/test_simpleopt.rb
687
- - test/rbbt/util/test_ssh.rb
688
- - test/rbbt/util/test_tmpfile.rb
689
- - test/rbbt/workflow/step/test_dependencies.rb
690
- - test/rbbt/workflow/step/test_save_load_inputs.rb
691
- - test/rbbt/workflow/test_doc.rb
692
- - test/rbbt/workflow/test_remote_workflow.rb
693
- - test/rbbt/workflow/test_schedule.rb
694
- - test/rbbt/workflow/test_step.rb
695
- - test/rbbt/workflow/test_task.rb
696
- - test/rbbt/workflow/util/test_archive.rb
697
- - test/rbbt/workflow/util/test_data.rb
698
- - test/rbbt/workflow/util/test_orchestrator.rb
699
- - test/test_helper.rb
483
+ test_files: []
@@ -1,43 +0,0 @@
1
- require File.join(File.expand_path(File.dirname(__FILE__)), '../..', 'test_helper.rb')
2
- require 'rbbt/annotations'
3
-
4
- module TestEntityString
5
- extend Entity
6
- self.annotation :code
7
- end
8
-
9
- class TestAnnotation < Test::Unit::TestCase
10
- def test_marshal
11
- a = "STRING"
12
- a = TestEntityString.setup(a)
13
-
14
- #assert !(Annotated === Marshal.load(Marshal.dump(a)))
15
- assert_equal a, Marshal.load(Marshal.dump(a))
16
- end
17
-
18
- def test_marshal_array
19
- a = ["STRING"]
20
- TestEntityString.setup(a)
21
-
22
- #assert !(Annotated === Marshal.load(Marshal.dump(a)))
23
- assert Annotated === a
24
- assert Annotated === a.first
25
- assert_equal a, Marshal.load(Marshal.dump(a))
26
- end
27
-
28
- def test_hash
29
- e = TestEntityString.setup("TEST", :code => 10)
30
- assert_equal "TEST", Annotated.to_hash(e)[:literal]
31
- assert_equal 10, Annotated.to_hash(e)[:info][:code]
32
- end
33
-
34
- def test_traverse_cpus
35
- strings = (1..10).to_a.collect{|n| n.to_s }
36
- res = TSV.traverse strings, :cpus => 2, :into => [] do |s|
37
- TestEntityString.setup(s, :code => s.to_i)
38
- end
39
-
40
- assert TestEntityString === res.first
41
- end
42
- end
43
-
@@ -1,87 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')
2
- require 'rbbt-util'
3
- require 'rbbt/association'
4
- require 'rbbt/association'
5
- require 'rbbt/association/database'
6
-
7
- class TestAssociationDatabase < Test::Unit::TestCase
8
-
9
- def effect_options
10
- effect_options = {
11
- :source => "SG=~Associated Gene Name",
12
- :target => "TG=~Associated Gene Name=>Ensembl Gene ID",
13
- :persist => false,
14
- :identifiers => datafile_test('identifiers'),
15
- }
16
- end
17
-
18
- def effect_tsv
19
- effect =<<-END
20
- #: :sep=" "#:type=:double
21
- #SG TG Effect directed?
22
- MDM2 TP53 inhibition false
23
- TP53 NFKB1|GLI1 activation|activation true|true
24
- END
25
-
26
- effect_tsv = TSV.open effect, effect_options.dup
27
- end
28
-
29
- def effect_database
30
- effect_database = Association.database(effect_tsv)
31
- end
32
-
33
- def test_tsv
34
- assert_equal %w(NFKB1 GLI1), effect_tsv["TP53"]["TG"]
35
- end
36
-
37
- def test_open_new_tsv
38
- tsv = Association.database effect_tsv, :fields => ["Effect"], :target => "TG=~Associated Gene Name=>Ensembl Gene ID"
39
- assert_equal ["Ensembl Gene ID", "Effect"], tsv.fields
40
- assert_equal "SG", tsv.key_field
41
- assert tsv.include? "MDM2"
42
- end
43
-
44
- def test_open_new_tsv_reverse
45
- tsv = Association.database effect_tsv, :fields => ["Effect"], :target => "SG=~Associated Gene Name=>Ensembl Gene ID", :zipped => true
46
- assert_equal ["Ensembl Gene ID", "Effect"], tsv.fields
47
- assert_equal "TG", tsv.key_field
48
- assert tsv.include? "NFKB1"
49
- end
50
-
51
- def test_database_translate
52
- database = Association.database(effect_tsv, effect_options.merge({:source => "SG=~Associated Gene Name=>Ensembl Gene ID", :target => "TG"}))
53
- assert_equal %w(inhibition), database["ENSG00000135679"]["Effect"]
54
- assert_equal %w(activation activation), database["ENSG00000141510"]["Effect"]
55
- end
56
-
57
- def test_database
58
- assert_equal %w(inhibition), effect_database["MDM2"]["Effect"]
59
- assert_equal %w(activation activation), effect_database["TP53"]["Effect"]
60
- end
61
-
62
- def test_index_list
63
- file = datafile_test('gene_ages')
64
- tsv = Association.database(file)
65
- assert_equal [["Bilateria"], ["Euteleostomi"], ["Duplicate"]], tsv["ENSG00000000003"]
66
- end
67
-
68
- def test_gene_ages
69
- file = datafile_test('gene_ages')
70
- assert Association.database(file, :source => "FamilyAge", :merge => true, :target => "Ensembl Gene ID", :persist => false).values.first.length > 1
71
- end
72
-
73
- def __test_reorder_multiple_mismatch
74
-
75
- text =<<-EOF
76
- #: :filename=BLADDER_11_and_12#:namespace=Hsa/feb2014#:type=:double
77
- #Genomic Mutation Ensembl Gene ID affected damaged splicing broken Sample
78
- 12:54423561:A ENSG00000273049|ENSG00000197757|ENSG00000198353|ENSG00000273046 false|true|false|false false|true|false|false false|false|false|false false|true|false|false 51106212
79
- EOF
80
-
81
- tsv = TSV.open(StringIO.new(text))
82
-
83
- index = Association.index(tsv, :source => "Sample", :target => "Genomic Mutation", :merge => true, :persist_update => true)
84
- assert_equal 4, index["51106212~12:54423561:A"][0].split(";;").length
85
-
86
- end
87
- end