rbbt-util 5.28.2 → 5.28.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6bc94b86c69f95806ae280d76df8da7696f5df0f008a3791385e4ccf11b70977
4
- data.tar.gz: f7763e2dd88ba121b8a625b846bf0f4f1efaba090b873f2947e0a83ae9dabff1
3
+ metadata.gz: 1eb8b404c84b1c6d07f3d13ffeaeb97a4b9fd59bf237241b98e184cbfdb98a43
4
+ data.tar.gz: f2a0e7c55aa053a7d559143b1ae235558355fd1f4f61f2845864e47b621e37fc
5
5
  SHA512:
6
- metadata.gz: 59fd76fc00eeeb892ad53bbbc0757d5e17dde600f505d31e8dabe43e0184e5c5bfcef2ccc3f7aa9bc295e36251b9f864706bc0dcf357cc3606b73b1f25f7d672
7
- data.tar.gz: ce4d345fc9876378b57ba8753d2a7dfd13b4fd23330246bc2385186f81344026cf415e7cc6eb86253f86e709e2061139930734b2c77b7329165ed2892e3e5d0a
6
+ metadata.gz: fd8348766af38ef48c379966ae2766e59fcb14714d78a5130856cdfef2d5a87eeabb4ae519a2fa6a2fa862d6b71cfff711eefe293b3f0954af6b0f70bbf58bdd
7
+ data.tar.gz: a8187db527df84d7db46e1cc049ed8e3a850188da16d0834408af102bf7f02977524786ab1267e6d047744d3e8cca3cc02c1382ede7b8766a61468867e2f8464
@@ -412,7 +412,9 @@ module Path
412
412
  end
413
413
 
414
414
  def replace_extension(new_extension = nil, multiple = false)
415
- if multiple
415
+ if String === multiple
416
+ new_path = self.sub(/(\.[^\.\/]{1,5})(.#{multiple})?$/,'')
417
+ elsif multiple
416
418
  new_path = self.sub(/(\.[^\.\/]{1,5})+$/,'')
417
419
  else
418
420
  new_path = self.sub(/\.[^\.\/]{1,5}$/,'')
@@ -58,13 +58,13 @@ module TSV
58
58
 
59
59
  identifiers, persist_input, compact = Misc.process_options options, :identifiers, :persist, :compact
60
60
  identifiers = tsv.identifier_files.first if identifiers.nil?
61
- identifiers = Organism.identifiers(tsv.namespace) if identifiers.nil? and tsv.namespace and Organism.identifiers(tsv.namespace).exists?
61
+ identifiers = Organism.identifiers(tsv.namespace) if defined?(Organism) && identifiers.nil? && tsv.namespace && Organism.identifiers(tsv.namespace).exists?
62
62
  identifiers.namespace ||= tsv.namespace
63
63
 
64
64
  fields = (identifiers and identifiers.all_fields.include?(field))? [field] : nil
65
65
  #index = identifiers.index :target => format, :fields => fields, :persist => persist_input, :order => true
66
66
 
67
- grep = Organism.blacklist_genes(tsv.namespace).list if identifiers.namespace and Organism.blacklist_genes(tsv.namespace).exists?
67
+ grep = Organism.blacklist_genes(tsv.namespace).list if defined?(Organism) && identifiers.namespace && Organism.blacklist_genes(tsv.namespace).exists?
68
68
  if fields.nil?
69
69
  index = identifiers.index(:data_tsv_grep => grep, :data_invert_grep => true, :target => format, :persist => true, :order => true, :unnamed => true, :data_persist => true)
70
70
  else
@@ -316,22 +316,30 @@ module TSV
316
316
 
317
317
  def to_single
318
318
  new = {}
319
- case type
320
- when :double
321
- through do |k,v|
322
- new[k] = v.first.first
323
- end
324
- when :flat
319
+
320
+ if block_given?
325
321
  through do |k,v|
326
- new[k] = v.first
322
+ new[k] = yield v
327
323
  end
328
- when :single
329
- return self
330
- when :list
331
- through do |k,v|
332
- new[k] = v.first
324
+ else
325
+ case type
326
+ when :double
327
+ through do |k,v|
328
+ new[k] = v.first.first
329
+ end
330
+ when :flat
331
+ through do |k,v|
332
+ new[k] = v.first
333
+ end
334
+ when :single
335
+ return self
336
+ when :list
337
+ through do |k,v|
338
+ new[k] = v.first
339
+ end
333
340
  end
334
341
  end
342
+
335
343
  self.annotate(new)
336
344
  new.type = :single
337
345
  new.fields = [new.fields.first] if new.fields.length > 1
@@ -4,8 +4,13 @@ module Workflow
4
4
  Rbbt.claim Rbbt.software.opt.jar["wdltool.jar"], :url, "https://github.com/broadinstitute/wdltool/releases/download/0.14/wdltool-0.14.jar"
5
5
 
6
6
  def run_cromwell(file, work_dir, options = {})
7
+ cromwell_inputs_file = Misc.process_options options, :cromwell_inputs_file
7
8
  jar = Rbbt.software.opt.jar["cromwell.jar"].produce.find
8
- CMD.cmd_log("java -jar '#{jar}' run '#{file}' --workflow-root='#{work_dir}'", options.merge("add_option_dashes" => true))
9
+ if cromwell_inputs_file
10
+ CMD.cmd_log("java -jar '#{jar}' run '#{file}' --workflow-root='#{work_dir}' -i #{cromwell_inputs_file}", options.merge("add_option_dashes" => true))
11
+ else
12
+ CMD.cmd_log("java -jar '#{jar}' run '#{file}' --workflow-root='#{work_dir}'", options.merge("add_option_dashes" => true))
13
+ end
9
14
  end
10
15
 
11
16
  def load_cromwell(file)
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.28.2
4
+ version: 5.28.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-12 00:00:00.000000000 Z
11
+ date: 2020-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake