2
|
1 #!/usr/bin/env perl
|
|
2
|
|
3 use warnings;
|
|
4 use strict;
|
|
5 use Getopt::Long;
|
|
6 use File::Basename;
|
|
7
|
|
8 # VALIDATE INPUT
|
|
9 die("Expected 3 args") unless @ARGV == 3;
|
|
10 my ($sff, $extra_files_path, $fastq) = @ARGV;
|
|
11
|
|
12 # DEFINE PATHS
|
|
13 mkdir($extra_files_path) unless -d $extra_files_path;
|
|
14 my $base = basename($sff);
|
|
15 my $fasta = "$extra_files_path/$base.fasta";
|
|
16 my $qual = "$extra_files_path/$base.qual";
|
|
17
|
|
18 # GENERATE FASTA, QUAL, FASTQ
|
|
19 my $outf;
|
|
20 my $out;
|
|
21 eval { $out=`sffinfo -seq $sff > $fasta` };
|
|
22 die("ERROR: $out") if $@;
|
|
23 print $out;
|
|
24 eval { $out=`sffinfo -qual $sff > $qual` };
|
|
25 die("ERROR: $out") if $@;
|
|
26 print $out;
|
|
27 eval { $out=`fasta_qual_to_fastq $fasta $qual $fastq` };
|
|
28 die("ERROR: $out") if $@;
|
|
29 print $out;
|
|
30 unlink($fasta, $qual);
|
|
31 exit 0;
|