Hello!

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

Note that updates take place every 10 minutes, commits may not be seen immediately.
Adding gradient heat-map feature. In progress...
authorpreecej <preecej@localhost>
Mon, 17 Oct 2011 22:10:01 +0000 (22:10 +0000)
committerpreecej <preecej@localhost>
Mon, 17 Oct 2011 22:10:01 +0000 (22:10 +0000)
svn path=/; revision=186

preecej/perl_singletons/pathway_gene_swapper.pl

index 7f74b3a4e74a3b31735d5aab0b90dae3ea80c1b9..6ff71d825136102dca71599152b32e4021076aa9 100644 (file)
@@ -59,7 +59,7 @@ pathway_gene_swapper.pl -i INPUT_FILE -g GENE_FILE -c CONFIG_FILE -o OUTPUT_FILE
         current working directory is assumed)
     -s  use provided gene symbols instead of config file's LabelPrefix
     -h  apply a heat-map to any multi-mapped set of paralogs
-        (NOTE: precludes custom box-coloring via the config file)
+        (NOTE: precludes custom box-coloring for paralogs)
     -L  Remove literature references.
     -v  View verbose information
     -G  Display GPML input/output documents
@@ -359,12 +359,37 @@ sub import_data
         $new_symbol = ""; # reset for next iter.
     }
     
+    # determine the original gene(s) with the highest # of homologs in the new 
+    # gene set
+    my $max_homolog_count = 0; # count for heat map calibration 
+    my @most_popular_genes; # identity of the gene(s) with the highest number of homologs 
+    foreach my $orig_gene_key (keys %swap_genes)
+    {
+        if ($max_homolog_count < scalar(@{$swap_genes{$orig_gene_key}}))
+        {
+            $max_homolog_count = scalar(@{$swap_genes{$orig_gene_key}});
+            @most_popular_genes = (); # new max; refresh
+            push @most_popular_genes, $orig_gene_key;
+        }
+        else
+        {
+            if ($max_homolog_count == scalar(@{$swap_genes{$orig_gene_key}}))
+            {
+                push @most_popular_genes, $orig_gene_key;
+            }
+        }
+    }
+    
     if ($verbose) # give add'l stats on gene and homolog counts
     {
         print "[Total number of original genes and homologs]\n"
             . "Original gene count: " . $original_gene_count . "\n"
             . "Replacement homolog count: $replacement_homolog_count\n\n"; 
     
+        print "[Highest number of homologs per gene]\n";
+        print "Number of homologs: $max_homolog_count\n";
+        print "Gene(s): @most_popular_genes\n\n";
+            
         print "[Number of homologs per original gene]\n";
         foreach my $orig_gene_key (keys %swap_genes)
         {
@@ -829,6 +854,10 @@ sub export_data
 
 init;
 
+print "[Available Gradients]"
+print Dumper(available_gradients()) . "\n\n";
+exit
+
 import_data;
 show_input;
 swap_genes();