annotate roche454/sff_to_fastq_converter.pl @ 1:584549c024c2 default tip

Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
author edward-kirton
date Tue, 07 Jun 2011 17:23:39 -0400
parents 9e30cc10a6a3
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
9e30cc10a6a3 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
edward-kirton
parents:
diff changeset
1 #!/usr/bin/env perl
9e30cc10a6a3 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
edward-kirton
parents:
diff changeset
2
9e30cc10a6a3 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
edward-kirton
parents:
diff changeset
3 use warnings;
9e30cc10a6a3 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
edward-kirton
parents:
diff changeset
4 use strict;
9e30cc10a6a3 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
edward-kirton
parents:
diff changeset
5 use Getopt::Long;
9e30cc10a6a3 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
edward-kirton
parents:
diff changeset
6 use File::Basename;
9e30cc10a6a3 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
edward-kirton
parents:
diff changeset
7
9e30cc10a6a3 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
edward-kirton
parents:
diff changeset
8 # VALIDATE INPUT
9e30cc10a6a3 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
edward-kirton
parents:
diff changeset
9 die("Expected 3 args") unless @ARGV == 3;
9e30cc10a6a3 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
edward-kirton
parents:
diff changeset
10 my ($sff, $extra_files_path, $fastq) = @ARGV;
9e30cc10a6a3 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
edward-kirton
parents:
diff changeset
11
9e30cc10a6a3 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
edward-kirton
parents:
diff changeset
12 # DEFINE PATHS
9e30cc10a6a3 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
edward-kirton
parents:
diff changeset
13 mkdir($extra_files_path) unless -d $extra_files_path;
9e30cc10a6a3 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
edward-kirton
parents:
diff changeset
14 my $base = basename($sff);
9e30cc10a6a3 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
edward-kirton
parents:
diff changeset
15 my $fasta = "$extra_files_path/$base.fasta";
9e30cc10a6a3 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
edward-kirton
parents:
diff changeset
16 my $qual = "$extra_files_path/$base.qual";
9e30cc10a6a3 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
edward-kirton
parents:
diff changeset
17
9e30cc10a6a3 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
edward-kirton
parents:
diff changeset
18 # GENERATE FASTA, QUAL, FASTQ
9e30cc10a6a3 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
edward-kirton
parents:
diff changeset
19 my $outf;
9e30cc10a6a3 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
edward-kirton
parents:
diff changeset
20 my $out;
9e30cc10a6a3 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
edward-kirton
parents:
diff changeset
21 eval { $out=`sffinfo -seq $sff > $fasta` };
9e30cc10a6a3 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
edward-kirton
parents:
diff changeset
22 die("ERROR: $out") if $@;
9e30cc10a6a3 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
edward-kirton
parents:
diff changeset
23 print $out;
9e30cc10a6a3 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
edward-kirton
parents:
diff changeset
24 eval { $out=`sffinfo -qual $sff > $qual` };
9e30cc10a6a3 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
edward-kirton
parents:
diff changeset
25 die("ERROR: $out") if $@;
9e30cc10a6a3 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
edward-kirton
parents:
diff changeset
26 print $out;
9e30cc10a6a3 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
edward-kirton
parents:
diff changeset
27 eval { $out=`fasta_qual_to_fastq $fasta $qual $fastq` };
9e30cc10a6a3 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
edward-kirton
parents:
diff changeset
28 die("ERROR: $out") if $@;
9e30cc10a6a3 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
edward-kirton
parents:
diff changeset
29 print $out;
9e30cc10a6a3 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
edward-kirton
parents:
diff changeset
30 unlink($fasta, $qual);
9e30cc10a6a3 Migrated tool version 1.0.0 from old tool shed archive to new tool shed repository
edward-kirton
parents:
diff changeset
31 exit 0;