[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.292, Mon Jun 13 09:32:09 2005 UTC revision 1.293, Mon Jun 13 16:43:48 2005 UTC
# Line 180  Line 180 
180      return $self->{_dbf};      return $self->{_dbf};
181  }  }
182    
183    sub table_exists {
184        my($self,$table) = @_;
185    
186        my $rdbH = $self->db_handle;
187        return $rdbH->table_exists($table);
188    }
189    
190  =head3 Open  =head3 Open
191    
# Line 5900  Line 5906 
5906    
5907    
5908  sub bbhs {  sub bbhs {
5909      my($self,$peg,$cutoff,$frac_match) = @_;      my($self,$peg,$cutoff) = @_;
5910      my($sim,$peg2,$genome2,$i,@sims2,%seen);      my($sim,$peg2,$genome2,$i,@sims2,%seen);
5911    
5912      if ($self->is_deleted_fid($peg)) { return () }      if ($self->is_deleted_fid($peg)) { return () }
5913    
     $frac_match = defined($frac_match) ? $frac_match : 0;  
   
5914      $cutoff = defined($cutoff) ? $cutoff : 1.0e-10;      $cutoff = defined($cutoff) ? $cutoff : 1.0e-10;
5915      my @bbhs = ();      my @bbhs = ();
     my @precomputed = ();  
5916      my $rdbH = $self->db_handle;      my $rdbH = $self->db_handle;
5917      my $relational_db_response = $rdbH->SQL("SELECT seek, others FROM bbhs WHERE peg = \'$peg\' ");      my $relational_db_response = $rdbH->SQL("SELECT peg2, psc FROM bbh WHERE peg1 = \'$peg\' ");
     if (@$relational_db_response == 1)  
     {  
         my($seek_set,$others) = @{$relational_db_response->[0]};  
         if (open(CORES,"<$FIG_Config::global/bbh.cores"))  
         {  
             my $seek;  
             foreach $seek (split(/,/,$seek_set))  
             {  
                 seek(CORES,$seek,0);  
                 $_ = <CORES>;  
                 chop;  
                 push(@precomputed,split(/,/,$_));  
             }  
             close(CORES);  
         }  
         push(@precomputed,split(/,/,$others));  
     }  
     my %bbhs = map { $_ => 1 } @precomputed;  
5918    
5919      foreach $sim ($self->sims($peg,10000,$cutoff,"fig"))      return sort { $a->[1] <=> $b->[1] } @{$relational_db_response};
     {  
         $peg2 = $sim->id2;  
         my $frac = &FIG::min(($sim->e1+1 - $sim->b1) / $sim->ln1, ($sim->e2+1 - $sim->b2) / $sim->ln2);  
         if ($bbhs{$peg2} && ($frac >= $frac_match))  
         {  
             push(@bbhs,[$peg2,$sim->psc]);  
         }  
     }  
     return @bbhs;  
5920  }  }
5921    
5922  #  #
# Line 9567  Line 9543 
9543      return @result;      return @result;
9544  }  }
9545    
9546    sub peg_to_roles_in_subsystems {
9547        my($self,$peg) = @_;
9548    
9549        my $rdbH = $self->db_handle;
9550        my $q    = "SELECT subsystem, role FROM subsystem_index WHERE protein = '$peg'";
9551        if (my $relational_db_response = $rdbH->SQL($q))
9552        {
9553            return @$relational_db_response;
9554        }
9555        return ();
9556    }
9557    
9558  =head3 assigned_pegs_not_in_ss  =head3 assigned_pegs_not_in_ss
9559    

Legend:
Removed from v.1.292  
changed lines
  Added in v.1.293

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3