Mercurial > repos > jtilman > flexbar
comparison flexbar.pl @ 10:f0bdf862ba39
Simplified perl wrapper.
author | jtilman |
---|---|
date | Mon, 31 Dec 2012 18:40:01 +0100 |
parents | a8399cb4972b |
children | 52c5e53aff28 |
comparison
equal
deleted
inserted
replaced
9:cb6deaad121f | 10:f0bdf862ba39 |
---|---|
3 # Author: Johannes T. Roehr | 3 # Author: Johannes T. Roehr |
4 | 4 |
5 use warnings; | 5 use warnings; |
6 use strict; | 6 use strict; |
7 | 7 |
8 my $flexbarDir = ""; | 8 my $format = pop @ARGV; |
9 my $folder = pop @ARGV; | |
10 my $id = pop @ARGV; | |
11 my $outFile = pop @ARGV; | |
9 | 12 |
10 my $pwd = $ENV{PWD}; | 13 my $call = join " ", @ARGV; |
11 | 14 |
12 my $lastIdx = $#ARGV; | 15 system $call .' --target reads > '. $outFile and exit 1; |
13 my $format = $ARGV[$lastIdx]; | |
14 my $folder = $ARGV[$lastIdx - 1]; | |
15 my $id = $ARGV[$lastIdx - 2]; | |
16 my $outFile = $ARGV[$lastIdx - 3]; | |
17 | 16 |
18 my $call = join " ", @ARGV[0..($lastIdx - 4)]; | |
19 | 17 |
20 system $flexbarDir . $call .' --target reads > '. $outFile; | 18 foreach(<reads*>){ |
21 | |
22 foreach(<$pwd ."/reads"*>){ | |
23 | 19 |
24 if(/^\.\//){ | 20 my $fileType; |
25 my $file = $pwd ."/". $_; | 21 |
26 | 22 $fileType = $1 if /\.(\w+)$/; |
27 s/^\.\///; | 23 $fileType = $format if /\.\w+fast\w$/; |
28 my $fileType; | 24 $fileType = 'tabular' if $fileType eq 'lengthdist'; |
29 | 25 |
30 $fileType = $1 if /\.(\w+)$/; | 26 s/_//g; |
31 $fileType = $format if /\.\w+fast\w$/; | 27 |
32 $fileType = 'tabular' if $fileType eq 'lengthdist'; | 28 my $name = "primary_". $id ."_". $_ ."_visible_". $fileType; |
33 | 29 |
34 s/_//g; | 30 rename $_, $name; |
35 | 31 rename $name, $folder; |
36 my $name = "primary_". $id ."_". $_ ."_visible_". $fileType; | |
37 | |
38 rename $file, $name; | |
39 rename $name, $folder; | |
40 } | |
41 } | 32 } |
42 | 33 |