16356 |
$ans = $taxonomy->{$genome}; |
$ans = $taxonomy->{$genome}; |
16357 |
} |
} |
16358 |
} |
} |
16359 |
if (!$ans) |
|
16360 |
{ |
if (!$ans) { |
16361 |
warn "No taxonomy found for $genome\n"; |
#warn "No taxonomy found for $genome\n"; |
16362 |
} |
} |
16363 |
|
|
16364 |
$ans =~ s/^\s*//o; |
$ans =~ s/^\s*//o; |
18420 |
} |
} |
18421 |
} |
} |
18422 |
|
|
18423 |
|
=head3 subsystems_for_pegs_complete |
18424 |
|
|
18425 |
|
Return the list of subsystems, roles and variants that the pegs appear in. |
18426 |
|
Returns a hash keyed by peg. Each item in the hash is a reference to a tuple |
18427 |
|
of subsystem, role and variant. If the last argument ($include_aux) |
18428 |
|
is "true", also roles playing auxiliary roles will be returned. |
18429 |
|
|
18430 |
|
=cut |
18431 |
|
|
18432 |
|
sub subsystems_for_pegs_complete { |
18433 |
|
my ($self, $pegs, $include_aux) = @_; |
18434 |
|
|
18435 |
|
my $rdbH = $self->db_handle; |
18436 |
|
my %results; |
18437 |
|
|
18438 |
|
my $q = "SELECT subsystem, role, variant, protein FROM (SELECT subsystem, role, variant, protein FROM subsystem_index WHERE protein IN ('".join("', '", @$pegs)."')) AS t1 LEFT JOIN deleted_fids ON t1.protein=deleted_fids.fid WHERE deleted_fids.fid IS NULL"; |
18439 |
|
unless ($include_aux) { |
18440 |
|
$q = "SELECT t2.subsystem, t2.role, t2.variant, t2.protein FROM (".$q.") AS t2 LEFT JOIN aux_roles ON (t2.subsystem=aux_roles.subsystem AND t2.role=aux_roles.role) WHERE aux_roles.role IS NULL"; |
18441 |
|
} |
18442 |
|
my $ret = $rdbH->SQL($q); |
18443 |
|
|
18444 |
|
foreach my $row (@$ret) { |
18445 |
|
if (exists($results{$row->[3]})) { |
18446 |
|
push(@{$results{$row->[3]}}, [ $row->[0], $row->[1], $row->[2] ]); |
18447 |
|
} else { |
18448 |
|
$results{$row->[3]} = [ [ $row->[0], $row->[1], $row->[2] ] ]; |
18449 |
|
} |
18450 |
|
} |
18451 |
|
|
18452 |
|
return %results; |
18453 |
|
} |
18454 |
|
|
18455 |
=head3 subsystems_for_peg |
=head3 subsystems_for_peg |
18456 |
|
|
18457 |
Return the list of subsystems and roles that this peg appears in. |
Return the list of subsystems and roles that this peg appears in. |