Hello!

To see the file structure, click on "tree".

Note that updates take place every 10 minutes, commits may not be seen immediately.
Adds simple read-in of csv gene-swapping file
authorpreecej <preecej@localhost>
Sat, 30 Jul 2011 00:42:34 +0000 (00:42 +0000)
committerpreecej <preecej@localhost>
Sat, 30 Jul 2011 00:42:34 +0000 (00:42 +0000)
svn path=/; revision=135

preecej/perl_singletons/pathway_gene_swapper.pl

index 46aa49756dedade418e78d59acd467ff52cb3670..b6134a0545374a5c6b4ed7a5c6a14355efc63a09 100644 (file)
@@ -97,6 +97,7 @@ my $debug = 0; # debugging switch
 
 # global data containers
 my %configs; # holds global configuration settings
+my %swap_genes; # holds original and swapped genes
 my $gpml_doc; #holds imported GPML data for manipulation and output
 
 $Data::Dumper::Pad = "... "; 
@@ -224,6 +225,31 @@ Reads, parses, and stores source GPML.
 sub import_data
 {
     print "Opening input file and reading header info...\n\n";
+    #open the file                                                                                                          
+    #read a line
+    #skip header line
+    #split line on comma
+    #get original gene and swapped gene
+    #add genes to %swap_genes
+    open(CONFIG_FILE, $input_gene_file) or die("Could not open $input_gene_file"); 
+    
+    my $line = <CONFIG_FILE>;
+    while (<CONFIG_FILE>)
+    {
+       $line = $_;
+       chomp $line;
+       my @line_ary = split(',',$line);
+       my $data_field = $line_ary[0];
+       my $data_val = $line_ary[1];
+
+       $swap_genes{$data_field} = $data_val; 
+    } 
+    #test:display %swap_genes
+     if ($debug) { print "...<DEBUG: \%swap_genes>\n"
+        . Dumper(\%swap_genes) . "\n\n"; }
+     
+    
+    
 }