[Genabel-commits] r1258 - pkg/ProbABEL/src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Jun 30 00:44:27 CEST 2013


Author: lckarssen
Date: 2013-06-30 00:44:27 +0200 (Sun, 30 Jun 2013)
New Revision: 1258

Modified:
   pkg/ProbABEL/src/probabel.pl
Log:
Fix bug #4683: probabel.pl doesn't write output files to the current dir if the name of the phenotype file contains a path (instead it writes to the path the pheno file is in. 
This commit changes that behaviour: now the default prefix for the output files is the name of the pheno file (minus the .PHE as before), but without any path information, so the output files are stored in the current working directory from which probabel.pl was called. 

Additionally this commit changes the default behaviour of the -o option to probabel.pl. Before the argument after the -o option was interpreted as an addition to the default prefix. Now it is considered a complete file name (including path if desired). 



Modified: pkg/ProbABEL/src/probabel.pl
===================================================================
--- pkg/ProbABEL/src/probabel.pl	2013-06-29 21:58:31 UTC (rev 1257)
+++ pkg/ProbABEL/src/probabel.pl	2013-06-29 22:44:27 UTC (rev 1258)
@@ -158,14 +158,16 @@
 
 
 my $phename = $ARGV[5];
-my $outfile_prefix = $phename;
+# By default the output file prefix is the same as the name of the
+# phenotype file (minus the .PHE extension and any paths)
+use File::Basename;
+my $outfile_prefix = basename($phename);
 my $keys="";
 for (my $i=6; $i<@ARGV; $i++) {
     if ($ARGV[$i] eq "-o")
     {
         # Apparently the user wants to change the output file name
-        # Let's interpret this as an addition to our own prefix
-        $outfile_prefix = $outfile_prefix.$ARGV[$i+1];
+        $outfile_prefix = $ARGV[$i+1];
 
         # Skip the next argument (supposedly the addition to the
         # output file name).



More information about the Genabel-commits mailing list