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
$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;
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
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";
}