Mercurial > repos > jtilman > flexbar
comparison flexbar.pl @ 40:2fcee21876db draft
Uploaded
author | jtilman |
---|---|
date | Sun, 01 Jul 2018 08:00:26 -0400 |
parents | 216a55a39b52 |
children | e1f80a81ba2c |
comparison
equal
deleted
inserted
replaced
39:ae7d2b47ad07 | 40:2fcee21876db |
---|---|
11 my @outFiles; | 11 my @outFiles; |
12 | 12 |
13 foreach(0..$#ARGV){ | 13 foreach(0..$#ARGV){ |
14 my $arg = $ARGV[$_]; | 14 my $arg = $ARGV[$_]; |
15 | 15 |
16 if($arg =~ /\.(fastq\w+)$/ || $arg =~ /\.(fastq\w+\.gz)$/){ | 16 if($arg =~ /\.(fastq\w+)$/ || $arg =~ /\.(fastq\w+\.gz)$/ || $arg =~ /\.(fastq\w+\.bz2)$/){ |
17 | 17 |
18 if(defined $format && $format ne $1){ | |
19 print STDERR "Paired read files should have the same format.\n"; | |
20 exit 1; | |
21 } | |
18 $format = $1; | 22 $format = $1; |
23 | |
19 my $file = $arg; | 24 my $file = $arg; |
20 | 25 |
21 $arg =~ s/\.fastq\w+$/\.fastq/; | 26 $arg =~ s/\.fastq\w+$/\.fastq/; |
22 $arg =~ s/\.fastq\w+\.gz$/\.fastq\.gz/; | 27 $arg =~ s/\.fastq\w+\.gz$/\.fastq\.gz/; |
28 $arg =~ s/\.fastq\w+\.bz2$/\.fastq\.bz2/; | |
29 | |
30 push @inFiles, $arg if $arg =~ /\.dat_input\.fastq$/ || $arg =~ /\.dat_input\.fastq\.gz$/ || $arg =~ /\.dat_input\.fastq\.bz2$/; | |
31 push @outFiles, $arg if $arg =~ /\.dat\.fastq$/ || $arg =~ /\.dat\.fastq\.gz$/ || $arg =~ /\.dat\.fastq\.bz2$/; | |
23 | 32 |
24 $ARGV[$_] = $arg; | 33 $ARGV[$_] = $arg; |
25 rename $file, $arg; | 34 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 } | 35 } |
30 } | 36 } |
31 | 37 |
32 my $call = join " ", @ARGV; | 38 my $call = join " ", @ARGV; |
33 | 39 |
40 | 46 |
41 my $file = $_; | 47 my $file = $_; |
42 | 48 |
43 s/\.fastq$//; | 49 s/\.fastq$//; |
44 s/\.fastq\.gz$//; | 50 s/\.fastq\.gz$//; |
51 s/\.fastq\.bz2$//; | |
45 | 52 |
46 rename $file, $_; | 53 rename $file, $_; |
47 } | 54 } |
48 | 55 |