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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dcf03395fb6992f9b928709c4c1a5b62bc8409f8
4
- data.tar.gz: 3d06adac3fe7750350c7185c93f61afae8f0b09e
3
+ metadata.gz: 3184d37817097198d31ebdd2af78c95b51bf1784
4
+ data.tar.gz: cc4c9a849005583c40a3009e6eb57a6fca0990fd
5
5
  SHA512:
6
- metadata.gz: 06501f7fca063beaff2358c021a46d14a93630d9ab3fd0b68c1df4e4f98e5c810916168401d2dd79d8e3b835b50a5907ac4cf41bae2bce7e18b28f7e9ef1245b
7
- data.tar.gz: 91ee3cf063dc7b645b28c3005ee911d5a51d5f1eaf6d78b10a1fd19ebbf64e73d7a95e8793328883febfa67bfee7ee1a6ae77b41c57272432d2e0e98187a9a68
6
+ metadata.gz: 27bd364fec2ac63ff3b61167579be2d26aa4f2617481559e199128ee118fb200b0bc71cbb432c59bb505d4719d70d613997baaee2a5448568101d927a73f7beb
7
+ data.tar.gz: 057a24eccb91df8d925adc264c4b20d7c2613a655b125415bbcf7fdefb3e7cb45723eea5ba42948762d742066876cfcf7cfdbd080f0e40e5f82566f7eb44e411
@@ -197,6 +197,7 @@ module TSV
197
197
 
198
198
  if complete
199
199
  fill = TrueClass === complete ? nil : complete
200
+ field_length = self.fields.length
200
201
  missing = other.keys - self.keys
201
202
  case type
202
203
  when :single
@@ -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 + [[]] * fields.length
41
+ self[key] = current + [[]] * num_fields
41
42
  else
42
- self[key] = current + [nil] * fields.length
43
+ self[key] = current + [nil] * num_fields
43
44
  end
44
45
  end
45
46
  end
@@ -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
@@ -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])
@@ -353,14 +353,16 @@ module Misc
353
353
 
354
354
  current_parts = []
355
355
  while line
356
- key, *parts = line.strip.split(sep, -1)
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
@@ -0,0 +1,12 @@
1
+ #a6cee3
2
+ #1f78b4
3
+ #b2df8a
4
+ #33a02c
5
+ #fb9a99
6
+ #e31a1c
7
+ #fdbf6f
8
+ #ff7f00
9
+ #cab2d6
10
+ #6a3d9a
11
+ #ffff99
12
+ #b15928
@@ -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.29
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-03-30 00:00:00.000000000 Z
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