annotate flexbar.pl @ 29:9709dbd13ee3 draft

Uploaded
author jtilman
date Tue, 05 Jun 2018 11:46:44 -0400
parents 6536146320ef
children c554e6d251fd
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
29
9709dbd13ee3 Uploaded
jtilman
parents: 28
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$/;
29
9709dbd13ee3 Uploaded
jtilman
parents: 28
diff changeset
23 $fileType = 'csfasta' if /\.csfasta$/;
22
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