[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.612, Tue Aug 28 18:46:40 2007 UTC revision 1.613, Wed Sep 5 20:59:52 2007 UTC
# Line 3787  Line 3787 
3787    
3788  sub is_genome {  sub is_genome {
3789      my($self,$genome) = @_;      my($self,$genome) = @_;
3790      my($x,$y);      my($y);
3791    
3792        my $is_genome = $self->cached("_is_genome");
3793    
3794      if (! ($x = $self->{_is_genome}))      if (defined($y = $is_genome->{$genome}))
3795      {      {
3796          $x = $self->{_is_genome} = {};          return $y;
3797      }      }
3798    
     if (defined($y = $x->{$genome})) { return $y }  
3799      my $rdbH = $self->db_handle;      my $rdbH = $self->db_handle;
3800      my $relational_db_response = $rdbH->SQL("SELECT genome  FROM genome where (genome = '$genome')");      my $relational_db_response = $rdbH->SQL("SELECT genome  FROM genome where (genome = '$genome')");
3801      $y = (@$relational_db_response == 1);      $y = (@$relational_db_response == 1);
3802      $x->{$genome} = $y;      $is_genome->{$genome} = $y;
3803      return $y;      return $y;
3804  }  }
3805    
3806    =head3 assert_genomes
3807    
3808    C<< $fig->assert_genomes(gid, gid, ...)>>
3809    
3810    Assert that the given list of genomes does exist, and allow is_genome() to succeed for them.
3811    
3812    This is used in FIG-based computations in the context of the RAST genome-import code, so that
3813    genomes that currently exist only in RAST are treated as present for the purposes of FIG.pm-based
3814    code.
3815    
3816    =cut
3817    
3818    sub assert_genomes
3819    {
3820        my($self, @genomes) = @_;
3821    
3822        my $assert = $self->cached("_is_genome");
3823        map { $assert->{$_} = 1 } @genomes;
3824    }
3825    
3826  =head3 genome_counts  =head3 genome_counts
3827    
3828  C<< my ($arch, $bact, $euk, $vir, $env, $unk) = $fig->genome_counts($complete); >>  C<< my ($arch, $bact, $euk, $vir, $env, $unk) = $fig->genome_counts($complete); >>

Legend:
Removed from v.1.612  
changed lines
  Added in v.1.613

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3