Hello!

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

Note that updates take place every 10 minutes, commits may not be seen immediately.
added commentary
authorpreecej <preecej@localhost>
Fri, 12 Aug 2011 20:03:53 +0000 (20:03 +0000)
committerpreecej <preecej@localhost>
Fri, 12 Aug 2011 20:03:53 +0000 (20:03 +0000)
svn path=/; revision=153

preecej/perl_singletons/pathway_gene_swapper.pl

index 4c8e4a1eda7f80adfe763709f6f28ec65dfddc39..7e3459f75d513066a42d3582182613c3647d49a5 100644 (file)
@@ -384,9 +384,12 @@ sub create_unique_hex_id($$)
 
     my $candidate_id = $first_digit . $last_four_digits;  
 
+    # recurse if you haven't generated a unique id yet
     if (exists ${$_[0]}{$candidate_id})
     {
         # print "not unique...\n"; # TEST
+        # the '&' suppresses prototype checking and avoids a runtime warning
+        # since this is a recursive call
         $candidate_id = &create_unique_hex_id($_[0],$_[1]);
     }
     else
@@ -460,6 +463,7 @@ sub swap_genes
             $existing_hex_ids{$_->getAttributeNode("GraphId")->getValue}
                 = $_->getTagName . ".GraphId";
         }
+
         # also build a data node hash to make lookup easier in the next section
         my $curr_xref_id = ($_->getElementsByTagName("Xref"))[0]
             ->getAttributeNode("ID")->getValue;
@@ -469,6 +473,7 @@ sub swap_genes
         
         if (length($curr_xref_id) > 0)
         {
+            if ($curr_xref_id eq "AT3G12810") { print "** hit on AT3G12810\n"; } # TEST
             $data_nodes_by_gene_id{$curr_xref_id} = $_;
         }
         else
@@ -487,6 +492,7 @@ sub swap_genes
         print "...<DEBUG: \%data_nodes_by_gene_id>\n";
         foreach my $tmp_node (keys %data_nodes_by_gene_id) {
             print "...   $tmp_node => $data_nodes_by_gene_id{$tmp_node}\n";
+            if ($tmp_node eq "AT3G12810") { print "** hit on AT3G12810 node\n"; } # TEST
         }
         print "\n";
     }