[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.164, Fri Oct 8 22:04:48 2004 UTC revision 1.165, Mon Oct 11 18:46:45 2004 UTC
# Line 3859  Line 3859 
3859  }  }
3860    
3861  #  #
3862  # Return just the bbh's that are in the given organisms.  # Modeled after the Sprout call of the same name.
3863  #  #
 sub bbhs_in_org {  
     my($self,$peg,$org_list,$cutoff,$frac_match) = @_;  
     my($sim,$peg2,$genome2,$i,@sims2,%seen);  
3864    
     if ($self->is_deleted_fid($peg)) { return () }  
   
     $frac_match = defined($frac_match) ? $frac_match : 0;  
3865    
3866      $cutoff = defined($cutoff) ? $cutoff : 1.0e-10;  sub bbh_list
     my @bbhs = ();  
     my @precomputed = ();  
     my $rdbH = $self->db_handle;  
     my $relational_db_response = $rdbH->SQL("SELECT seek, others FROM bbhs WHERE peg = \'$peg\' ");  
     if (@$relational_db_response == 1)  
3867      {      {
3868          my($seek,$others) = @{$relational_db_response->[0]};      my($self, $genome, $features) = @_;
         if (open(CORES,"<$FIG_Config::global/bbh.cores"))  
         {  
             seek(CORES,$seek,0);  
             $_ = <CORES>;  
             close(CORES);  
             chop;  
             push(@precomputed,split(/,/,$_));  
         }  
         push(@precomputed,split(/,/,$others));  
     }  
3869    
3870      #      my $cutoff = 1.0e-10;
     # Extract just the ones in the org_list passed in.  
     #  
3871    
3872      my %org_map;      my $out = {};
3873      map { $org_map{$_}++ } @$org_list;      for my $feature (@$features)
   
     my %bbhs;  
     for my $bbh (@precomputed)  
3874      {      {
3875          $bbhs{$bbh} = 1 if ($bbh =~ /fig\|(\d+\.\d+)\./ && $org_map{$1});          my @bbhs = $self->bbhs($feature, $cutoff);
     }  
3876    
3877      foreach $sim ($self->sims($peg,10000,$cutoff,"fig"))          $out->{$feature} = [grep { /fig\|$genome\.peg/ } map { $_->[0] } @bbhs];
     {  
         $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]);  
         }  
3878      }      }
3879      return @bbhs;      return $out;
3880  }  }
3881    
3882  =pod  =pod

Legend:
Removed from v.1.164  
changed lines
  Added in v.1.165

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3