annotate baseline_wrapper.pl @ 27:0bf826f62f04 default tip

fixed toolshed not filling fields
author Franco Caramia <franco.caramia@petermac.org>
date Wed, 04 Jun 2014 11:04:17 +1000
parents 2770f49cb0dc
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
23
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
1 #sshpass -p pmac1512 ssh -o StrictHostkeyChecking=no galaxy@pmc-bioinf03 "gmt music play $*"
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
2 #echo "gmt music play $*"
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
3
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
4
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
5 use strict;
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
6 use warnings;
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
7 use File::Basename;
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
8 use Cwd;
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
9 die qq(
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
10 Bad numbr of inputs
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
11
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
12 ) if(!@ARGV);
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
13
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
14
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
15 my $player_options = "";
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
16 my $baseline_output;
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
17
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
18 my $dir = getcwd;
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
19 my $variable = "";
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
20 my $files = "";
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
21 foreach my $input (@ARGV)
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
22 {
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
23 my @tmp = split "::", $input;
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
24
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
25 if($tmp[0] eq "PLAYEROPTION")
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
26 {
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
27 $variable = $tmp[1];
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
28 $variable =~ s/=/ /g;
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
29 $player_options = "$player_options $variable";
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
30 }
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
31 elsif($tmp[0] eq "BASELINEOUTPUT")
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
32 {
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
33 $baseline_output = $tmp[1];
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
34 }
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
35 elsif($tmp[0] eq "BAMLISTENTRY")
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
36 {
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
37 $files = "$files ${tmp[1]}";
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
38 }
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
39 else
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
40 {
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
41 die("Unknown Input: $input\n");
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
42 }
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
43 }
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
44
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
45
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
46 my $working_dir = "BASELINE_OUTPUT";
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
47 #remove extension
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
48
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
49 #Create Contra Output dir
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
50 system ("mkdir $working_dir");
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
51
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
52 #run baseline
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
53
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
54 system ("baseline.py --file $files --output $working_dir $player_options > /dev/null");
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
55
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
56 #Search control file in output dir
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
57 opendir(DIR, $working_dir);
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
58 my @FILES= readdir(DIR);
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
59 foreach my $file (@FILES)
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
60 {
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
61 my ($filename,$directory,$extension) = fileparse($file, qr/\.[^.]*/);
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
62 if ($extension eq ".txt")
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
63 {
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
64 system ("mv $working_dir/$file $baseline_output");
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
65 }
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
66 }
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
67 closedir(DIR);
2770f49cb0dc re-uploading contra
Franco Caramia <franco.caramia@petermac.org>
parents:
diff changeset
68