[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.13, Sun Dec 28 17:11:29 2003 UTC revision 1.14, Mon Dec 29 02:22:37 2003 UTC
# Line 1043  Line 1043 
1043    
1044  sub taxonomy_of {  sub taxonomy_of {
1045      my($self,$genome) = @_;      my($self,$genome) = @_;
1046      my($tax);      my($ans);
1047      my $taxonomy = $self->cached('_taxonomy');      my $taxonomy = $self->cached('_taxonomy');
1048    
1049      if (! $taxonomy->{$genome})      if (! ($ans = $taxonomy->{$genome}))
1050      {      {
1051          foreach $genome ($self->genomes)          my $rdbH = $self->db_handle;
1052          {          my $relational_db_response = $rdbH->SQL("SELECT genome,taxonomy  FROM genome");
1053              if (open(TMP,"<$FIG_Config::organisms/$genome/TAXONOMY"))          my $pair;
1054            foreach $pair (@$relational_db_response)
1055              {              {
1056                  $tax = <TMP>;              $taxonomy->{$pair->[0]} = $pair->[1];
                 chop $tax;  
                 $self->{_taxonomy}->{$genome} = $tax;  
                 close(TMP);  
1057              }              }
1058            $ans = $taxonomy->{$genome};
1059          }          }
1060          $taxonomy = $self->{_taxonomy};      return $ans;
     }  
     return $taxonomy->{$genome};  
1061  }  }
1062    
1063  =pod  =pod
# Line 1938  Line 1935 
1935      }      }
1936  }  }
1937    
1938    sub maps_to_id {
1939        my($self,$id) = @_;
1940    
1941        my $rdbH = $self->db_handle;
1942        my $relational_db_response = $rdbH->SQL("SELECT maps_to FROM peg_synonyms WHERE  syn_id = \'$id\' ");
1943        return ($relational_db_response && (@$relational_db_response == 1)) ? $relational_db_response->[0]->[0] : $id;
1944    }
1945    
1946  ################ Assignments of Function to PEGs  ##########################  ################ Assignments of Function to PEGs  ##########################
1947    
1948  =pod  =pod

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3