annotate flexbar.pl @ 26:2c6ab15e5964 draft

Uploaded
author jtilman
date Wed, 21 Oct 2015 14:42:15 -0400
parents 12e4b3bb38c6
children 6536146320ef
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
26
2c6ab15e5964 Uploaded
jtilman
parents: 22
diff changeset
3 # Flexbar wrapper for Galaxy tool definition, version 2.5
19
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$/;
22
12e4b3bb38c6 Adjusted tool definition to Flexbar release 2.4
jtilman
parents: 21
diff changeset
23 $fileType = 'csfasta' if /\.csfasta$/;
12e4b3bb38c6 Adjusted tool definition to Flexbar release 2.4
jtilman
parents: 21
diff changeset
24 $fileType = 'tabular' if /\.lengthdist$/;
19
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
25
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
26 my $file = $_;
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
27
22
12e4b3bb38c6 Adjusted tool definition to Flexbar release 2.4
jtilman
parents: 21
diff changeset
28 s/_/-/g;
19
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
29
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
30 my $name = "primary_". $id ."_". $_ ."_visible_". $fileType;
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
31
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
32 rename $file, $name;
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
33 rename $name, $folder;
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
34 }
621fa3daa2a1 Updated tool definition for Flexbar 2.33 release
jtilman
parents:
diff changeset
35