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