8643 |
return (); |
return (); |
8644 |
} |
} |
8645 |
|
|
8646 |
|
|
8647 |
|
=head3 ext_ids_in_family |
8648 |
|
|
8649 |
|
usage: @exts = $fig->ext_ids_in_family($family) |
8650 |
|
|
8651 |
|
Returns a list of the external ids in an external family name. |
8652 |
|
|
8653 |
|
=cut |
8654 |
|
|
8655 |
|
sub ext_ids_in_family { |
8656 |
|
my($self,$family) = @_; |
8657 |
|
|
8658 |
|
my($relational_db_response); |
8659 |
|
my $rdbH = $self->db_handle; |
8660 |
|
|
8661 |
|
if ($rdbH->table_exists('localid_map') && |
8662 |
|
($relational_db_response = $rdbH->SQL("SELECT DISTINCT localid from localid_map WHERE family = '$family'")) && |
8663 |
|
(@$relational_db_response >= 1)) |
8664 |
|
{ |
8665 |
|
return map { $_->[0] } @$relational_db_response; |
8666 |
|
} |
8667 |
|
return (); |
8668 |
|
} |
8669 |
|
|
8670 |
|
=head3 ext_in_family |
8671 |
|
|
8672 |
|
usage: @ext_families = $fig->in_family($id) |
8673 |
|
|
8674 |
|
Returns an array containing the external families containing an id. The ID is the one from the original database (e.g. npfam|PB129746) |
8675 |
|
|
8676 |
|
=cut |
8677 |
|
|
8678 |
|
sub ext_in_family { |
8679 |
|
my($self,$id) = @_; |
8680 |
|
|
8681 |
|
my($relational_db_response); |
8682 |
|
my $rdbH = $self->db_handle; |
8683 |
|
|
8684 |
|
if ($rdbH->table_exists('localid_map') && |
8685 |
|
($relational_db_response = $rdbH->SQL("SELECT DISTINCT family from localid_map WHERE localid = '$id'"))) |
8686 |
|
{ |
8687 |
|
my %seen; # only return the first occurence of anyting. |
8688 |
|
return grep {!$seen{$_}++} map { $_->[0] } @$relational_db_response; |
8689 |
|
} |
8690 |
|
return (); |
8691 |
|
} |
8692 |
|
|
8693 |
=head3 prot_to_cid |
=head3 prot_to_cid |
8694 |
|
|
8695 |
Convert a protein to a global ID |
Convert a protein to a global ID |