diff flexbar.pl @ 11:52c5e53aff28

Revised perl wrapper.
author jtilman
date Wed, 02 Jan 2013 12:54:28 +0100
parents f0bdf862ba39
children 4cbf6c6d2f2b
line wrap: on
line diff
--- a/flexbar.pl	Mon Dec 31 18:40:01 2012 +0100
+++ b/flexbar.pl	Wed Jan 02 12:54:28 2013 +0100
@@ -5,12 +5,10 @@
 use warnings;
 use strict;
 
-my $format  = pop @ARGV;
-my $folder  = pop @ARGV;
-my $id      = pop @ARGV;
-my $outFile = pop @ARGV;
 
-my $call = join " ", @ARGV;
+my ($outFile, $id, $folder, $format) = @ARGV[($#ARGV - 3) .. $#ARGV];
+
+my $call = join " ", @ARGV[0..($#ARGV - 4)];
 
 system $call .' --target reads > '. $outFile and exit 1;
 
@@ -23,11 +21,13 @@
 	$fileType = $format    if /\.\w+fast\w$/;
 	$fileType = 'tabular'  if $fileType eq 'lengthdist';
 	
+	my $file = $_;
+	
 	s/_//g;
 	
 	my $name = "primary_". $id ."_". $_ ."_visible_". $fileType;
 	
-	rename $_, $name;
+	rename $file, $name;
 	rename $name, $folder;
 }