19
|
1 #!/usr/bin/env perl
|
|
2
|
21
|
3 # Flexbar wrapper for Galaxy tool definition, version 2.34
|
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
|
|
13 system $call .' --target FlexbarTargetFile > '. $outFile and exit 1;
|
|
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$/;
|
|
23 $fileType = 'tabular' if $fileType eq 'lengthdist';
|
|
24
|
|
25 my $file = $_;
|
|
26
|
|
27 s/_//g;
|
|
28
|
|
29 my $name = "primary_". $id ."_". $_ ."_visible_". $fileType;
|
|
30
|
|
31 rename $file, $name;
|
|
32 rename $name, $folder;
|
|
33 }
|
|
34
|