[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.99, Sat May 29 14:08:58 2004 UTC revision 1.100, Sun May 30 15:04:26 2004 UTC
# Line 2815  Line 2815 
2815    
2816      $cutoff = defined($cutoff) ? $cutoff : 1.0e-10;      $cutoff = defined($cutoff) ? $cutoff : 1.0e-10;
2817      my @bbhs = ();      my @bbhs = ();
2818        my @precomputed = ();
2819        my $rdbH = $self->db_handle;
2820        my $relational_db_response = $rdbH->SQL("SELECT seek, others FROM bbhs WHERE peg = \'$peg\' ");
2821        if (@$relational_db_response == 1)
2822        {
2823            my($seek,$others) = @{$relational_db_response->[0]};
2824            if (open(CORES,"<$FIG_Config::global/bbh.cores"))
2825            {
2826                seek(CORES,$seek,0);
2827                $_ = <CORES>;
2828                close(CORES);
2829                chop;
2830                push(@precomputed,split(/,/,$_));
2831            }
2832            push(@precomputed,split(/,/,$others));
2833        }
2834        my %bbhs = map { $_ => 1 } @precomputed;
2835    
     my $genome1 = $self->genome_of($peg);  
     $seen{$genome1} = 1;  
2836      foreach $sim ($self->sims($peg,10000,$cutoff,"fig"))      foreach $sim ($self->sims($peg,10000,$cutoff,"fig"))
2837      {      {
2838          $peg2 = $sim->id2;          $peg2 = $sim->id2;
2839          $genome2 = $self->genome_of($peg2);          if ($bbhs{$peg2})
         next if ($seen{$genome2});  
         $seen{$genome2} = 1;  
         @sims2 = $self->sims($peg2,10000,$cutoff,"fig");  
         for ($i=0; ($i < @sims2) && ($self->genome_of($sims2[$i]->id2) ne $genome1); $i++) {}  
         if (($i < @sims2) && ($sims2[$i]->id2 eq $peg))  
2840          {          {
2841              push(@bbhs,[$peg2,$sim->psc]);              push(@bbhs,[$peg2,$sim->psc]);
2842          }          }
# Line 3487  Line 3497 
3497      &run("make_indexes");      &run("make_indexes");
3498      &run("format_peg_dbs");      &run("format_peg_dbs");
3499      &run("load_links");      &run("load_links");
3500        &run("load_bbhs");
3501  }  }
3502    
3503  ################################# Automated Assignments  ####################################  ################################# Automated Assignments  ####################################
# Line 4406  Line 4417 
4417  usage: @candidates = $fig->best_bbh_candidates($genome,$cutoff,$requested,$known)  usage: @candidates = $fig->best_bbh_candidates($genome,$cutoff,$requested,$known)
4418    
4419  This routine returns a list of up to $requested candidates from $genome.  A candidate is a BBH  This routine returns a list of up to $requested candidates from $genome.  A candidate is a BBH
4420  against one of the PEGs in @$known.  Each entry in the list is a 3-tuple:  against one of the PEGs in genomes from the list given by@$known.
4421    Each entry in the list is a 3-tuple:
4422    
4423      [CandidatePEG,KnownBBH,Pscore]      [CandidatePEG,KnownBBH,Pscore]
4424    

Legend:
Removed from v.1.99  
changed lines
  Added in v.1.100

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3