[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.307, Sun Jul 10 04:59:11 2005 UTC revision 1.308, Tue Jul 12 00:34:32 2005 UTC
# Line 7515  Line 7515 
7515      my $rdbH = $self->db_handle;      my $rdbH = $self->db_handle;
7516    
7517      if ($rdbH->table_exists('localfam_function') &&      if ($rdbH->table_exists('localfam_function') &&
7518          ($relational_db_response = $rdbH->SQL("SELECT uid from localfam_uid WHERE family = '$family'")))          ($relational_db_response = $rdbH->SQL("SELECT cid from localfam_cid WHERE family = '$family'")))
7519      {      {
7520          return scalar @$relational_db_response;          return scalar @$relational_db_response;
7521      }      }
# Line 7536  Line 7536 
7536      my($relational_db_response);      my($relational_db_response);
7537      my $rdbH = $self->db_handle;      my $rdbH = $self->db_handle;
7538    
7539      if ($rdbH->table_exists('localfam_uid') &&      if ($rdbH->table_exists('localfam_cid') &&
7540          ($relational_db_response = $rdbH->SQL("SELECT uid FROM localfam_uid")) &&          ($relational_db_response = $rdbH->SQL("SELECT cid FROM localfam_cid")) &&
7541          (@$relational_db_response >= 1))          (@$relational_db_response >= 1))
7542      {      {
7543          return map { $_->[0] } @$relational_db_response;          return map { $_->[0] } @$relational_db_response;
# Line 7560  Line 7560 
7560      my $rdbH = $self->db_handle;      my $rdbH = $self->db_handle;
7561    
7562      if ($rdbH->table_exists('localfam_function') &&      if ($rdbH->table_exists('localfam_function') &&
7563          ($relational_db_response = $rdbH->SQL("SELECT uid from localfam_uid WHERE family = '$family'")) &&          ($relational_db_response = $rdbH->SQL("SELECT cid from localfam_cid WHERE family = '$family'")) &&
7564          (@$relational_db_response >= 1))          (@$relational_db_response >= 1))
7565      {      {
7566          my %seen; # only return the first occurence of anyting.          my %seen; # only return the first occurence of anyting.
# Line 7578  Line 7578 
7578  =cut  =cut
7579    
7580  sub in_family {  sub in_family {
7581      my($self,$uid) = @_;      my($self,$cid) = @_;
7582    
7583      my($relational_db_response);      my($relational_db_response);
7584      my $rdbH = $self->db_handle;      my $rdbH = $self->db_handle;
7585    
7586      if ($rdbH->table_exists('localfam_function') &&      if ($rdbH->table_exists('localfam_function') &&
7587          ($relational_db_response = $rdbH->SQL("SELECT family from localfam_uid WHERE uid = $uid")))          ($relational_db_response = $rdbH->SQL("SELECT family from localfam_cid WHERE cid = $cid")))
7588      {      {
7589       my %seen; # only return the first occurence of anyting.       my %seen; # only return the first occurence of anyting.
7590       return grep {!$seen{$_}++} map { $_->[0] } @$relational_db_response;       return grep {!$seen{$_}++} map { $_->[0] } @$relational_db_response;
# Line 7592  Line 7592 
7592      return ();      return ();
7593  }  }
7594    
7595  #prot_to_uid  #prot_to_cid
7596  #usage: convert a protein to a global ID  #usage: convert a protein to a global ID
7597  #Note that this is not the same uid as GenBank uses, it is unique to our database. Because of this, this method is deprecated and should be called as eid instead.  #Note that this is not the same cid as GenBank uses, it is unique to our database. Because of this, this method is deprecated and should be called as eid instead.
7598    
7599  sub prot_to_uid {  sub prot_to_cid {
7600   return &prot_to_eid(@_);   return &prot_to_eid(@_);
7601  }  }
7602    
# Line 7618  Line 7618 
7618      my($relational_db_response);      my($relational_db_response);
7619      my $rdbH = $self->db_handle;      my $rdbH = $self->db_handle;
7620    
7621      if ($rdbH->table_exists('localid_uid') &&      if ($rdbH->table_exists('localid_cid') &&
7622          ($relational_db_response = $rdbH->SQL("SELECT uid from localid_uid WHERE localid = '$prot'")) &&          ($relational_db_response = $rdbH->SQL("SELECT cid from localid_cid WHERE localid = '$prot'")) &&
7623          (@$relational_db_response == 1))          (@$relational_db_response == 1))
7624      {      {
7625          return $relational_db_response->[0]->[0];          return $relational_db_response->[0]->[0];
# Line 7627  Line 7627 
7627      return "";      return "";
7628  }  }
7629    
7630  #uid_to_prots  #cid_to_prots
7631  # deprecated to eid_to_prots (see above)  # deprecated to eid_to_prots (see above)
7632    
7633  sub uid_to_prots {  sub cid_to_prots {
7634   return eid_to_prots(@_);   return eid_to_prots(@_);
7635  }  }
7636    
# Line 7642  Line 7642 
7642  =cut  =cut
7643    
7644  sub eid_to_prots {  sub eid_to_prots {
7645      my($self,$uid) = @_;      my($self,$cid) = @_;
7646    
7647      my($relational_db_response);      my($relational_db_response);
7648      my $rdbH = $self->db_handle;      my $rdbH = $self->db_handle;
7649    
7650      if ($rdbH->table_exists('localid_uid') &&      if ($rdbH->table_exists('localid_cid') &&
7651          ($relational_db_response = $rdbH->SQL("SELECT localid from localid_uid WHERE uid = $uid")) &&          ($relational_db_response = $rdbH->SQL("SELECT localid from localid_cid WHERE cid = $cid")) &&
7652          (@$relational_db_response >= 1))          (@$relational_db_response >= 1))
7653      {      {
7654          return map { $_->[0] } @$relational_db_response;          return map { $_->[0] } @$relational_db_response;

Legend:
Removed from v.1.307  
changed lines
  Added in v.1.308

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3