[Bio] / FigKernelPackages / FIG.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/FIG.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.670, Wed Mar 5 02:19:11 2008 UTC revision 1.671, Wed Mar 5 17:07:50 2008 UTC
# Line 8751  Line 8751 
8751      return ($relational_db_response && (@$relational_db_response == 1)) ? $relational_db_response->[0]->[0] : $id;      return ($relational_db_response && (@$relational_db_response == 1)) ? $relational_db_response->[0]->[0] : $id;
8752  }  }
8753    
8754    #
8755    # ID correspondence table utilities
8756    #
8757    
8758    =head3 get_corresponding_ids
8759    
8760        my @id_list = $fig->get_corresponding_ids($id, $with_type_info);
8761    
8762    Return a list of the identifiers that correspond to the given identifier, based on
8763    the  PIR id correspondence table.
8764    
8765    =over 4
8766    
8767    =item id
8768    
8769    Identifer to look up.
8770    
8771    =item with_type_info
8772    
8773    Pass a true value here to return tuples [id, source-type, link-information] instead of identifiers.
8774    
8775    =item RETURN
8776    
8777    A list of identifiers if $with_type_info not true; a  list of tuples
8778    [id, source-type, link-information] otherwise.
8779    
8780    =back
8781    
8782    =cut
8783    
8784    sub get_corresponding_ids
8785    {
8786        my($self, $id, $with_type_info) = @_;
8787    
8788        my $dbf = $self->db_handle();
8789        my $dbh = $dbf->{_dbh};
8790    
8791        if ($with_type_info)
8792        {
8793            my $res = $dbf->SQL(qq(SELECT i2.protein_id, t.name
8794                                   FROM id_correspondence i1 JOIN id_correspondence i2 ON i1.file_num = i2.file_num AND i1.set_id = i2.set_id
8795                                    JOIN id_correspondence_type t ON t.id = i2.type
8796                                   WHERE i1.protein_id = ?
8797                                   ), undef, $id);
8798            return @$res;
8799        }
8800        else
8801        {
8802            my $res = $dbh->selectcol_arrayref(qq(SELECT i2.protein_id
8803                                                  FROM id_correspondence i1 JOIN id_correspondence i2 ON i1.file_num = i2.file_num AND i1.set_id = i2.set_id
8804                                                  WHERE i1.protein_id = ?), undef, $id);
8805            return @$res;
8806        }
8807    }
8808    
8809  ################ GFF3 utilities  ##########################  ################ GFF3 utilities  ##########################
8810    
8811  sub get_gff_writer  sub get_gff_writer

Legend:
Removed from v.1.670  
changed lines
  Added in v.1.671

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3