rbbt-util 5.33.2 → 5.33.3

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
  SHA256:
3
- metadata.gz: 331adb8d6a45a7cc3ee18b17785ffe03d28585274e9b2d1cab5cd502cdc90821
4
- data.tar.gz: 8580df0b38d805739fe3ad80e688c92a5c31305893ef1cf6cfccd88c0aaccc7a
3
+ metadata.gz: 3ffb05883cf1e7eda628395b50967322b42240ace100fb73a2f4c4a1ed5e8d27
4
+ data.tar.gz: 8b25c002f68b88dc0ba1f09c041258ee0ca15d4fc6f8dc3df5de37ea2473d059
5
5
  SHA512:
6
- metadata.gz: 6381f886a7282c03c8e8303ae148fe4a4fc3b82dad60d1d039953d83075aa85ccc19bb75f24811e2158a6715b9ed471288b2b23110c981a61ad167bc6593aac0
7
- data.tar.gz: 1476c3fdf9fe56928a9dd85fc2384735b71a0a40a45359197fc203608f2933aa6a6f5ec94c1bd5ae4b5782b2cd2bbe752f2d06973f9989307d81e3a1f261eba2
6
+ metadata.gz: 7b74e527336830eecb1cad52bb13cbcb335c734a18e9261d87cfba6da93422cf94a826e97d43c6ef1d37d122623408230d80a037a9a91000fa95a6cf9c818cf6
7
+ data.tar.gz: 8b8de5c12aac8dfae5f68018cb5aae4023b78993fa78aa7cf93cacc16eea4c2b959f75190ead6862502ecc75ae3ccd9cc462b1db26930943447a758f1f359cd9
@@ -11,7 +11,7 @@ module HPC
11
11
  iii :END_BATCHES
12
12
  else
13
13
  n = batch.dup
14
- n[:deps] = n[:deps].collect{|b| b[:top_level] }
14
+ n[:deps] = n[:deps].collect{|b| b[:top_level] } if n[:deps]
15
15
  iif n
16
16
  end
17
17
  end
@@ -79,14 +79,14 @@ module HPC
79
79
 
80
80
  batches.each do |batch|
81
81
  jobs = batch[:jobs]
82
- all_deps = jobs.collect{|d| job_dependencies(d) }.flatten.uniq
82
+ all_deps = jobs.collect{|d| job_dependencies(d) }.flatten.uniq - jobs
83
83
 
84
84
  minimum = all_deps
85
85
  all_deps.each do |dep|
86
86
  minimum -= job_dependencies(dep)
87
87
  end
88
88
 
89
- all_deps = minimum
89
+ all_deps = minimum
90
90
  deps = all_deps.collect do |d|
91
91
  (batches - [batch]).select{|batch| batch[:jobs].collect(&:path).include? d.path }
92
92
  end.flatten.uniq
data/lib/rbbt/util/cmd.rb CHANGED
@@ -75,7 +75,7 @@ module CMD
75
75
 
76
76
  string = ""
77
77
  options.each do |option, value|
78
- raise "Invalid option key: #{option.inspect}" if option.to_s !~ /^[a-z_0-9\-=]+$/i
78
+ raise "Invalid option key: #{option.inspect}" if option.to_s !~ /^[a-z_0-9\-=.]+$/i
79
79
  #raise "Invalid option value: #{value.inspect}" if value.to_s.include? "'"
80
80
  value = value.gsub("'","\\'") if value.to_s.include? "'"
81
81
 
@@ -92,7 +92,12 @@ module Workflow
92
92
  self.dependencies = self.dependencies - [dep]
93
93
  Open.rm_rf self.files_dir if Open.exist? self.files_dir
94
94
  FileUtils.cp_r dep.files_dir, self.files_dir if Open.exist?(dep.files_dir)
95
- Open.ln_h dep.path, self.tmp_path
95
+
96
+ if dep.overriden
97
+ Open.link dep.path, self.tmp_path
98
+ else
99
+ Open.ln_h dep.path, self.tmp_path
100
+ end
96
101
 
97
102
  case remove.to_s
98
103
  when 'true'
@@ -4,7 +4,7 @@ module Workflow
4
4
  end
5
5
 
6
6
  def self.nextflow_includes(file)
7
- Open.read(file).scan(/^include\s*{\s*(.*?)(?:\s*as.*?)?}\s*from\s+"(.*?)"(?:\s*params.*)?/).collect{|p| p}.uniq
7
+ Open.read(file).scan(/^include\s*{\s*([^\s]*?)\s+.*?}\s*from\s+["'](.*?)["'](?:\s*params.*)?/).collect{|p| p}.uniq
8
8
  end
9
9
 
10
10
  def self.nextflow_recursive_params(file)
@@ -48,25 +48,43 @@ module Workflow
48
48
  task name => result do
49
49
  work = file('work')
50
50
  profile = config :profile, :nextflow
51
+ config_file = config :config, :nextflow
51
52
 
52
- new_inputs = inputs.zip(inputs.fields).collect do |v,f|
53
- if String === v && m = v.match(/^JOB_FILE:(.*)/)
54
- file(m[1])
55
- elsif v.nil?
56
- Rbbt::Config.get(['nextflow', f] * "_", 'default', f)
53
+ nextflow_inputs = {}
54
+
55
+ inputs.zip(inputs.fields).collect do |v,f|
56
+ v = if String === v && m = v.match(/^JOB_FILE:(.*)/)
57
+ file(m[1])
58
+ elsif v.nil?
59
+ Rbbt::Config.get(['nextflow', f] * "_", 'default', f)
60
+ else
61
+ v
62
+ end
63
+
64
+ if f.to_s.include?("-")
65
+ p,_sep, section = f.to_s.partition("-")
66
+ name = [section, p] * "."
57
67
  else
58
- v
68
+ name = f
59
69
  end
70
+
71
+ nextflow_inputs[name] = v
60
72
  end
61
73
 
62
- inputs.replace new_inputs
63
-
64
74
  Misc.in_dir file('stage') do
65
- if profile
66
- cmd("nextflow run -work-dir #{work} -ansi-log false -profile #{profile} #{file}", inputs.to_hash.merge('add_option_dashes' => true))
67
- else
68
- cmd("nextflow run -work-dir #{work} -ansi-log false #{file}", inputs.to_hash.merge('add_option_dashes' => true))
69
- end
75
+
76
+ cmd = "nextflow "
77
+
78
+ cmd += " -C #{config_file}" if config_file
79
+
80
+ cmd += " run"
81
+
82
+ cmd += " -work-dir #{work} -ansi-log false"
83
+
84
+ cmd += " -profile #{profile}" if profile
85
+
86
+
87
+ cmd("#{cmd} #{file}", nextflow_inputs.merge('add_option_dashes' => true))
70
88
  end
71
89
 
72
90
  output_file = file(output).glob.first if output
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.33.2
4
+ version: 5.33.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-23 00:00:00.000000000 Z
11
+ date: 2022-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake