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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Dec 13 18:05:08 CET 2012


Author: lckarssen
Date: 2012-12-13 18:05:08 +0100 (Thu, 13 Dec 2012)
New Revision: 1053

Modified:
   pkg/ProbABEL/src/probabel.pl
Log:
In probabel.pl: converted tabs to spaces. Only code layout change, not functional changes

Modified: pkg/ProbABEL/src/probabel.pl
===================================================================
--- pkg/ProbABEL/src/probabel.pl	2012-12-13 11:24:07 UTC (rev 1052)
+++ pkg/ProbABEL/src/probabel.pl	2012-12-13 17:05:08 UTC (rev 1053)
@@ -27,8 +27,8 @@
 # Set file locations
 my $base_path = "./";
 my @anprog = ($base_path . "palinear",
-	      $base_path . "palogist",
-	      $base_path . "pacoxph");
+              $base_path . "palogist",
+              $base_path . "pacoxph");
 my $config = "probabel_config.cfg";
 
 # Define the regression methods that are implemented
@@ -67,48 +67,48 @@
 # Print usage info if arguments are not correct
 if(@ARGV<6 || $ARGV[0] eq "--help" || $ARGV[0] eq "-h") {
     print "Usage:
-	probabel.pl chrom-start chrom-end method cohort <--allmodels OR --additive> trait <other available options of ProbABEL functions>\n";
+        probabel.pl chrom-start chrom-end method cohort <--allmodels OR --additive> trait <other available options of ProbABEL functions>\n";
     print "\n	* chrom-start - the first chromosome number, chrom-end - the last one; X or Y have to be run separately (specify them twice, once as chrom-start and once as chrom-end)";
     print "\n	* method can be ";
     foreach my $me(@method) {print "\"".$me."\", "};
     print "\n	* use --allmodels if you need dominant, recessive and heterozygous models
-	  and --additive if additive only\n";
+          and --additive if additive only\n";
     print "	* Available cohorts are ";
     foreach my $coh(keys %cohorts) {
-	print "\"".$coh."\", "
+        print "\"".$coh."\", "
     };
     print "\n	* example:
-	  probabel.pl 1 22 linear \"ERF\" --additive filename
-	  (filename has to be saved as filename.PHE)\n\n";
+          probabel.pl 1 22 linear \"ERF\" --additive filename
+          (filename has to be saved as filename.PHE)\n\n";
 
     if(@ARGV == 1 && ($ARGV[0] eq "--help" || $ARGV[0] eq "-h")) {
-	print "\nDetails:\n";
-	print " The probabel.pl script is used for analysis of imputed data. First you have to create a file with the phenotype values that you are going to use. The first column contains ids in special order, the second one contains the trait which you are going	analyze, the others contain covariates.  For example:
+        print "\nDetails:\n";
+        print " The probabel.pl script is used for analysis of imputed data. First you have to create a file with the phenotype values that you are going to use. The first column contains ids in special order, the second one contains the trait which you are going	analyze, the others contain covariates.  For example:
 
-	id         phen1 covariate1  covariate2
-	1_2094  0     334         0
-	1_5060  1     56          1
-	1_4077  1     346         6
-	.
-	.
-	.
+        id         phen1 covariate1  covariate2
+        1_2094  0     334         0
+        1_5060  1     56          1
+        1_4077  1     346         6
+        .
+        .
+        .
 
-	This implies the model:
-	phen1 ~ covariate1 + covariate2 + SNP
+        This implies the model:
+        phen1 ~ covariate1 + covariate2 + SNP
 
 
-	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 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 command line:
-	  probabel.pl 1 22 \"method\" \"cohort\" --model name_of_file
-	Change \"method\", \"cohort\" and --model to appropriate values\n";
-	print "\n	Version: $version";
-	print "\n\n	Authors: Lennart Karssen   - l.karssen\@erasmusmc.nl,
- 		 Maksim Struchalin - m.struchalin\@erasmusmc.nl,
-		 Yurii Aulchenko   - yurii.aulchenko\@gmail.com.\n\n";
+        Then run the following on the command line:
+          probabel.pl 1 22 \"method\" \"cohort\" --model name_of_file
+        Change \"method\", \"cohort\" and --model to appropriate values\n";
+        print "\n	Version: $version";
+        print "\n\n	Authors: Lennart Karssen   - l.karssen\@erasmusmc.nl,
+                 Maksim Struchalin - m.struchalin\@erasmusmc.nl,
+                 Yurii Aulchenko   - yurii.aulchenko\@gmail.com.\n\n";
     }
     else {
-	print "Type probabel.pl --help for more details.\n";
+        print "Type probabel.pl --help for more details.\n";
     }
     exit;
 }
@@ -134,7 +134,7 @@
     print "\nerror: Wrong cohort name, \"$chohort\" is not an available cohort.
 Available cohorts are ";
     foreach my $coh(keys %cohorts) {
-	print "\"".$coh."\", ";
+        print "\"".$coh."\", ";
     }
     print "\n\n";
     exit;
@@ -150,8 +150,8 @@
 my $prog;
 for (my $i=0; $i<@method; $i++) {
     if ($ARGV[2] eq $method[$i]) {
-	$passed = 1;
-	$prog = $anprog[$i];
+        $passed = 1;
+        $prog = $anprog[$i];
     }
 }
 die "error: Wrong method. method has to be one of: @method\n" if (!$passed);
@@ -163,17 +163,17 @@
 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];
+        # 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];
 
-	# Skip the next argument (supposedly the addition to the
-	# output file name).
-	$i++;
+        # Skip the next argument (supposedly the addition to the
+        # output file name).
+        $i++;
     }
     else
     {
-	$keys = $keys.$ARGV[$i]." ";
+        $keys = $keys.$ARGV[$i]." ";
     }
 }
 chop($keys);
@@ -214,10 +214,10 @@
     $legend_arg =~ s/$chr_replacement/$chr/g;
 
     if($hadhead==0) {
-	$head="";
-	$hadhead=1;
+        $head="";
+        $hadhead=1;
     } else {
-	my $head="--no-head";
+        my $head="--no-head";
     }
 
     system "$prog -p $phename.PHE --ngpreds $model_option_num -i $mlinfo_arg -d $mldose_arg -m $legend_arg --chrom $chr -o $outfile_prefix $head $keys";
@@ -235,82 +235,82 @@
     $infofiles =~ s/$chunk_replacement/*/g;
     $nrchunks = `ls $infofiles 2>/dev/null | wc -l`;
     if ($nrchunks==0) {
-	# If no chunked info files exist the 'wc -l' command returns 0
-	# so that actually means 1 chunk containing all data.
-	$nrchunks = 1;
+        # If no chunked info files exist the 'wc -l' command returns 0
+        # so that actually means 1 chunk containing all data.
+        $nrchunks = 1;
     }
     print "Nr. of chunks: $nrchunks";
 
     # Loop over all chunks
     for (my $chunk=1; $chunk <= $nrchunks; $chunk++)
     {
-	if($hadhead==0) {
-	    $head="";
-	    $hadhead=1;
-	} else {
-	    $head="--no-head";
-	}
-	$mlinfo_arg = $mlinfo;
-	$mlinfo_arg =~ s/$chr_replacement/$chr/g;
-	$mlinfo_arg =~ s/$chunk_replacement/$chunk/g;
+        if($hadhead==0) {
+            $head="";
+            $hadhead=1;
+        } else {
+            $head="--no-head";
+        }
+        $mlinfo_arg = $mlinfo;
+        $mlinfo_arg =~ s/$chr_replacement/$chr/g;
+        $mlinfo_arg =~ s/$chunk_replacement/$chunk/g;
 
-	$mldose_arg = $mldose_prob;
-	$mldose_arg =~ s/$chr_replacement/$chr/g;
-	$mldose_arg =~ s/$chunk_replacement/$chunk/g;
+        $mldose_arg = $mldose_prob;
+        $mldose_arg =~ s/$chr_replacement/$chr/g;
+        $mldose_arg =~ s/$chunk_replacement/$chunk/g;
 
-	$legend_arg = $legend;
-	$legend_arg =~ s/$chr_replacement/$chr/g;
-	$legend_arg =~ s/$chunk_replacement/$chunk/g;
+        $legend_arg = $legend;
+        $legend_arg =~ s/$chr_replacement/$chr/g;
+        $legend_arg =~ s/$chunk_replacement/$chunk/g;
 
-	my $command = "$prog -p $phename.PHE --ngpreds $model_option_num -i $mlinfo_arg -d $mldose_arg -m $legend_arg --chrom $chr -o $outfile_prefix.chunk$chunk.chr$chr $head $keys";
-	print "$command \n";
-	system $command;
+        my $command = "$prog -p $phename.PHE --ngpreds $model_option_num -i $mlinfo_arg -d $mldose_arg -m $legend_arg --chrom $chr -o $outfile_prefix.chunk$chunk.chr$chr $head $keys";
+        print "$command \n";
+        system $command;
 
-	if($model_option_num==2)
-	{
-	    `cat $outfile_prefix.chunk${chunk}.chr${chr}$_2df_file_postfix >> ${outfile_prefix}.${chr}${_2df_file_postfix}`;
-	    `rm $outfile_prefix.chunk${chunk}.chr${chr}$_2df_file_postfix`;
+        if($model_option_num==2)
+        {
+            `cat $outfile_prefix.chunk${chunk}.chr${chr}$_2df_file_postfix >> ${outfile_prefix}.${chr}${_2df_file_postfix}`;
+            `rm $outfile_prefix.chunk${chunk}.chr${chr}$_2df_file_postfix`;
 
-	    `cat $outfile_prefix.chunk${chunk}.chr${chr}$_add_file_postfix >> ${outfile_prefix}.${chr}${_add_file_postfix}`;
-	    `rm $outfile_prefix.chunk${chunk}.chr${chr}$_add_file_postfix`;
+            `cat $outfile_prefix.chunk${chunk}.chr${chr}$_add_file_postfix >> ${outfile_prefix}.${chr}${_add_file_postfix}`;
+            `rm $outfile_prefix.chunk${chunk}.chr${chr}$_add_file_postfix`;
 
-	    `cat $outfile_prefix.chunk${chunk}.chr${chr}$_domin_file_postfix >> ${outfile_prefix}.${chr}${_domin_file_postfix}`;
-	    `rm $outfile_prefix.chunk${chunk}.chr${chr}$_domin_file_postfix`;
+            `cat $outfile_prefix.chunk${chunk}.chr${chr}$_domin_file_postfix >> ${outfile_prefix}.${chr}${_domin_file_postfix}`;
+            `rm $outfile_prefix.chunk${chunk}.chr${chr}$_domin_file_postfix`;
 
-	    `cat $outfile_prefix.chunk${chunk}.chr${chr}$_recess_file_postfix >> ${outfile_prefix}.${chr}${_recess_file_postfix}`;
-	    `rm $outfile_prefix.chunk${chunk}.chr${chr}$_recess_file_postfix`;
+            `cat $outfile_prefix.chunk${chunk}.chr${chr}$_recess_file_postfix >> ${outfile_prefix}.${chr}${_recess_file_postfix}`;
+            `rm $outfile_prefix.chunk${chunk}.chr${chr}$_recess_file_postfix`;
 
-	    `cat $outfile_prefix.chunk${chunk}.chr${chr}$_over_domin_file_postfix >> ${outfile_prefix}.${chr}${_over_domin_file_postfix}`;
-	    `rm $outfile_prefix.chunk${chunk}.chr${chr}$_over_domin_file_postfix`;
-	} else {
-	    `cat $outfile_prefix.chunk${chunk}.chr${chr}$_add_file_postfix >> $outfile_prefix.${chr}${_add_file_postfix}`;
-	    print "cat $outfile_prefix.chunk${chunk}.chr${chr}$_add_file_postfix >> $outfile_prefix.chr${chr}${_add_file_postfix}\n";
-	    `rm $outfile_prefix.chunk${chunk}.chr${chr}$_add_file_postfix`;
-	    print "rm $outfile_prefix.chunk${chunk}.chr${chr}$_add_file_postfix\n";
-	}
+            `cat $outfile_prefix.chunk${chunk}.chr${chr}$_over_domin_file_postfix >> ${outfile_prefix}.${chr}${_over_domin_file_postfix}`;
+            `rm $outfile_prefix.chunk${chunk}.chr${chr}$_over_domin_file_postfix`;
+        } else {
+            `cat $outfile_prefix.chunk${chunk}.chr${chr}$_add_file_postfix >> $outfile_prefix.${chr}${_add_file_postfix}`;
+            print "cat $outfile_prefix.chunk${chunk}.chr${chr}$_add_file_postfix >> $outfile_prefix.chr${chr}${_add_file_postfix}\n";
+            `rm $outfile_prefix.chunk${chunk}.chr${chr}$_add_file_postfix`;
+            print "rm $outfile_prefix.chunk${chunk}.chr${chr}$_add_file_postfix\n";
+        }
     }
 
     if($model_option_num==2)
     {
-	`cat $outfile_prefix.${chr}$_2df_file_postfix >> ${outfile_prefix}${_2df_file_postfix}`;
-	`rm $outfile_prefix.${chr}$_2df_file_postfix`;
+        `cat $outfile_prefix.${chr}$_2df_file_postfix >> ${outfile_prefix}${_2df_file_postfix}`;
+        `rm $outfile_prefix.${chr}$_2df_file_postfix`;
 
-	`cat $outfile_prefix.${chr}$_add_file_postfix >> ${outfile_prefix}${_add_file_postfix}`;
-	`rm $outfile_prefix.${chr}$_add_file_postfix`;
+        `cat $outfile_prefix.${chr}$_add_file_postfix >> ${outfile_prefix}${_add_file_postfix}`;
+        `rm $outfile_prefix.${chr}$_add_file_postfix`;
 
-	`cat $outfile_prefix.${chr}$_domin_file_postfix >> ${outfile_prefix}${_domin_file_postfix}`;
-	`rm $outfile_prefix.${chr}$_domin_file_postfix`;
+        `cat $outfile_prefix.${chr}$_domin_file_postfix >> ${outfile_prefix}${_domin_file_postfix}`;
+        `rm $outfile_prefix.${chr}$_domin_file_postfix`;
 
-	`cat $outfile_prefix.${chr}$_recess_file_postfix >> ${outfile_prefix}${_recess_file_postfix}`;
-	`rm $outfile_prefix.${chr}$_recess_file_postfix`;
+        `cat $outfile_prefix.${chr}$_recess_file_postfix >> ${outfile_prefix}${_recess_file_postfix}`;
+        `rm $outfile_prefix.${chr}$_recess_file_postfix`;
 
-	`cat $outfile_prefix.${chr}$_over_domin_file_postfix >> ${outfile_prefix}${_over_domin_file_postfix}`;
-	`rm $outfile_prefix.${chr}$_over_domin_file_postfix`;
+        `cat $outfile_prefix.${chr}$_over_domin_file_postfix >> ${outfile_prefix}${_over_domin_file_postfix}`;
+        `rm $outfile_prefix.${chr}$_over_domin_file_postfix`;
     } else {
-	`cat $outfile_prefix.${chr}$_add_file_postfix >> $outfile_prefix${_add_file_postfix}`;
-	print "cat $outfile_prefix.${chr}$_add_file_postfix >> $outfile_prefix${_add_file_postfix}\n";
-	`rm $outfile_prefix.${chr}$_add_file_postfix`;
-	print "rm $outfile_prefix.${chr}$_add_file_postfix\n";
+        `cat $outfile_prefix.${chr}$_add_file_postfix >> $outfile_prefix${_add_file_postfix}`;
+        print "cat $outfile_prefix.${chr}$_add_file_postfix >> $outfile_prefix${_add_file_postfix}\n";
+        `rm $outfile_prefix.${chr}$_add_file_postfix`;
+        print "rm $outfile_prefix.${chr}$_add_file_postfix\n";
     }
 }
 



More information about the Genabel-commits mailing list