Mercurial > repos > jtilman > flexbar
comparison flexbar.pl @ 11:52c5e53aff28
Revised perl wrapper.
author | jtilman |
---|---|
date | Wed, 02 Jan 2013 12:54:28 +0100 |
parents | f0bdf862ba39 |
children | 4cbf6c6d2f2b |
comparison
equal
deleted
inserted
replaced
10:f0bdf862ba39 | 11:52c5e53aff28 |
---|---|
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 $format = pop @ARGV; | |
9 my $folder = pop @ARGV; | |
10 my $id = pop @ARGV; | |
11 my $outFile = pop @ARGV; | |
12 | 8 |
13 my $call = join " ", @ARGV; | 9 my ($outFile, $id, $folder, $format) = @ARGV[($#ARGV - 3) .. $#ARGV]; |
10 | |
11 my $call = join " ", @ARGV[0..($#ARGV - 4)]; | |
14 | 12 |
15 system $call .' --target reads > '. $outFile and exit 1; | 13 system $call .' --target reads > '. $outFile and exit 1; |
16 | 14 |
17 | 15 |
18 foreach(<reads*>){ | 16 foreach(<reads*>){ |
21 | 19 |
22 $fileType = $1 if /\.(\w+)$/; | 20 $fileType = $1 if /\.(\w+)$/; |
23 $fileType = $format if /\.\w+fast\w$/; | 21 $fileType = $format if /\.\w+fast\w$/; |
24 $fileType = 'tabular' if $fileType eq 'lengthdist'; | 22 $fileType = 'tabular' if $fileType eq 'lengthdist'; |
25 | 23 |
24 my $file = $_; | |
25 | |
26 s/_//g; | 26 s/_//g; |
27 | 27 |
28 my $name = "primary_". $id ."_". $_ ."_visible_". $fileType; | 28 my $name = "primary_". $id ."_". $_ ."_visible_". $fileType; |
29 | 29 |
30 rename $_, $name; | 30 rename $file, $name; |
31 rename $name, $folder; | 31 rename $name, $folder; |
32 } | 32 } |
33 | 33 |