Skip to content

Commit

Permalink
support compatibility for the output directory with pip engine
Browse files Browse the repository at this point in the history
  • Loading branch information
rjpbonnal committed Jun 25, 2015
1 parent c452950 commit 3cbfc7d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions bin/gfastqc
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,27 @@ config = YAML.load_file(options.config)
@base_file_names << options.second if options.second # this can be optional

if options.pipengine
unless config['output']
unless config['resources'] && config['resources']['output']
puts "Error: If you selected the compatible option -p/--pipengine, an 'output' tag must occour in your configuration file."
end
end

output = if config['output']
config['output']
elsif options.pipengine && config['resources'] && config['resources']['output']
config['resources']['output']
else
'.'
end


config['samples'].each_pair do |name, path|
@data[name] = {}
@tables[name] = {}
@base_file_names.each do |base_file_name|
@data[name][base_file_name]={}
@tables[name][base_file_name]={}
file = File.join(options.pipengine ? File.join(config['output'], name) : path, options.step, "#{base_file_name}_fastqc.zip")
file = File.join(options.pipengine ? File.join(output, name) : path, options.step, "#{base_file_name}_fastqc.zip")
Zip::File.open(file) do |zip_file|
zip_file.glob('*/Images/*.png').each do |entry|
field_name = File.basename(entry.name,".png")
Expand Down

0 comments on commit 3cbfc7d

Please sign in to comment.