annotate Contra/baseline_wrapper.pl @ 0:7564f3b1e675

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