38
|
1 #!/usr/bin/env perl
|
|
2
|
|
3 # Flexbar wrapper for Galaxy tool definition, version 3.4.2
|
|
4 # Author: Johannes Roehr
|
|
5
|
|
6 use warnings;
|
|
7 use strict;
|
|
8
|
|
9 my $format;
|
|
10 my @inFiles;
|
|
11 my @outFiles;
|
|
12
|
|
13 foreach(0..$#ARGV){
|
|
14 my $arg = $ARGV[$_];
|
|
15
|
|
16 if($arg =~ /\.(fastq\w+)$/ || $arg =~ /\.(fastq\w+\.gz)$/){
|
|
17
|
|
18 $format = $1;
|
|
19 my $file = $arg;
|
|
20
|
|
21 $arg =~ s/\.fastq\w+$/\.fastq/;
|
|
22 $arg =~ s/\.fastq\w+\.gz$/\.fastq\.gz/;
|
|
23
|
|
24 $ARGV[$_] = $arg;
|
|
25 rename $file, $arg;
|
|
26
|
|
27 push @inFiles, $arg if $arg =~ /\.dat_input\.fastq$/ || $arg =~ /\.dat_input\.fastq\.gz$/;
|
|
28 push @outFiles, $arg if $arg =~ /\.dat\.fastq$/ || $arg =~ /\.dat\.fastq\.gz$/;
|
|
29 }
|
|
30 }
|
|
31
|
|
32 my $call = join " ", @ARGV;
|
|
33
|
|
34 system $call and exit 1;
|
|
35
|
|
36
|
|
37 unlink $_ or warn "Could not unlink $_: $!" foreach(@inFiles);
|
|
38
|
|
39 foreach(@outFiles){
|
|
40
|
|
41 my $file = $_;
|
|
42
|
|
43 s/\.fastq$//;
|
|
44 s/\.fastq\.gz$//;
|
|
45
|
|
46 rename $file, $_;
|
|
47 }
|
|
48
|