0
|
1 #!/usr/bin/ruby
|
|
2 ##########################################################
|
|
3 ## Wrapper to convert SFF to Fasta
|
|
4 ##
|
|
5 ## Author: Biowebdb, 2014
|
|
6 ##
|
|
7 ## This tool needs sff_extraxt version 0.28 or higher
|
|
8 ## in path directory or $SFF_EXTRACT
|
|
9 ##
|
|
10 ## This tool need Biowebdb Ruby Lib
|
|
11 ## (http://biowebdb.org)
|
|
12 ##
|
|
13 ##########################################################
|
|
14 require "logger"
|
|
15 require "#{ENV['biowebdb']}/bioinformatics/Bioinformatics"
|
|
16
|
|
17 c = Bioinformatics.program "Sff"
|
|
18 c.logger(Logger.new(STDOUT))
|
|
19 c.workPath="/tmp/"
|
|
20 c.input = ARGV[0]
|
|
21 if ARGV.size == 2
|
|
22 c.format = 'FASTQ'
|
|
23 else
|
|
24 c.format = 'FASTA'
|
|
25 end
|
|
26 c.outputDir = "/tmp/#{Time.new.strftime("%Y%m%d%H%M%S")}"
|
|
27 c.execute(c.lineCommand)
|
|
28
|
|
29 basename = File.basename(c.input, '.*')
|
|
30
|
|
31 if c.format == 'FASTQ'
|
|
32 Kernel.system("mv #{c.outputDir}/*.fastq #{ARGV[1]}")
|
|
33 else
|
|
34 Kernel.system("mv #{c.output} #{ARGV[1]}")
|
|
35 Kernel.system("mv #{c.outputQual} #{ARGV[2]}")
|
|
36 end |