rbbt-util 4.3.0 → 4.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +11 -6
- data/bin/rbbt_exec.rb +9 -1
- data/lib/rbbt/annotations.rb +78 -22
- data/lib/rbbt/persist.rb +14 -6
- data/lib/rbbt/persist/tsv.rb +10 -4
- data/lib/rbbt/resource.rb +1 -0
- data/lib/rbbt/resource/path.rb +43 -2
- data/lib/rbbt/resource/util.rb +3 -3
- data/lib/rbbt/tsv.rb +8 -2
- data/lib/rbbt/tsv/accessor.rb +29 -28
- data/lib/rbbt/tsv/attach.rb +8 -3
- data/lib/rbbt/tsv/attach/util.rb +3 -0
- data/lib/rbbt/tsv/excel.rb +91 -0
- data/lib/rbbt/tsv/filter.rb +17 -7
- data/lib/rbbt/tsv/manipulate.rb +26 -11
- data/lib/rbbt/tsv/parser.rb +3 -3
- data/lib/rbbt/tsv/util.rb +6 -29
- data/lib/rbbt/util/R.rb +27 -2
- data/lib/rbbt/util/chain_methods.rb +1 -2
- data/lib/rbbt/util/misc.rb +142 -13
- data/lib/rbbt/util/named_array.rb +5 -5
- data/lib/rbbt/util/open.rb +8 -4
- data/lib/rbbt/workflow.rb +5 -40
- data/lib/rbbt/workflow/accessor.rb +11 -0
- data/lib/rbbt/workflow/annotate.rb +8 -2
- data/lib/rbbt/workflow/step.rb +21 -2
- data/lib/rbbt/workflow/task.rb +3 -3
- data/share/lib/R/util.R +48 -15
- data/test/rbbt/resource/test_path.rb +15 -0
- data/test/rbbt/test_annotations.rb +11 -1
- data/test/rbbt/test_tsv.rb +15 -2
- data/test/rbbt/tsv/test_index.rb +27 -24
- data/test/rbbt/tsv/test_util.rb +1 -0
- data/test/rbbt/util/test_misc.rb +20 -0
- data/test/rbbt/util/test_open.rb +3 -5
- data/test/rbbt/workflow/test_step.rb +2 -2
- metadata +24 -9
data/test/rbbt/tsv/test_util.rb
CHANGED
data/test/rbbt/util/test_misc.rb
CHANGED
@@ -4,6 +4,26 @@ require 'test/unit'
|
|
4
4
|
|
5
5
|
class TestMisc < Test::Unit::TestCase
|
6
6
|
|
7
|
+
def test_fixutf8
|
8
|
+
string = "abc\xffdef"
|
9
|
+
string = string.force_encoding("UTF-8") if string.respond_to? :force_encoding
|
10
|
+
assert(! string.valid_encoding?) if string.respond_to? :valid_encoding?
|
11
|
+
assert(! string.valid_encoding) if string.respond_to? :valid_encoding
|
12
|
+
assert( Misc.fixutf8(string).valid_encoding?) if string.respond_to? :valid_encoding?
|
13
|
+
assert( Misc.fixutf8(string).valid_encoding) if string.respond_to? :valid_encoding
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_colors_for
|
17
|
+
colors, used = Misc.colors_for([1,2,2,1,2,1,2,2,3,3,2,3,2])
|
18
|
+
assert_equal Misc::COLOR_LIST[1], used[2]
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_total_length
|
22
|
+
ranges = [(0..100), (50..150), (120..160)]
|
23
|
+
ranges = [(0..100), (50..150), (120..160), (51..70)]
|
24
|
+
assert_equal 161, Misc.total_length(ranges)
|
25
|
+
end
|
26
|
+
|
7
27
|
def test_id_filename?
|
8
28
|
TmpFile.with_file("") do |file|
|
9
29
|
assert Misc.is_filename?(file)
|
data/test/rbbt/util/test_open.rb
CHANGED
@@ -13,15 +13,13 @@ class TestOpen < Test::Unit::TestCase
|
|
13
13
|
def test_nice
|
14
14
|
nice = 0.5
|
15
15
|
|
16
|
-
Open.wget('http://google.com', :quiet => true, :nice => nice).read =~ /html/
|
17
16
|
t = Time.now
|
18
|
-
Open.wget('http://google.com', :quiet => true, :nice => nice).read
|
17
|
+
Open.wget('http://google.com', :quiet => true, :nice => nice).read
|
19
18
|
assert(Time.now - t + 0.5 >= nice)
|
20
19
|
|
21
|
-
Open.wget('http://google.com', :quiet => true, :nice => nice, :nice_key => 1).read
|
22
|
-
Open.wget('http://google.com', :quiet => true, :nice => nice, :nice_key => 2).read =~ /html/
|
20
|
+
Open.wget('http://google.com', :quiet => true, :nice => nice, :nice_key => 1).read
|
23
21
|
t = Time.now
|
24
|
-
Open.wget('http://google.com', :quiet => true, :nice => nice, :nice_key => 1).read
|
22
|
+
Open.wget('http://google.com', :quiet => true, :nice => nice, :nice_key => 1).read
|
25
23
|
assert(Time.now - t + 0.5 >= nice)
|
26
24
|
end
|
27
25
|
|
@@ -3,7 +3,7 @@ require 'rbbt/workflow/task'
|
|
3
3
|
require 'rbbt/workflow/step'
|
4
4
|
require 'rbbt'
|
5
5
|
|
6
|
-
class
|
6
|
+
class TestStep < Test::Unit::TestCase
|
7
7
|
|
8
8
|
def test_step
|
9
9
|
task = Task.setup do "TEST" end
|
@@ -86,7 +86,7 @@ class TestStrp < Test::Unit::TestCase
|
|
86
86
|
while not job.abort do sleep 1 end
|
87
87
|
Open.write(lock, "open")
|
88
88
|
job.join
|
89
|
-
assert job.
|
89
|
+
assert job.aborted?
|
90
90
|
end
|
91
91
|
end
|
92
92
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbbt-util
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 47
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 4
|
8
|
-
-
|
8
|
+
- 4
|
9
9
|
- 0
|
10
|
-
version: 4.
|
10
|
+
version: 4.4.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Miguel Vazquez
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
18
|
+
date: 2012-07-18 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: rake
|
@@ -129,6 +129,20 @@ dependencies:
|
|
129
129
|
version: "0"
|
130
130
|
type: :runtime
|
131
131
|
version_requirements: *id008
|
132
|
+
- !ruby/object:Gem::Dependency
|
133
|
+
name: simplews
|
134
|
+
prerelease: false
|
135
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
136
|
+
none: false
|
137
|
+
requirements:
|
138
|
+
- - ">="
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
hash: 3
|
141
|
+
segments:
|
142
|
+
- 0
|
143
|
+
version: "0"
|
144
|
+
type: :runtime
|
145
|
+
version_requirements: *id009
|
132
146
|
description: Utilities for handling tsv files, caches, etc
|
133
147
|
email: miguel.vazquez@cnio.es
|
134
148
|
executables:
|
@@ -160,6 +174,7 @@ files:
|
|
160
174
|
- lib/rbbt/tsv/accessor.rb
|
161
175
|
- lib/rbbt/tsv/attach.rb
|
162
176
|
- lib/rbbt/tsv/attach/util.rb
|
177
|
+
- lib/rbbt/tsv/excel.rb
|
163
178
|
- lib/rbbt/tsv/filter.rb
|
164
179
|
- lib/rbbt/tsv/index.rb
|
165
180
|
- lib/rbbt/tsv/manipulate.rb
|
@@ -191,9 +206,9 @@ files:
|
|
191
206
|
- test/test_helper.rb
|
192
207
|
- test/rbbt/util/test_tmpfile.rb
|
193
208
|
- test/rbbt/util/test_filecache.rb
|
194
|
-
- test/rbbt/util/test_open.rb
|
195
|
-
- test/rbbt/util/test_R.rb
|
196
209
|
- test/rbbt/util/test_misc.rb
|
210
|
+
- test/rbbt/util/test_R.rb
|
211
|
+
- test/rbbt/util/test_open.rb
|
197
212
|
- test/rbbt/util/test_cmd.rb
|
198
213
|
- test/rbbt/util/test_simpleDSL.rb
|
199
214
|
- test/rbbt/util/test_chain_methods.rb
|
@@ -251,7 +266,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
251
266
|
requirements: []
|
252
267
|
|
253
268
|
rubyforge_project:
|
254
|
-
rubygems_version: 1.8.
|
269
|
+
rubygems_version: 1.8.24
|
255
270
|
signing_key:
|
256
271
|
specification_version: 3
|
257
272
|
summary: Utilities for the Ruby Bioinformatics Toolkit (rbbt)
|
@@ -259,9 +274,9 @@ test_files:
|
|
259
274
|
- test/test_helper.rb
|
260
275
|
- test/rbbt/util/test_tmpfile.rb
|
261
276
|
- test/rbbt/util/test_filecache.rb
|
262
|
-
- test/rbbt/util/test_open.rb
|
263
|
-
- test/rbbt/util/test_R.rb
|
264
277
|
- test/rbbt/util/test_misc.rb
|
278
|
+
- test/rbbt/util/test_R.rb
|
279
|
+
- test/rbbt/util/test_open.rb
|
265
280
|
- test/rbbt/util/test_cmd.rb
|
266
281
|
- test/rbbt/util/test_simpleDSL.rb
|
267
282
|
- test/rbbt/util/test_chain_methods.rb
|