Skip to content

Commit

Permalink
added wildcard for output copy
Browse files Browse the repository at this point in the history
  • Loading branch information
fstrozzi committed Oct 12, 2012
1 parent 9fe57c2 commit 6ea98fd
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/bio/grid/job.rb
Expand Up @@ -22,7 +22,7 @@ def set_commandline(cmd_line,inputs,input1,groups,index)
if commandline =~/<output>\.(\S+)/ if commandline =~/<output>\.(\S+)/
extension = $1 extension = $1
commandline.gsub!(/<output>/,job_output) commandline.gsub!(/<output>/,job_output)
job_output << ".#{extension}" #job_output << ".#{extension}"
else else
self.options[:output_folder] = true self.options[:output_folder] = true
commandline.gsub!(/<output>/,job_output) commandline.gsub!(/<output>/,job_output)
Expand All @@ -35,12 +35,12 @@ def append_options
if self.options[:copy] if self.options[:copy]
self.instructions << ("mkdir -p #{self.options[:copy]}\n") self.instructions << ("mkdir -p #{self.options[:copy]}\n")
copy_type = (self.options[:output_folder]) ? "cp -r" : "cp" copy_type = (self.options[:output_folder]) ? "cp -r" : "cp"
self.instructions << ("#{copy_type} #{self.job_output} #{self.options[:copy]}\n") self.instructions << ("#{copy_type} #{self.job_output}* #{self.options[:copy]}\n")
end end


if self.options[:clean] if self.options[:clean]
rm_type = (self.options[:output_folder]) ? "rm -fr" : "rm -f" rm_type = (self.options[:output_folder]) ? "rm -fr" : "rm -f"
self.instructions << ("#{rm_type} #{self.job_output}\n") self.instructions << ("#{rm_type} #{self.job_output}*\n")
end end
end end


Expand All @@ -62,11 +62,11 @@ def set_scheduler_options(type)


def execute(command_line,inputs,input1,groups,index) def execute(command_line,inputs,input1,groups,index)
self.set_scheduler_options(:pbs) # set script specific options for the scheduling system self.set_scheduler_options(:pbs) # set script specific options for the scheduling system
self.set_commandline(command_line,inputs,input1,groups,index) self.set_commandline(command_line,inputs,input1,groups,index)
self.set_output_dir self.set_output_dir
self.append_options self.append_options
job_filename = (self.options[:keep]) ? "job_#{index+1}#{self.options[:parameter_value]}.sh" : "job.sh" job_filename = (self.options[:keep]) ? "job_#{index+1}#{self.options[:parameter_value]}.sh" : "job.sh"
self.run(job_filename) self.run(job_filename)
end end




Expand Down

0 comments on commit 6ea98fd

Please sign in to comment.