# HG changeset patch # User biowebdb # Date 1396289421 14400 # Node ID d27bec235ad97dbf15b267c342b2f8fb03907df6 Uploaded diff -r 000000000000 -r d27bec235ad9 sffextract.rb --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sffextract.rb Mon Mar 31 14:10:21 2014 -0400 @@ -0,0 +1,36 @@ +#!/usr/bin/ruby +########################################################## +## Wrapper to convert SFF to Fasta +## +## Author: Biowebdb, 2014 +## +## This tool needs sff_extraxt version 0.28 or higher +## in path directory or $SFF_EXTRACT +## +## This tool need Biowebdb Ruby Lib +## (http://biowebdb.org) +## +########################################################## +require "logger" +require "#{ENV['biowebdb']}/bioinformatics/Bioinformatics" + +c = Bioinformatics.program "Sff" +c.logger(Logger.new(STDOUT)) +c.workPath="/tmp/" +c.input = ARGV[0] +if ARGV.size == 2 + c.format = 'FASTQ' +else + c.format = 'FASTA' +end +c.outputDir = "/tmp/#{Time.new.strftime("%Y%m%d%H%M%S")}" +c.execute(c.lineCommand) + +basename = File.basename(c.input, '.*') + +if c.format == 'FASTQ' + Kernel.system("mv #{c.outputDir}/*.fastq #{ARGV[1]}") +else + Kernel.system("mv #{c.output} #{ARGV[1]}") + Kernel.system("mv #{c.outputQual} #{ARGV[2]}") +end \ No newline at end of file