Class: Bio::FastQC::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/bio/fastqc/cli.rb

Instance Method Summary collapse

Instance Method Details

#parse(*files) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/bio/fastqc/cli.rb', line 12

def parse(*files)
  files.each do |file|
    data = Data.read(file)
    summary = Parser.new(data).summary
    out = Converter.new(summary).convert_to(options[:format])

    outdir_path = options[:outdir]
    if outdir_path && File.directory?(outdir_path)
      filename_org = File.basename(summary[:filename])
      fpath = File.join(outdir_path, filename_org + "." + options[:format])
      open(fpath, "w"){|f| f.puts(out) }
    else
      puts out
    end
  end
end