diff roche454/sff_to_fastq_converter.pl @ 0:f036c7107601

Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
author edward-kirton
date Tue, 07 Jun 2011 17:50:32 -0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/roche454/sff_to_fastq_converter.pl	Tue Jun 07 17:50:32 2011 -0400
@@ -0,0 +1,31 @@
+#!/usr/bin/env perl
+
+use warnings;
+use strict;
+use Getopt::Long;
+use File::Basename;
+
+# VALIDATE INPUT
+die("Expected 3 args") unless @ARGV == 3;
+my ($sff, $extra_files_path, $fastq) = @ARGV;
+
+# DEFINE PATHS
+mkdir($extra_files_path) unless -d $extra_files_path;
+my $base  = basename($sff);
+my $fasta = "$extra_files_path/$base.fasta";
+my $qual  = "$extra_files_path/$base.qual";
+
+# GENERATE FASTA, QUAL, FASTQ
+my $outf;
+my $out;
+eval { $out=`sffinfo -seq $sff > $fasta` };
+die("ERROR: $out") if $@;
+print $out;
+eval { $out=`sffinfo -qual $sff > $qual` };
+die("ERROR: $out") if $@;
+print $out;
+eval { $out=`fasta_qual_to_fastq $fasta $qual $fastq` };
+die("ERROR: $out") if $@;
+print $out;
+unlink($fasta, $qual);
+exit 0;