1
|
1 #!/usr/bin/env perl
|
|
2
|
|
3 # Author: Johannes T. Roehr
|
|
4
|
|
5 use warnings;
|
|
6 use strict;
|
|
7
|
10
|
8 my $format = pop @ARGV;
|
|
9 my $folder = pop @ARGV;
|
|
10 my $id = pop @ARGV;
|
|
11 my $outFile = pop @ARGV;
|
1
|
12
|
10
|
13 my $call = join " ", @ARGV;
|
1
|
14
|
10
|
15 system $call .' --target reads > '. $outFile and exit 1;
|
1
|
16
|
|
17
|
10
|
18 foreach(<reads*>){
|
1
|
19
|
10
|
20 my $fileType;
|
|
21
|
|
22 $fileType = $1 if /\.(\w+)$/;
|
|
23 $fileType = $format if /\.\w+fast\w$/;
|
|
24 $fileType = 'tabular' if $fileType eq 'lengthdist';
|
|
25
|
|
26 s/_//g;
|
|
27
|
|
28 my $name = "primary_". $id ."_". $_ ."_visible_". $fileType;
|
|
29
|
|
30 rename $_, $name;
|
|
31 rename $name, $folder;
|
1
|
32 }
|
|
33
|