[Genabel-commits] r783 - in pkg/ProbABEL: . src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Sep 14 20:37:32 CEST 2011


Author: lckarssen
Date: 2011-09-14 20:37:31 +0200 (Wed, 14 Sep 2011)
New Revision: 783

Added:
   pkg/ProbABEL/src/probabel_config.cfg.example
Removed:
   pkg/ProbABEL/src/probabel_config.cfg
Modified:
   pkg/ProbABEL/configure.ac
   pkg/ProbABEL/src/Makefile.am
   pkg/ProbABEL/src/probabel.pl
Log:
* In ProbABEL's configure.ac script the version number was already set
  to 0.2, changed it to 0.2-beta to avoid confusion about the present
  status of the code.
* The probabel_config.cfg file is now renamed to have .example added to
  it. This is to make sure that make install does not overwrite the
  user's own version.
* Various edits related to the probabel.pl script:
  - Some cleaning up (removal of unnecessary bits, addition of some comments)
  - In src/Makefle.am:
    + substitute the path to the installed binaries
    + substitute the version number



Modified: pkg/ProbABEL/configure.ac
===================================================================
--- pkg/ProbABEL/configure.ac	2011-09-11 19:37:12 UTC (rev 782)
+++ pkg/ProbABEL/configure.ac	2011-09-14 18:37:31 UTC (rev 783)
@@ -2,8 +2,8 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ([2.67])
-AC_INIT(ProbABEL, 0.2-0, genabel-devel at r-forge.wu-wien.ac.at)
-AM_INIT_AUTOMAKE(ProbABEL, 0.2-0)
+AC_INIT(ProbABEL, 0.2-0-beta, genabel-devel at r-forge.wu-wien.ac.at)
+AM_INIT_AUTOMAKE(ProbABEL, 0.2-0-beta)
 AC_CONFIG_SRCDIR([src/data.h])
 AC_CONFIG_HEADERS([src/config.h])
 

Modified: pkg/ProbABEL/src/Makefile.am
===================================================================
--- pkg/ProbABEL/src/Makefile.am	2011-09-11 19:37:12 UTC (rev 782)
+++ pkg/ProbABEL/src/Makefile.am	2011-09-14 18:37:31 UTC (rev 783)
@@ -46,9 +46,11 @@
 dist_bin_SCRIPTS = probabel.pl extIDS.pl
 
 ## Install the config file
-dist_sysconf_DATA = probabel_config.cfg
+dist_sysconf_DATA = probabel_config.cfg.example
 
-## Insert the correct path to the configure file in probabel.pl
+## Insert the correct values of several variables in the installed probabel.pl
 install-exec-hook:
 	$(SED) -i "s;probabel_config.cfg;@sysconfdir@/probabel_config.cfg;" \
 		 $(DESTDIR)$(bindir)/probabel.pl
+	$(SED) -i "s;\./;@bindir@/;" $(DESTDIR)$(bindir)/probabel.pl
+	$(SED) -i "s;PROBABEL_VERSION;@VERSION@;" $(DESTDIR)$(bindir)/probabel.pl

Modified: pkg/ProbABEL/src/probabel.pl
===================================================================
--- pkg/ProbABEL/src/probabel.pl	2011-09-11 19:37:12 UTC (rev 782)
+++ pkg/ProbABEL/src/probabel.pl	2011-09-14 18:37:31 UTC (rev 783)
@@ -1,34 +1,18 @@
 #! /usr/bin/perl
 
-#============================================================================
+#==========================================================================
 #
 #           Filename:  probabel.pl
 #
 #        Description: Handy perl wrapper for ProbABEL functions
 #
-#            Version:  1.5
-#            Created:  28-Oct-2008
-#           Revision:  none
-#  last modification:  02-Sep-2011
-#
-#             Author:  Lennart C. Karssen,
-#                      Maksim V. Struchalin,
-#                      Yurii S. Aulchenko
-#            Company:  Erasmus MC,
-#                      Department of Epidemiology,
-#                      The Netherlands.
-#              Email:  l.karssen at erasmusmc.nl,
-#                      m.struchalin at erasmusmc.nl,
-#                      i.aoultchenko at erasmusmc.nl
-#
-#============================================================================
+#==========================================================================
 
+#==========================================================================
+# Set variables
+$version="PROBABEL_VERSION";
 
-
-
-$version="1.5";
-$release_data="02-Sep-2011";
-
+# Define some filename postfixes
 $_2df_file_postfix = "_2df.out.txt";
 $_add_file_postfix = "_add.out.txt";
 $_domin_file_postfix = "_domin.out.txt";
@@ -36,16 +20,19 @@
 $_over_domin_file_postfix = "_over_domin.out.txt";
 
 
-
-
+# Separators in the config file
 $separator_cfg = ",";
 $separator_filename = "_._chr_._";
 
+# Set file locations
 $base_path = "./";
+ at anprog = ($base_path . "palinear",
+	   $base_path . "palogist",
+	   $base_path . "pacoxph");
 $config = "probabel_config.cfg";
 
- at method = ("linear","logistic","coxph");
- at anprog = ($base_path . "palinear", $base_path . "palogist", $base_path . "pacoxph");
+# Define the regression methods that are implemented
+ at method = ("linear", "logistic", "coxph");
 
 %cohorts;
 @mlinfo;
@@ -54,10 +41,11 @@
 @legend;
 
 
+#==========================================================================
+# Read config file
+open(CFG,"$config") or die "Reading configuration file failed: $!" .
+    "\nDid you forget to edit and rename the probabel_config.cfg.example file?\n";
 
-#read config file
-open(CFG,"$config") or die "$!";
-
 <CFG>; #skip the first line (header)
 
 for(my $i=0 ; my $line = <CFG> ; $i++)
@@ -65,19 +53,17 @@
 	next if (/^#/);
 	chomp($line);
 	@line_array = split(/$separator_cfg/, $line);
-#	foreach (@line_array) {print $_."\n"}
-#	print "\n";
 	$cohorts{$line_array[0]} = $i;
 	$mlinfo[$i]  = $line_array[1];
 	$mldose[$i]  = $line_array[2];
 	$mlprobe[$i] = $line_array[3];
 	$legend[$i]  = $line_array[4];
-#	print "legend[$i]=".$legend[$i]."\n";
-#	print "mlprobe[$i]=".$mlprobe[$i]."\n";
 	}
 close(CFG);
 
 
+#==========================================================================
+# Print usage info if arguments are not correct
 if(@ARGV<6 || $ARGV[0] eq "--help")
 	{
 	print "\nUsage:
@@ -96,8 +82,9 @@
 
 	print "\n Details:\n";
 	print "   The probabel.pl script is used for analysis of imputed data.
-   First you have to create file with the phenotypes that you are going to use.
-   The first column contains ids in special order, the second: the trait which you are going analyze, the others containd covariates.
+   First you have to create a file with the phenotypes that you are going to use.
+   The first column contains ids in special order, the second: the trait which
+   you are going analyze, the others contains covariates.
    Like this =>
 
    id         phen1 covariate1  covariate2
@@ -114,26 +101,25 @@
 
    Then save it to folder where you are doing the analysis. The name of the file must be name_of_file.PHE, where name_of_file is any name.
 
-   Then run the following on the Linux command line:
+   Then run the following on the command line:
    probabel.pl 1 22 \"method\" \"cohort\" --model name_of_file
    Change \"method\" \"cohort\" --model to appropriate values\n";
 	print "\n	Version: $version";
-	print "\n	Release data: $release_data";
 	print "\n\n	Authors: Lennart Karssen   - l.karssen\@erasmusmc.nl,
  		 Maksim Struchalin - m.struchalin\@erasmusmc.nl,
-		 Yurii Aulchenko   - i.aoultchenko\@erasmusmc.nl.\n\n";
+		 Yurii Aulchenko   - yurii.aulchenko at gmail.com.\n\n";
 	exit;
 	}
 
 
+#==========================================================================
+# Put the command line arguments into variables and verify them
 $startchr = $ARGV[0];
 $endchr = $ARGV[1];
 $method = $ARGV[2];
 $chohort = $ARGV[3];
 $model = $ARGV[4];
 
-
-
 die "error: chrom-start is > 22" if($startchr > 22 && $startchr != "X") ;
 die "error: chrom-end is > 22" if($endchr > 22 && $endchr != "X");
 die "error: chrom-start > chrom-end" if($startchr > $endchr);
@@ -169,9 +155,6 @@
 die "error: Wrong method. method has to be one of: @method\n" if (!$passed);
 
 
-
-
-
 $phename = $ARGV[5];
 $keys="";
 
@@ -204,7 +187,8 @@
 	}
 
 
-
+#==========================================================================
+# Start the analysis now that the input has been validated
 print "Start...\n";
 
 $chr = $startchr;

Deleted: pkg/ProbABEL/src/probabel_config.cfg
===================================================================
--- pkg/ProbABEL/src/probabel_config.cfg	2011-09-11 19:37:12 UTC (rev 782)
+++ pkg/ProbABEL/src/probabel_config.cfg	2011-09-14 18:37:31 UTC (rev 783)
@@ -1,3 +0,0 @@
-cohort,mlinfo_path,mldose_path,mlprobe_path,legend_path
-ERGO,script_test/merlin._._chr_._.collected.ped.out.mlinfo,script_test/merlin._._chr_._.collected.ped.out.mldose,script_test/merlin._._chr_._.collected.ped.out.mlprob,script_test/genotypes_chr_._chr_.__CEU_r22_nr.b36_fwd_legend.txt
-ERGOPLUS,/mnt/space/ergoplus/ergoplus.chr_._chr_._.mach.mlinfo,/mnt/space/ergoplus/ergoplus.chr_._chr_._.mach.mldose,/mnt/space/ergoplus/ergoplus.chr_._chr_._.mach.mlprob,/mnt/impute/impute_b36/collected/genotypes_chr_._chr_.__CEU_r22_nr.b36_fwd_legend.txt

Copied: pkg/ProbABEL/src/probabel_config.cfg.example (from rev 781, pkg/ProbABEL/src/probabel_config.cfg)
===================================================================
--- pkg/ProbABEL/src/probabel_config.cfg.example	                        (rev 0)
+++ pkg/ProbABEL/src/probabel_config.cfg.example	2011-09-14 18:37:31 UTC (rev 783)
@@ -0,0 +1,3 @@
+cohort,mlinfo_path,mldose_path,mlprobe_path,legend_path
+ERGO,script_test/merlin._._chr_._.collected.ped.out.mlinfo,script_test/merlin._._chr_._.collected.ped.out.mldose,script_test/merlin._._chr_._.collected.ped.out.mlprob,script_test/genotypes_chr_._chr_.__CEU_r22_nr.b36_fwd_legend.txt
+ERGOPLUS,/mnt/space/ergoplus/ergoplus.chr_._chr_._.mach.mlinfo,/mnt/space/ergoplus/ergoplus.chr_._chr_._.mach.mldose,/mnt/space/ergoplus/ergoplus.chr_._chr_._.mach.mlprob,/mnt/impute/impute_b36/collected/genotypes_chr_._chr_.__CEU_r22_nr.b36_fwd_legend.txt



More information about the Genabel-commits mailing list