bio-pipengine 0.8.2 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/bin/pipengine +1 -0
  4. data/lib/bio/pipengine.rb +21 -0
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b69f042e366f72a66422d70bfe2e14f634f2167c
4
- data.tar.gz: bc9d13da2c214f7cb703c5f7122c1ace4285230a
3
+ metadata.gz: 383594042b8a168b00d40d54e32c5a7a65b80d33
4
+ data.tar.gz: 4fbe9029f9164019773464d76dce673a9a295cc6
5
5
  SHA512:
6
- metadata.gz: 567d59c47d05f446f77cb67ab0c161609abb61a605a087bf5bd9713af12ac84f85c7fa47fee79fe455510d9a9cd955bbe6232502bc7fdc5efb8139c82dfc7518
7
- data.tar.gz: 157069ff56e1c2c4334b4b54c0f9ed9ae02eeffd3309e9527fa41743d825cada30f6083c36cc21eee70b95821b3e80428badb0d01bb14c9c36596e2949d693cf
6
+ metadata.gz: d808b81a9533dfe6ce2d63df335480dacf73b0b11166abcd7984be75f72867f7a842a7b44fc630190da216ed3a57ac32cbdf9080bcf86cd242956b39a1dbbc77
7
+ data.tar.gz: d0a27bf16ca3feac1f49c75ac7c9a8b06d08097178d32b9d05bd1a67eff6b549a18035ce3bbfa73e43f8ba8affb2a7a7c13ca9f43173a29567afb0b1e97fc259
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.2
1
+ 0.9.0
data/bin/pipengine CHANGED
@@ -34,6 +34,7 @@ when "run"
34
34
  opt :inspect_pipeline, "Show steps", :short => "i", :type => :string
35
35
  opt :log, "Log script activities, by default stdin. Options are fluentd", :type => :string, :default => "stdin"
36
36
  opt :log_adapter, "(stdin|syslog|fluentd) In case of fluentd use http://destination.hostname:port/yourtag", :type => :string
37
+ opt :tag, "Overwrite tags present in samples.yml and pipeline.yml files (e.g. tag1=value1 tag2=value2)", :type => :strings
37
38
  end
38
39
  #when "jobs"
39
40
  # ARGV.shift
data/lib/bio/pipengine.rb CHANGED
@@ -50,6 +50,24 @@ module Bio
50
50
  end
51
51
  end
52
52
 
53
+ def self.parse_tag_option(option_tag)
54
+ if !option_tag
55
+ return {}
56
+ else
57
+ tags = {}
58
+ option_tag.each do |tag|
59
+ values = tag.split("=")
60
+ if values.empty?
61
+ @@logger_error.error "\nAbort! Unrecognized values for tag option, please provide the tags as follows: tag1=value1 tag2=value2".red
62
+ exit
63
+ else
64
+ tags.merge! Hash[*values.flatten]
65
+ end
66
+ end
67
+ return tags
68
+ end
69
+ end
70
+
53
71
  # handle steps that run on multiple samples (i.e. sample groups job)
54
72
  def self.check_and_run_multi(samples_file,pipeline,samples_list,options)
55
73
  step_multi = options[:steps].map {|s| Bio::Pipengine::Step.new(s,pipeline["steps"][s]).is_multi?}
@@ -86,8 +104,11 @@ module Bio
86
104
  job.local = options[:tmp]
87
105
  job.custom_output = options[:output_dir]
88
106
  job.custom_name = (options[:name]) ? options[:name] : nil
107
+ # Adding pipeline and samples resources
89
108
  job.add_resources pipeline["resources"]
90
109
  job.add_resources samples_file["resources"]
110
+ # Adding resource tag from the command line which can overwrite resources defined in the pipeline and samples files
111
+ job.add_resources parse_tag_option(options[:tag])
91
112
  #setting the logging system
92
113
  job.log = options[:log]
93
114
  job.log_adapter = options[:log_adapter]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bio-pipengine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francesco Strozzi
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-04-11 00:00:00.000000000 Z
12
+ date: 2016-04-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: trollop