872 |
# Now we need to link all the map's roles to it. |
# Now we need to link all the map's roles to it. |
873 |
# A hash is used to prevent duplicates. |
# A hash is used to prevent duplicates. |
874 |
my %roleHash = (); |
my %roleHash = (); |
875 |
for my $role ($fig->map_to_ecs($map)) { |
for my $ec ($fig->map_to_ecs($map)) { |
876 |
if (exists $ecToRoles{$role} && ! $roleHash{$role}) { |
if (exists $ecToRoles{$ec}) { |
877 |
$loadRoleOccursIn->Put($ecToRoles{$role}, $map); |
for my $role (@{$ecToRoles{$ec}}) { |
878 |
|
if (! $roleHash{$role}) { |
879 |
|
$loadRoleOccursIn->Put($role, $map); |
880 |
$roleHash{$role} = 1; |
$roleHash{$role} = 1; |
881 |
} |
} |
882 |
} |
} |
883 |
} |
} |
884 |
|
} |
885 |
|
} |
886 |
# Before we leave, we must create the Catalyzes table. We start with the reactions, |
# Before we leave, we must create the Catalyzes table. We start with the reactions, |
887 |
# then use the "ecToRoles" table to convert EC numbers to role IDs. |
# then use the "ecToRoles" table to convert EC numbers to role IDs. |
888 |
my @reactions = $fig->all_reactions(); |
my @reactions = $fig->all_reactions(); |