bio-grid 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/bin/bio-grid +4 -0
- data/bio-grid.gemspec +3 -3
- data/lib/bio/grid.rb +4 -4
- data/lib/bio/grid/job.rb +7 -7
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.2
|
data/bin/bio-grid
CHANGED
@@ -56,6 +56,10 @@ optparse = OptionParser.new do |opts|
|
|
56
56
|
options[:sep] = sep
|
57
57
|
end
|
58
58
|
|
59
|
+
opts.on("--uuid UUID","Provide a UUID for the job array") do |uuid|
|
60
|
+
options[:uuid] = uuid
|
61
|
+
end
|
62
|
+
|
59
63
|
opts.on("--keep-scripts","Keep all the running scripts created for all the jobs") {options[:keep] = true}
|
60
64
|
|
61
65
|
opts.on("-h","--help","Display this screen") do
|
data/bio-grid.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "bio-grid"
|
8
|
-
s.version = "0.3.
|
8
|
+
s.version = "0.3.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Francesco Strozzi"]
|
12
|
-
s.date = "2012-
|
12
|
+
s.date = "2012-10-12"
|
13
13
|
s.description = "A BioGem to submit jobs on a queue system"
|
14
14
|
s.email = "francesco.strozzi@gmail.com"
|
15
15
|
s.executables = ["bio-grid"]
|
@@ -37,7 +37,7 @@ Gem::Specification.new do |s|
|
|
37
37
|
s.homepage = "http://github.com/fstrozzi/bioruby-grid"
|
38
38
|
s.licenses = ["MIT"]
|
39
39
|
s.require_paths = ["lib"]
|
40
|
-
s.rubygems_version = "1.8.
|
40
|
+
s.rubygems_version = "1.8.23"
|
41
41
|
s.summary = "A BioGem to submit jobs on a queue system"
|
42
42
|
|
43
43
|
if s.respond_to? :specification_version then
|
data/lib/bio/grid.rb
CHANGED
@@ -3,16 +3,16 @@ module Bio
|
|
3
3
|
class Grid
|
4
4
|
|
5
5
|
attr_accessor :input,:number,:uuid
|
6
|
-
def initialize(input,number)
|
6
|
+
def initialize(input,number, uuid)
|
7
7
|
@input = input
|
8
8
|
@number = number
|
9
|
-
@uuid = UUID.new.generate.split("-").first
|
9
|
+
@uuid = uuid ? uuid : UUID.new.generate.split("-").first
|
10
10
|
end
|
11
11
|
|
12
12
|
def self.run(options)
|
13
13
|
options[:number] = "all" unless options[:number]
|
14
|
-
grid = self.new options[:input], options[:number]
|
15
|
-
options[:uuid] = grid.uuid
|
14
|
+
grid = self.new options[:input], options[:number], options[:uuid]
|
15
|
+
options[:uuid] = grid.uuid unless options[:uuid]
|
16
16
|
groups = grid.prepare_input_groups
|
17
17
|
inputs = groups.keys.sort
|
18
18
|
groups[inputs.shift].each_with_index do |input1,index|
|
data/lib/bio/grid/job.rb
CHANGED
@@ -22,7 +22,7 @@ module Bio
|
|
22
22
|
if commandline =~/<output>\.(\S+)/
|
23
23
|
extension = $1
|
24
24
|
commandline.gsub!(/<output>/,job_output)
|
25
|
-
job_output << ".#{extension}"
|
25
|
+
#job_output << ".#{extension}"
|
26
26
|
else
|
27
27
|
self.options[:output_folder] = true
|
28
28
|
commandline.gsub!(/<output>/,job_output)
|
@@ -35,12 +35,12 @@ module Bio
|
|
35
35
|
if self.options[:copy]
|
36
36
|
self.instructions << ("mkdir -p #{self.options[:copy]}\n")
|
37
37
|
copy_type = (self.options[:output_folder]) ? "cp -r" : "cp"
|
38
|
-
self.instructions << ("#{copy_type} #{self.job_output} #{self.options[:copy]}\n")
|
38
|
+
self.instructions << ("#{copy_type} #{self.job_output}* #{self.options[:copy]}\n")
|
39
39
|
end
|
40
40
|
|
41
41
|
if self.options[:clean]
|
42
42
|
rm_type = (self.options[:output_folder]) ? "rm -fr" : "rm -f"
|
43
|
-
self.instructions << ("#{rm_type} #{self.job_output}
|
43
|
+
self.instructions << ("#{rm_type} #{self.job_output}*\n")
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
@@ -62,11 +62,11 @@ module Bio
|
|
62
62
|
|
63
63
|
def execute(command_line,inputs,input1,groups,index)
|
64
64
|
self.set_scheduler_options(:pbs) # set script specific options for the scheduling system
|
65
|
-
|
65
|
+
self.set_commandline(command_line,inputs,input1,groups,index)
|
66
66
|
self.set_output_dir
|
67
|
-
|
68
|
-
|
69
|
-
|
67
|
+
self.append_options
|
68
|
+
job_filename = (self.options[:keep]) ? "job_#{index+1}#{self.options[:parameter_value]}.sh" : "job.sh"
|
69
|
+
self.run(job_filename)
|
70
70
|
end
|
71
71
|
|
72
72
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bio-grid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-10-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: uuid
|
@@ -146,7 +146,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
146
146
|
version: '0'
|
147
147
|
segments:
|
148
148
|
- 0
|
149
|
-
hash: -
|
149
|
+
hash: -3879853977881312685
|
150
150
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
151
151
|
none: false
|
152
152
|
requirements:
|
@@ -155,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
155
155
|
version: '0'
|
156
156
|
requirements: []
|
157
157
|
rubyforge_project:
|
158
|
-
rubygems_version: 1.8.
|
158
|
+
rubygems_version: 1.8.23
|
159
159
|
signing_key:
|
160
160
|
specification_version: 3
|
161
161
|
summary: A BioGem to submit jobs on a queue system
|