diff Contra/baseline_wrapper.pl @ 0:7564f3b1e675

Uploaded
author fcaramia
date Thu, 13 Sep 2012 02:31:43 -0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Contra/baseline_wrapper.pl	Thu Sep 13 02:31:43 2012 -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);
+