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