From: preecej Date: Thu, 28 Jul 2011 18:39:11 +0000 (+0000) Subject: Includes Mamatha's first updates to opt args X-Git-Url: http://gitweb.planteome.org/?a=commitdiff_plain;h=93179e874cb80653c0f12d707a0d2585b743b4a4;p=old-jaiswallab-svn%2F.git Includes Mamatha's first updates to opt args svn path=/; revision=127 --- diff --git a/preecej/perl_singletons/pathway_gene_swapper.pl b/preecej/perl_singletons/pathway_gene_swapper.pl index d472432..ca17c35 100644 --- a/preecej/perl_singletons/pathway_gene_swapper.pl +++ b/preecej/perl_singletons/pathway_gene_swapper.pl @@ -75,7 +75,9 @@ use XML::DOM; # --------------------------------------------------------------------------- my %opts; # arg options -my $input_file; +my $input_gpml_file; +my $input_gene_file; +my $input_config_file; my $output_file; my $verbose = 0; # flag for verbose output my $debug = 0; # debugging switch @@ -91,19 +93,33 @@ my $gpml_doc; sub init { # read and set options - getopts('i:o:vd', \%opts); + getopts('i:g:c:o:vd', \%opts); foreach my $key (keys %opts) { my $value = $opts{$key}; switch ($key) { case "i" { if ($value =~ /\//) { # assume path - $input_file = $value; + $input_gpml_file = $value; } else { - $input_file = getcwd() . "\/$value"; + $input_gpml_file = getcwd() . "\/$value"; } } - case "o" { + case "g" { + if ($value =~ /\//) { # assume path + $input_gene_file = $value; + } else { + $input_gene_file = getcwd() . "\/$value"; + } + } + case "c" { + if ($value =~ /\//) { # assume path + $input_config_file = $value; + } else { + $input_config_file = getcwd() . "\/$value"; + } + } + case "o" { if ($value =~ /\//) { # assume path $output_file = $value; } else { @@ -122,7 +138,9 @@ sub init . "------------------ Pathway Gene Swapper --------------------\n" . "------------------------------------------------------------\n" . "\n" - . "Input File: $input_file\n" + . "Input File: $input_gpml_file\n" + . " $input_gene_file\n" + . " $input_config_file\n" . "Output File: $output_file\n" . "Running in verbose mode? " . ($verbose ? "Yes" : "No") . "\n" . "Running in debug mode? " . ($verbose ? "Yes" : "No") . "\n"