19
|
1 #!/usr/bin/env perl
|
|
2
|
26
|
3 # Flexbar wrapper for Galaxy tool definition, version 2.5
|
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$/;
|
22
|
23 $fileType = 'csfasta' if /\.csfasta$/;
|
|
24 $fileType = 'tabular' if /\.lengthdist$/;
|
19
|
25
|
|
26 my $file = $_;
|
|
27
|
22
|
28 s/_/-/g;
|
19
|
29
|
|
30 my $name = "primary_". $id ."_". $_ ."_visible_". $fileType;
|
|
31
|
|
32 rename $file, $name;
|
|
33 rename $name, $folder;
|
|
34 }
|
|
35
|