annotate flexbar.pl @ 20:83e3813084f2

Adjustment of when tags.
author jtilman
date Tue, 21 May 2013 16:01:38 +0200
parents 621fa3daa2a1
children d62311a7bac6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
1 #!/usr/bin/env perl
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
2
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
3 # Flexbar wrapper for Galaxy tool definition, version 2.33
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
4 # Author: Johannes Roehr
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
5
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
6 use warnings;
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
7 use strict;
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
8
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
9 my ($outFile, $id, $folder, $format) = @ARGV[($#ARGV - 3) .. $#ARGV];
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
10
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
11 my $call = join " ", @ARGV[0..($#ARGV - 4)];
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
12
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
13 system $call .' --target FlexbarTargetFile > '. $outFile and exit 1;
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
14
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
15
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
16 foreach(<FlexbarTargetFile*>){
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
17
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
18 my $fileType;
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
19
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
20 $fileType = $1 if /\.(\w+)$/;
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
21 $fileType = $format if /\.\w*fast\w$/;
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
22 $fileType = 'fasta' if /\.fasta$/;
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
23 $fileType = 'tabular' if $fileType eq 'lengthdist';
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
24
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
25 my $file = $_;
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
26
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
27 s/_//g;
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
28
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
29 my $name = "primary_". $id ."_". $_ ."_visible_". $fileType;
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
30
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
31 rename $file, $name;
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
32 rename $name, $folder;
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
33 }
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
34