rbbt-util 5.19.29 → 5.19.30
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rbbt/tsv/attach.rb +1 -0
- data/lib/rbbt/tsv/attach/util.rb +3 -2
- data/lib/rbbt/tsv/change_id.rb +9 -1
- data/lib/rbbt/tsv/index.rb +1 -0
- data/lib/rbbt/util/misc/pipes.rb +5 -3
- data/share/color/diverging_colors.hex +12 -0
- data/share/rbbt_commands/app/start +6 -0
- data/test/rbbt/util/misc/test_pipes.rb +28 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3184d37817097198d31ebdd2af78c95b51bf1784
|
4
|
+
data.tar.gz: cc4c9a849005583c40a3009e6eb57a6fca0990fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27bd364fec2ac63ff3b61167579be2d26aa4f2617481559e199128ee118fb200b0bc71cbb432c59bb505d4719d70d613997baaee2a5448568101d927a73f7beb
|
7
|
+
data.tar.gz: 057a24eccb91df8d925adc264c4b20d7c2613a655b125415bbcf7fdefb3e7cb45723eea5ba42948762d742066876cfcf7cfdbd080f0e40e5f82566f7eb44e411
|
data/lib/rbbt/tsv/attach.rb
CHANGED
data/lib/rbbt/tsv/attach/util.rb
CHANGED
@@ -4,6 +4,7 @@ module TSV
|
|
4
4
|
fields = other.fields - [key_field].concat(self.fields) if fields.nil?
|
5
5
|
|
6
6
|
fields = [fields].compact unless Array === fields
|
7
|
+
num_fields = fields.length
|
7
8
|
|
8
9
|
field_positions = fields.collect{|field| other.identify_field field}
|
9
10
|
other.with_unnamed do
|
@@ -37,9 +38,9 @@ module TSV
|
|
37
38
|
self[key] = current + new_values
|
38
39
|
else
|
39
40
|
if type == :double
|
40
|
-
self[key] = current + [[]] *
|
41
|
+
self[key] = current + [[]] * num_fields
|
41
42
|
else
|
42
|
-
self[key] = current + [nil] *
|
43
|
+
self[key] = current + [nil] * num_fields
|
43
44
|
end
|
44
45
|
end
|
45
46
|
end
|
data/lib/rbbt/tsv/change_id.rb
CHANGED
@@ -53,9 +53,17 @@ module TSV
|
|
53
53
|
identifiers, persist_input, compact = Misc.process_options options, :identifiers, :persist, :compact
|
54
54
|
identifiers = tsv.identifier_files.first if identifiers.nil?
|
55
55
|
identifiers = Organism.identifiers(tsv.namespace) if identifiers.nil? and tsv.namespace and Organism.identifiers(tsv.namespace).exists?
|
56
|
+
identifiers.namespace ||= tsv.namespace
|
56
57
|
|
57
58
|
fields = (identifiers and identifiers.all_fields.include?(field))? [field] : nil
|
58
|
-
index = identifiers.index :target => format, :fields => fields, :persist => persist_input
|
59
|
+
#index = identifiers.index :target => format, :fields => fields, :persist => persist_input, :order => true
|
60
|
+
|
61
|
+
grep = Organism.blacklist_genes(tsv.namespace).list if identifiers.namespace and Organism.blacklist_genes(tsv.namespace).exists?
|
62
|
+
if fields.nil?
|
63
|
+
index = identifiers.index(:data_tsv_grep => grep, :data_invert_grep => true, :target => format, :persist => true, :order => true, :unnamed => true, :data_persist => true)
|
64
|
+
else
|
65
|
+
index = identifiers.index(:data_tsv_grep => grep, :data_invert_grep => true, :target => format, :fields => fields, :order => true, :unnamed => true, :persist => true, :data_persist => true)
|
66
|
+
end
|
59
67
|
|
60
68
|
orig_type = tsv.type
|
61
69
|
tsv = tsv.to_double if orig_type != :double
|
data/lib/rbbt/tsv/index.rb
CHANGED
@@ -129,6 +129,7 @@ module TSV
|
|
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
|
132
|
+
data_options[:grep] ||= data_options[:tsv_grep] if data_options[:tsv_grep]
|
132
133
|
identifiers = TSV.open(file, data_options)
|
133
134
|
identifiers.with_monitor :desc => "Creating Index for #{ file }" do
|
134
135
|
identifiers.index(options.merge :persist_data => data, :persist => persist_options[:persist])
|
data/lib/rbbt/util/misc/pipes.rb
CHANGED
@@ -353,14 +353,16 @@ module Misc
|
|
353
353
|
|
354
354
|
current_parts = []
|
355
355
|
while line
|
356
|
-
key, *parts = line.
|
357
|
-
current_key ||= key
|
356
|
+
key, *parts = line.chomp.split(sep, -1)
|
358
357
|
case
|
359
358
|
when key.nil?
|
359
|
+
when current_parts.nil?
|
360
|
+
current_parts = parts
|
361
|
+
current_key = key
|
360
362
|
when current_key == key
|
361
363
|
parts.each_with_index do |part,i|
|
362
364
|
if current_parts[i].nil?
|
363
|
-
current_parts[i] = part
|
365
|
+
current_parts[i] = "|" << part
|
364
366
|
else
|
365
367
|
current_parts[i] = current_parts[i] << "|" << part
|
366
368
|
end
|
@@ -18,6 +18,7 @@ $ rbbt app start [options] <app_name>
|
|
18
18
|
-s--server* Server type: thin, webrick, unicorn, etc
|
19
19
|
-f--finder Start server with finder functionality
|
20
20
|
-R--Rserve_session* Rserve session to use, otherwise start new one
|
21
|
+
-wd--workdir* Change the working directory of the workflow
|
21
22
|
--views* Directory with view templates
|
22
23
|
EOF
|
23
24
|
|
@@ -30,6 +31,11 @@ if options[:help]
|
|
30
31
|
exit 0
|
31
32
|
end
|
32
33
|
|
34
|
+
if options[:workdir]
|
35
|
+
require 'rbbt/workflow'
|
36
|
+
Workflow.workdir = options[:workdir]
|
37
|
+
end
|
38
|
+
|
33
39
|
options[:Port] ||= options[:port]
|
34
40
|
options[:Host] ||= "0.0.0.0"
|
35
41
|
options[:Bind] ||= "0.0.0.0"
|
@@ -19,6 +19,34 @@ row2 aa bb cc
|
|
19
19
|
assert_equal ["BB", "bb"], tsv["row2"][1]
|
20
20
|
end
|
21
21
|
|
22
|
+
def test_collapse_stream_gap
|
23
|
+
text=<<-EOF
|
24
|
+
row2 AA BB
|
25
|
+
row2 aa bb cc
|
26
|
+
EOF
|
27
|
+
|
28
|
+
s = StringIO.new text
|
29
|
+
assert Misc.collapse_stream(s, nil, " ").read =~ /\|cc$/
|
30
|
+
|
31
|
+
text=<<-EOF
|
32
|
+
row2 aa bb cc
|
33
|
+
row2 AA BB
|
34
|
+
EOF
|
35
|
+
|
36
|
+
s = StringIO.new text
|
37
|
+
assert Misc.collapse_stream(s, nil, " ").read =~ /cc\|$/
|
38
|
+
|
39
|
+
text=<<-EOF
|
40
|
+
row2 AA BB
|
41
|
+
row2 aa bb cc
|
42
|
+
EOF
|
43
|
+
|
44
|
+
s = StringIO.new text
|
45
|
+
assert Misc.collapse_stream(s, nil, " ").read =~ /\|cc$/
|
46
|
+
|
47
|
+
end
|
48
|
+
|
49
|
+
|
22
50
|
def test_paste_stream
|
23
51
|
text1=<<-EOF
|
24
52
|
row1 A B C
|
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.19.
|
4
|
+
version: 5.19.30
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Vazquez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -294,6 +294,7 @@ files:
|
|
294
294
|
- share/Rlib/plot.R
|
295
295
|
- share/Rlib/svg.R
|
296
296
|
- share/Rlib/util.R
|
297
|
+
- share/color/diverging_colors.hex
|
297
298
|
- share/config.ru
|
298
299
|
- share/install/software/HTSLIB
|
299
300
|
- share/install/software/lib/install_helpers
|