changeset 2:32086c82051c draft

Uploaded
author fcaramia
date Mon, 17 Jun 2013 01:13:34 -0400
parents 9fb39e19d8f4
children cf300f1ceeee
files baseline_wrapper.pl
diffstat 1 files changed, 68 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/baseline_wrapper.pl	Mon Jun 17 01:13:34 2013 -0400
@@ -0,0 +1,68 @@
+#sshpass -p pmac1512 ssh -o StrictHostkeyChecking=no galaxy@pmc-bioinf03 "gmt music play $*"
+#echo "gmt music play $*"
+
+
+use strict;
+use warnings;
+use File::Basename; 
+use Cwd;
+die qq(
+Bad numbr of inputs
+
+) if(!@ARGV);
+
+
+my $player_options = "";
+my $baseline_output;
+
+my $dir = getcwd;
+my $variable = "";
+my $files = "";
+foreach my $input (@ARGV) 
+{
+	my @tmp = split "::", $input;
+	
+	if($tmp[0] eq "PLAYEROPTION") 
+	{
+		$variable = $tmp[1];
+		$variable =~ s/=/ /g;
+		$player_options = "$player_options $variable";
+	}
+	elsif($tmp[0] eq "BASELINEOUTPUT") 
+	{
+		$baseline_output = $tmp[1];
+	}  
+	elsif($tmp[0] eq "BAMLISTENTRY") 
+	{
+		$files = "$files ${tmp[1]}";
+	}
+	else 
+	{
+		die("Unknown Input: $input\n");
+	}
+}
+
+
+my $working_dir = "BASELINE_OUTPUT";
+#remove extension
+
+#Create Contra Output dir 
+system ("mkdir $working_dir");
+
+#run baseline
+
+system ("baseline.py --file $files --output $working_dir $player_options > /dev/null");
+
+#Search control file in output dir
+opendir(DIR, $working_dir);
+my @FILES= readdir(DIR); 
+foreach my $file (@FILES) 
+{
+	my ($filename,$directory,$extension) = fileparse($file, qr/\.[^.]*/);
+	if ($extension eq ".txt")
+	{
+		system ("mv $working_dir/$file $baseline_output");
+	}
+}
+closedir(DIR);
+